Commit fcfe6392 authored by Kashyap, Desai's avatar Kashyap, Desai Committed by James Bottomley

[SCSI] mpt2sas: fix oops because drv data points to NULL on resume from hibernate

Fix another ocurring when the system resumes.  This oops was due to driver
setting the pci drvdata to NULL on the prior hibernation.  Becuase it was
set to NULL, upon resmume we assume the pci drvdata is non-zero, and we oops.
To fix the ooops, we don't set pci drvdata to NULL at hibernation time.
Signed-off-by: default avatarKashyap Desai <kashyap.desai@lsi.com>
Signed-off-by: default avatarJames Bottomley <James.Bottomley@suse.de>
parent e4750c98
...@@ -1171,7 +1171,6 @@ mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER *ioc) ...@@ -1171,7 +1171,6 @@ mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER *ioc)
} }
} }
pci_set_drvdata(pdev, ioc->shost);
_base_mask_interrupts(ioc); _base_mask_interrupts(ioc);
r = _base_enable_msix(ioc); r = _base_enable_msix(ioc);
if (r) if (r)
...@@ -1194,7 +1193,6 @@ mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER *ioc) ...@@ -1194,7 +1193,6 @@ mpt2sas_base_map_resources(struct MPT2SAS_ADAPTER *ioc)
ioc->pci_irq = -1; ioc->pci_irq = -1;
pci_release_selected_regions(ioc->pdev, ioc->bars); pci_release_selected_regions(ioc->pdev, ioc->bars);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
return r; return r;
} }
...@@ -3253,7 +3251,6 @@ mpt2sas_base_free_resources(struct MPT2SAS_ADAPTER *ioc) ...@@ -3253,7 +3251,6 @@ mpt2sas_base_free_resources(struct MPT2SAS_ADAPTER *ioc)
ioc->chip_phys = 0; ioc->chip_phys = 0;
pci_release_selected_regions(ioc->pdev, ioc->bars); pci_release_selected_regions(ioc->pdev, ioc->bars);
pci_disable_device(pdev); pci_disable_device(pdev);
pci_set_drvdata(pdev, NULL);
return; return;
} }
...@@ -3275,6 +3272,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) ...@@ -3275,6 +3272,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
if (r) if (r)
return r; return r;
pci_set_drvdata(ioc->pdev, ioc->shost);
r = _base_make_ioc_ready(ioc, CAN_SLEEP, SOFT_RESET); r = _base_make_ioc_ready(ioc, CAN_SLEEP, SOFT_RESET);
if (r) if (r)
goto out_free_resources; goto out_free_resources;
...@@ -3357,6 +3355,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc) ...@@ -3357,6 +3355,7 @@ mpt2sas_base_attach(struct MPT2SAS_ADAPTER *ioc)
ioc->remove_host = 1; ioc->remove_host = 1;
mpt2sas_base_free_resources(ioc); mpt2sas_base_free_resources(ioc);
_base_release_memory_pools(ioc); _base_release_memory_pools(ioc);
pci_set_drvdata(ioc->pdev, NULL);
kfree(ioc->tm_cmds.reply); kfree(ioc->tm_cmds.reply);
kfree(ioc->transport_cmds.reply); kfree(ioc->transport_cmds.reply);
kfree(ioc->config_cmds.reply); kfree(ioc->config_cmds.reply);
...@@ -3389,6 +3388,7 @@ mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc) ...@@ -3389,6 +3388,7 @@ mpt2sas_base_detach(struct MPT2SAS_ADAPTER *ioc)
mpt2sas_base_stop_watchdog(ioc); mpt2sas_base_stop_watchdog(ioc);
mpt2sas_base_free_resources(ioc); mpt2sas_base_free_resources(ioc);
_base_release_memory_pools(ioc); _base_release_memory_pools(ioc);
pci_set_drvdata(ioc->pdev, NULL);
kfree(ioc->pfacts); kfree(ioc->pfacts);
kfree(ioc->ctl_cmds.reply); kfree(ioc->ctl_cmds.reply);
kfree(ioc->base_cmds.reply); kfree(ioc->base_cmds.reply);
......
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