1. 23 7月, 2012 1 次提交
  2. 20 7月, 2012 1 次提交
    • S
      spi: omap2-mcspi: Fix the below warning · a3ce9a80
      Shubhrajyoti D 提交于
      The dma_map and dma_unmap should have same parameter
      passed otherwise we get the below warn.
      
      ks8851 spi1.0: DMA-API: device driver tries to free DMA memory it has not allocated [device address=0x000000009f22]
      
      [    2.066925] Modules linked in:
      [    2.070312]
      [    2.071929] [<c001c250>] (unwind_backtrace+0x0/0x130) from [<c0043d84>] (warn_slowpath_common+0x4c/0x64)
      [    2.081909] [<c0043d84>] (warn_slowpath_common+0x4c/0x64) from [<c0043e30>] (warn_slowpath_fmt+0x30/0x40)
      [    2.091949] [<c0043e30>] (warn_slowpath_fmt+0x30/0x40) from [<c0293824>] (check_unmap+0x6d0/0x7b0)
      [    2.101348] [<c0293824>] (check_unmap+0x6d0/0x7b0) from [<c02939cc>] (debug_dma_unmap_page+0x64/0x70)
      [    2.111053] [<c02939cc>] (debug_dma_unmap_page+0x64/0x70) from [<c03519a4>] (omap2_mcspi_txrx_dma+0x2d8/0x4fc)
      [    2.121582] [<c03519a4>] (omap2_mcspi_txrx_dma+0x2d8/0x4fc) from [<c03524d8>] (omap2_mcspi_work.clone.4+0xf0/0x290)
      [    2.132537] [<c03524d8>] (omap2_mcspi_work.clone.4+0xf0/0x290) from [<c0352900>] (omap2_mcspi_transfer_one_message+0x288/0x438)
      [    2.144592] [<c0352900>] (omap2_mcspi_transfer_one_message+0x288/0x438) from [<c03503bc>] (spi_pump_messages+0x100/0x160)
      [    2.156127] [<c03503bc>] (spi_pump_messages+0x100/0x160) from [<c006635c>] (kthread_worker_fn+0xac/0x180)
      [    2.166168] [<c006635c>] (kthread_worker_fn+0xac/0x180) from [<c0066578>] (kthread+0x90/0x9c)
      [    2.175140] [<c0066578>] (kthread+0x90/0x9c) from [<c00157fc>] (kernel_thread_exit+0x0/0x8)
      [    2.183898] ---[ end trace d1830ce6e44292f2 ]---
      
      Fix the warn by changing the unmap parameter.
      Reported-by: NRussell King - ARM Linux <linux@arm.linux.org.uk>
      Signed-off-by: NShubhrajyoti D <shubhrajyoti@ti.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      a3ce9a80
  3. 18 6月, 2012 1 次提交
    • R
      SPI: fix over-eager devm_xxx() conversion · 10aa5a35
      Russell King 提交于
      1a77b127 (OMAP : SPI : use devm_* functions) converted the SPI
      device controller state to use devm_kzalloc().  Unfortunately, this
      is used against an unbound struct device, which results in the
      following when the device is bound to its driver:
      
      ------------[ cut here ]------------
      WARNING: at /home/rmk/git/linux-rmk/drivers/base/dd.c:257 driver_probe_device+0x78/0x21c()
      Modules linked in:
      Backtrace:
      [<c0017d0c>] (dump_backtrace+0x0/0x10c) from [<c033e208>] (dump_stack+0x18/0x1c) r7:00000000 r6:c01ff28c r5:c040050c r4:00000101
      [<c033e1f0>] (dump_stack+0x0/0x1c) from [<c00337ec>] (warn_slowpath_common+0x58/0x70)
      [<c0033794>] (warn_slowpath_common+0x0/0x70) from [<c0033828>] (warn_slowpath_null+0x24/0x2c)
      [<c0033804>] (warn_slowpath_null+0x0/0x2c) from [<c01ff28c>] (driver_probe_device+0x78/0x21c)
      [<c01ff214>] (driver_probe_device+0x0/0x21c) from [<c01ff49c>] (__driver_attach+0x6c/0x90)
      [<c01ff430>] (__driver_attach+0x0/0x90) from [<c01fda70>] (bus_for_each_dev+0x58/0x98)
      [<c01fda18>] (bus_for_each_dev+0x0/0x98) from [<c01ff0f4>] (driver_attach+0x20/0x28)
      [<c01ff0d4>] (driver_attach+0x0/0x28) from [<c01fe2f4>] (bus_add_driver+0xb4/0x230)
      [<c01fe240>] (bus_add_driver+0x0/0x230) from [<c01ffb24>] (driver_register+0xac/0x138)
      [<c01ffa78>] (driver_register+0x0/0x138) from [<c0215d4c>] (spi_register_driver+0x4c/0x60)
      [<c0215d00>] (spi_register_driver+0x0/0x60) from [<c045414c>] (ks8851_init+0x14/0x1c)
      [<c0454138>] (ks8851_init+0x0/0x1c) from [<c0008770>] (do_one_initcall+0x9c/0x164)
      [<c00086d4>] (do_one_initcall+0x0/0x164) from [<c0436410>] (kernel_init+0x128/0x210)
      [<c04362e8>] (kernel_init+0x0/0x210) from [<c0038754>] (do_exit+0x0/0x72c)
      ---[ end trace 4dcda79f5e89dd84 ]---
      ks8851 spi1.0: message enable is 0
      ks8851 spi1.0: eth0: revision 0, MAC 08:00:28:01:4d:c6, IRQ 194, has EEPROM
      
      Fix this by partially reverting the original commit.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      10aa5a35
  4. 20 5月, 2012 1 次提交
  5. 11 4月, 2012 3 次提交
  6. 19 3月, 2012 3 次提交
  7. 16 2月, 2012 1 次提交
  8. 29 10月, 2011 3 次提交
  9. 24 10月, 2011 1 次提交
  10. 11 6月, 2011 1 次提交
  11. 06 6月, 2011 1 次提交
  12. 04 6月, 2011 1 次提交
  13. 24 3月, 2011 1 次提交
  14. 05 3月, 2011 1 次提交
  15. 25 2月, 2011 1 次提交
  16. 18 2月, 2011 2 次提交
  17. 28 1月, 2011 1 次提交
  18. 08 1月, 2011 1 次提交
    • R
      spi/omap: Fix DMA API usage in OMAP MCSPI driver · 07fe0351
      Russell King - ARM Linux 提交于
      Running the latest kernel on the 4430SDP board with DMA API debugging
      enabled results in this:
      
      WARNING: at lib/dma-debug.c:803 check_unmap+0x19c/0x6f0()
      NULL NULL: DMA-API: device driver tries to free DMA memory it has not allocated
      [device address=0x000000008129901a] [size=260 bytes]
      Modules linked in:
      Backtrace:
      [<c003cbe0>] (dump_backtrace+0x0/0x10c) from [<c0278da8>] (dump_stack+0x18/0x1c)
       r7:c1839dc0 r6:c0198578 r5:c0304b17 r4:00000323
      [<c0278d90>] (dump_stack+0x0/0x1c) from [<c005b158>] (warn_slowpath_common+0x58/0x70)
      [<c005b100>] (warn_slowpath_common+0x0/0x70) from [<c005b214>] (warn_slowpath_fmt+0x38/0x40)
       r8:c1839e40 r7:00000000 r6:00000104 r5:00000000 r4:8129901a
      [<c005b1dc>] (warn_slowpath_fmt+0x0/0x40) from [<c0198578>] (check_unmap+0x19c/0x6f0)
       r3:c03110de r2:c0304e6b
      [<c01983dc>] (check_unmap+0x0/0x6f0) from [<c0198cd8>] (debug_dma_unmap_page+0x74/0x80)
      [<c0198c64>] (debug_dma_unmap_page+0x0/0x80) from [<c01d5ad8>] (omap2_mcspi_work+0x514/0xbf0)
      [<c01d55c4>] (omap2_mcspi_work+0x0/0xbf0) from [<c006dfb0>] (process_one_work+0x294/0x400)
      [<c006dd1c>] (process_one_work+0x0/0x400) from [<c006e50c>] (worker_thread+0x220/0x3f8)
      [<c006e2ec>] (worker_thread+0x0/0x3f8) from [<c00738d0>] (kthread+0x88/0x90)
      [<c0073848>] (kthread+0x0/0x90) from [<c005e924>] (do_exit+0x0/0x5fc)
       r7:00000013 r6:c005e924 r5:c0073848 r4:c1829ee0
      ---[ end trace 1b75b31a2719ed20 ]---
      
      I've no idea why this driver uses NULL for dma_unmap_single instead of
      the &spi->dev that is laying around just waiting to be used in that
      function - but it's an easy fix.
      
      Also replace this comment with a FIXME comment:
                      /* Do DMA mapping "early" for better error reporting and
                       * dcache use.  Note that if dma_unmap_single() ever starts
                       * to do real work on ARM, we'd need to clean up mappings
                       * for previous transfers on *ALL* exits of this loop...
                       */
      as the comment is not true - we do work in dma_unmap() functions,
      particularly on ARMv6 and above.  I've corrected the existing unmap
      functions but if any others are required they must be added ASAP.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      07fe0351
  19. 30 12月, 2010 1 次提交
    • G
      spi/omap2_mcspi.c: Force CS to be in inactive state after off-mode transition · 42ce7fd6
      Gregory CLEMENT 提交于
      When SPI wake up from OFF mode, CS is in the wrong state: force it to the
      inactive state.
      
      During the system life, I monitored the CS behavior using a oscilloscope.
      I also activated debug in omap2_mcspi, so I saw when driver disable the clocks
      and restore context when device is not used.Each time the CS was in the correct
      state.  It was only when system was put suspend to ram with off-mode activated
      that on resume the CS was in wrong state( ie activated).
      
      Changelog:
      * Change from v1 to v2:
        - Rebase on linus/master (after 2.6.37-rc1)
        - Do some clean-up and fix indentation on both patches
        - Add more explanations for patch 2
      
      * Change from v2 to v3:
        - Use directly resume function of spi_master instead of using function
        - from spi_device as Grant Likely pointed it out.
        - Force this transition explicitly for each CS used by a device.
      
      * Change from v3 to v4:
        - Patch clean-up according to Kevin Hilman and checkpatch.
        - Now force CS to be in inactive state only if it was inactive when it was
          suspended.
      
      * Change from v4 to v5:
        - Rebase on linus/master (after 2.6.37-rc3)
        - Collapse some lines as pointed by Grant Likely
        - Fix a spelling
      
      * Change from v5 to v6:
        - Rebase on linus/master (after 2.6.37-rc7)
        - Use CONFIG_SUSPEND instead of CONFIG_PM
        - Didn't use legacy PM methods anymore. Instead, add a struct dev_pm_ops and
          add the resume method there.
        - Fix multi-line comment style
      
      * Change from v6 to v7:
        - Rebase on linus/master (after 2.6.37-rc8)
        - Drop an extra line
      Signed-off-by: NGregory CLEMENT <gregory.clement@free-electrons.com>
      Acked-by: NDavid Brownell <dbrownell@users.sourceforge.net>
      Reviewed-by: NKevin Hilman <khilman@deeprootsystems.com>
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      42ce7fd6
  20. 21 10月, 2010 2 次提交
  21. 29 9月, 2010 1 次提交
  22. 25 5月, 2010 3 次提交
  23. 28 4月, 2010 2 次提交
  24. 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
  25. 11 3月, 2010 2 次提交
  26. 16 2月, 2010 1 次提交
  27. 21 10月, 2009 1 次提交
    • T
      omap: headers: Move remaining headers from include/mach to include/plat · ce491cf8
      Tony Lindgren 提交于
      Move the remaining headers under plat-omap/include/mach
      to plat-omap/include/plat. Also search and replace the
      files using these headers to include using the right path.
      
      This was done with:
      
      #!/bin/bash
      mach_dir_old="arch/arm/plat-omap/include/mach"
      plat_dir_new="arch/arm/plat-omap/include/plat"
      headers=$(cd $mach_dir_old && ls *.h)
      omap_dirs="arch/arm/*omap*/ \
      drivers/video/omap \
      sound/soc/omap"
      other_files="drivers/leds/leds-ams-delta.c \
      drivers/mfd/menelaus.c \
      drivers/mfd/twl4030-core.c \
      drivers/mtd/nand/ams-delta.c"
      
      for header in $headers; do
      	old="#include <mach\/$header"
      	new="#include <plat\/$header"
      	for dir in $omap_dirs; do
      		find $dir -type f -name \*.[chS] | \
      			xargs sed -i "s/$old/$new/"
      	done
      	find drivers/ -type f -name \*omap*.[chS] | \
      		xargs sed -i "s/$old/$new/"
      	for file in $other_files; do
      		sed -i "s/$old/$new/" $file
      	done
      done
      
      for header in $(ls $mach_dir_old/*.h); do
      	git mv $header $plat_dir_new/
      done
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      ce491cf8
  28. 23 9月, 2009 1 次提交