1. 04 Dec, 2009 1 commit
  2. 24 Nov, 2009 34 commits
  3. 11 Nov, 2009 1 commit
    • Linus Torvalds's avatar
      PCI: allow matching of prefetchable resources to non-prefetchable windows · 8c8def26
      Linus Torvalds authored
      I'm not entirely sure it needs to go into 32, but it's probably the right
      thing to do. Another way of explaining the patch is:
      
       - we currently pick the _first_ exactly matching bus resource entry, but
         the _last_ inexactly matching one. Normally first/last shouldn't
         matter, but bus resource entries aren't actually all created equal: in
         a transparent bus, the last resources will be the parent resources,
         which we should generally try to avoid unless we have no choice. So
         "first matching" is the thing we should always aim for.
      
       - the patch is a bit bigger than it needs to be, because I simplified the
         logic at the same time. It used to be a fairly incomprehensible
      
      	if ((res->flags & IORESOURCE_PREFETCH) && !(r->flags & IORESOURCE_PREFETCH))
      		best = r;       /* Approximating prefetchable by non-prefetchable */
      
         and technically, all the patch did was to make that complex choice be
         even more complex (it basically added a "&& !best" to say that if we
         already gound a non-prefetchable window for the prefetchable resource,
         then we won't override an earlier one with that later one: remember
         "first matching").
      
       - So instead of that complex one with three separate conditionals in one,
         I split it up a bit, and am taking advantage of the fact that we
         already handled the exact case, so if 'res->flags' has the PREFETCH
         bit, then we already know that 'r->flags' will _not_ have it. So the
         simplified code drops the redundant test, and does the new '!best' test
         separately. It also uses 'continue' as a way to ignore the bus
         resource we know doesn't work (ie a prefetchable bus resource is _not_
         acceptable for anything but an exact match), so it turns into:
      
      	/* We can't insert a non-prefetch resource inside a prefetchable parent .. */
      	if (r->flags & IORESOURCE_PREFETCH)
      		continue;
      	/* .. but we can put a prefetchable resource inside a non-prefetchable one */
      	if (!best)
      		best = r;
      
         instead. With the comments, it's now six lines instead of two, but it's
         conceptually simpler, and I _could_ have written it as two lines:
      
      	if ((res->flags & IORESOURCE_PREFETCH) && !best)
      		best = r;	/* Approximating prefetchable by non-prefetchable */
      
         but I thought that was too damn subtle.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      8c8def26
  4. 06 Nov, 2009 4 commits
    • Thomas Gleixner's avatar
      PCI: Replace old style lock initializer · e9d1e492
      Thomas Gleixner authored
      SPIN_LOCK_UNLOCKED is deprecated. Use DEFINE_SPINLOCK instead.
      
      Make the lock static while at it.
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      e9d1e492
    • Isaku Yamahata's avatar
      ia64/xen: compilation fix · 5b5d9448
      Isaku Yamahata authored
      This patch fixes the following compilation error introduced by a PCI related
      features.
      
      The change set of 5dd1af9f84c79bedd589db89e71ca733f3bf0ebd moves some
      xen related definitions from the arch header file
      (x86/include/asm/xen/hypervisor.h) to the common header file
      (include/xen/xen.h).  So ia64/xen also follows it.
      
      In file included from linux-next/include/xen/grant_table.h:41,
                       from linux-next/drivers/block/xen-blkfront.c:48:
      linux-next/arch/ia64/include/asm/xen/hypervisor.h:43: error: nested redefinition of 'enum xen_domain_type'
      linux-next/arch/ia64/include/asm/xen/hypervisor.h:43: error: redeclaration of 'enum xen_domain_type'
      linux-next/arch/ia64/include/asm/xen/hypervisor.h:44: error: redeclaration of enumerator 'XEN_NATIVE'
      linux-next/include/xen/xen.h:5: error: previous definition of 'XEN_NATIVE' was here
      linux-next/arch/ia64/include/asm/xen/hypervisor.h:45: error: redeclaration of enumerator 'XEN_PV_DOMAIN'
      linux-next/include/xen/xen.h:6: error: previous definition of 'XEN_PV_DOMAIN' was here
      linux-next/arch/ia64/include/asm/xen/hypervisor.h:46: error: redeclaration of enumerator 'XEN_HVM_DOMAIN'
      linux-next/include/xen/xen.h:7: error: previous definition of 'XEN_HVM_DOMAIN' was here
      Signed-off-by: default avatarIsaku Yamahata <yamahata@valinux.co.jp>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      5b5d9448
    • Kenji Kaneshige's avatar
      PCI hotplug: fix oshp evaluation · 9b536e0b
      Kenji Kaneshige authored
      If firmware doesn't grant over native hotplug control through ACPI
      _OSC method, we must not evaluate OSHP.
      Acked-by: default avatarAndrew Patterson <andrew.patterson@hp.com>
      Signed-off-by: default avatarKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      9b536e0b
    • Andreas Herrmann's avatar
      PCI: derive nearby CPUs from device's instead of bus' NUMA information · e0cd5160
      Andreas Herrmann authored
      In case of AMD CPU northbridge functions this NUMA information might
      differ.  Here is an example from a 4-socket system.
      
      Currently Linux shows
      
        root@hagen:/sys/devices/pci0000:00/0000:00:1a.4# cat numa_node
        0
        root@hagen:/sys/devices/pci0000:00/0000:00:1a.4# cat local_cpu*
        0-3
        00000000,0000000f
      
      which is not correct for northbridge functions as the local CPUs
      are those of the same socket.
      
      With this patch and a quirk for AMD CPU NB functions Linux can
      do better and correctly show
      
        root@hagen:/sys/devices/pci0000:00/0000:00:1a.4# cat numa_node
        2
        root@hagen:/sys/devices/pci0000:00/0000:00:1a.4# cat local_cpu*
        8-11
        00000000,00000f00
      Signed-off-by: default avatarAndreas Herrmann <andreas.herrmann3@amd.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      e0cd5160