Linux SCSI subsystem development
 help / color / mirror / Atom feed
* [PATCH v2] scsi: aacraid: Improve code readability
@ 2025-10-21 20:17 Bart Van Assche
  2025-10-22  8:00 ` John Garry
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Bart Van Assche @ 2025-10-21 20:17 UTC (permalink / raw)
  To: Martin K . Petersen
  Cc: linux-scsi, Bart Van Assche, Gilbert Wu, Sagar Biradar,
	John Garry, Adaptec OEM Raid Solutions, James E.J. Bottomley

aac_queuecommand() is a scsi_host_template.queuecommand() implementation.
Any value returned by this function other than one of the following values
is translated into SCSI_MLQUEUE_HOST_BUSY:
* 0
* SCSI_MLQUEUE_HOST_BUSY
* SCSI_MLQUEUE_DEVICE_BUSY
* SCSI_MLQUEUE_EH_RETRY
* SCSI_MLQUEUE_TARGET_BUSY

Improve readability of aac_queuecommand() by returning
SCSI_MLQUEUE_HOST_BUSY instead of FAILED.

Cc: Gilbert Wu <gilbert.wu@microchip.com>
Cc: Sagar Biradar <Sagar.Biradar@microchip.com>
Cc: John Garry <john.g.garry@oracle.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---

Changes compared to v1: instead of failing a SCSI command if aac_scsi_cmd()
  returns a value that is not zero, let the SCSI core retry the command.

 drivers/scsi/aacraid/linit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
index ea66196ef7c7..82c6e7c7cdaf 100644
--- a/drivers/scsi/aacraid/linit.c
+++ b/drivers/scsi/aacraid/linit.c
@@ -242,7 +242,7 @@ static int aac_queuecommand(struct Scsi_Host *shost,
 {
 	aac_priv(cmd)->owner = AAC_OWNER_LOWLEVEL;
 
-	return aac_scsi_cmd(cmd) ? FAILED : 0;
+	return aac_scsi_cmd(cmd) ? SCSI_MLQUEUE_HOST_BUSY : 0;
 }
 
 /**

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

* Re: [PATCH v2] scsi: aacraid: Improve code readability
  2025-10-21 20:17 [PATCH v2] scsi: aacraid: Improve code readability Bart Van Assche
@ 2025-10-22  8:00 ` John Garry
  2025-10-24  3:01 ` Martin K. Petersen
  2025-10-30  3:33 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: John Garry @ 2025-10-22  8:00 UTC (permalink / raw)
  To: Bart Van Assche, Martin K . Petersen
  Cc: linux-scsi, Gilbert Wu, Sagar Biradar, Adaptec OEM Raid Solutions,
	James E.J. Bottomley

On 21/10/2025 21:17, Bart Van Assche wrote:
> aac_queuecommand() is a scsi_host_template.queuecommand() implementation.
> Any value returned by this function other than one of the following values
> is translated into SCSI_MLQUEUE_HOST_BUSY:
> * 0
> * SCSI_MLQUEUE_HOST_BUSY
> * SCSI_MLQUEUE_DEVICE_BUSY
> * SCSI_MLQUEUE_EH_RETRY
> * SCSI_MLQUEUE_TARGET_BUSY
> 
> Improve readability of aac_queuecommand() by returning
> SCSI_MLQUEUE_HOST_BUSY instead of FAILED.
> 
> Cc: Gilbert Wu <gilbert.wu@microchip.com>
> Cc: Sagar Biradar <Sagar.Biradar@microchip.com>
> Cc: John Garry <john.g.garry@oracle.com>
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Reviewed-by: John Garry <john.g.garry@oracle.com>

> ---
> 
> Changes compared to v1: instead of failing a SCSI command if aac_scsi_cmd()
>    returns a value that is not zero, let the SCSI core retry the command.
> 
>   drivers/scsi/aacraid/linit.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
> index ea66196ef7c7..82c6e7c7cdaf 100644
> --- a/drivers/scsi/aacraid/linit.c
> +++ b/drivers/scsi/aacraid/linit.c
> @@ -242,7 +242,7 @@ static int aac_queuecommand(struct Scsi_Host *shost,
>   {
>   	aac_priv(cmd)->owner = AAC_OWNER_LOWLEVEL;
>   
> -	return aac_scsi_cmd(cmd) ? FAILED : 0;
> +	return aac_scsi_cmd(cmd) ? SCSI_MLQUEUE_HOST_BUSY : 0;
>   }
>   
>   /**


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

* Re: [PATCH v2] scsi: aacraid: Improve code readability
  2025-10-21 20:17 [PATCH v2] scsi: aacraid: Improve code readability Bart Van Assche
  2025-10-22  8:00 ` John Garry
@ 2025-10-24  3:01 ` Martin K. Petersen
  2025-10-30  3:33 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-10-24  3:01 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Gilbert Wu, Sagar Biradar,
	John Garry, Adaptec OEM Raid Solutions, James E.J. Bottomley


Bart,

> aac_queuecommand() is a scsi_host_template.queuecommand()
> implementation. Any value returned by this function other than one of
> the following values is translated into SCSI_MLQUEUE_HOST_BUSY:

Applied to 6.19/scsi-staging, thanks!

-- 
Martin K. Petersen

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

* Re: [PATCH v2] scsi: aacraid: Improve code readability
  2025-10-21 20:17 [PATCH v2] scsi: aacraid: Improve code readability Bart Van Assche
  2025-10-22  8:00 ` John Garry
  2025-10-24  3:01 ` Martin K. Petersen
@ 2025-10-30  3:33 ` Martin K. Petersen
  2 siblings, 0 replies; 4+ messages in thread
From: Martin K. Petersen @ 2025-10-30  3:33 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Martin K . Petersen, linux-scsi, Gilbert Wu, Sagar Biradar,
	John Garry, Adaptec OEM Raid Solutions, James E.J. Bottomley

On Tue, 21 Oct 2025 13:17:43 -0700, Bart Van Assche wrote:

> aac_queuecommand() is a scsi_host_template.queuecommand() implementation.
> Any value returned by this function other than one of the following values
> is translated into SCSI_MLQUEUE_HOST_BUSY:
> * 0
> * SCSI_MLQUEUE_HOST_BUSY
> * SCSI_MLQUEUE_DEVICE_BUSY
> * SCSI_MLQUEUE_EH_RETRY
> * SCSI_MLQUEUE_TARGET_BUSY
> 
> [...]

Applied to 6.19/scsi-queue, thanks!

[1/1] scsi: aacraid: Improve code readability
      https://git.kernel.org/mkp/scsi/c/e414748b7e83

-- 
Martin K. Petersen

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

end of thread, other threads:[~2025-10-30  3:33 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-21 20:17 [PATCH v2] scsi: aacraid: Improve code readability Bart Van Assche
2025-10-22  8:00 ` John Garry
2025-10-24  3:01 ` Martin K. Petersen
2025-10-30  3:33 ` Martin K. Petersen

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