Skip to content

Commit ad1562a

Browse files
Xiang Chengregkh
authored andcommitted
scsi: hisi_sas: config ATA de-reset as an constrained command for v3 hw
[ Upstream commit 9413532 ] As a unconstrained command, a command can be sent to SATA disk even if SATA disk status is BUSY, ERR or DRQ. If an ATA reset assert is successful but ATA reset de-assert fails, then it will retry the reset de-assert. If reset de- assert retry is successful, we think it is okay to probe the device but actually it still has Err status. Apparently we need to retry the ATA reset assertion and de- assertion instead for this mentioned scenario. As such, we config ATA reset assert as a constrained command, if ATA reset de-assert fails, then ATA reset de-assert retry will also fail. Then we will retry the proper process of ATA reset assert and de-assert again. Signed-off-by: Xiang Chen <[email protected]> Signed-off-by: John Garry <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 13e4e35 commit ad1562a

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

drivers/scsi/hisi_sas/hisi_sas_v3_hw.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -328,10 +328,11 @@ enum {
328328
#define DIR_TO_DEVICE 2
329329
#define DIR_RESERVED 3
330330

331-
#define CMD_IS_UNCONSTRAINT(cmd) \
332-
((cmd == ATA_CMD_READ_LOG_EXT) || \
333-
(cmd == ATA_CMD_READ_LOG_DMA_EXT) || \
334-
(cmd == ATA_CMD_DEV_RESET))
331+
#define FIS_CMD_IS_UNCONSTRAINED(fis) \
332+
((fis.command == ATA_CMD_READ_LOG_EXT) || \
333+
(fis.command == ATA_CMD_READ_LOG_DMA_EXT) || \
334+
((fis.command == ATA_CMD_DEV_RESET) && \
335+
((fis.control & ATA_SRST) != 0)))
335336

336337
static u32 hisi_sas_read32(struct hisi_hba *hisi_hba, u32 off)
337338
{
@@ -1044,7 +1045,7 @@ static int prep_ata_v3_hw(struct hisi_hba *hisi_hba,
10441045
<< CMD_HDR_FRAME_TYPE_OFF;
10451046
dw1 |= sas_dev->device_id << CMD_HDR_DEV_ID_OFF;
10461047

1047-
if (CMD_IS_UNCONSTRAINT(task->ata_task.fis.command))
1048+
if (FIS_CMD_IS_UNCONSTRAINED(task->ata_task.fis))
10481049
dw1 |= 1 << CMD_HDR_UNCON_CMD_OFF;
10491050

10501051
hdr->dw1 = cpu_to_le32(dw1);

0 commit comments

Comments
 (0)