public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] megaraid_sas: boot hangs while LD is offline
@ 2016-01-15 13:43 Hannes Reinecke
  2016-01-18  5:48 ` Kashyap Desai
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2016-01-15 13:43 UTC (permalink / raw)
  To: Sumit Saxena
  Cc: Kashyap Desai, megaraidlinux.pdl, Martin K. Petersen,
	James Bottomley, linux-scsi, Hannes Reinecke, Hannes Reinecke

Offline Logical drives (LDs) should not allowed to be visible
to the OS, as the OS will hang trying to send commands to it.
This patch skips offline LDs like it already does for
non-system physical drives (PDs).

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 97a1c1c..f32831b 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1760,7 +1760,7 @@ static void megasas_set_dma_alignment(struct scsi_device *sdev)
 
 static int megasas_slave_configure(struct scsi_device *sdev)
 {
-	u16 pd_index = 0;
+	u16 pd_index = 0, ld_index;
 	struct megasas_instance *instance;
 
 	instance = megasas_lookup_instance(sdev->host->host_no);
@@ -1772,6 +1772,11 @@ static int megasas_slave_configure(struct scsi_device *sdev)
 			if (instance->pd_list[pd_index].driveState !=
 				MR_PD_STATE_SYSTEM)
 				return -ENXIO;
+		} else {
+			ld_index = ((sdev->channel - MEGASAS_MAX_PD_CHANNELS) *
+				    MEGASAS_MAX_DEV_PER_CHANNEL) + sdev->id;
+			if (instance->ld_ids[ld_index] == 0xff)
+				return -ENXIO;
 		}
 	}
 	megasas_set_dma_alignment(sdev);
-- 
1.8.5.6


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

* RE: [PATCH] megaraid_sas: boot hangs while LD is offline
  2016-01-15 13:43 [PATCH] megaraid_sas: boot hangs while LD is offline Hannes Reinecke
@ 2016-01-18  5:48 ` Kashyap Desai
  2016-01-18  6:54   ` Hannes Reinecke
  0 siblings, 1 reply; 6+ messages in thread
From: Kashyap Desai @ 2016-01-18  5:48 UTC (permalink / raw)
  To: Hannes Reinecke, Sumit Saxena
  Cc: PDL,MEGARAIDLINUX, Martin K. Petersen, James Bottomley,
	linux-scsi, Hannes Reinecke

> -----Original Message-----
> From: Hannes Reinecke [mailto:hare@suse.de]
> Sent: Friday, January 15, 2016 7:13 PM
> To: Sumit Saxena
> Cc: Kashyap Desai; megaraidlinux.pdl@avagotech.com; Martin K. Petersen;
> James Bottomley; linux-scsi@vger.kernel.org; Hannes Reinecke; Hannes
> Reinecke
> Subject: [PATCH] megaraid_sas: boot hangs while LD is offline
>
> Offline Logical drives (LDs) should not allowed to be visible to the OS,
as the
> OS will hang trying to send commands to it.
> This patch skips offline LDs like it already does for non-system
physical
> drives (PDs).
>
> Signed-off-by: Hannes Reinecke <hare@suse.com>
> ---
>  drivers/scsi/megaraid/megaraid_sas_base.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
> b/drivers/scsi/megaraid/megaraid_sas_base.c
> index 97a1c1c..f32831b 100644
> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
> @@ -1760,7 +1760,7 @@ static void megasas_set_dma_alignment(struct
> scsi_device *sdev)
>
>  static int megasas_slave_configure(struct scsi_device *sdev)  {
> -	u16 pd_index = 0;
> +	u16 pd_index = 0, ld_index;
>  	struct megasas_instance *instance;
>
>  	instance = megasas_lookup_instance(sdev->host->host_no);
> @@ -1772,6 +1772,11 @@ static int megasas_slave_configure(struct
> scsi_device *sdev)
>  			if (instance->pd_list[pd_index].driveState !=
>  				MR_PD_STATE_SYSTEM)
>  				return -ENXIO;
> +		} else {
> +			ld_index = ((sdev->channel -
> MEGASAS_MAX_PD_CHANNELS) *
> +				    MEGASAS_MAX_DEV_PER_CHANNEL) +
> sdev->id;
> +			if (instance->ld_ids[ld_index] == 0xff)
> +				return -ENXIO;

Hannes - We attempted this code change for one of the issue in past. This
code drop was just a quick workaround to unblock that customer issue.
Avago provided FW fix for this issue as new FW (again fix was done 2 years
before, so many latest FW will have this fix) return below sense key for
TUR.
SenseKey=0x2, asc=0x4, ascq=0x3(LOGICAL UNIT NOT READY, MANUAL
INTERVENTION REQUIRED)

Have you seen any issue w.r.t VD Offline or trying to optimize code in
megaraid driver ?

>  		}
>  	}
>  	megasas_set_dma_alignment(sdev);
> --
> 1.8.5.6

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

* Re: [PATCH] megaraid_sas: boot hangs while LD is offline
  2016-01-18  5:48 ` Kashyap Desai
