diff options
author | Deepak Ukey <deepak.ukey@microchip.com> | 2018-09-11 14:18:02 +0530 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2018-09-11 21:13:08 -0400 |
commit | cd135754d837bc4b15a9211d30bfc23f2247afb9 (patch) | |
tree | 9443a9c827b0e13c9d79d0730927ab78f1c74305 /drivers/scsi/pm8001/pm80xx_hwi.c | |
parent | 0b1b1d88614fcd90c65d27dbd14490dcbf2c9b5f (diff) | |
download | lwn-cd135754d837bc4b15a9211d30bfc23f2247afb9.tar.gz lwn-cd135754d837bc4b15a9211d30bfc23f2247afb9.zip |
scsi: pm80xx: Fix for phy enable/disable functionality
Added proper mask for phy id in mpi_phy_stop_resp().
Signed-off-by: Deepak Ukey <deepak.ukey@microchip.com>
Signed-off-by: Viswas G <Viswas.G@microchip.com>
Acked-by: Jack Wang <jinpu.wang@profitbricks.com>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/pm8001/pm80xx_hwi.c')
-rw-r--r-- | drivers/scsi/pm8001/pm80xx_hwi.c | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/drivers/scsi/pm8001/pm80xx_hwi.c b/drivers/scsi/pm8001/pm80xx_hwi.c index 42f0405601ad..91ff6a44e9d9 100644 --- a/drivers/scsi/pm8001/pm80xx_hwi.c +++ b/drivers/scsi/pm8001/pm80xx_hwi.c @@ -3118,8 +3118,9 @@ static int mpi_phy_start_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) pm8001_printk("phy start resp status:0x%x, phyid:0x%x\n", status, phy_id)); if (status == 0) { - phy->phy_state = 1; - if (pm8001_ha->flags == PM8001F_RUN_TIME) + phy->phy_state = PHY_LINK_DOWN; + if (pm8001_ha->flags == PM8001F_RUN_TIME && + phy->enable_completion != NULL) complete(phy->enable_completion); } return 0; @@ -3211,7 +3212,7 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void *piomb) return 0; } phy->phy_attached = 0; - phy->phy_state = 0; + phy->phy_state = PHY_LINK_DISABLE; break; case HW_EVENT_PORT_INVALID: PM8001_MSG_DBG(pm8001_ha, @@ -3384,13 +3385,14 @@ static int mpi_phy_stop_resp(struct pm8001_hba_info *pm8001_ha, void *piomb) u32 status = le32_to_cpu(pPayload->status); u32 phyid = - le32_to_cpu(pPayload->phyid); + le32_to_cpu(pPayload->phyid) & 0xFF; struct pm8001_phy *phy = &pm8001_ha->phy[phyid]; PM8001_MSG_DBG(pm8001_ha, pm8001_printk("phy:0x%x status:0x%x\n", phyid, status)); - if (status == 0) - phy->phy_state = 0; + if (status == PHY_STOP_SUCCESS || + status == PHY_STOP_ERR_DEVICE_ATTACHED) + phy->phy_state = PHY_LINK_DISABLE; return 0; } |