From: yangxingui <yangxingui@huawei.com>
To: John Garry <john.g.garry@oracle.com>, <liyihang9@huawei.com>,
<yanaijie@huawei.com>
Cc: <jejb@linux.ibm.com>, <martin.petersen@oracle.com>,
<linux-scsi@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
<linuxarm@huawei.com>, <prime.zeng@huawei.com>,
<liuyonglong@huawei.com>, <kangfenglong@huawei.com>,
<liyangyang20@huawei.com>, <f.fangjian@huawei.com>,
<xiabing14@h-partners.com>
Subject: Re: [PATCH v3 1/3] scsi: hisi_sas: Enable force phy when SATA disk directly connected
Date: Fri, 21 Feb 2025 09:59:27 +0800 [thread overview]
Message-ID: <5a4384dc-4edb-9e29-d1dd-190d69b9e313@huawei.com> (raw)
In-Reply-To: <4bf89b6c-8730-4ae8-8b26-770b2aab2c13@oracle.com>
Hi, John
On 2025/2/21 1:35, John Garry wrote:
> On 20/02/2025 13:05, Xingui Yang wrote:
>
> -john.garry@huawei.com (this has not worked in over 2 years ...)
Sorry, I used the wrong one.
>
>> the SAS controller determines the disk to which I/Os are delivered based
>> on the port id in the DQ entry when SATA disk directly connected.
>>
>> When many phys were disconnected immediately and connected again during
>> I/O sending and port id of phys were changed and used by other link, I/O
>> may be sent to incorrect disk and data inconsistency on the SATA disk may
>
>
> So is the disk reported gone (from libsas point-of-view) after you
> unplug? If not, why not?
The problem may occur in a scenario where multiple SATA disks are
inserted almost at the same time. When phy reset is executed in error
processing, other phys are also up, which may cause the hw port id
corresponding to the phy to change. The log is as follows:
[ 4588.608924] hisi_sas_v3_hw 0000:b4:02.0: phyup: phy2 link_rate=10(sata)
[ 4588.609039] sas: phy-8:2 added to port-8:4, phy_mask:0x4
(5000000000000802)
[ 4588.609267] sas: DOING DISCOVERY on port 4, pid:69294
[ 4588.609276] hisi_sas_v3_hw 0000:b4:02.0: dev[13:5] found
[ 4588.671362] sas: ata40: end_device-8:4: dev error handler
[ 4588.846387] hisi_sas_v3_hw 0000:b4:02.0: phydown: phy2 phy_state=0xc3
// phy2's hw port id assign by chip is released
[ 4588.846393] hisi_sas_v3_hw 0000:b4:02.0: ignore flutter phy2 down
[ 4588.919837] hisi_sas_v3_hw 0000:b4:02.0: phyup: phy3
link_rate=10(sata) // phy3 is assigned the hw port id previously used by
phy2
[ 4589.029656] hisi_sas_v3_hw 0000:b4:02.0: phyup: phy2
link_rate=10(sata) // phy2's hw port id is assigned a new one
[ 4589.220662] ata40.00: ATA-9: HUH721010ALE600, T3C0, max UDMA/133
[ 4589.220666] ata40.00: 19532873728 sectors, multi 0: LBA48 NCQ (depth
32), AA
[ 4589.233022] ata40.00: configured for UDMA/133
In view of the situation corresponding to the above log, the
hisi_sas_port.id corresponding to phy2 has not been updated, and the old
port id is still used, which will cause the IO delivered to phy2 to be
abnormally delivered to the disk of phy3.
After force phy, the chip will check whether the phy information matches
the port id and intercept this abnormal IO.
Thanks.
Xingui
next prev parent reply other threads:[~2025-02-21 1:59 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-20 13:05 [PATCH v3 0/3] scsi: hisi_sas: Fixed IO error caused by port id not updated Xingui Yang
2025-02-20 13:05 ` [PATCH v3 1/3] scsi: hisi_sas: Enable force phy when SATA disk directly connected Xingui Yang
2025-02-20 17:35 ` John Garry
2025-02-21 1:59 ` yangxingui [this message]
2025-02-24 8:29 ` John Garry
2025-02-24 9:36 ` yangxingui
2025-02-24 12:21 ` John Garry
2025-02-24 13:12 ` yangxingui
2025-02-24 17:34 ` John Garry
2025-02-25 1:48 ` yangxingui
2025-02-25 8:19 ` John Garry
2025-02-25 9:35 ` yangxingui
2025-02-26 8:57 ` John Garry
2025-02-27 8:33 ` yangxingui
2025-03-04 9:48 ` John Garry
2025-03-05 8:16 ` yangxingui
2025-03-05 16:15 ` John Garry
2025-03-06 1:44 ` yangxingui
2025-03-10 13:09 ` yangxingui
2025-03-10 17:45 ` John Garry
2025-03-11 1:53 ` yangxingui
2025-03-12 9:44 ` yangxingui
2025-03-12 11:19 ` John Garry
2025-02-20 13:05 ` [PATCH v3 2/3] scsi: libsas: Move sas_put_device() to libsas.h Xingui Yang
2025-02-21 2:36 ` Jason Yan
2025-02-20 13:05 ` [PATCH v3 3/3] scsi: hisi_sas: Fixed IO error caused by port id not updated Xingui Yang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5a4384dc-4edb-9e29-d1dd-190d69b9e313@huawei.com \
--to=yangxingui@huawei.com \
--cc=f.fangjian@huawei.com \
--cc=jejb@linux.ibm.com \
--cc=john.g.garry@oracle.com \
--cc=kangfenglong@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=linuxarm@huawei.com \
--cc=liuyonglong@huawei.com \
--cc=liyangyang20@huawei.com \
--cc=liyihang9@huawei.com \
--cc=martin.petersen@oracle.com \
--cc=prime.zeng@huawei.com \
--cc=xiabing14@h-partners.com \
--cc=yanaijie@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox