Re: [PATCH] qla2xxx: Mask off Scope bits in retry delay.

2018-06-07 Thread Martin K. Petersen


Himanshu,

> Some newer target uses "Status Qualifier" response in a returned "Busy
> Status". This new response code of 0x4001, which is "Scope" bits,
> translates to "Affects all units accessible by target".  Due to this
> new value returned in the Scope bits, driver was using that value as
> timeout value which resulted into driver waiting for 27min timeout.
>
> This patch masks off this Scope bits so that driver does not use this
> value as retry delay time.

Applied to 4.18/scsi-fixes. Thank you!

-- 
Martin K. Petersen  Oracle Linux Engineering


Re: [PATCH] qla2xxx: Mask off Scope bits in retry delay.

2018-06-07 Thread Martin Wilck
On Wed, 2018-06-06 at 08:41 -0700, Himanshu Madhani wrote:
> From: Anil Gurumurthy 
> 
> Some newer target uses "Status Qualifier" response in a returned
> "Busy Status". This new response code of 0x4001, which is "Scope"
> bits,
> translates to "Affects all units accessible by target".
> Due to this new value returned in the Scope bits, driver was using
> that value as timeout value which resulted into driver waiting for
> 27min
> timeout.
> 
> This patch masks off this Scope bits so that driver does not use
> this value as retry delay time.
> 
> Cc: 
> Signed-off-by: Anil Gurumurthy 
> Signed-off-by: Giridhar Malavali 
> Signed-off-by: Himanshu Madhani 

Tested successfully by SUSE customers.

Acked-by: Martin Wilck 

-- 
Dr. Martin Wilck , Tel. +49 (0)911 74053 2107
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton
HRB 21284 (AG Nürnberg)



Re: [PATCH] qla2xxx: Mask off Scope bits in retry delay.

2018-06-06 Thread Ewan D. Milne
On Wed, 2018-06-06 at 08:41 -0700, Himanshu Madhani wrote:
> From: Anil Gurumurthy 
> 
> Some newer target uses "Status Qualifier" response in a returned
> "Busy Status". This new response code of 0x4001, which is "Scope" bits,
> translates to "Affects all units accessible by target".
> Due to this new value returned in the Scope bits, driver was using
> that value as timeout value which resulted into driver waiting for 27min
> timeout.
> 
> This patch masks off this Scope bits so that driver does not use
> this value as retry delay time.
> 
> Cc: 
> Signed-off-by: Anil Gurumurthy 
> Signed-off-by: Giridhar Malavali 
> Signed-off-by: Himanshu Madhani 
> ---
> Hi Martin, 
> 
> This patch fixes driver retry delay timer with a specific target which
> returns Scope field in the BUSY status. Driver was translating this 
> Scope bits as timeout delay value and was wating for 27 minutes for retry. 
> 
> Please apply this to 4.18/scsi-fixes at your earliest convenience.
> 
> Thanks,
> Himanshu
> ---
>  drivers/scsi/qla2xxx/qla_isr.c | 8 ++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
> index a3dc83f9444d..68560a097ae1 100644
> --- a/drivers/scsi/qla2xxx/qla_isr.c
> +++ b/drivers/scsi/qla2xxx/qla_isr.c
> @@ -2494,8 +2494,12 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct 
> rsp_que *rsp, void *pkt)
>   ox_id = le16_to_cpu(sts24->ox_id);
>   par_sense_len = sizeof(sts24->data);
>   /* Valid values of the retry delay timer are 0x1-0xffef */
> - if (sts24->retry_delay > 0 && sts24->retry_delay < 0xfff1)
> - retry_delay = sts24->retry_delay;
> + if (sts24->retry_delay > 0 && sts24->retry_delay < 0xfff1) {
> + retry_delay = sts24->retry_delay & 0x3fff;
> + ql_dbg(ql_dbg_io, sp->vha, 0x3033,
> + "%s: scope=%#x retry_delay=%#x\n", __func__,
> + sts24->retry_delay >> 14, retry_delay);
> + }
>   } else {
>   if (scsi_status & SS_SENSE_LEN_VALID)
>   sense_len = le16_to_cpu(sts->req_sense_length);

Reviewed-by: Ewan D. Milne 





[PATCH] qla2xxx: Mask off Scope bits in retry delay.

2018-06-06 Thread Himanshu Madhani
From: Anil Gurumurthy 

Some newer target uses "Status Qualifier" response in a returned
"Busy Status". This new response code of 0x4001, which is "Scope" bits,
translates to "Affects all units accessible by target".
Due to this new value returned in the Scope bits, driver was using
that value as timeout value which resulted into driver waiting for 27min
timeout.

This patch masks off this Scope bits so that driver does not use
this value as retry delay time.

Cc: 
Signed-off-by: Anil Gurumurthy 
Signed-off-by: Giridhar Malavali 
Signed-off-by: Himanshu Madhani 
---
Hi Martin, 

This patch fixes driver retry delay timer with a specific target which
returns Scope field in the BUSY status. Driver was translating this 
Scope bits as timeout delay value and was wating for 27 minutes for retry. 

Please apply this to 4.18/scsi-fixes at your earliest convenience.

Thanks,
Himanshu
---
 drivers/scsi/qla2xxx/qla_isr.c | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
index a3dc83f9444d..68560a097ae1 100644
--- a/drivers/scsi/qla2xxx/qla_isr.c
+++ b/drivers/scsi/qla2xxx/qla_isr.c
@@ -2494,8 +2494,12 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct 
rsp_que *rsp, void *pkt)
ox_id = le16_to_cpu(sts24->ox_id);
par_sense_len = sizeof(sts24->data);
/* Valid values of the retry delay timer are 0x1-0xffef */
-   if (sts24->retry_delay > 0 && sts24->retry_delay < 0xfff1)
-   retry_delay = sts24->retry_delay;
+   if (sts24->retry_delay > 0 && sts24->retry_delay < 0xfff1) {
+   retry_delay = sts24->retry_delay & 0x3fff;
+   ql_dbg(ql_dbg_io, sp->vha, 0x3033,
+   "%s: scope=%#x retry_delay=%#x\n", __func__,
+   sts24->retry_delay >> 14, retry_delay);
+   }
} else {
if (scsi_status & SS_SENSE_LEN_VALID)
sense_len = le16_to_cpu(sts->req_sense_length);
-- 
2.12.0