aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/vme
diff options
context:
space:
mode:
authorJoe Schultz <jschultz@xes-inc.com>2014-04-03 15:48:16 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-04-16 17:08:37 -0400
commit226572b110ab6083cb8c1d6afb191166b4178179 (patch)
tree1badb68060b9d5fa5a5d219f4dc7d9009c5660c3 /drivers/vme
parent098ced8fefe4a4e4240fa47b1ed9b00d65b6cd21 (diff)
vme_tsi148: Fix PCI address mapping assumption
Previously, tsi148_master_set() assumed the address contained in its PCI bus resource represented the actual PCI bus address. This is a fine assumption on some platforms. However, on platforms that don't use a 1:1 (CPU:PCI) mapping this results in the tsi148 driver configuring an invalid master window translation. This patch updates the vme_tsi148 driver to first convert the address contained in the PCI bus resource into a PCI bus address before using it. [asierra: account for pcibios_resource_to_bus() prototype change] Signed-off-by: Joe Schultz <jschultz@xes-inc.com> Signed-off-by: Aaron Sierra <asierra@xes-inc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/vme')
-rw-r--r--drivers/vme/bridges/vme_tsi148.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c
index 6b03be715005..e64e4208de2b 100644
--- a/drivers/vme/bridges/vme_tsi148.c
+++ b/drivers/vme/bridges/vme_tsi148.c
@@ -910,11 +910,15 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
910 unsigned long long pci_bound, vme_offset, pci_base; 910 unsigned long long pci_bound, vme_offset, pci_base;
911 struct vme_bridge *tsi148_bridge; 911 struct vme_bridge *tsi148_bridge;
912 struct tsi148_driver *bridge; 912 struct tsi148_driver *bridge;
913 struct pci_bus_region region;
914 struct pci_dev *pdev;
913 915
914 tsi148_bridge = image->parent; 916 tsi148_bridge = image->parent;
915 917
916 bridge = tsi148_bridge->driver_priv; 918 bridge = tsi148_bridge->driver_priv;
917 919
920 pdev = container_of(tsi148_bridge->parent, struct pci_dev, dev);
921
918 /* Verify input data */ 922 /* Verify input data */
919 if (vme_base & 0xFFFF) { 923 if (vme_base & 0xFFFF) {
920 dev_err(tsi148_bridge->parent, "Invalid VME Window " 924 dev_err(tsi148_bridge->parent, "Invalid VME Window "
@@ -949,7 +953,9 @@ static int tsi148_master_set(struct vme_master_resource *image, int enabled,
949 pci_bound = 0; 953 pci_bound = 0;
950 vme_offset = 0; 954 vme_offset = 0;
951 } else { 955 } else {
952 pci_base = (unsigned long long)image->bus_resource.start; 956 pcibios_resource_to_bus(pdev->bus, &region,
957 &image->bus_resource);
958 pci_base = region.start;
953 959
954 /* 960 /*
955 * Bound address is a valid address for the window, adjust 961 * Bound address is a valid address for the window, adjust