diff mbox series

[v4,2/5] scsi: Added a new error code in scsi.h

Message ID 1603370091-9337-3-git-send-email-muneendra.kumar@broadcom.com (mailing list archive)
State Superseded
Headers show
Series scsi: Support to handle Intermittent errors | expand

Commit Message

Muneendra Kumar Oct. 22, 2020, 12:34 p.m. UTC
Added a new error code DID_TRANSPORT_MARGINAL to handle marginal
errors in scsi.h

Clearing the SCMD_NORETRIES_ABORT bit in state flag before
blk_mq_start_request

Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>

---
v4:
No change

v3:
Rearranged the patch by merging second hunk of the previous(v2)
patch3 to this patch

v2:
Newpatch
---
 drivers/scsi/scsi_lib.c | 1 +
 include/scsi/scsi.h     | 1 +
 2 files changed, 2 insertions(+)

Comments

Ewan Milne Oct. 26, 2020, 11:45 a.m. UTC | #1
Don't you need to add the DID_TRANSPORT_MARGINAL case to
scsi_decide_disposition() ?   DID_TRANSPORT_FAILFAST returns
SUCCESS but the default case returns ERROR.

-Ewan


On Thu, 2020-10-22 at 18:04 +0530, Muneendra wrote:
> Added a new error code DID_TRANSPORT_MARGINAL to handle marginal
> errors in scsi.h
> 
> Clearing the SCMD_NORETRIES_ABORT bit in state flag before
> blk_mq_start_request
> 
> Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>
> 
> ---
> v4:
> No change
> 
> v3:
> Rearranged the patch by merging second hunk of the previous(v2)
> patch3 to this patch
> 
> v2:
> Newpatch
> ---
>  drivers/scsi/scsi_lib.c | 1 +
>  include/scsi/scsi.h     | 1 +
>  2 files changed, 2 insertions(+)
> 
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
> index 1a2e9bab42ef..2b5dea07498e 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1660,6 +1660,7 @@ static blk_status_t scsi_queue_rq(struct
> blk_mq_hw_ctx *hctx,
>  		req->rq_flags |= RQF_DONTPREP;
>  	} else {
>  		clear_bit(SCMD_STATE_COMPLETE, &cmd->state);
> +		clear_bit(SCMD_NORETRIES_ABORT, &cmd->state);
>  	}
>  
>  	cmd->flags &= SCMD_PRESERVED_FLAGS;
> diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
> index 5339baadc082..5b287ad8b727 100644
> --- a/include/scsi/scsi.h
> +++ b/include/scsi/scsi.h
> @@ -159,6 +159,7 @@ static inline int scsi_is_wlun(u64 lun)
>  				 * paths might yield different results
> */
>  #define DID_ALLOC_FAILURE 0x12  /* Space allocation on the device
> failed */
>  #define DID_MEDIUM_ERROR  0x13  /* Medium error */
> +#define DID_TRANSPORT_MARGINAL 0x14 /* Transport marginal errors */
>  #define DRIVER_OK       0x00	/* Driver
> status                           */
>  
>  /*
Muneendra Kumar Oct. 26, 2020, 8:24 p.m. UTC | #2
Hi Ewan,
Thanks for the input .
I will add this change.

Regards,
Muneendra.

-----Original Message-----
From: Ewan D. Milne [mailto:emilne@redhat.com]
Sent: Monday, October 26, 2020 5:16 PM
To: Muneendra <muneendra.kumar@broadcom.com>; linux-scsi@vger.kernel.org;
michael.christie@oracle.com; hare@suse.de
Cc: jsmart2021@gmail.com; mkumar@redhat.com
Subject: Re: [patch v4 2/5] scsi: Added a new error code in scsi.h

Don't you need to add the DID_TRANSPORT_MARGINAL case to
scsi_decide_disposition() ?   DID_TRANSPORT_FAILFAST returns
SUCCESS but the default case returns ERROR.

-Ewan


On Thu, 2020-10-22 at 18:04 +0530, Muneendra wrote:
> Added a new error code DID_TRANSPORT_MARGINAL to handle marginal
> errors in scsi.h
>
> Clearing the SCMD_NORETRIES_ABORT bit in state flag before
> blk_mq_start_request
>
> Signed-off-by: Muneendra <muneendra.kumar@broadcom.com>
>
> ---
> v4:
> No change
>
> v3:
> Rearranged the patch by merging second hunk of the previous(v2)
> patch3 to this patch
>
> v2:
> Newpatch
> ---
>  drivers/scsi/scsi_lib.c | 1 +
>  include/scsi/scsi.h     | 1 +
>  2 files changed, 2 insertions(+)
>
> diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index
> 1a2e9bab42ef..2b5dea07498e 100644
> --- a/drivers/scsi/scsi_lib.c
> +++ b/drivers/scsi/scsi_lib.c
> @@ -1660,6 +1660,7 @@ static blk_status_t scsi_queue_rq(struct
> blk_mq_hw_ctx *hctx,
>  		req->rq_flags |= RQF_DONTPREP;
>  	} else {
>  		clear_bit(SCMD_STATE_COMPLETE, &cmd->state);
> +		clear_bit(SCMD_NORETRIES_ABORT, &cmd->state);
>  	}
>
>  	cmd->flags &= SCMD_PRESERVED_FLAGS;
> diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index
> 5339baadc082..5b287ad8b727 100644
> --- a/include/scsi/scsi.h
> +++ b/include/scsi/scsi.h
> @@ -159,6 +159,7 @@ static inline int scsi_is_wlun(u64 lun)
>  				 * paths might yield different results */  #define
> DID_ALLOC_FAILURE 0x12  /* Space allocation on the device failed */
> #define DID_MEDIUM_ERROR  0x13  /* Medium error */
> +#define DID_TRANSPORT_MARGINAL 0x14 /* Transport marginal errors */
>  #define DRIVER_OK       0x00	/* Driver
> status                           */
>
>  /*
diff mbox series

Patch

diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 1a2e9bab42ef..2b5dea07498e 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1660,6 +1660,7 @@  static blk_status_t scsi_queue_rq(struct blk_mq_hw_ctx *hctx,
 		req->rq_flags |= RQF_DONTPREP;
 	} else {
 		clear_bit(SCMD_STATE_COMPLETE, &cmd->state);
+		clear_bit(SCMD_NORETRIES_ABORT, &cmd->state);
 	}
 
 	cmd->flags &= SCMD_PRESERVED_FLAGS;
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 5339baadc082..5b287ad8b727 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -159,6 +159,7 @@  static inline int scsi_is_wlun(u64 lun)
 				 * paths might yield different results */
 #define DID_ALLOC_FAILURE 0x12  /* Space allocation on the device failed */
 #define DID_MEDIUM_ERROR  0x13  /* Medium error */
+#define DID_TRANSPORT_MARGINAL 0x14 /* Transport marginal errors */
 #define DRIVER_OK       0x00	/* Driver status                           */
 
 /*