linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v10 0/3] Three changes related with UFS clock scaling
@ 2021-01-19 11:52 Can Guo
  2021-01-19 11:52 ` [PATCH v10 1/3] scsi: ufs: Protect some contexts from unexpected " Can Guo
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Can Guo @ 2021-01-19 11:52 UTC (permalink / raw)
  To: asutoshd, nguyenb, hongwus, ziqichen, linux-scsi, kernel-team, cang

This series is made based on 5.12/scsi-queue 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 v9:
- Minor update in the 1st change.

Change since v8:
- Rebased on 5.12/scsi-queue

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

*** BLURB HERE ***

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 | 214 +++++++++++++++++++++++++---------------------
 drivers/scsi/ufs/ufshcd.h |  10 ++-
 2 files changed, 127 insertions(+), 97 deletions(-)

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


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

end of thread, other threads:[~2021-01-20  8:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-19 11:52 [PATCH v10 0/3] Three changes related with UFS clock scaling Can Guo
2021-01-19 11:52 ` [PATCH v10 1/3] scsi: ufs: Protect some contexts from unexpected " Can Guo
2021-01-20  4:54   ` Stanley Chu
2021-01-20  8:29     ` Can Guo
2021-01-19 11:53 ` [PATCH v10 2/3] scsi: ufs: Refactor ufshcd_init/exit_clk_scaling/gating() Can Guo
2021-01-20  5:05   ` Stanley Chu
2021-01-19 11:53 ` [PATCH v10 3/3] scsi: ufs: Revert "Make sure clk scaling happens only when HBA is runtime ACTIVE" Can Guo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).