Hi all,
Today's linux-next merge of the scsi-mkp tree got a conflict in:
drivers/ufs/core/ufshcd.c
between commit:
fe06b7c07f3f ("scsi: ufs: core: Set default runtime/system PM levels before ufshcd_hba_init()")
from Linus' tree and commit:
20b97acc4caf ("scsi: ufs: core: Fix a race condition related to device commands")
from the scsi-mkp tree.
I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.
--
Cheers,
Stephen Rothwell
diff --cc drivers/ufs/core/ufshcd.c
index 0534390c2a35,3288a7da73dc..000000000000
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@@ -10475,21 -10460,8 +10460,23 @@@ int ufshcd_init(struct ufs_hba *hba, vo
*/
spin_lock_init(&hba->clk_gating.lock);
+ /*
+ * Set the default power management level for runtime and system PM.
+ * Host controller drivers can override them in their
+ * 'ufs_hba_variant_ops::init' callback.
+ *
+ * Default power saving mode is to keep UFS link in Hibern8 state
+ * and UFS device in sleep state.
+ */
+ hba->rpm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(
+ UFS_SLEEP_PWR_MODE,
+ UIC_LINK_HIBERN8_STATE);
+ hba->spm_lvl = ufs_get_desired_pm_lvl_for_dev_link_state(
+ UFS_SLEEP_PWR_MODE,
+ UIC_LINK_HIBERN8_STATE);
+
+ init_completion(&hba->dev_cmd.complete);
+
err = ufshcd_hba_init(hba);
if (err)
goto out_error;
On 3/20/25 10:47 PM, Stephen Rothwell wrote:
> Hi all,
>
> Today's linux-next merge of the scsi-mkp tree got a conflict in:
>
> drivers/ufs/core/ufshcd.c
>
> between commit:
>
> fe06b7c07f3f ("scsi: ufs: core: Set default runtime/system PM levels before ufshcd_hba_init()")
>
> from Linus' tree and commit:
>
> 20b97acc4caf ("scsi: ufs: core: Fix a race condition related to device commands")
>
> from the scsi-mkp tree.
>
> I fixed it up (see below) and can carry the fix as necessary. This
> is now fixed as far as linux-next is concerned, but any non trivial
> conflicts should be mentioned to your upstream maintainer when your tree
> is submitted for merging. You may also want to consider cooperating
> with the maintainer of the conflicting tree to minimise any particularly
> complex conflicts.
Hi Stephen,
Thank you for having resolved this conflict. While the conflict
resolution looks good to me and should result in working code, it may
be desirable to resolve it differently (init_completion() before the
ufs_get_desired_pm_lvl_for_dev_link_state() calls). This way the
spin_lock_init() and init_completion() calls stay close to each other.
Thanks,
Bart.
Hi Bart, On Fri, 21 Mar 2025 09:29:20 -0700 Bart Van Assche <bvanassche@acm.org> wrote: > > Thank you for having resolved this conflict. While the conflict > resolution looks good to me and should result in working code, it may > be desirable to resolve it differently (init_completion() before the > ufs_get_desired_pm_lvl_for_dev_link_state() calls). This way the > spin_lock_init() and init_completion() calls stay close to each other. I have fixed this up from today. Thanks for checking. -- Cheers, Stephen Rothwell
© 2016 - 2026 Red Hat, Inc.