1. 13 5月, 2010 1 次提交
  2. 06 5月, 2010 2 次提交
  3. 30 3月, 2010 1 次提交
    • T
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking... · 5a0e3ad6
      Tejun Heo 提交于
      include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
      
      percpu.h is included by sched.h and module.h and thus ends up being
      included when building most .c files.  percpu.h includes slab.h which
      in turn includes gfp.h making everything defined by the two files
      universally available and complicating inclusion dependencies.
      
      percpu.h -> slab.h dependency is about to be removed.  Prepare for
      this change by updating users of gfp and slab facilities include those
      headers directly instead of assuming availability.  As this conversion
      needs to touch large number of source files, the following script is
      used as the basis of conversion.
      
        http://userweb.kernel.org/~tj/misc/slabh-sweep.py
      
      The script does the followings.
      
      * Scan files for gfp and slab usages and update includes such that
        only the necessary includes are there.  ie. if only gfp is used,
        gfp.h, if slab is used, slab.h.
      
      * When the script inserts a new include, it looks at the include
        blocks and try to put the new include such that its order conforms
        to its surrounding.  It's put in the include block which contains
        core kernel includes, in the same order that the rest are ordered -
        alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
        doesn't seem to be any matching order.
      
      * If the script can't find a place to put a new include (mostly
        because the file doesn't have fitting include block), it prints out
        an error message indicating which .h file needs to be added to the
        file.
      
      The conversion was done in the following steps.
      
      1. The initial automatic conversion of all .c files updated slightly
         over 4000 files, deleting around 700 includes and adding ~480 gfp.h
         and ~3000 slab.h inclusions.  The script emitted errors for ~400
         files.
      
      2. Each error was manually checked.  Some didn't need the inclusion,
         some needed manual addition while adding it to implementation .h or
         embedding .c file was more appropriate for others.  This step added
         inclusions to around 150 files.
      
      3. The script was run again and the output was compared to the edits
         from #2 to make sure no file was left behind.
      
      4. Several build tests were done and a couple of problems were fixed.
         e.g. lib/decompress_*.c used malloc/free() wrappers around slab
         APIs requiring slab.h to be added manually.
      
      5. The script was run on all .h files but without automatically
         editing them as sprinkling gfp.h and slab.h inclusions around .h
         files could easily lead to inclusion dependency hell.  Most gfp.h
         inclusion directives were ignored as stuff from gfp.h was usually
         wildly available and often used in preprocessor macros.  Each
         slab.h inclusion directive was examined and added manually as
         necessary.
      
      6. percpu.h was updated not to include slab.h.
      
      7. Build test were done on the following configurations and failures
         were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
         distributed build env didn't work with gcov compiles) and a few
         more options had to be turned off depending on archs to make things
         build (like ipr on powerpc/64 which failed due to missing writeq).
      
         * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
         * powerpc and powerpc64 SMP allmodconfig
         * sparc and sparc64 SMP allmodconfig
         * ia64 SMP allmodconfig
         * s390 SMP allmodconfig
         * alpha SMP allmodconfig
         * um on x86_64 SMP allmodconfig
      
      8. percpu.h modifications were reverted so that it could be applied as
         a separate patch and serve as bisection point.
      
      Given the fact that I had only a couple of failures from tests on step
      6, I'm fairly confident about the coverage of this conversion patch.
      If there is a breakage, it's likely to be something in one of the arch
      headers which should be easily discoverable easily on most builds of
      the specific arch.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Guess-its-ok-by: NChristoph Lameter <cl@linux-foundation.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
      5a0e3ad6
  4. 11 3月, 2010 2 次提交
  5. 24 2月, 2010 1 次提交
  6. 23 2月, 2010 2 次提交
  7. 17 12月, 2009 1 次提交
    • B
      PCI/cardbus: Add a fixup hook and fix powerpc · 2d1c8618
      Benjamin Herrenschmidt 提交于
      The cardbus code creates PCI devices without ever going through the
      necessary fixup bits and pieces that normal PCI devices go through.
      
      There's in fact a commented out call to pcibios_fixup_bus() in there,
      it's commented because ... it doesn't work.
      
      I could make pcibios_fixup_bus() do the right thing on powerpc easily
      but I felt it cleaner instead to provide a specific hook pci_fixup_cardbus
      for which a weak empty implementation is provided by the PCI core.
      
      This fixes cardbus on powerbooks and probably all other PowerPC
      platforms which was broken completely for ever on some platforms and
      since 2.6.31 on others such as PowerBooks when we made the DMA ops
      mandatory (since those are setup by the fixups).
      Acked-by: NDominik Brodowski <linux@dominikbrodowski.net>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: NJesse Barnes <jbarnes@virtuousgeek.org>
      2d1c8618
  8. 14 10月, 2009 1 次提交
    • H
      powerpc/pci: Fix MODPOST warning · 0f6023d5
      Heiko Schocher 提交于
      making a powerpc target with PCI support, shows the
      following warning:
      
        MODPOST vmlinux.o
      WARNING: vmlinux.o(.text+0x10430): Section mismatch in reference from the
      function pcibios_allocate_bus_resources() to the function .init.text:reparent_resources()
      
      The function pcibios_allocate_bus_resources() references
      the function __init reparent_resources().
      
      This is often because pcibios_allocate_bus_resources lacks a __init
      annotation or the annotation of reparent_resources is wrong.
      
      This patch fix this warning by removing the __init
      annotation before reparent_resources.
      Signed-off-by: NHeiko Schocher <hs@denx.de>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      0f6023d5
  9. 24 9月, 2009 1 次提交
  10. 02 9月, 2009 1 次提交
  11. 28 8月, 2009 4 次提交
  12. 02 6月, 2009 1 次提交
    • S
      powerpc/pci: Fix annotation of pcibios_claim_one_bus · baf75b0a
      Stephen Rothwell 提交于
      It was __devinit, but it is also within a CONFIG_HOTPLUG guarded section
      of code, so the __devinit does nothing but cause the following warning:
      
      WARNING: vmlinux.o(.text+0x107a8): Section mismatch in reference from the function pcibios_finish_adding_to_bus() to the function .devinit.text:pcibios_claim_one_bus()
      The function pcibios_finish_adding_to_bus() references
      the function __devinit pcibios_claim_one_bus().
      This is often because pcibios_finish_adding_to_bus lacks a __devinit
      annotation or the annotation of pcibios_claim_one_bus is wrong.
      
      It is also only (externally) used in arch/powerpc/kernel/of_platform.c
      which cannot be built as a module so don't export it.
      Signed-off-by: NStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      baf75b0a
  13. 15 5月, 2009 1 次提交
    • B
      powerpc: Fix PCI ROM access · ad892a63
      Benjamin Herrenschmidt 提交于
      A couple of issues crept in since about 2.6.27 related to accessing PCI
      device ROMs on various powerpc machines.
      
      First, historically, we don't allocate the ROM resource in the resource
      tree. I'm not entirely certain of why, I susepct they often contained
      garbage on x86 but it's hard to tell. This causes the current generic
      code to always call pci_assign_resource() when trying to access the said
      ROM from sysfs, which will try to re-assign some new address regardless
      of what the ROM BAR was already set to at boot time. This can be a
      problem on hypervisor platforms like pSeries where we aren't supposed
      to move PCI devices around (and in fact probably can't).
      
      Second, our code that generates the PCI tree from the OF device-tree
      (instead of doing config space probing) which we mostly use on pseries
      at the moment, didn't set the (new) flag IORESOURCE_SIZEALIGN on any
      resource. That means that any attempt at re-assigning such a resource
      with pci_assign_resource() would fail due to resource_alignment()
      returning 0.
      
      This fixes this by doing these two things:
      
       - The code that calculates resource flags based on the OF device-node
      is improved to set IORESOURCE_SIZEALIGN on any valid BAR, and while at
      it also set IORESOURCE_READONLY for ROMs since we were lacking that too
      
       - We now allocate ROM resources as part of the resource tree. However
      to limit the chances of nasty conflicts due to busted firmwares, we
      only do it on the second pass of our two-passes allocation scheme,
      so that all valid and enabled BARs get precedence.
      
      This brings pSeries back the ability to access PCI ROMs via sysfs (and
      thus initialize various video cards from X etc...).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      ad892a63
  14. 24 3月, 2009 1 次提交
  15. 11 3月, 2009 1 次提交
  16. 11 2月, 2009 1 次提交
  17. 10 2月, 2009 1 次提交
    • B
      powerpc/pci: mmap anonymous memory when legacy_mem doesn't exist · 5b11abfd
      Benjamin Herrenschmidt 提交于
      The new legacy_mem file in sysfs is causing problems with X on machines
      that don't support legacy memory access. The way I initially implemented
      it, we would fail with -ENXIO when trying to mmap it, thus exposing to
      X that we do support the API but there is no legacy memory.
      
      Unfortunately, X poor error handling is causing it to fail to start when
      it gets this error.
      
      This implements a workaround hack that instead maps anonymous memory
      instead (using shmem if VM_SHARED is set, just like /dev/zero does).
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      5b11abfd
  18. 02 2月, 2009 1 次提交
  19. 08 1月, 2009 1 次提交
    • B
      powerpc/pci: Reserve legacy regions on PCI · c1f34302
      Benjamin Herrenschmidt 提交于
      There's a problem on some embedded platforms when we re-assign
      everything on PCI, such as 44x. The generic code tries to avoid
      assigning devices to addresses overlapping the low legacy
      addresses such as VGA hard decoded areas using constants that
      are unfortunately no good for us, as they don't take into account
      the address translation we do to access PCI busses.
      
      Thus we end up allocating things like IO BARs to 0, which is
      technically legal, but will shadow hard decoded ports for use
      by things like VGA cards.
      
      This works around it by attempting to reserve legacy regions
      before we try to assign addresses.
      
      NOTE: This may have nasty side effects in cases I haven't tested
      yet:
      
       - We try to use FW mappings (ie. powermac) and the FW has allocated
      a conflicting address over those legacy regions. This will typically
      happen. I would expect the new code to just fail with an informative
      message without harm but I haven't had a chance to test that scenario
      yet.
      
       - A device with fixed BARs overlapping those legacy addresses such
      as an IDE controller in legacy mode is in the system. I don't know
      for sure yet what will happen there, I have to test :-)
      
      Ideally, we should change PCIBIOS_MIN_IO/MIN_MEM accross the board
      to take a bus pointer so they can provide appropriate per-bus translated
      values to the generic code but that's a more invasive patch. I will
      do that in the future, but in the meantime, this fixes the problem
      locally
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      c1f34302
  20. 21 12月, 2008 1 次提交
    • B
      powerpc/mm: Rework usage of _PAGE_COHERENT/NO_CACHE/GUARDED · 64b3d0e8
      Benjamin Herrenschmidt 提交于
      Currently, we never set _PAGE_COHERENT in the PTEs, we just OR it in
      in the hash code based on some CPU feature bit.  We also manipulate
      _PAGE_NO_CACHE and _PAGE_GUARDED by hand in all sorts of places.
      
      This changes the logic so that instead, the PTE now contains
      _PAGE_COHERENT for all normal RAM pages thay have I = 0 on platforms
      that need it.  The hash code clears it if the feature bit is not set.
      
      It also adds some clean accessors to setup various valid combinations
      of access flags and change various bits of code to use them instead.
      
      This should help having the PTE actually containing the bit
      combinations that we really want.
      
      I also removed _PAGE_GUARDED from _PAGE_BASE on 44x and instead
      set it explicitely from the TLB miss.  I will ultimately remove it
      completely as it appears that it might not be needed after all
      but in the meantime, having it in the TLB miss makes things a
      lot easier.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Acked-by: NKumar Gala <galak@kernel.crashing.org>
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      64b3d0e8
  21. 16 12月, 2008 1 次提交
  22. 06 11月, 2008 4 次提交
  23. 05 11月, 2008 4 次提交
  24. 31 10月, 2008 1 次提交
  25. 22 10月, 2008 1 次提交
  26. 21 10月, 2008 1 次提交
  27. 15 10月, 2008 1 次提交
    • B
      powerpc/pci: Improve detection of unassigned bridge resources · b5561511
      Benjamin Herrenschmidt 提交于
      When the powerpc PCI layer is not configured to re-assign everything,
      it currently fails to detect that a PCI to PCI bridge has been left
      unassigned by the firmware and tries to allocate resource for the
      default window values in the bridge (0...X) (with the notable exception
      of a hack we have in there that detects some Apple firmware unassigned
      bridge resources).
      
      This results in resource allocation failures, which are generally
      fixed up later on but it causes scary warnings in the logs and we
      have seen the fixup code fall over in some circumstances (a different
      issue to fix as well).
      
      This code improves that by providing a more complete & useful function
      to intuit that a bridge was left unassigned by the firmware, and thus
      force a full re-allocation by the PCI code without trying to allocate
      the existing useless resources first.
      
      The algorithm we use basically considers unassigned a window that
      starts at 0 (PCI address) if the corresponding address space enable
      bit is not set. In addition, for memory space, it considers such a
      resource unassigned also if the host bridge isn't configured to
      forward cycles to address 0 (ie, the resource basically overlaps
      main memory).
      
      This fixes a range of problems with things like Bare-Metal support
      on pSeries machines, or attempt to use partial firmware PCI setup.
      Signed-off-by: NBenjamin Herrenschmidt <benh@kernel.crashing.org>
      b5561511
  28. 07 10月, 2008 1 次提交