Skip to contentSkip to conversation

scsi/lpfc: use remove handler as shutdown handler

PATCH In review Thadeu Lima de Souza Cascardo 2 participants 2 messages Jan 26, 2015 – Feb 16, 2015

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 scsi/lpfc: use remove handler as shutdown handler

Without a shutdown handler, some cards behave very badly after a kexec. During probe, pending DMA writes will corrupt kernel memory, for example.

Using the remove handler guarantees we will use a well tested path.

With this patch I applied, I managed to use kexec multiple times and probe and SCSI scan worked every time.

---
 drivers/scsi/lpfc/lpfc_init.c |    1 +
 1 file changed, 1 insertion(+)
drivers/scsi/lpfc/lpfc_init.c +1 -0
index 0b2c53a..8aa804a 100644
@@ -11248,6 +11248,7 @@ static struct pci_driver lpfc_driver = {
 	.id_table	= lpfc_id_table,
 	.probe		= lpfc_pci_probe_one,
 	.remove		= lpfc_pci_remove_one,
+	.shutdown	= lpfc_pci_remove_one,
 	.suspend        = lpfc_pci_suspend_one,
 	.resume		= lpfc_pci_resume_one,
 	.err_handler    = &lpfc_err_handler,
Signature · 1 line
1.7.10.4
Acked-by on v1 1/1
#1 lore raw

Looks good.

-- james

Quoted 26 lines · Thadeu Lima de Souza Cascardo

Without a shutdown handler, some cards behave very badly after a kexec. During probe, pending DMA writes will corrupt kernel memory, for example.

Using the remove handler guarantees we will use a well tested path.

With this patch I applied, I managed to use kexec multiple times and probe and SCSI scan worked every time.

---
  drivers/scsi/lpfc/lpfc_init.c |    1 +
  1 file changed, 1 insertion(+)
drivers/scsi/lpfc/lpfc_init.c +1 -0
index 0b2c53a..8aa804a 100644
@@ -11248,6 +11248,7 @@ static struct pci_driver lpfc_driver = {
  	.id_table	= lpfc_id_table,
  	.probe		= lpfc_pci_probe_one,
  	.remove		= lpfc_pci_remove_one,
+	.shutdown	= lpfc_pci_remove_one,
  	.suspend        = lpfc_pci_suspend_one,
  	.resume		= lpfc_pci_resume_one,
  	.err_handler    = &lpfc_err_handler,