@ 2016-01-18  6:54   ` Hannes Reinecke
  0 siblings, 0 replies; 6+ messages in thread
From: Hannes Reinecke @ 2016-01-18  6:54 UTC (permalink / raw)
  To: Kashyap Desai, Sumit Saxena
  Cc: PDL,MEGARAIDLINUX, Martin K. Petersen, James Bottomley,
	linux-scsi, Hannes Reinecke

On 01/18/2016 06:48 AM, Kashyap Desai wrote:
>> -----Original Message-----
>> From: Hannes Reinecke [mailto:hare@suse.de]
>> Sent: Friday, January 15, 2016 7:13 PM
>> To: Sumit Saxena
>> Cc: Kashyap Desai; megaraidlinux.pdl@avagotech.com; Martin K. Petersen;
>> James Bottomley; linux-scsi@vger.kernel.org; Hannes Reinecke; Hannes
>> Reinecke
>> Subject: [PATCH] megaraid_sas: boot hangs while LD is offline
>>
>> Offline Logical drives (LDs) should not allowed to be visible to the OS,
> as the
>> OS will hang trying to send commands to it.
>> This patch skips offline LDs like it already does for non-system
> physical
>> drives (PDs).
>>
>> Signed-off-by: Hannes Reinecke <hare@suse.com>
>> ---
>>   drivers/scsi/megaraid/megaraid_sas_base.c | 7 ++++++-
>>   1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
>> b/drivers/scsi/megaraid/megaraid_sas_base.c
>> index 97a1c1c..f32831b 100644
>> --- a/drivers/scsi/megaraid/megaraid_sas_base.c
>> +++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>> @@ -1760,7 +1760,7 @@ static void megasas_set_dma_alignment(struct
>> scsi_device *sdev)
>>
>>   static int megasas_slave_configure(struct scsi_device *sdev)  {
>> -	u16 pd_index = 0;
>> +	u16 pd_index = 0, ld_index;
>>   	struct megasas_instance *instance;
>>
>>   	instance = megasas_lookup_instance(sdev->host->host_no);
>> @@ -1772,6 +1772,11 @@ static int megasas_slave_configure(struct
>> scsi_device *sdev)
>>   			if (instance->pd_list[pd_index].driveState !=
>>   				MR_PD_STATE_SYSTEM)
>>   				return -ENXIO;
>> +		} else {
>> +			ld_index = ((sdev->channel -
>> MEGASAS_MAX_PD_CHANNELS) *
>> +				    MEGASAS_MAX_DEV_PER_CHANNEL) +
>> sdev->id;
>> +			if (instance->ld_ids[ld_index] == 0xff)
>> +				return -ENXIO;
>
> Hannes - We attempted this code change for one of the issue in past. This
> code drop was just a quick workaround to unblock that customer issue.
> Avago provided FW fix for this issue as new FW (again fix was done 2 years
> before, so many latest FW will have this fix) return below sense key for
> TUR.
> SenseKey=0x2, asc=0x4, ascq=0x3(LOGICAL UNIT NOT READY, MANUAL
> INTERVENTION REQUIRED)
>
> Have you seen any issue w.r.t VD Offline or trying to optimize code in
> megaraid driver ?
>
Currently I'm in the process to review all non-mainstream SLES 
patches. And this is one of them which do not have a clear 
equivalent in mainline.
But as all are customers are running _with_ this patch, we wouldn't 
know if the upstream fix resolves this issue, too.

But thanks for the review, I'll drop this patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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

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

* [PATCH] megaraid_sas: boot hangs while LD is offline
@ 2017-08-15 11:59 Hannes Reinecke
  2017-08-16 13:05 ` Sumit Saxena
  0 siblings, 1 reply; 6+ messages in thread
