public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 0/5] ufs: Do not requeue while ungating the clock
@ 2023-05-29 20:26 Bart Van Assche
  2023-05-29 20:26 ` [PATCH v4 1/5] scsi: core: Rework scsi_host_block() Bart Van Assche
                   ` (6 more replies)
  0 siblings, 7 replies; 14+ messages in thread
From: Bart Van Assche @ 2023-05-29 20:26 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: Jaegeuk Kim, linux-scsi, Adrian Hunter, Bart Van Assche

Hi Martin,

In the traces we recorded while testing zoned storage we noticed that UFS
commands are requeued while the clock is being ungated. Command requeueing
makes it harder than necessary to preserve the command order. Hence this
patch series that modifies the SCSI core and also the UFS driver such that
clock ungating does not trigger command requeueing.

Please consider this patch series for the next merge window.

Thanks,

Bart.

Changes compared to v3:
- Added a patch that removes two duplicate declarations.

Changes compared to v2:
- Only enable BLK_MQ_F_BLOCKING if clock gating is supported.
- Introduce flag queuecommand_may_block in both the SCSI host and SCSI host
  template data structures.

Changes compared to v1:
- Dropped patch "scsi: ufs: core: Unexport ufshcd_hold() and ufshcd_release()".
- Removed a ufshcd_scsi_block_requests() / ufshcd_scsi_unblock_requests() pair
  from patch "scsi: ufs: Ungate the clock synchronously".

Bart Van Assche (4):
  scsi: core: Rework scsi_host_block()
  scsi: core: Support setting BLK_MQ_F_BLOCKING
  scsi: ufs: Conditionally enable the BLK_MQ_F_BLOCKING flag
  scsi: ufs: Ungate the clock synchronously

Bart Van Assche (5):
  scsi: core: Rework scsi_host_block()
  scsi: core: Support setting BLK_MQ_F_BLOCKING
  scsi: ufs: Conditionally enable the BLK_MQ_F_BLOCKING flag
  scsi: ufs: Declare ufshcd_{hold,release}() once
  scsi: ufs: Ungate the clock synchronously

 drivers/scsi/hosts.c             |  1 +
 drivers/scsi/scsi_lib.c          | 27 ++++++----
 drivers/ufs/core/ufs-sysfs.c     |  2 +-
 drivers/ufs/core/ufshcd-crypto.c |  2 +-
 drivers/ufs/core/ufshcd-priv.h   |  3 --
 drivers/ufs/core/ufshcd.c        | 87 ++++++++++----------------------
 include/scsi/scsi_host.h         |  6 +++
 include/ufs/ufshcd.h             |  2 +-
 8 files changed, 54 insertions(+), 76 deletions(-)


^ permalink raw reply	[flat|nested] 14+ messages in thread
* [PATCH] scsi: stex: Fix gcc 13 warnings
@ 2023-05-29 20:21 Bart Van Assche
  2023-05-29 20:21 ` [PATCH v4 4/5] scsi: ufs: Declare ufshcd_{hold,release}() once Bart Van Assche
  0 siblings, 1 reply; 14+ messages in thread
From: Bart Van Assche @ 2023-05-29 20:21 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: Jaegeuk Kim, linux-scsi, Adrian Hunter, Bart Van Assche, stable,
	Randy Dunlap, James E.J. Bottomley

gcc 13 may assign another type to enumeration constants than gcc 12. Split
the large enum at the top of source file stex.c such that the type of the
constants used in time expressions is changed back to the same type chosen
by gcc 12. This patch suppresses compiler warnings like this one:

In file included from ./include/linux/bitops.h:7,
                 from ./include/linux/kernel.h:22,
                 from drivers/scsi/stex.c:13:
drivers/scsi/stex.c: In function ‘stex_common_handshake’:
./include/linux/typecheck.h:12:25: error: comparison of distinct pointer types lacks a cast [-Werror]
   12 |         (void)(&__dummy == &__dummy2); \
      |                         ^~
./include/linux/jiffies.h:106:10: note: in expansion of macro ‘typecheck’
  106 |          typecheck(unsigned long, b) && \
      |          ^~~~~~~~~
drivers/scsi/stex.c:1035:29: note: in expansion of macro ‘time_after’
 1035 |                         if (time_after(jiffies, before + MU_MAX_DELAY * HZ)) {
      |                             ^~~~~~~~~~

See also https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107405.

Cc: stable@vger.kernel.org
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Tested-by: Randy Dunlap <rdunlap@infradead.org> # build-tested
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/stex.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/scsi/stex.c b/drivers/scsi/stex.c
index 5b230e149c3d..8ffb75be99bc 100644
--- a/drivers/scsi/stex.c
+++ b/drivers/scsi/stex.c
@@ -109,7 +109,9 @@ enum {
 	TASK_ATTRIBUTE_HEADOFQUEUE		= 0x1,
 	TASK_ATTRIBUTE_ORDERED			= 0x2,
 	TASK_ATTRIBUTE_ACA			= 0x4,
+};
 
+enum {
 	SS_STS_NORMAL				= 0x80000000,
 	SS_STS_DONE				= 0x40000000,
 	SS_STS_HANDSHAKE			= 0x20000000,
@@ -121,7 +123,9 @@ enum {
 	SS_I2H_REQUEST_RESET			= 0x2000,
 
 	SS_MU_OPERATIONAL			= 0x80000000,
+};
 
+enum {
 	STEX_CDB_LENGTH				= 16,
 	STATUS_VAR_LEN				= 128,
 

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

end of thread, other threads:[~2023-06-08  1:43 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-29 20:26 [PATCH v4 0/5] ufs: Do not requeue while ungating the clock Bart Van Assche
2023-05-29 20:26 ` [PATCH v4 1/5] scsi: core: Rework scsi_host_block() Bart Van Assche
2023-05-29 20:26 ` [PATCH v4 2/5] scsi: core: Support setting BLK_MQ_F_BLOCKING Bart Van Assche
2023-05-29 20:26 ` [PATCH v4 3/5] scsi: ufs: Conditionally enable the BLK_MQ_F_BLOCKING flag Bart Van Assche
2023-05-30  9:52   ` Bean Huo
2023-05-29 20:26 ` [PATCH v4 4/5] scsi: ufs: Declare ufshcd_{hold,release}() once Bart Van Assche
2023-05-30  9:48   ` Adrian Hunter
2023-05-31  7:59   ` Keoseong Park
2023-05-29 20:26 ` [PATCH v4 5/5] scsi: ufs: Ungate the clock synchronously Bart Van Assche
2023-05-30 11:10   ` Bean Huo
2023-05-30 17:39   ` Bao D. Nguyen
2023-05-31 15:45 ` [PATCH v4 0/5] ufs: Do not requeue while ungating the clock Martin K. Petersen
2023-06-08  1:42 ` Martin K. Petersen
  -- strict thread matches above, loose matches on Subject: below --
2023-05-29 20:21 [PATCH] scsi: stex: Fix gcc 13 warnings Bart Van Assche
2023-05-29 20:21 ` [PATCH v4 4/5] scsi: ufs: Declare ufshcd_{hold,release}() once Bart Van Assche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox