[SCSI] megaraid_sas: Fix probe_one to clear MSI-X flags in kdump

The following patch for megaraid_sas fixes megasas_probe_one() to
clear MSI-X flags in kdump when the 'reset_devices' kernel parameter
is passed in.

Signed-off-by: Adam Radford <aradford@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
This commit is contained in:
adam radford 2011-02-24 20:56:28 -08:00 committed by James Bottomley
parent e1419191d8
commit 66192dfe1e
2 changed files with 21 additions and 1 deletions

View file

@ -1477,4 +1477,7 @@ struct megasas_mgmt_info {
int max_index;
};
#define msi_control_reg(base) (base + PCI_MSI_FLAGS)
#define PCI_MSIX_FLAGS_ENABLE (1 << 15)
#endif /*LSI_MEGARAID_SAS_H */

View file

@ -3901,9 +3901,26 @@ megasas_set_dma_mask(struct pci_dev *pdev)
static int __devinit
megasas_probe_one(struct pci_dev *pdev, const struct pci_device_id *id)
{
int rval;
int rval, pos;
struct Scsi_Host *host;
struct megasas_instance *instance;
u16 control = 0;
/* Reset MSI-X in the kdump kernel */
if (reset_devices) {
pos = pci_find_capability(pdev, PCI_CAP_ID_MSIX);
if (pos) {
pci_read_config_word(pdev, msi_control_reg(pos),
&control);
if (control & PCI_MSIX_FLAGS_ENABLE) {
dev_info(&pdev->dev, "resetting MSI-X\n");
pci_write_config_word(pdev,
msi_control_reg(pos),
control &
~PCI_MSIX_FLAGS_ENABLE);
}
}
}
/*
* Announce PCI information