aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRobert Elliott <elliott@hp.com>2014-11-14 18:27:24 -0500
committerChristoph Hellwig <hch@lst.de>2014-11-20 03:11:27 -0500
commit4fa604e13bb2a6ef6e89224c80d96af385f533c3 (patch)
tree144db757929f69c824f3848a6cb0dd751248acef
parent763aadbf5015e86e93d209f10e34fd4daacc459b (diff)
hpsa: always call pci_set_master after pci_enable_device
If the kernel is booted with the reset_device parameter, which is done for kdump, then the driver needs to call pci_set_master after pci_enable_device to reenable bus mastering (since the preceding pci_disable_device call disables bus mastering). Also, place that after pci_request_regions both in the kdump code and the normal pci_init code. Remove the comment summarizing what pci_set_master does, with the incomplete commentary on the impact of pci_disable_device. Signed-off-by: Robert Elliott <elliott@hp.com> Signed-off-by: Don Brace <don.brace@pmcs.com> Reviewed-by: Don Brace <don.brace@pmcs.com> Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r--drivers/scsi/hpsa.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index 4db9d1921dca..36db63f63143 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -6363,15 +6363,15 @@ static int hpsa_pci_init(struct ctlr_info *h)
6363 return err; 6363 return err;
6364 } 6364 }
6365 6365
6366 /* Enable bus mastering (pci_disable_device may disable this) */
6367 pci_set_master(h->pdev);
6368
6369 err = pci_request_regions(h->pdev, HPSA); 6366 err = pci_request_regions(h->pdev, HPSA);
6370 if (err) { 6367 if (err) {
6371 dev_err(&h->pdev->dev, 6368 dev_err(&h->pdev->dev,
6372 "cannot obtain PCI resources, aborting\n"); 6369 "cannot obtain PCI resources, aborting\n");
6373 return err; 6370 return err;
6374 } 6371 }
6372
6373 pci_set_master(h->pdev);
6374
6375 hpsa_interrupt_mode(h); 6375 hpsa_interrupt_mode(h);
6376 err = hpsa_pci_find_memory_BAR(h->pdev, &h->paddr); 6376 err = hpsa_pci_find_memory_BAR(h->pdev, &h->paddr);
6377 if (err) 6377 if (err)
@@ -6451,7 +6451,9 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
6451 dev_warn(&pdev->dev, "failed to enable device.\n"); 6451 dev_warn(&pdev->dev, "failed to enable device.\n");
6452 return -ENODEV; 6452 return -ENODEV;
6453 } 6453 }
6454
6454 pci_set_master(pdev); 6455 pci_set_master(pdev);
6456
6455 /* Reset the controller with a PCI power-cycle or via doorbell */ 6457 /* Reset the controller with a PCI power-cycle or via doorbell */
6456 rc = hpsa_kdump_hard_reset_controller(pdev); 6458 rc = hpsa_kdump_hard_reset_controller(pdev);
6457 6459