From: Hannes Reinecke @ 2017-08-15 11:59 UTC (permalink / raw)
  To: Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Sumit Saxena, Kashyap Desai,
	megaraidlinux.pdl, linux-scsi, Hannes Reinecke, Hannes Reinecke

Offline Logical drives (LDs) should not allowed to be visible
to the OS, as the OS will hang trying to send commands to it.
This patch skips offline LDs like it already does for
non-system physical drives (PDs).

Signed-off-by: Hannes Reinecke <hare@suse.com>
---
 drivers/scsi/megaraid/megaraid_sas_base.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 5202c2f..39b08fc 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -1897,14 +1897,19 @@ static void megasas_set_static_target_properties(struct scsi_device *sdev,
 
 static int megasas_slave_configure(struct scsi_device *sdev)
 {
-	u16 pd_index = 0;
+	u16 pd_index = 0, ld_index;
 	struct megasas_instance *instance;
 	int ret_target_prop = DCMD_FAILED;
 	bool is_target_prop = false;
 
 	instance = megasas_lookup_instance(sdev->host->host_no);
 	if (instance->pd_list_not_supported) {
-		if (!MEGASAS_IS_LOGICAL(sdev) && sdev->type == TYPE_DISK) {
+		if (MEGASAS_IS_LOGICAL(sdev)) {
+			ld_index = ((sdev->channel - MEGASAS_MAX_PD_CHANNELS) *
+				    MEGASAS_MAX_DEV_PER_CHANNEL) + sdev->id;
+			if (instance->ld_ids[ld_index] == 0xff)
+				return -ENXIO;
+		} else if (sdev->type == TYPE_DISK) {
 			pd_index = (sdev->channel * MEGASAS_MAX_DEV_PER_CHANNEL) +
 				sdev->id;
 			if (instance->pd_list[pd_index].driveState !=
-- 
1.8.5.6

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

* RE: [PATCH] megaraid_sas: boot hangs while LD is offline
  2017-08-15 11:59 Hannes Reinecke
@ 2017-08-16 13:05 ` Sumit Saxena
  2017-08-16 13:06   ` Hannes Reinecke
  0 siblings, 1 reply; 6+ messages in thread
From: Sumit Saxena @ 2017-08-16 13:05 UTC (permalink / raw)
  To: Hannes Reinecke, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Kashyap Desai,
	PDL,MEGARAIDLINUX, linux-scsi, Hannes Reinecke

>-----Original Message-----
>From: Hannes Reinecke [mailto:hare@suse.de]
>Sent: Tuesday, August 15, 2017 5:29 PM
>To: Martin K. Petersen
>Cc: Christoph Hellwig; James Bottomley; Sumit Saxena; Kashyap Desai;
>megaraidlinux.pdl@broadcom.com; linux-scsi@vger.kernel.org; Hannes
>Reinecke; Hannes Reinecke
>Subject: [PATCH] megaraid_sas: boot hangs while LD is offline
>
>Offline Logical drives (LDs) should not allowed to be visible to the OS,
as the
>OS will hang trying to send commands to it.
>This patch skips offline LDs like it already does for non-system physical
drives
>(PDs).

Hi Hannes,

You have submitted this patch in past as it was part of SLES kernel but
missing in upstream and it was concluded to drop this patch then.
This issue was fixed in firmware 4 years back and many firmware versions
should be available with the fix so this fix is not required in
driver(upstream
as well SLES kernel). Do you see any functional issue without this patch ?
If not, I would request  to back out this patch from SLES kernel also.

Thanks,
Sumit

>
>Signed-off-by: Hannes Reinecke <hare@suse.com>
>---
> drivers/scsi/megaraid/megaraid_sas_base.c | 9 +++++++--
> 1 file changed, 7 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c
>b/drivers/scsi/megaraid/megaraid_sas_base.c
>index 5202c2f..39b08fc 100644
>--- a/drivers/scsi/megaraid/megaraid_sas_base.c
>+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
>@@ -1897,14 +1897,19 @@ static void
>megasas_set_static_target_properties(struct scsi_device *sdev,
>
> static int megasas_slave_configure(struct scsi_device *sdev)  {
>-	u16 pd_index = 0;
>+	u16 pd_index = 0, ld_index;
> 	struct megasas_instance *instance;
> 	int ret_target_prop = DCMD_FAILED;
> 	bool is_target_prop = false;
>
> 	instance = megasas_lookup_instance(sdev->host->host_no);
> 	if (instance->pd_list_not_supported) {
>-		if (!MEGASAS_IS_LOGICAL(sdev) && sdev->type ==
>TYPE_DISK) {
>+		if (MEGASAS_IS_LOGICAL(sdev)) {
>+			ld_index = ((sdev->channel -
>MEGASAS_MAX_PD_CHANNELS) *
>+				    MEGASAS_MAX_DEV_PER_CHANNEL) +
>sdev->id;
>+			if (instance->ld_ids[ld_index] == 0xff)
>+				return -ENXIO;
>+		} else if (sdev->type == TYPE_DISK) {
> 			pd_index = (sdev->channel *
>MEGASAS_MAX_DEV_PER_CHANNEL) +
> 				sdev->id;
> 			if (instance->pd_list[pd_index].driveState !=
>--
>1.8.5.6

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

* Re: [PATCH] megaraid_sas: boot hangs while LD is offline
  2017-08-16 13:05 ` Sumit Saxena
@ 2017-08-16 13:06   ` Hannes Reinecke
  0 siblings, 0 replies; 6+ messages in thread
From: Hannes Reinecke @ 2017-08-16 13:06 UTC (permalink / raw)
  To: Sumit Saxena, Martin K. Petersen
  Cc: Christoph Hellwig, James Bottomley, Kashyap Desai,
	PDL,MEGARAIDLINUX, linux-scsi, Hannes Reinecke

On 08/16/2017 03:05 PM, Sumit Saxena wrote:
>> -----Original Message-----
>> From: Hannes Reinecke [mailto:hare@suse.de]
>> Sent: Tuesday, August 15, 2017 5:29 PM
>> To: Martin K. Petersen
>> Cc: Christoph Hellwig; James Bottomley; Sumit Saxena; Kashyap Desai;
>> megaraidlinux.pdl@broadcom.com; linux-scsi@vger.kernel.org; Hannes
>> Reinecke; Hannes Reinecke
>> Subject: [PATCH] megaraid_sas: boot hangs while LD is offline
>>
>> Offline Logical drives (LDs) should not allowed to be visible to the OS,
> as the
>> OS will hang trying to send commands to it.
>> This patch skips offline LDs like it already does for non-system physical
> drives
>> (PDs).
> 
> Hi Hannes,
> 
> You have submitted this patch in past as it was part of SLES kernel but
> missing in upstream and it was concluded to drop this patch then.
> This issue was fixed in firmware 4 years back and many firmware versions
> should be available with the fix so this fix is not required in
> driver(upstream
> as well SLES kernel). Do you see any functional issue without this patch ?
> If not, I would request  to back out this patch from SLES kernel also.
> 
Okay, if you say so.
Will be removing it.

Martin, please drop this patch.

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		   Teamlead Storage & Networking
hare@suse.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)

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

end of thread, other threads:[~2017-08-16 13:06 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-01-15 13:43 [PATCH] megaraid_sas: boot hangs while LD is offline Hannes Reinecke
2016-01-18  5:48 ` Kashyap Desai
2016-01-18  6:54   ` Hannes Reinecke
  -- strict thread matches above, loose matches on Subject: below --
2017-08-15 11:59 Hannes Reinecke
2017-08-16 13:05 ` Sumit Saxena
2017-08-16 13:06   ` Hannes Reinecke

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