Commit 3a1ae967 authored by Viswas G's avatar Viswas G Committed by James Bottomley

pm80xx: Corrected device state changes in I_T_Nexus_Reset.

In Nexus reset the device state request are not needed.
Signed-off-by: default avatarViswas G <Viswas.G@pmcs.com>
Reviewed-by: default avatarSuresh Thiagarajan <Suresh.Thiagarajan@pmcs.com>
Acked-by: default avatarJack Wang <jinpu.wang@profitbricks.com>
Reviewed-by: default avatarTomas Henzl <thenzl@redhat.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent b093d590
...@@ -975,19 +975,27 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev) ...@@ -975,19 +975,27 @@ int pm8001_I_T_nexus_reset(struct domain_device *dev)
phy = sas_get_local_phy(dev); phy = sas_get_local_phy(dev);
if (dev_is_sata(dev)) { if (dev_is_sata(dev)) {
DECLARE_COMPLETION_ONSTACK(completion_setstate);
if (scsi_is_sas_phy_local(phy)) { if (scsi_is_sas_phy_local(phy)) {
rc = 0; rc = 0;
goto out; goto out;
} }
rc = sas_phy_reset(phy, 1); rc = sas_phy_reset(phy, 1);
if (rc) {
PM8001_EH_DBG(pm8001_ha,
pm8001_printk("phy reset failed for device %x\n"
"with rc %d\n", pm8001_dev->device_id, rc));
rc = TMF_RESP_FUNC_FAILED;
goto out;
}
msleep(2000); msleep(2000);
rc = pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev , rc = pm8001_exec_internal_task_abort(pm8001_ha, pm8001_dev ,
dev, 1, 0); dev, 1, 0);
pm8001_dev->setds_completion = &completion_setstate; if (rc) {
rc = PM8001_CHIP_DISP->set_dev_state_req(pm8001_ha, PM8001_EH_DBG(pm8001_ha,
pm8001_dev, 0x01); pm8001_printk("task abort failed %x\n"
wait_for_completion(&completion_setstate); "with rc %d\n", pm8001_dev->device_id, rc));
rc = TMF_RESP_FUNC_FAILED;
}
} else { } else {
rc = sas_phy_reset(phy, 1); rc = sas_phy_reset(phy, 1);
msleep(2000); msleep(2000);
......
...@@ -569,6 +569,14 @@ struct pm8001_fw_image_header { ...@@ -569,6 +569,14 @@ struct pm8001_fw_image_header {
#define NCQ_READ_LOG_FLAG 0x80000000 #define NCQ_READ_LOG_FLAG 0x80000000
#define NCQ_ABORT_ALL_FLAG 0x40000000 #define NCQ_ABORT_ALL_FLAG 0x40000000
#define NCQ_2ND_RLE_FLAG 0x20000000 #define NCQ_2ND_RLE_FLAG 0x20000000
/* Device states */
#define DS_OPERATIONAL 0x01
#define DS_PORT_IN_RESET 0x02
#define DS_IN_RECOVERY 0x03
#define DS_IN_ERROR 0x04
#define DS_NON_OPERATIONAL 0x07
/** /**
* brief param structure for firmware flash update. * brief param structure for firmware flash update.
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment