1. 11 5月, 2010 1 次提交
  2. 26 4月, 2010 1 次提交
    • M
      sh: Do not try merging two 128MB PMB mappings · c7b03fa0
      Matt Fleming 提交于
      There is a logic error in pmb_merge() that means we will incorrectly try
      to merge two 128MB PMB mappings into one mapping. However, 256MB isn't a
      valid PMB map size and pmb_merge() will actually drop the second 128MB
      mapping.
      
      This patch allows my SDK7786 board to boot when configured with
      CONFIG_MEMORY_SIZE=0x10000000.
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      c7b03fa0
  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. 23 3月, 2010 2 次提交
  5. 05 3月, 2010 1 次提交
  6. 04 3月, 2010 1 次提交
    • P
      sh: fix up MMU reset with variable PMB mapping sizes. · 281983d6
      Paul Mundt 提交于
      Presently we run in to issues with the MMU resetting the CPU when
      variable sized mappings are employed. This takes a slightly more
      aggressive approach to keeping the TLB and cache state sane before
      establishing the mappings in order to cut down on races observed on
      SMP configurations.
      
      At the same time, we bump the VMA range up to the 0xb000...0xc000 range,
      as there still seems to be some undocumented behaviour in setting up
      variable mappings in the 0xa000...0xb000 range, resulting in reset by the
      TLB.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      281983d6
  7. 03 3月, 2010 1 次提交
  8. 02 3月, 2010 3 次提交
  9. 01 3月, 2010 1 次提交
  10. 18 2月, 2010 2 次提交
    • P
      sh: Merge legacy and dynamic PMB modes. · d01447b3
      Paul Mundt 提交于
      This implements a bit of rework for the PMB code, which permits us to
      kill off the legacy PMB mode completely. Rather than trusting the boot
      loader to do the right thing, we do a quick verification of the PMB
      contents to determine whether to have the kernel setup the initial
      mappings or whether it needs to mangle them later on instead.
      
      If we're booting from legacy mappings, the kernel will now take control
      of them and make them match the kernel's initial mapping configuration.
      This is accomplished by breaking the initialization phase out in to
      multiple steps: synchronization, merging, and resizing. With the recent
      rework, the synchronization code establishes page links for compound
      mappings already, so we build on top of this for promoting mappings and
      reclaiming unused slots.
      
      At the same time, the changes introduced for the uncached helpers also
      permit us to dynamically resize the uncached mapping without any
      particular headaches. The smallest page size is more than sufficient for
      mapping all of kernel text, and as we're careful not to jump to any far
      off locations in the setup code the mapping can safely be resized
      regardless of whether we are executing from it or not.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      d01447b3
    • P
      sh: Use uncached I/O helpers in PMB setup. · 2e450643
      Paul Mundt 提交于
      The PMB code is an example of something that spends an absurd amount of
      time running uncached when only a couple of operations really need to be.
      This switches over to the shiny new uncached helpers, permitting us to
      spend far more time running cached.
      
      Additionally, MMUCR twiddling is perfectly safe from cached space given
      that it's paired with a control register barrier, so fix that up, too.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      2e450643
  11. 17 2月, 2010 5 次提交
  12. 16 2月, 2010 2 次提交
  13. 26 1月, 2010 1 次提交
    • P
      sh: Mass ctrl_in/outX to __raw_read/writeX conversion. · 9d56dd3b
      Paul Mundt 提交于
      The old ctrl in/out routines are non-portable and unsuitable for
      cross-platform use. While drivers/sh has already been sanitized, there
      is still quite a lot of code that is not. This converts the arch/sh/ bits
      over, which permits us to flag the routines as deprecated whilst still
      building with -Werror for the architecture code, and to ensure that
      future users are not added.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      9d56dd3b
  14. 21 1月, 2010 1 次提交
  15. 20 1月, 2010 1 次提交
  16. 18 1月, 2010 1 次提交
    • M
      sh: Setup early PMB mappings. · 3d467676
      Matt Fleming 提交于
      More and more boards are going to start shipping that boot with the MMU
      in 32BIT mode by default. Previously we relied on the bootloader to
      setup PMB mappings for use by the kernel but we also need to cater for
      boards whose bootloaders don't set them up.
      
      If CONFIG_PMB_LEGACY is not enabled we have full control over our PMB
      mappings and can compress our address space. Usually, the distance
      between the the cached and uncached mappings of RAM is always 512MB,
      however we can compress the distance to be the amount of RAM on the
      board.
      
      pmb_init() now becomes much simpler. It no longer has to calculate any
      mappings, it just has to synchronise the software PMB table with the
      hardware.
      
      Tested on SDK7786 and SH7785LCR.
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      3d467676
  17. 13 1月, 2010 1 次提交
    • P
      sh: fixed PMB mode refactoring. · a0ab3668
      Paul Mundt 提交于
      This introduces some much overdue chainsawing of the fixed PMB support.
      fixed PMB was introduced initially to work around the fact that dynamic
      PMB mode was relatively broken, though they were never intended to
      converge. The main areas where there are differences are whether the
      system is booted in 29-bit mode or 32-bit mode, and whether legacy
      mappings are to be preserved. Any system booting in true 32-bit mode will
      not care about legacy mappings, so these are roughly decoupled.
      
      Regardless of the entry point, PMB and 32BIT are directly related as far
      as the kernel is concerned, so we also switch back to having one select
      the other.
      
      With legacy mappings iterated through and applied in the initialization
      path it's now possible to finally merge the two implementations and
      permit dynamic remapping overtop of remaining entries regardless of
      whether boot mappings are crafted by hand or inherited from the boot
      loader.
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      a0ab3668
  18. 10 10月, 2009 6 次提交
  19. 09 10月, 2009 2 次提交
    • M
      sh: Don't allocate smaller sized mappings on every iteration · a2767cfb
      Matt Fleming 提交于
      Currently, we've got the less than ideal situation where if we need to
      allocate a 256MB mapping we'll allocate four entries like so,
      
      	 entry 1: 128MB
      	 entry 2:  64MB
      	 entry 3:  16MB
      	 entry 4:  16MB
      
      This is because as we execute the loop in pmb_remap() we will
      progressively try mapping the remaining address space with smaller and
      smaller sizes. This isn't good because the size we use on one iteration
      may be the perfect size to use on the next iteration, for instance when
      the initial size is divisible by one of the PMB mapping sizes.
      
      With this patch, we now only need two entries in the PMB to map 256MB of
      address space,
      
      	  entry 1: 128MB
      	  entry 2: 128MB
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      a2767cfb
    • M
      sh: Plug PMB alloc memory leak · fc2bdefd
      Matt Fleming 提交于
      If we fail to allocate a PMB entry in pmb_remap() we must remember to
      clear and free any PMB entries that we may have previously allocated,
      e.g. if we were allocating a multiple entry mapping.
      Signed-off-by: NMatt Fleming <matt@console-pimps.org>
      Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
      fc2bdefd
  20. 16 3月, 2009 1 次提交
  21. 20 10月, 2008 1 次提交
  22. 28 7月, 2008 1 次提交
  23. 27 7月, 2008 1 次提交
  24. 19 4月, 2008 1 次提交
  25. 28 1月, 2008 1 次提交