[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <9765d9c7-959f-3611-4093-89f7e941e2ba@huawei.com>
Date: Thu, 27 Feb 2025 16:33:29 +0800
From: yangxingui <yangxingui@...wei.com>
To: John Garry <john.g.garry@...cle.com>, <liyihang9@...wei.com>,
<yanaijie@...wei.com>
CC: <jejb@...ux.ibm.com>, <martin.petersen@...cle.com>,
<linux-scsi@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linuxarm@...wei.com>, <prime.zeng@...wei.com>, <liuyonglong@...wei.com>,
<kangfenglong@...wei.com>, <liyangyang20@...wei.com>,
<f.fangjian@...wei.com>, <xiabing14@...artners.com>
Subject: Re: [PATCH v3 1/3] scsi: hisi_sas: Enable force phy when SATA disk
directly connected
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.
Solution as follow?
+static bool hisi_sas_hw_port_id_changed(struct hisi_hba *hisi_hba, int
phy_no)
+{
+ struct hisi_sas_phy *phy = &hisi_hba->phy[phy_no];
+ struct asd_sas_phy *sas_phy = &phy->sas_phy;
+ struct device *dev = hisi_hba->dev;
+ struct asd_sas_port *sas_port;
+ struct hisi_sas_port *port;
+
+ if (!sas_phy->port)
+ return false;
+
+ sas_port = sas_phy->port;
+ port = to_hisi_sas_port(sas_port);
+ if (phy->port_id == port->id)
+ return false;
+
+ dev_info(dev, "phy%d's hw port id changed from %d to %llu\n",
+ phy_no, port->id, phy->port_id);
+
+ return true;
+}
+
static void hisi_sas_slot_index_clear(struct hisi_hba *hisi_hba, int
slot_idx)
{
void *bitmap = hisi_hba->slot_index_tags;
@@ -856,6 +878,14 @@ static void hisi_sas_phyup_work_common(struct
work_struct *work,
struct asd_sas_phy *sas_phy = &phy->sas_phy;
int phy_no = sas_phy->id;
+ if (hisi_sas_hw_port_id_changed(hisi_hba, phy_no)) {
+ sas_phy_disconnected(sas_phy);
+ phy->phy_attached = 0;
+ sas_notify_port_event(sas_phy, PORTE_LINK_RESET_ERR,
GFP_ATOMIC);
+ hisi_sas_notify_phy_event(phy, HISI_PHYE_LINK_RESET);
+ return;
+ }
+
Thanks,
Xingui
Powered by blists - more mailing lists