Commit 9f176099 authored by Bradley Grove's avatar Bradley Grove Committed by Christoph Hellwig

pm8001: Fix hibernation issue

During hibernation, the HBA firmware may lose power and forget the device
id info.   This causes the HBA to reject IO upon resume.   The fix is
to call the libsas power management routines to make the domain device
forgetful.

This fixes bug 76681: https://bugzilla.kernel.org/show_bug.cgi?id=76681Signed-off-by: default avatarBradley Grove <bgrove@attotech.com>
Acked-by: default avatarJack Wang <xjtuwjp@gmail.com>
Signed-off-by: default avatarChristoph Hellwig <hch@lst.de>
parent 4dc06fd8
...@@ -964,6 +964,7 @@ static int pm8001_pci_suspend(struct pci_dev *pdev, pm_message_t state) ...@@ -964,6 +964,7 @@ static int pm8001_pci_suspend(struct pci_dev *pdev, pm_message_t state)
int i, j; int i, j;
u32 device_state; u32 device_state;
pm8001_ha = sha->lldd_ha; pm8001_ha = sha->lldd_ha;
sas_suspend_ha(sha);
flush_workqueue(pm8001_wq); flush_workqueue(pm8001_wq);
scsi_block_requests(pm8001_ha->shost); scsi_block_requests(pm8001_ha->shost);
if (!pdev->pm_cap) { if (!pdev->pm_cap) {
...@@ -1013,6 +1014,7 @@ static int pm8001_pci_resume(struct pci_dev *pdev) ...@@ -1013,6 +1014,7 @@ static int pm8001_pci_resume(struct pci_dev *pdev)
int rc; int rc;
u8 i = 0, j; u8 i = 0, j;
u32 device_state; u32 device_state;
DECLARE_COMPLETION_ONSTACK(completion);
pm8001_ha = sha->lldd_ha; pm8001_ha = sha->lldd_ha;
device_state = pdev->current_state; device_state = pdev->current_state;
...@@ -1033,7 +1035,7 @@ static int pm8001_pci_resume(struct pci_dev *pdev) ...@@ -1033,7 +1035,7 @@ static int pm8001_pci_resume(struct pci_dev *pdev)
rc = pci_go_44(pdev); rc = pci_go_44(pdev);
if (rc) if (rc)
goto err_out_disable; goto err_out_disable;
sas_prep_resume_ha(sha);
/* chip soft rst only for spc */ /* chip soft rst only for spc */
if (pm8001_ha->chip_id == chip_8001) { if (pm8001_ha->chip_id == chip_8001) {
PM8001_CHIP_DISP->chip_soft_rst(pm8001_ha); PM8001_CHIP_DISP->chip_soft_rst(pm8001_ha);
...@@ -1065,7 +1067,13 @@ static int pm8001_pci_resume(struct pci_dev *pdev) ...@@ -1065,7 +1067,13 @@ static int pm8001_pci_resume(struct pci_dev *pdev)
for (i = 1; i < pm8001_ha->number_of_intr; i++) for (i = 1; i < pm8001_ha->number_of_intr; i++)
PM8001_CHIP_DISP->interrupt_enable(pm8001_ha, i); PM8001_CHIP_DISP->interrupt_enable(pm8001_ha, i);
} }
scsi_unblock_requests(pm8001_ha->shost); pm8001_ha->flags = PM8001F_RUN_TIME;
for (i = 0; i < pm8001_ha->chip->n_phy; i++) {
pm8001_ha->phy[i].enable_completion = &completion;
PM8001_CHIP_DISP->phy_start_req(pm8001_ha, i);
wait_for_completion(&completion);
}
sas_resume_ha(sha);
return 0; return 0;
err_out_disable: err_out_disable:
......
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