diff mbox

scsi_dh_rdac: always retry MODE SELECT on command lock violation

Message ID 1453473761-54777-1-git-send-email-hare@suse.de (mailing list archive)
State Accepted, archived
Headers show

Commit Message

Hannes Reinecke Jan. 22, 2016, 2:42 p.m. UTC
If MODE SELECT returns with sense '05/91/36' (command lock violation)
it should always be retried without counting the number of retries.
During an HBA upgrade or similar circumstances one might see a flood
of MODE SELECT command from various HBAs, which will easily trigger
the sense code and exceed the retry count.

References: bsc#956949

Signed-off-by: Hannes Reinecke <hare@suse.de>
---
 drivers/scsi/device_handler/scsi_dh_rdac.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Johannes Thumshirn Jan. 22, 2016, 2:48 p.m. UTC | #1
On Fri, Jan 22, 2016 at 03:42:41PM +0100, Hannes Reinecke wrote:
> If MODE SELECT returns with sense '05/91/36' (command lock violation)
> it should always be retried without counting the number of retries.
> During an HBA upgrade or similar circumstances one might see a flood
> of MODE SELECT command from various HBAs, which will easily trigger
> the sense code and exceed the retry count.
> 
> References: bsc#956949

Without the bugzilla refrence

Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>

> 
> Signed-off-by: Hannes Reinecke <hare@suse.de>
> ---
>  drivers/scsi/device_handler/scsi_dh_rdac.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
> index 3613581..93880ed 100644
> --- a/drivers/scsi/device_handler/scsi_dh_rdac.c
> +++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
> @@ -562,7 +562,7 @@ static int mode_select_handle_sense(struct scsi_device *sdev,
>  			/*
>  			 * Command Lock contention
>  			 */
> -			err = SCSI_DH_RETRY;
> +			err = SCSI_DH_IMM_RETRY;
>  		break;
>  	default:
>  		break;
> @@ -612,6 +612,8 @@ retry:
>  		err = mode_select_handle_sense(sdev, h->sense);
>  		if (err == SCSI_DH_RETRY && retry_cnt--)
>  			goto retry;
> +		if (err == SCSI_DH_IMM_RETRY)
> +			goto retry;
>  	}
>  	if (err == SCSI_DH_OK) {
>  		h->state = RDAC_STATE_ACTIVE;
> -- 
> 1.8.5.6
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
Martin K. Petersen Feb. 4, 2016, 2:48 a.m. UTC | #2
>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:

Hannes> If MODE SELECT returns with sense '05/91/36' (command lock
Hannes> violation) it should always be retried without counting the
Hannes> number of retries.  During an HBA upgrade or similar
Hannes> circumstances one might see a flood of MODE SELECT command from
Hannes> various HBAs, which will easily trigger the sense code and
Hannes> exceed the retry count.

Should this be Cc: stable?
Hannes Reinecke Feb. 4, 2016, 7:01 a.m. UTC | #3
On 02/04/2016 03:48 AM, Martin K. Petersen wrote:
>>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:
> 
> Hannes> If MODE SELECT returns with sense '05/91/36' (command lock
> Hannes> violation) it should always be retried without counting the
> Hannes> number of retries.  During an HBA upgrade or similar
> Hannes> circumstances one might see a flood of MODE SELECT command from
> Hannes> various HBAs, which will easily trigger the sense code and
> Hannes> exceed the retry count.
> 
> Should this be Cc: stable?
> 
Probably, yes.

Can you do it?

Cheers,

Hannes
Martin K. Petersen Feb. 5, 2016, 3:28 a.m. UTC | #4
>>>>> "Hannes" == Hannes Reinecke <hare@suse.de> writes:

Hannes> If MODE SELECT returns with sense '05/91/36' (command lock
Hannes> violation) it should always be retried without counting the
Hannes> number of retries.  During an HBA upgrade or similar
Hannes> circumstances one might see a flood of MODE SELECT command from
Hannes> various HBAs, which will easily trigger the sense code and
Hannes> exceed the retry count.

Applied to 4.5/scsi-fixes.
diff mbox

Patch

diff --git a/drivers/scsi/device_handler/scsi_dh_rdac.c b/drivers/scsi/device_handler/scsi_dh_rdac.c
index 3613581..93880ed 100644
--- a/drivers/scsi/device_handler/scsi_dh_rdac.c
+++ b/drivers/scsi/device_handler/scsi_dh_rdac.c
@@ -562,7 +562,7 @@  static int mode_select_handle_sense(struct scsi_device *sdev,
 			/*
 			 * Command Lock contention
 			 */
-			err = SCSI_DH_RETRY;
+			err = SCSI_DH_IMM_RETRY;
 		break;
 	default:
 		break;
@@ -612,6 +612,8 @@  retry:
 		err = mode_select_handle_sense(sdev, h->sense);
 		if (err == SCSI_DH_RETRY && retry_cnt--)
 			goto retry;
+		if (err == SCSI_DH_IMM_RETRY)
+			goto retry;
 	}
 	if (err == SCSI_DH_OK) {
 		h->state = RDAC_STATE_ACTIVE;