All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v8 0/3] Three changes related with UFS clock scaling
@ 2020-12-30 11:29 Can Guo
  2020-12-30 11:29 ` [PATCH v8 1/3] scsi: ufs: Protect some contexts from unexpected " Can Guo
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Can Guo @ 2020-12-30 11:29 UTC (permalink / raw)
  To: asutoshd, nguyenb, hongwus, ziqichen, rnayak, linux-scsi,
	kernel-team, saravanak, salyzyn, cang

This series is made based on 5.10/scsi-fixes branch.

Current devfreq framework allows sysfs nodes like governor, min_freq and max_freq to be changed even after devfreq device is suspended.
Meanwhile, devfreq_suspend_device() cannot/wouldn't synchronize clock scaling which has already been invoked through devfreq sysfs nodes menitioned above.
It means that clock scaling invoked through these devfreq sysfs nodes can happen at any time regardless of the state of UFS host and/or device.
We need to control and synchronize clock scaling in this scenario.

The 1st change allows contexts to prevent clock scaling from being invoked through devfreq sysfs nodes.
The 2nd change is just a code cleanup for clk_scaling/gating initialization routine.
The 3rd change reverts one old change which can be covered by the 1st change. For branches which do not have this change yet, it can be ignored.

Change since v7:
- Slightly updated the 1st change: changed the up_write() before ufshcd_wb_ctrl() to downgrade_write() in ufshcd_devfreq_scale(),
  so that ufshcd_wb_ctrl() is called with clk_scale_lock held, this is to make sure race condition won't happen to ufshcd_wb_ctrl().

Change since v6:
- Updated the 2nd change

Change since v5:
- Reomved the code change in ufshcd_shutdown() since it is not quite relevant with this fix

Change since v4:
- Updated some comment lines as requested by Stanley

Change since v3:
- Slightly updated the 1st change

Change since v2:
- Split the 1st change to two changes, which become the 1st change and the 3rd change

Change since v1:
- Updated the 2nd change

Can Guo (3):
  scsi: ufs: Protect some contexts from unexpected clock scaling
  scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating()
  scsi: ufs: Revert "Make sure clk scaling happens only when HBA is
    runtime ACTIVE"

 drivers/scsi/ufs/ufshcd.c | 216 ++++++++++++++++++++++++++--------------------
 drivers/scsi/ufs/ufshcd.h |  10 ++-
 2 files changed, 132 insertions(+), 94 deletions(-)

-- 
Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2021-01-06  4:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30 11:29 [PATCH v8 0/3] Three changes related with UFS clock scaling Can Guo
2020-12-30 11:29 ` [PATCH v8 1/3] scsi: ufs: Protect some contexts from unexpected " Can Guo
2020-12-31  4:39   ` Can Guo
2020-12-30 11:29 ` [PATCH v8 2/3] scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating() Can Guo
2020-12-30 11:29 ` [PATCH v8 3/3] scsi: ufs: Revert "Make sure clk scaling happens only when HBA is runtime ACTIVE" Can Guo
2020-12-30 11:29   ` Can Guo
2020-12-30 11:29   ` Can Guo
2021-01-06  2:45 ` [PATCH v8 0/3] Three changes related with UFS clock scaling Martin K. Petersen
2021-01-06  4:02   ` Can Guo

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.