[PATCH v5 0/4] Untie the host lock entanglement - part 2

Avri Altman posted 4 patches 1 year, 2 months ago
drivers/ufs/core/ufshcd.c | 253 ++++++++++++++++++--------------------
include/ufs/ufshcd.h      |  25 ++--
2 files changed, 140 insertions(+), 138 deletions(-)
[PATCH v5 0/4] Untie the host lock entanglement - part 2
Posted by Avri Altman 1 year, 2 months ago
Here is the 2nd part in the sequel, watering down the scsi host lock
usage in the ufs driver. This work is motivated by a comment made by
Bart [1], of the abuse of the scsi host lock in the ufs driver.  Its
Precursor [2] removed the host lock around some of the host register
accesses.

This part replaces the scsi host lock by dedicated locks serializing
access to the clock gating and clock scaling members.

Changes compared to v4:
 - split patch 1 into 2 parts (Bart)
 - use scoped_guard() for the host_lock as well (Bart)
 - remove irrelevant comment and use lockdep_assert_held instead (Bart)
 - improve @lock documentation (Bart)

Changes compared to v3:
 - Keep the host lock when checking ufshcd_state (Bean)

Changes compared to v2:
 - Use clang-format to fix formating (Bart)
 - Use guard() in ufshcd_clkgate_enable_store (Bart)
 - Elaborate commit log (Bart)

Changes compared to v1:
 - use the guard() & scoped_guard() macros (Bart)
 - re-order struct ufs_clk_scaling and struct ufs_clk_gating (Bart)

[1] https://lore.kernel.org/linux-scsi/0b031b8f-c07c-42ef-af93-7336439d3c37@acm.org/
[2] https://lore.kernel.org/linux-scsi/20241024075033.562562-1-avri.altman@wdc.com/

Avri Altman (4):
  scsi: ufs: core: Introduce ufshcd_has_pending_tasks
  scsi: ufs: core: Prepare to introduce a new clock_gating lock
  scsi: ufs: core: Introduce a new clock_gating lock
  scsi: ufs: core: Introduce a new clock_scaling lock

 drivers/ufs/core/ufshcd.c | 253 ++++++++++++++++++--------------------
 include/ufs/ufshcd.h      |  25 ++--
 2 files changed, 140 insertions(+), 138 deletions(-)

-- 
2.25.1
Re: [PATCH v5 0/4] Untie the host lock entanglement - part 2
Posted by Martin K. Petersen 1 year, 2 months ago
On Sun, 24 Nov 2024 09:08:04 +0200, Avri Altman wrote:

> Here is the 2nd part in the sequel, watering down the scsi host lock
> usage in the ufs driver. This work is motivated by a comment made by
> Bart [1], of the abuse of the scsi host lock in the ufs driver.  Its
> Precursor [2] removed the host lock around some of the host register
> accesses.
> 
> This part replaces the scsi host lock by dedicated locks serializing
> access to the clock gating and clock scaling members.
> 
> [...]

Applied to 6.14/scsi-queue, thanks!

[1/4] scsi: ufs: core: Introduce ufshcd_has_pending_tasks
      https://git.kernel.org/mkp/scsi/c/e738ba458e75
[2/4] scsi: ufs: core: Prepare to introduce a new clock_gating lock
      https://git.kernel.org/mkp/scsi/c/7869c6521f57
[3/4] scsi: ufs: core: Introduce a new clock_gating lock
      https://git.kernel.org/mkp/scsi/c/209f4e43b806
[4/4] scsi: ufs: core: Introduce a new clock_scaling lock
      https://git.kernel.org/mkp/scsi/c/be769e5cf53b

-- 
Martin K. Petersen	Oracle Linux Engineering
Re: [PATCH v5 0/4] Untie the host lock entanglement - part 2
Posted by Martin K. Petersen 1 year, 2 months ago
Avri,

> Here is the 2nd part in the sequel, watering down the scsi host lock
> usage in the ufs driver. This work is motivated by a comment made by
> Bart [1], of the abuse of the scsi host lock in the ufs driver. Its
> Precursor [2] removed the host lock around some of the host register
> accesses.
>
> This part replaces the scsi host lock by dedicated locks serializing
> access to the clock gating and clock scaling members.

Applied to 6.14/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering