aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/megaraid
diff options
context:
space:
mode:
authoradam radford <aradford@gmail.com>2011-02-24 20:56:28 -0800
committerJames Bottomley <James.Bottomley@suse.de>2011-02-28 11:47:48 -0600
commit66192dfe1e74eae31a76cfc36092dabdba1324e6 (patch)
tree50d23dfbb7fb154c43ccf9eb28ec5e4d8e984ae2 /drivers/scsi/megaraid
parente1419191d8d38098fb6ef29e94aadd15dabff3da (diff)
downloadkernel_samsung_smdk4412-66192dfe1e74eae31a76cfc36092dabdba1324e6.zip
kernel_samsung_smdk4412-66192dfe1e74eae31a76cfc36092dabdba1324e6.tar.gz
kernel_samsung_smdk4412-66192dfe1e74eae31a76cfc36092dabdba1324e6.tar.bz2
[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>
Diffstat (limited to 'drivers/scsi/megaraid')
-rw-r--r--drivers/scsi/megaraid/megaraid_sas.h3
-rw-r--r--drivers/scsi/megaraid/megaraid_sas_base.c19
2 files changed, 21 insertions, 1 deletions
diff --git a/drivers/scsi/megaraid/megaraid_sas.h b/drivers/scsi/megaraid/megaraid_sas.h
index 1b5e375..e00ee4a 100644
--- a/drivers/scsi/megaraid/megaraid_sas.h
+++ b/drivers/scsi/megaraid/megaraid_sas.h
@@ -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 */
diff --git a/drivers/scsi/megaraid/megaraid_sas_base.c b/drivers/scsi/megaraid/megaraid_sas_base.c
index 050ec16..a521e1a 100644
--- a/drivers/scsi/megaraid/megaraid_sas_base.c
+++ b/drivers/scsi/megaraid/megaraid_sas_base.c
@@ -3901,9 +3901,26 @@ fail_set_dma_mask:
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