All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] scsi: hisi_sas: Add softreset in hisi_sas_I_T_nexus_reset()
@ 2019-03-20 10:21 ` John Garry
  0 siblings, 0 replies; 6+ messages in thread
From: John Garry @ 2019-03-20 10:21 UTC (permalink / raw)
  To: jejb, martin.petersen
  Cc: linuxarm, linux-kernel, linux-scsi, Luo Jiaxing, John Garry

From: Luo Jiaxing <luojiaxing@huawei.com>

We found out that for v2 hw, a SATA disk can not be written to after
the system comes up.

In commit ffb1c820b8b6 ("scsi: hisi_sas: remove the check of sas_dev
status in hisi_sas_I_T_nexus_reset()"), we introduced a path where we may
issue an internal abort for a SATA device, but without following it with a
softreset.

We need to always follow an internal abort with a software reset, as per HW
programming flow, so add this.

Fixes: ffb1c820b8b6 ("scsi: hisi_sas: remove the check of sas_dev status in hisi_sas_I_T_nexus_reset()")
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---

Hi James, Martin,

Please consider this patch for 5.1 fixes. It's fixes a big regression,
where we can no longer access SATA disks, like here:
https://storage.kernelci.org/next/master/next-20190213/arm64/defconfig/gcc-7/lab-collabora/boot-hip07-d05.html

Thanks,
John

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 3c3cf89f713f..14bac4966c87 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1801,6 +1801,12 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
 	}
 	hisi_sas_dereg_device(hisi_hba, device);
 
+	if (dev_is_sata(device)) {
+		rc = hisi_sas_softreset_ata_disk(device);
+		if (rc)
+			return TMF_RESP_FUNC_FAILED;
+	}
+
 	rc = hisi_sas_debug_I_T_nexus_reset(device);
 
 	if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV))
-- 
2.17.1


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

* [PATCH] scsi: hisi_sas: Add softreset in hisi_sas_I_T_nexus_reset()
@ 2019-03-20 10:21 ` John Garry
  0 siblings, 0 replies; 6+ messages in thread
From: John Garry @ 2019-03-20 10:21 UTC (permalink / raw)
  To: jejb, martin.petersen
  Cc: linuxarm, linux-kernel, linux-scsi, Luo Jiaxing, John Garry

From: Luo Jiaxing <luojiaxing@huawei.com>

We found out that for v2 hw, a SATA disk can not be written to after
the system comes up.

In commit ffb1c820b8b6 ("scsi: hisi_sas: remove the check of sas_dev
status in hisi_sas_I_T_nexus_reset()"), we introduced a path where we may
issue an internal abort for a SATA device, but without following it with a
softreset.

We need to always follow an internal abort with a software reset, as per HW
programming flow, so add this.

Fixes: ffb1c820b8b6 ("scsi: hisi_sas: remove the check of sas_dev status in hisi_sas_I_T_nexus_reset()")
Signed-off-by: Luo Jiaxing <luojiaxing@huawei.com>
Signed-off-by: John Garry <john.garry@huawei.com>
---

Hi James, Martin,

Please consider this patch for 5.1 fixes. It's fixes a big regression,
where we can no longer access SATA disks, like here:
https://storage.kernelci.org/next/master/next-20190213/arm64/defconfig/gcc-7/lab-collabora/boot-hip07-d05.html

Thanks,
John

diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
index 3c3cf89f713f..14bac4966c87 100644
--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
+++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
@@ -1801,6 +1801,12 @@ static int hisi_sas_I_T_nexus_reset(struct domain_device *device)
 	}
 	hisi_sas_dereg_device(hisi_hba, device);
 
+	if (dev_is_sata(device)) {
+		rc = hisi_sas_softreset_ata_disk(device);
+		if (rc)
+			return TMF_RESP_FUNC_FAILED;
+	}
+
 	rc = hisi_sas_debug_I_T_nexus_reset(device);
 
 	if ((rc == TMF_RESP_FUNC_COMPLETE) || (rc == -ENODEV))
-- 
2.17.1

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

* Re: [PATCH] scsi: hisi_sas: Add softreset in hisi_sas_I_T_nexus_reset()
  2019-03-20 10:21 ` John Garry
@ 2019-03-20 18:25   ` Martin K. Petersen
  -1 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2019-03-20 18:25 UTC (permalink / raw)
  To: John Garry
  Cc: jejb, martin.petersen, linuxarm, linux-kernel, linux-scsi, Luo Jiaxing


John,

> We need to always follow an internal abort with a software reset, as
> per HW programming flow, so add this.

Mangled patch. Applied it by hand to 5.1/scsi-fixes but please use git
send-email.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] scsi: hisi_sas: Add softreset in hisi_sas_I_T_nexus_reset()
@ 2019-03-20 18:25   ` Martin K. Petersen
  0 siblings, 0 replies; 6+ messages in thread
From: Martin K. Petersen @ 2019-03-20 18:25 UTC (permalink / raw)
  To: John Garry
  Cc: jejb, martin.petersen, linuxarm, linux-kernel, linux-scsi, Luo Jiaxing


John,

> We need to always follow an internal abort with a software reset, as
> per HW programming flow, so add this.

Mangled patch. Applied it by hand to 5.1/scsi-fixes but please use git
send-email.

-- 
Martin K. Petersen	Oracle Linux Engineering

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

* Re: [PATCH] scsi: hisi_sas: Add softreset in hisi_sas_I_T_nexus_reset()
  2019-03-20 18:25   ` Martin K. Petersen
@ 2019-03-21 10:27     ` John Garry
  -1 siblings, 0 replies; 6+ messages in thread
From: John Garry @ 2019-03-21 10:27 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: jejb, linuxarm, linux-kernel, linux-scsi, Luo Jiaxing

On 20/03/2019 18:25, Martin K. Petersen wrote:
>
> John,
>
>> We need to always follow an internal abort with a software reset, as
>> per HW programming flow, so add this.
>
> Mangled patch. Applied it by hand to 5.1/scsi-fixes but please use git
> send-email.
>

Hi Martin,

I'm not sure what happened. Patch 
https://patchwork.kernel.org/patch/10861283/mbox/ applied ok for me, and 
I did use git send-email.

Thanks,
John


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

* Re: [PATCH] scsi: hisi_sas: Add softreset in hisi_sas_I_T_nexus_reset()
@ 2019-03-21 10:27     ` John Garry
  0 siblings, 0 replies; 6+ messages in thread
From: John Garry @ 2019-03-21 10:27 UTC (permalink / raw)
  To: Martin K. Petersen; +Cc: jejb, linuxarm, linux-kernel, linux-scsi, Luo Jiaxing

On 20/03/2019 18:25, Martin K. Petersen wrote:
>
> John,
>
>> We need to always follow an internal abort with a software reset, as
>> per HW programming flow, so add this.
>
> Mangled patch. Applied it by hand to 5.1/scsi-fixes but please use git
> send-email.
>

Hi Martin,

I'm not sure what happened. Patch 
https://patchwork.kernel.org/patch/10861283/mbox/ applied ok for me, and 
I did use git send-email.

Thanks,
John

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

end of thread, other threads:[~2019-03-21 10:27 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-20 10:21 [PATCH] scsi: hisi_sas: Add softreset in hisi_sas_I_T_nexus_reset() John Garry
2019-03-20 10:21 ` John Garry
2019-03-20 18:25 ` Martin K. Petersen
2019-03-20 18:25   ` Martin K. Petersen
2019-03-21 10:27   ` John Garry
2019-03-21 10:27     ` John Garry

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.