lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <4279fe21-6db8-4deb-b5f7-663720637cf0@oracle.com>
Date: Tue, 4 Mar 2025 09:48:44 +0000
From: John Garry <john.g.garry@...cle.com>
To: yangxingui <yangxingui@...wei.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

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.

Thanks,
John

> 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

Powered by Openwall GNU/*/Linux Powered by OpenVZ