Re: [PATCH v3 1/3] scsi: hisi_sas: Enable force phy when SATA disk directly connected

yangxingui
2025-03-05T08:16:54Z

Hi, John

On 2025/3/4 17:48, John Garry wrote:
> On 27/02/2025 08:33, yangxingui wrote:
>> Hi, John
>>
>> On 2025/2/26 16:57, John Garry wrote:
>>
>>>
>>> The lldd_dev_found CB is where you should set the itct, and it is
>>> only possible to do that if you report the device gone first. So that
>>> seems like a simpler solution.
>
> Sure, something like that - you just need to get libsas to trigger the
> proper hw port id assignment for the device. As for specific
> implementation in the LLDD, that up to you guys.

Thank you for your suggestions. The disk was finally restored to normal,
but the error handling took a long time. Since the error handling would
set the host to the recovery state, other disks on the same host would
be blocked for a long time. Log as follow:

[ 1351.602899] hisi_sas_v3_hw 0000:74:02.0: phyup: phy3 link_rate=10(sata)
[ 1351.610892] sas: phy-1:3 added to port-1:0, phy_mask:0x8
(5000000000000103)
[ 1351.611057] sas: DOING DISCOVERY on port 0, pid:7
[ 1351.611068] hisi_sas_v3_hw 0000:74:02.0: dev[1:5] found
[ 1351.617396] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[ 1351.618272] hisi_sas_v3_hw 0000:74:02.0: phyup: phy2 link_rate=10(sata)
[ 1351.624300] sas: ata10: end_device-1:0: dev error handler
[ 1351.670954] hisi_sas_v3_hw 0000:74:02.0: phydown: phy3 phy_state=0xf7
[ 1351.678388] hisi_sas_v3_hw 0000:74:02.0: ignore flutter phy3 down
[ 1351.685465] hisi_sas_v3_hw 0000:74:02.0: phyup: phy4 link_rate=11
[ 1351.841167] hisi_sas_v3_hw 0000:74:02.0: phyup: phy3 link_rate=10(sata)
[ 1351.849054] hisi_sas_v3_hw 0000:74:02.0: phy3's hw port id changed
from 0 to 1
[ 1351.857967] hisi_sas_v3_hw 0000:74:02.0: phydown: phy3 phy_state=0xf7
[ 1352.006552] hisi_sas_v3_hw 0000:74:02.0: task prep: SATA/STP port0
not attach device
[ 1352.015679] hisi_sas_v3_hw 0000:74:02.0: task exec: failed[-70]!
[ 1352.022734] sas: lldd_execute_task returned: -70
[ 1352.022754] ata10.00: failed to IDENTIFY (I/O error, err_mask=0x40)
[ 1352.041168] hisi_sas_v3_hw 0000:74:02.0: phyup: phy3 link_rate=10(sata)
[ 1357.218587] hisi_sas_v3_hw 0000:74:02.0: erroneous completion
iptt=4019 task=0000000055585b33 dev id=1 addr=5000000000000103 CQ hdr:
0x8000007 0x10fb3 0x0 0x0 Error info: 0x0 0x0 0x0 0x0
[ 1357.237298] hisi_sas_v3_hw 0000:74:02.0: task prep: SATA/STP port0
not attach device
[ 1357.246666] hisi_sas_v3_hw 0000:74:02.0: task exec: failed[-70]!
[ 1357.253850] hisi_sas_v3_hw 0000:74:02.0: abort tmf: executing
internal task failed: -70
[ 1357.263487] hisi_sas_v3_hw 0000:74:02.0: ata disk 5000000000000103
reset failed
[ 1357.272487] hisi_sas_v3_hw 0000:74:02.0: phydown: phy3 phy_state=0xf7
[ 1357.280131] hisi_sas_v3_hw 0000:74:02.0: ignore flutter phy3 down
[ 1357.453175] hisi_sas_v3_hw 0000:74:02.0: phyup: phy3 link_rate=10(sata)
[ 1357.618532] hisi_sas_v3_hw 0000:74:02.0: task prep: SATA/STP port0
not attach device
[ 1357.627915] hisi_sas_v3_hw 0000:74:02.0: task exec: failed[-70]!
[ 1357.635086] sas: lldd_execute_task returned: -70
[ 1357.635108] ata10.00: failed to IDENTIFY (I/O error, err_mask=0x40)
[ 1362.850591] hisi_sas_v3_hw 0000:74:02.0: erroneous completion
iptt=4020 task=0000000055585b33 dev id=1 addr=5000000000000103 CQ hdr:
0x8000007 0x10fb4 0x0 0x0 Error info: 0x0 0x0 0x0 0x0
[ 1362.869450] hisi_sas_v3_hw 0000:74:02.0: task prep: SATA/STP port0
not attach device
[ 1362.878890] hisi_sas_v3_hw 0000:74:02.0: task exec: failed[-70]!
[ 1362.886100] hisi_sas_v3_hw 0000:74:02.0: abort tmf: executing
internal task failed: -70
[ 1362.895779] hisi_sas_v3_hw 0000:74:02.0: ata disk 5000000000000103
reset failed
[ 1362.904789] hisi_sas_v3_hw 0000:74:02.0: phydown: phy3 phy_state=0xf7
[ 1362.912447] hisi_sas_v3_hw 0000:74:02.0: ignore flutter phy3 down
[ 1363.089166] hisi_sas_v3_hw 0000:74:02.0: phyup: phy3 link_rate=10(sata)
[ 1363.254527] hisi_sas_v3_hw 0000:74:02.0: task prep: SATA/STP port0
not attach device
[ 1363.263891] hisi_sas_v3_hw 0000:74:02.0: task exec: failed[-70]!
[ 1363.271052] sas: lldd_execute_task returned: -70
[ 1363.271077] ata10.00: failed to IDENTIFY (I/O error, err_mask=0x40)
[ 1368.482569] hisi_sas_v3_hw 0000:74:02.0: erroneous completion
iptt=4021 task=0000000055585b33 dev id=1 addr=5000000000000103 CQ hdr:
0x8000007 0x10fb5 0x0 0x0 Error info: 0x0 0x0 0x0 0x0
[ 1368.501395] hisi_sas_v3_hw 0000:74:02.0: task prep: SATA/STP port0
not attach device
[ 1368.510834] hisi_sas_v3_hw 0000:74:02.0: task exec: failed[-70]!
[ 1368.518058] hisi_sas_v3_hw 0000:74:02.0: abort tmf: executing
internal task failed: -70
[ 1368.527745] hisi_sas_v3_hw 0000:74:02.0: ata disk 5000000000000103
reset failed
[ 1368.536750] hisi_sas_v3_hw 0000:74:02.0: phydown: phy3 phy_state=0xf7
[ 1368.544401] hisi_sas_v3_hw 0000:74:02.0: ignore flutter phy3 down
[ 1368.721173] hisi_sas_v3_hw 0000:74:02.0: phyup: phy3 link_rate=10(sata)
[ 1368.886544] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0
tries: 1
[ 1368.896602] sas: sas_probe_sata: for direct-attached device
5000000000000103 returned -19
[ 1368.906510] hisi_sas_v3_hw 0000:74:02.0: dev[1:5] is gone
[ 1368.913148] hisi_sas_v3_hw 0000:74:02.0: erroneous completion
iptt=4022 task=00000000ee9f5e36 dev id=1 addr=5000000000000103 CQ hdr:
0x8000007 0x10fb6 0x0 0x0 Error info: 0x0 0x0 0x0 0x0
[ 1368.932057] sas: DONE DISCOVERY on port 0, pid:7, result:0
[ 1369.571030] sas: phy-1:3 added to port-1:0, phy_mask:0x8
(5000000000000103)
[ 1369.571201] sas: DOING DISCOVERY on port 0, pid:7
[ 1369.571205] hisi_sas_v3_hw 0000:74:02.0: dev[9:5] found
[ 1369.577546] sas: Enter sas_scsi_recover_host busy: 0 failed: 0
[ 1369.584543] sas: ata12: end_device-1:0: dev error handler
[ 1369.584653] sas: ata11: end_device-1:1: dev error handler
[ 1369.611048] hisi_sas_v3_hw 0000:74:02.0: phydown: phy3 phy_state=0xf7
[ 1369.618639] hisi_sas_v3_hw 0000:74:02.0: ignore flutter phy3 down
[ 1369.793175] hisi_sas_v3_hw 0000:74:02.0: phyup: phy3 link_rate=10(sata)
[ 1374.447031] ata12.00: ATA-10: ST2000NM0055-1V4104, TN05, max UDMA/133
[ 1374.454648] ata12.00: 3907029168 sectors, multi 0: LBA48 NCQ (depth 32)
[ 1374.463850] ata12.00: configured for UDMA/133
[ 1374.469363] sas: --- Exit sas_scsi_recover_host: busy: 0 failed: 0
tries: 1
[ 1374.506234] scsi 1:0:6:0: Direct-Access ATA ST2000NM0055-1V4
TN05 PQ: 0 ANSI: 5
[ 1374.515932] sas: DONE DISCOVERY on port 0, pid:7, result:0
[ 1374.515986] sas: sas_form_port: phy3 belongs to port0 already(1)!
[ 1374.523240] sas: sas_form_port: phy3 belongs to port0 already(1)!
[ 1374.538915] sas: sas_form_port: phy3 belongs to port0 already(1)!

Thanks,
Xingui