Re: [PATCH 0/6] libsas and drivers: NCQ error handling
From: Damien Le Moal
Date: Fri Aug 12 2022 - 14:24:37 EST
On 2022/08/12 9:33, John Garry wrote:
> On 12/08/2022 16:39, Damien Le Moal wrote:
>>> For this specific test we don't seem to run a hardreset after the
>>> autopsy, but we do seem to be getting an NCQ error. That's interesting.
>>>
>>> We have noticed this scenario for hisi_sas NCQ error, whereby the
>>> autopsy decided a reset is not required or useful, such as a medium
>>> error. Anyway the pm8001 driver relies on the reset being run always for
>>> the NCQ error. So I am thinking of tweaking sas_ata_link_abort() as follows:
>>>
>>> void sas_ata_link_abort(struct domain_device *device)
>>> {
>>> struct ata_port *ap = device->sata_dev.ap;
>>> struct ata_link *link = &ap->link;
>>>
>>> link->eh_info.err_mask |= AC_ERR_DEV;
>>> + link->eh_info.action |= ATA_EH_RESET;
>>> ata_link_abort(link);
>>> }
>>>
>>> This should force a reset.
>> This is an unaligned write to a sequential write required zone on SMR. So
>> definitely not worth a reset. Forcing hard resetting the link for such error is
>> an overkill. I think it is better to let ata_link_abort() -> ... -> scsi & ata
>> EH decide on the disposition.
>
> Do you know if this triggered the pm8001 IO_XFER_ERROR_ABORTED_NCQ_MODE
> error?
>
> If I do not set ATA_EH_RESET then I need to trust that libata will
> always decide to do the reset for pm8001 IO_XFER_ERROR_ABORTED_NCQ_MODE
> error. That is because it is in the reset that I send the pm8001 "abort
> all" command - I could not find a better place for it.
Not sure what error it was. Will need to add a print of it to check. Easy to do.
>
>>
>> Note that patch 3 did not apply cleanly to the current Linus tree. So a rebase
>> for the series is needed.
>>
>
> That might be just git am, which always seems temperamental. The patches
> still apply from cherry-pick'ing for me. Anyway, I'll send a new version
> next week.
Yes, it was a "bad ancestor" thing. Direct patching worked just fine.
>
> Thanks,
> John
>
--
Damien Le Moal
Western Digital Research