Skip to content

Commit

Permalink
hpsa: always call pci_set_master after pci_enable_device
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Robert Elliott authored and Christoph Hellwig committed Nov 20, 2014
1 parent 763aadb commit 4fa604e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/scsi/hpsa.c
Original file line number Diff line number Diff line change
@@ -6363,15 +6363,15 @@ static int hpsa_pci_init(struct ctlr_info *h)
return err;
}

/* Enable bus mastering (pci_disable_device may disable this) */
pci_set_master(h->pdev);

err = pci_request_regions(h->pdev, HPSA);
if (err) {
dev_err(&h->pdev->dev,
"cannot obtain PCI resources, aborting\n");
return err;
}

pci_set_master(h->pdev);

hpsa_interrupt_mode(h);
err = hpsa_pci_find_memory_BAR(h->pdev, &h->paddr);
if (err)
@@ -6451,7 +6451,9 @@ static int hpsa_init_reset_devices(struct pci_dev *pdev)
dev_warn(&pdev->dev, "failed to enable device.\n");
return -ENODEV;
}

pci_set_master(pdev);

/* Reset the controller with a PCI power-cycle or via doorbell */
rc = hpsa_kdump_hard_reset_controller(pdev);

0 comments on commit 4fa604e

Please sign in to comment.