diff mbox series

scsi: pm80xx: Set stopped phy's linkrate to Disabled

Message ID 20220708205026.969161-1-changyuanl@google.com
State New
Headers show
Series scsi: pm80xx: Set stopped phy's linkrate to Disabled | expand

Commit Message

Changyuan Lyu July 8, 2022, 8:50 p.m. UTC
Negotiated link rate needs to be updated to Disabled when phy is
stopped.

Reviewed-by: Igor Pylypiv <ipylypiv@google.com>
Signed-off-by: Changyuan Lyu <changyuanl@google.com>
---
 drivers/scsi/pm8001/pm80xx_hwi.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

Comments

Jinpu Wang July 9, 2022, 6:20 a.m. UTC | #1
On Fri, Jul 8, 2022 at 10:50 PM Changyuan Lyu <changyuanl@google.com> wrote:
>
> Negotiated link rate needs to be updated to Disabled when phy is
> stopped.
>
> Reviewed-by: Igor Pylypiv <ipylypiv@google.com>
> Signed-off-by: Changyuan Lyu <changyuanl@google.com>
Acked-by: Jack Wang <jinpu.wang@ionso.com>
> ---
>  drivers/scsi/pm8001/pm80xx_hwi.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
> index 01c5e8ff4cc5..303cd05fec50 100644
> --- a/drivers/scsi/pm8001/pm80xx_hwi.c
> +++ b/drivers/scsi/pm8001/pm80xx_hwi.c
> @@ -3723,8 +3723,12 @@ static int mpi_phy_stop_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
>         pm8001_dbg(pm8001_ha, MSG, "phy:0x%x status:0x%x\n",
>                    phyid, status);
>         if (status == PHY_STOP_SUCCESS ||
> -               status == PHY_STOP_ERR_DEVICE_ATTACHED)
> +               status == PHY_STOP_ERR_DEVICE_ATTACHED) {
>                 phy->phy_state = PHY_LINK_DISABLE;
> +               phy->sas_phy.phy->negotiated_linkrate = SAS_PHY_DISABLED;
> +               phy->sas_phy.linkrate = SAS_PHY_DISABLED;
> +       }
> +
>         return 0;
>  }
>
> --
> 2.37.0.rc0.161.g10f37bed90-goog
>
Martin K. Petersen July 14, 2022, 4:22 a.m. UTC | #2
On Fri, 8 Jul 2022 13:50:26 -0700, Changyuan Lyu wrote:

> Negotiated link rate needs to be updated to Disabled when phy is
> stopped.
> 
> 

Applied to 5.19/scsi-fixes, thanks!

[1/1] scsi: pm80xx: Set stopped phy's linkrate to Disabled
      https://git.kernel.org/mkp/scsi/c/355bf2e036c9
diff mbox series

Patch

diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c
index 01c5e8ff4cc5..303cd05fec50 100644
--- a/drivers/scsi/pm8001/pm80xx_hwi.c
+++ b/drivers/scsi/pm8001/pm80xx_hwi.c
@@ -3723,8 +3723,12 @@  static int mpi_phy_stop_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)
 	pm8001_dbg(pm8001_ha, MSG, "phy:0x%x status:0x%x\n",
 		   phyid, status);
 	if (status == PHY_STOP_SUCCESS ||
-		status == PHY_STOP_ERR_DEVICE_ATTACHED)
+		status == PHY_STOP_ERR_DEVICE_ATTACHED) {
 		phy->phy_state = PHY_LINK_DISABLE;
+		phy->sas_phy.phy->negotiated_linkrate = SAS_PHY_DISABLED;
+		phy->sas_phy.linkrate = SAS_PHY_DISABLED;
+	}
+
 	return 0;
 }