vme: lower alignment requirement in pci bridge drivers
authorDmitry Kalinkin <dmitry.kalinkin@gmail.com>
Wed, 8 Jul 2015 14:42:17 +0000 (17:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 4 Oct 2015 18:50:05 +0000 (19:50 +0100)
Universe II allows PCI address grannularity of 4K or 64K depending on
the window id. tsi148 only supports 64K. Existing driver implementations
are validating window size against this grannularity and then use that
very size as alignment parameter to pci_bus_alloc_resource.  This
constraint is excessive, alignment by granularity should be enough.

This changes alignment constraint from size to a fixed constraint of
64K.

Signed-off-by: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/vme/bridges/vme_ca91cx42.c
drivers/vme/bridges/vme_tsi148.c

index f692efcf683fc7a9a6150b4962cc218bf26148f4..1d41cf21319bfb5ceecff6ec8231014c7b104205 100644 (file)
@@ -554,7 +554,7 @@ static int ca91cx42_alloc_resource(struct vme_master_resource *image,
        image->bus_resource.flags = IORESOURCE_MEM;
 
        retval = pci_bus_alloc_resource(pdev->bus,
-               &image->bus_resource, size, size, PCIBIOS_MIN_MEM,
+               &image->bus_resource, size, 0x10000, PCIBIOS_MIN_MEM,
                0, NULL, NULL);
        if (retval) {
                dev_err(ca91cx42_bridge->parent, "Failed to allocate mem "
index fb1e7ad272ec4ed3f92c7649adbb906423d60b66..6c40f282c267c20f914d20c9c24527c7d3f51ff3 100644 (file)
@@ -846,7 +846,7 @@ static int tsi148_alloc_resource(struct vme_master_resource *image,
        image->bus_resource.flags = IORESOURCE_MEM;
 
        retval = pci_bus_alloc_resource(pdev->bus,
-               &image->bus_resource, size, size, PCIBIOS_MIN_MEM,
+               &image->bus_resource, size, 0x10000, PCIBIOS_MIN_MEM,
                0, NULL, NULL);
        if (retval) {
                dev_err(tsi148_bridge->parent, "Failed to allocate mem "
This page took 0.027536 seconds and 5 git commands to generate.