Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ipr: differentiate pci-x and pci-e based adapters

MSI has only been tested on and known to work with PCI-E based adapters. This
patch adds a field to struct ipr_chip_t to indicate which type of interrupt to
use based on what is known about the chip.

Signed-off-by: Wayne Boyer <wayneb@linux.vnet.ibm.com>
Acked-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>

authored by

Wayne Boyer and committed by
James Bottomley
1be7bd82 95fecd90

+21 -15
+17 -15
drivers/scsi/ipr.c
··· 131 131 }; 132 132 133 133 static const struct ipr_chip_t ipr_chip[] = { 134 - { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, &ipr_chip_cfg[0] }, 135 - { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, &ipr_chip_cfg[0] }, 136 - { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, &ipr_chip_cfg[0] }, 137 - { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, &ipr_chip_cfg[0] }, 138 - { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E, &ipr_chip_cfg[0] }, 139 - { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, &ipr_chip_cfg[1] }, 140 - { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, &ipr_chip_cfg[1] } 134 + { PCI_VENDOR_ID_MYLEX, PCI_DEVICE_ID_IBM_GEMSTONE, IPR_USE_LSI, &ipr_chip_cfg[0] }, 135 + { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_CITRINE, IPR_USE_LSI, &ipr_chip_cfg[0] }, 136 + { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN, IPR_USE_LSI, &ipr_chip_cfg[0] }, 137 + { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN, IPR_USE_LSI, &ipr_chip_cfg[0] }, 138 + { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_OBSIDIAN_E, IPR_USE_MSI, &ipr_chip_cfg[0] }, 139 + { PCI_VENDOR_ID_IBM, PCI_DEVICE_ID_IBM_SNIPE, IPR_USE_LSI, &ipr_chip_cfg[1] }, 140 + { PCI_VENDOR_ID_ADAPTEC2, PCI_DEVICE_ID_ADAPTEC2_SCAMP, IPR_USE_LSI, &ipr_chip_cfg[1] } 141 141 }; 142 142 143 143 static int ipr_max_bus_speeds [] = { ··· 7399 7399 } 7400 7400 7401 7401 /** 7402 - * ipr_get_chip_cfg - Find adapter chip configuration 7402 + * ipr_get_chip_info - Find adapter chip information 7403 7403 * @dev_id: PCI device id struct 7404 7404 * 7405 7405 * Return value: 7406 - * ptr to chip config on success / NULL on failure 7406 + * ptr to chip information on success / NULL on failure 7407 7407 **/ 7408 - static const struct ipr_chip_cfg_t * __devinit 7409 - ipr_get_chip_cfg(const struct pci_device_id *dev_id) 7408 + static const struct ipr_chip_t * __devinit 7409 + ipr_get_chip_info(const struct pci_device_id *dev_id) 7410 7410 { 7411 7411 int i; 7412 7412 7413 7413 for (i = 0; i < ARRAY_SIZE(ipr_chip); i++) 7414 7414 if (ipr_chip[i].vendor == dev_id->vendor && 7415 7415 ipr_chip[i].device == dev_id->device) 7416 - return ipr_chip[i].cfg; 7416 + return &ipr_chip[i]; 7417 7417 return NULL; 7418 7418 } 7419 7419 ··· 7540 7540 ata_host_init(&ioa_cfg->ata_host, &pdev->dev, 7541 7541 sata_port_info.flags, &ipr_sata_ops); 7542 7542 7543 - ioa_cfg->chip_cfg = ipr_get_chip_cfg(dev_id); 7543 + ioa_cfg->ipr_chip = ipr_get_chip_info(dev_id); 7544 7544 7545 - if (!ioa_cfg->chip_cfg) { 7545 + if (!ioa_cfg->ipr_chip) { 7546 7546 dev_err(&pdev->dev, "Unknown adapter chipset 0x%04X 0x%04X\n", 7547 7547 dev_id->vendor, dev_id->device); 7548 7548 goto out_scsi_host_put; 7549 7549 } 7550 + 7551 + ioa_cfg->chip_cfg = ioa_cfg->ipr_chip->cfg; 7550 7552 7551 7553 if (ipr_transop_timeout) 7552 7554 ioa_cfg->transop_timeout = ipr_transop_timeout; ··· 7601 7599 } 7602 7600 7603 7601 /* Enable MSI style interrupts if they are supported. */ 7604 - if (!(rc = pci_enable_msi(pdev))) { 7602 + if (ioa_cfg->ipr_chip->intr_type == IPR_USE_MSI && !pci_enable_msi(pdev)) { 7605 7603 rc = ipr_test_msi(ioa_cfg, pdev); 7606 7604 if (rc == -EOPNOTSUPP) 7607 7605 pci_disable_msi(pdev);
+4
drivers/scsi/ipr.h
··· 1025 1025 struct ipr_chip_t { 1026 1026 u16 vendor; 1027 1027 u16 device; 1028 + u16 intr_type; 1029 + #define IPR_USE_LSI 0x00 1030 + #define IPR_USE_MSI 0x01 1028 1031 const struct ipr_chip_cfg_t *cfg; 1029 1032 }; 1030 1033 ··· 1163 1160 1164 1161 unsigned int transop_timeout; 1165 1162 const struct ipr_chip_cfg_t *chip_cfg; 1163 + const struct ipr_chip_t *ipr_chip; 1166 1164 1167 1165 void __iomem *hdw_dma_regs; /* iomapped PCI memory space */ 1168 1166 unsigned long hdw_dma_regs_pci; /* raw PCI memory space */