mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-17 10:26:09 +00:00
[SCSI] hpsa: factor out the code to reset controllers on driver load
for kdump support Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com> Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
parent
a51fd47f1b
commit
4c2a8c40d8
@ -3571,33 +3571,44 @@ static void __devinit hpsa_hba_inquiry(struct ctlr_info *h)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static __devinit int hpsa_init_reset_devices(struct pci_dev *pdev)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
|
||||||
|
if (!reset_devices)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
/* Reset the controller with a PCI power-cycle */
|
||||||
|
if (hpsa_hard_reset_controller(pdev) || hpsa_reset_msi(pdev))
|
||||||
|
return -ENODEV;
|
||||||
|
|
||||||
|
/* Some devices (notably the HP Smart Array 5i Controller)
|
||||||
|
need a little pause here */
|
||||||
|
msleep(HPSA_POST_RESET_PAUSE_MSECS);
|
||||||
|
|
||||||
|
/* Now try to get the controller to respond to a no-op */
|
||||||
|
for (i = 0; i < HPSA_POST_RESET_NOOP_RETRIES; i++) {
|
||||||
|
if (hpsa_noop(pdev) == 0)
|
||||||
|
break;
|
||||||
|
else
|
||||||
|
dev_warn(&pdev->dev, "no-op failed%s\n",
|
||||||
|
(i < 11 ? "; re-trying" : ""));
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int __devinit hpsa_init_one(struct pci_dev *pdev,
|
static int __devinit hpsa_init_one(struct pci_dev *pdev,
|
||||||
const struct pci_device_id *ent)
|
const struct pci_device_id *ent)
|
||||||
{
|
{
|
||||||
int i, rc;
|
int dac, rc;
|
||||||
int dac;
|
|
||||||
struct ctlr_info *h;
|
struct ctlr_info *h;
|
||||||
|
|
||||||
if (number_of_controllers == 0)
|
if (number_of_controllers == 0)
|
||||||
printk(KERN_INFO DRIVER_NAME "\n");
|
printk(KERN_INFO DRIVER_NAME "\n");
|
||||||
if (reset_devices) {
|
|
||||||
/* Reset the controller with a PCI power-cycle */
|
|
||||||
if (hpsa_hard_reset_controller(pdev) || hpsa_reset_msi(pdev))
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
/* Some devices (notably the HP Smart Array 5i Controller)
|
rc = hpsa_init_reset_devices(pdev);
|
||||||
need a little pause here */
|
if (rc)
|
||||||
msleep(HPSA_POST_RESET_PAUSE_MSECS);
|
return rc;
|
||||||
|
|
||||||
/* Now try to get the controller to respond to a no-op */
|
|
||||||
for (i = 0; i < HPSA_POST_RESET_NOOP_RETRIES; i++) {
|
|
||||||
if (hpsa_noop(pdev) == 0)
|
|
||||||
break;
|
|
||||||
else
|
|
||||||
dev_warn(&pdev->dev, "no-op failed%s\n",
|
|
||||||
(i < 11 ? "; re-trying" : ""));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Command structures must be aligned on a 32-byte boundary because
|
/* Command structures must be aligned on a 32-byte boundary because
|
||||||
* the 5 lower bits of the address are used by the hardware. and by
|
* the 5 lower bits of the address are used by the hardware. and by
|
||||||
|
Loading…
x
Reference in New Issue
Block a user