diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-02 23:09:08 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-03-02 23:09:08 -0500 |
commit | 13df7977431e3b906a23bb75f29e0f40a8d73f87 (patch) | |
tree | bc2c78c3b816a65f90c31cccebdc15b38352c045 /drivers/pci | |
parent | 6d8b3e1ad3d3815d9c87b8553493301e243af76a (diff) | |
parent | 0414855fdc4a40da05221fc6062cccbc0c30f169 (diff) |
Merge 3.14-rc5 into driver-core-next
We want the fixes in here.
Diffstat (limited to 'drivers/pci')
-rw-r--r-- | drivers/pci/host/pci-mvebu.c | 11 | ||||
-rw-r--r-- | drivers/pci/msi.c | 10 | ||||
-rw-r--r-- | drivers/pci/pci.c | 10 |
3 files changed, 20 insertions, 11 deletions
diff --git a/drivers/pci/host/pci-mvebu.c b/drivers/pci/host/pci-mvebu.c index 13478ecd4113..0e79665afd44 100644 --- a/drivers/pci/host/pci-mvebu.c +++ b/drivers/pci/host/pci-mvebu.c | |||
@@ -60,14 +60,6 @@ | |||
60 | #define PCIE_DEBUG_CTRL 0x1a60 | 60 | #define PCIE_DEBUG_CTRL 0x1a60 |
61 | #define PCIE_DEBUG_SOFT_RESET BIT(20) | 61 | #define PCIE_DEBUG_SOFT_RESET BIT(20) |
62 | 62 | ||
63 | /* | ||
64 | * This product ID is registered by Marvell, and used when the Marvell | ||
65 | * SoC is not the root complex, but an endpoint on the PCIe bus. It is | ||
66 | * therefore safe to re-use this PCI ID for our emulated PCI-to-PCI | ||
67 | * bridge. | ||
68 | */ | ||
69 | #define MARVELL_EMULATED_PCI_PCI_BRIDGE_ID 0x7846 | ||
70 | |||
71 | /* PCI configuration space of a PCI-to-PCI bridge */ | 63 | /* PCI configuration space of a PCI-to-PCI bridge */ |
72 | struct mvebu_sw_pci_bridge { | 64 | struct mvebu_sw_pci_bridge { |
73 | u16 vendor; | 65 | u16 vendor; |
@@ -388,7 +380,8 @@ static void mvebu_sw_pci_bridge_init(struct mvebu_pcie_port *port) | |||
388 | 380 | ||
389 | bridge->class = PCI_CLASS_BRIDGE_PCI; | 381 | bridge->class = PCI_CLASS_BRIDGE_PCI; |
390 | bridge->vendor = PCI_VENDOR_ID_MARVELL; | 382 | bridge->vendor = PCI_VENDOR_ID_MARVELL; |
391 | bridge->device = MARVELL_EMULATED_PCI_PCI_BRIDGE_ID; | 383 | bridge->device = mvebu_readl(port, PCIE_DEV_ID_OFF) >> 16; |
384 | bridge->revision = mvebu_readl(port, PCIE_DEV_REV_OFF) & 0xff; | ||
392 | bridge->header_type = PCI_HEADER_TYPE_BRIDGE; | 385 | bridge->header_type = PCI_HEADER_TYPE_BRIDGE; |
393 | bridge->cache_line_size = 0x10; | 386 | bridge->cache_line_size = 0x10; |
394 | 387 | ||
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c index 7a0fec6ce571..955ab7990c5b 100644 --- a/drivers/pci/msi.c +++ b/drivers/pci/msi.c | |||
@@ -545,9 +545,15 @@ static int populate_msi_sysfs(struct pci_dev *pdev) | |||
545 | return -ENOMEM; | 545 | return -ENOMEM; |
546 | list_for_each_entry(entry, &pdev->msi_list, list) { | 546 | list_for_each_entry(entry, &pdev->msi_list, list) { |
547 | char *name = kmalloc(20, GFP_KERNEL); | 547 | char *name = kmalloc(20, GFP_KERNEL); |
548 | if (!name) | ||
549 | goto error_attrs; | ||
550 | |||
548 | msi_dev_attr = kzalloc(sizeof(*msi_dev_attr), GFP_KERNEL); | 551 | msi_dev_attr = kzalloc(sizeof(*msi_dev_attr), GFP_KERNEL); |
549 | if (!msi_dev_attr) | 552 | if (!msi_dev_attr) { |
553 | kfree(name); | ||
550 | goto error_attrs; | 554 | goto error_attrs; |
555 | } | ||
556 | |||
551 | sprintf(name, "%d", entry->irq); | 557 | sprintf(name, "%d", entry->irq); |
552 | sysfs_attr_init(&msi_dev_attr->attr); | 558 | sysfs_attr_init(&msi_dev_attr->attr); |
553 | msi_dev_attr->attr.name = name; | 559 | msi_dev_attr->attr.name = name; |
@@ -589,6 +595,7 @@ error_attrs: | |||
589 | ++count; | 595 | ++count; |
590 | msi_attr = msi_attrs[count]; | 596 | msi_attr = msi_attrs[count]; |
591 | } | 597 | } |
598 | kfree(msi_attrs); | ||
592 | return ret; | 599 | return ret; |
593 | } | 600 | } |
594 | 601 | ||
@@ -959,7 +966,6 @@ EXPORT_SYMBOL(pci_disable_msi); | |||
959 | /** | 966 | /** |
960 | * pci_msix_vec_count - return the number of device's MSI-X table entries | 967 | * pci_msix_vec_count - return the number of device's MSI-X table entries |
961 | * @dev: pointer to the pci_dev data structure of MSI-X device function | 968 | * @dev: pointer to the pci_dev data structure of MSI-X device function |
962 | |||
963 | * This function returns the number of device's MSI-X table entries and | 969 | * This function returns the number of device's MSI-X table entries and |
964 | * therefore the number of MSI-X vectors device is capable of sending. | 970 | * therefore the number of MSI-X vectors device is capable of sending. |
965 | * It returns a negative errno if the device is not capable of sending MSI-X | 971 | * It returns a negative errno if the device is not capable of sending MSI-X |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 1febe90831b4..6b05f6134b68 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -1181,6 +1181,8 @@ EXPORT_SYMBOL_GPL(pci_load_and_free_saved_state); | |||
1181 | static int do_pci_enable_device(struct pci_dev *dev, int bars) | 1181 | static int do_pci_enable_device(struct pci_dev *dev, int bars) |
1182 | { | 1182 | { |
1183 | int err; | 1183 | int err; |
1184 | u16 cmd; | ||
1185 | u8 pin; | ||
1184 | 1186 | ||
1185 | err = pci_set_power_state(dev, PCI_D0); | 1187 | err = pci_set_power_state(dev, PCI_D0); |
1186 | if (err < 0 && err != -EIO) | 1188 | if (err < 0 && err != -EIO) |
@@ -1190,6 +1192,14 @@ static int do_pci_enable_device(struct pci_dev *dev, int bars) | |||
1190 | return err; | 1192 | return err; |
1191 | pci_fixup_device(pci_fixup_enable, dev); | 1193 | pci_fixup_device(pci_fixup_enable, dev); |
1192 | 1194 | ||
1195 | pci_read_config_byte(dev, PCI_INTERRUPT_PIN, &pin); | ||
1196 | if (pin) { | ||
1197 | pci_read_config_word(dev, PCI_COMMAND, &cmd); | ||
1198 | if (cmd & PCI_COMMAND_INTX_DISABLE) | ||
1199 | pci_write_config_word(dev, PCI_COMMAND, | ||
1200 | cmd & ~PCI_COMMAND_INTX_DISABLE); | ||
1201 | } | ||
1202 | |||
1193 | return 0; | 1203 | return 0; |
1194 | } | 1204 | } |
1195 | 1205 | ||