1. 01 10月, 2012 1 次提交
    • S
      spi: remove completely broken Tegra driver · 536a53a3
      Stephen Warren 提交于
      The current SPI driver has many issues. Examples are:
      
      * Segfaulting on most transfers due to expecting all transfers to have
        both RX and TX buffers.
      * Hanging on TX transfers since the whole driver flow is driven by RX
        DMA completion, but the HW is only told to enable RX for RX transfers.
      * Use of clk_disable_unprepare() from atomic context.
      * Once those and other minor issues are fixed, the driver still doesn't
        actually work.
      * The driver also implements a deprecated API to the SPI core.
      
      For this reason, simply remove the driver completely. This has two
      advantages:
      
      1) This will remove the last use of Tegra's <mach/dma.h>, which will
         allow that file to be removed, which is required for single zImage
         work.
      
      2) The downstream driver is significaly different from the current
         code. I believe a patch to re-add the downstream driver (with
         appropriate cleanup) will be much simpler to review if it's a new
         file rather than randomly interspered with essentially unrelated
         existing code.
      Signed-off-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      536a53a3
  2. 28 9月, 2012 3 次提交
  3. 25 9月, 2012 2 次提交
    • R
      spi/pl022: Devicetree support w/o platform data · 39a6ac11
      Roland Stigge 提交于
      Even with devicetree support, we needed platform data to provide some data,
      leading to mixed device tree and platform data. This patch makes it possible to
      provide all that information via device tree. Now, the data must be provided
      via platform data _or_ device tree completely.
      
      Only in case of DMA where a callback specification is necessary (dma_filter()),
      platform data is the only option.
      Signed-off-by: NRoland Stigge <stigge@antcom.de>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      39a6ac11
    • S
      spi/s3c64xx: Don't free controller_data on non-dt platforms · 5bee3b94
      Sylwester Nawrocki 提交于
      When s3c64xx-spi is instantiated from device tree an instance of
      struct s3c64xx_spi_csinfo is dynamically allocated in the driver.
      For non-dt platform it is passed from board code through
      spi_register_board_info(). On error path in s3c64xx_spi_setup()
      function there is an attempt to free this data struct
      s3c64xx_spi_csinfo object as it would have been allocated in the
      driver for both, dt and non-dt based platforms. This leads to
      following bug when gpio request fails:
      
      spi spi1.0: Failed to get /CS gpio [21]: -16
      kernel BUG at mm/slub.c:3478!
      Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
      Modules linked in:
      CPU: 0    Not tainted  (3.6.0-rc5-00092-g9b0b493-dirty #6111)
      PC is at kfree+0x148/0x158
      LR is at s3c64xx_spi_setup+0xac/0x290
      pc : [<c00a513c>]    lr : [<c0227014>]    psr: 40000013
      sp : ee043e10  ip : c032883c  fp : c0481f7c
      r10: ee0abd80  r9 : 00000063  r8 : 00000000
      r7 : ee129e78  r6 : ee104a00  r5 : fffffff0  r4 : c047bc64
      r3 : 40000400  r2 : c047bc64  r1 : c04def60  r0 : 0004047b
      Flags: nZcv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment kernel
      Control: 10c5387d  Table: 4000404a  DAC: 00000015
      Process swapper/0 (pid: 1, stack limit = 0xee0422f0)
      Stack: (0xee043e10 to 0xee044000)
      ...
      [<c00a513c>] (kfree+0x148/0x158) from [<c0227014>] (s3c64xx_spi_setup+0xac/0x290)
      [<c0227014>] (s3c64xx_spi_setup+0xac/0x290) from [<c02251a4>] (spi_setup+0x34/0x4c)
      [<c02251a4>] (spi_setup+0x34/0x4c) from [<c02258d0>] (spi_add_device+0x98/0x128)
      [<c02258d0>] (spi_add_device+0x98/0x128) from [<c02259d4>] (spi_new_device+0x74/0xa8)
      [<c02259d4>] (spi_new_device+0x74/0xa8) from [<c0225a2c>] (spi_match_master_to_boardinfo+0x24/0x44)
      [<c0225a2c>] (spi_match_master_to_boardinfo+0x24/0x44) from [<c0225b40>] (spi_register_master+0xf4/0x2a8)
      [<c0225b40>] (spi_register_master+0xf4/0x2a8) from [<c043fe0c>] (s3c64xx_spi_probe+0x34c/0x42c)
      [<c043fe0c>] (s3c64xx_spi_probe+0x34c/0x42c) from [<c01fc198>] (platform_drv_probe+0x18/0x1c)
      
      There should be no attempt to kfree controller_data when it was
      externally provided through the board code. Fix this by freeing
      controller_data only when dev->of_node is not null.
      Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NKyungmin Park <kyungmin.park@samsung.com>
      Acked-by: NKukjin Kim <kgene.kim@samsung.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      5bee3b94
  4. 23 9月, 2012 1 次提交
  5. 21 9月, 2012 1 次提交
    • T
      ARM: OMAP1: Make plat/mux.h omap1 only · 70c494c3
      Tony Lindgren 提交于
      We are moving omap2+ to use the device tree based pinctrl-single.c
      and will be removing the old mux framework. This will remove the
      omap1 specific parts from plat-omap.
      Acked-by: NFelipe Balbi <balbi@ti.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: linux-usb@vger.kernel.org
      Cc: linux-pcmcia@lists.infradead.org
      Cc: spi-devel-general@lists.sourceforge.net
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      70c494c3
  6. 20 9月, 2012 1 次提交
    • P
      spi/pl022: adopt pinctrl support · 4f5e1b37
      Patrice Chotard 提交于
      Amend the PL022 pin controller to optionally take a pin control
      handle and set the state of the pins to "default" on boot and
      runtime resume, and to "sleep" at runtime suspend. This way we
      will dynamically save power on the SPI busses, for example some
      electronic designs may be able to ground the pins when unused
      instead of pull-up. Some pin controllers may want to set the
      pins as wake-up sources when sleeping.
      
      Effect on platforms using the PL022 driver:
      
      - If the platform does not use pin control - no semantic effect,
        the pinctrl stubs will kick in and resolve the situation.
      
      - Platforms using this driver and have pin control but no
        function defined for the PL022 need to either supply a
        "default" function in their map or enable pinctrl dummies
        so the driver is satisfied.
      
      - Platforms using this driver with hogs for setting up the PL022
        pin control - stop using hogs to take the pl022 pin control
        handle, let the driver handle this.
      
      I'be looked at some platforms that may be affected:
      
      - SPEAr: appears to define the proper functions in their device
        trees and not hogging them, so things should be smooth, the
        driver will simply start to take its pins.
      
      - Ux500: the proper function is defined and will be taken properly
        by the driver. New sleep states introduced by a separate patch to
        ux500 but no regression, since the default state is sufficient.
      
      - U300: old hog deleted as part of this patch.
      
      - LPC32xx: does not appear to be using pinctrl.
      
      - ARM Integrator IMPD1, RealView & Versatile: does not use pinctrl.
      Tested-by: NRoland Stigge <stigge@antcom.de>
      Signed-off-by: NPatrice Chotard <patrice.chotard@stericsson.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      4f5e1b37
  7. 19 9月, 2012 2 次提交
    • A
      ARM: samsung: move platform_data definitions · 436d42c6
      Arnd Bergmann 提交于
      Platform data for device drivers should be defined in
      include/linux/platform_data/*.h, not in the architecture
      and platform specific directories.
      
      This moves such data out of the samsung include directories
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Acked-by: NMauro Carvalho Chehab <mchehab@redhat.com>
      Cc: Kukjin Kim <kgene.kim@samsung.com>
      Cc: Kyungmin Park <kyungmin.park@samsung.com>
      Cc: Ben Dooks <ben-linux@fluff.org>
      Cc: Jeff Garzik <jgarzik@pobox.com>
      Cc: Guenter Roeck <linux@roeck-us.net>
      Cc: "Wolfram Sang (embedded platforms)" <w.sang@pengutronix.de>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: Bryan Wu <bryan.wu@canonical.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Sylwester Nawrocki <s.nawrocki@samsung.com>
      Cc: Chris Ball <cjb@laptop.org>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Felipe Balbi <balbi@ti.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Cc: Sangbeom Kim <sbkim73@samsung.com>
      Cc: Liam Girdwood <lrg@ti.com>
      Cc: linux-samsung-soc@vger.kernel.org
      436d42c6
    • A
      ARM: omap: move platform_data definitions · 2203747c
      Arnd Bergmann 提交于
      Platform data for device drivers should be defined in
      include/linux/platform_data/*.h, not in the architecture
      and platform specific directories.
      
      This moves such data out of the omap include directories
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Acked-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Acked-by: NTony Lindgren <tony@atomide.com>
      Cc: Kevin Hilman <khilman@ti.com>
      Cc: "Benoît Cousson" <b-cousson@ti.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Kyungmin Park <kyungmin.park@samsung.com>
      Cc: Ohad Ben-Cohen <ohad@wizery.com>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: Omar Ramirez Luna <omar.ramirez@ti.com>
      Cc: Tomi Valkeinen <tomi.valkeinen@ti.com>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Cc: Peter Ujfalusi <peter.ujfalusi@ti.com>
      Cc: Jarkko Nikula <jarkko.nikula@bitmer.com>
      Cc: Liam Girdwood <lrg@ti.com>
      Cc: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
      Cc: Jean Pihet <j-pihet@ti.com>
      Cc: J Keerthy <j-keerthy@ti.com>
      Cc: linux-omap@vger.kernel.org
      2203747c
  8. 17 9月, 2012 1 次提交
  9. 14 9月, 2012 4 次提交
  10. 13 9月, 2012 1 次提交
  11. 12 9月, 2012 1 次提交
  12. 07 9月, 2012 1 次提交
  13. 06 9月, 2012 10 次提交
  14. 01 9月, 2012 1 次提交
  15. 28 8月, 2012 7 次提交
    • G
      spi/mxs: Fix device remove function · 7d520d28
      Guenter Roeck 提交于
      The call sequence spi_alloc_master/spi_register_master/spi_unregister_master
      is complete; it reduces the device reference count to zero, which results in
      device memory being freed. The remove function accesses the freed memory after
      the call to spi_unregister_master(), _and_ it calls spi_master_put on the freed
      memory.
      
      Acquire a reference to the SPI master device and release it after cleanup is
      complete (with the existing spi_master_put) to solve the problem.
      
      Also, the device subsystem ensures that the remove function is only called once,
      and resets device driver data to NULL. Remove the unnecessaary calls to
      platform_set_drvdata().
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Reviewed-by: NMarek Vasut <marex@denx.de>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      7d520d28
    • G
      spi/s3c64xx: Drop extra calls to spi_master_get in suspend/remove functions · 9a2a5245
      Guenter Roeck 提交于
      Suspend and resume functions call spi_master_get() without matching
      spi_master_put(). The extra references are unnecessary and cause subsequent
      module unload attempts to fail. Drop the calls.
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Acked-by: NKukjin Kim <kgene.kim@samsung.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      9a2a5245
    • G
      spi/topcliff-pch: Fix device remove function · 63002e84
      Guenter Roeck 提交于
      The call sequence spi_alloc_master/spi_register_master/spi_unregister_master
      is complete; it reduces the device reference count to zero, which results in
      device memory being freed. An extra call to spi_master_put is unnecessary
      and results in an access to free memory. Drop it.
      
      Also, the device subsystem resets device driver data to NULL after the call to
      the remove function returns, so there is no need to do it here.
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      63002e84
    • G
      spi/tegra: Fix device remove function · c68025bf
      Guenter Roeck 提交于
      The call to spi_unregister_master() in the device remove function frees device
      memory, and with it any device local data. However, device local data is still
      accessed after the call to spi_unregister_master().
      
      Acquire a reference to the SPI master device and release it after cleanup is
      complete to solve the problem.
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      c68025bf
    • G
      spi/stmp: Fix device remove function · 154390dc
      Guenter Roeck 提交于
      The call sequence spi_alloc_master/spi_register_master/spi_unregister_master
      is complete; it reduces the device reference count to zero, which results in
      device memory being freed. The remove function accesses the freed memory after
      the call to spi_unregister_master(), _and_ it calls spi_master_put on the freed
      memory.
      
      Acquire a reference to the SPI master device and release it after cleanup is
      complete (with the existing spi_master_put) to solve the problem.
      
      Also, the device subsystem ensures that the remove function is only called once,
      and resets device driver data to NULL. Remove the respective check and drop the
      unnecessaary call to platform_set_drvdata().
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      154390dc
    • M
      mxs/spi: Fix misuse of init_completion · 41682e03
      Marek Vasut 提交于
      The init_completion() call does reinit not only the variable carrying
      the flag that the completion finished, but also initialized the
      waitqueue associated with the completion. On the contrary, the
      INIT_COMPLETION() call only reinits the flag.
      
      In case there was anything still stuck in the waitqueue, subsequent call
      to init_completion() would be able to create possible race condition. This
      patch uses the proper function and moves init_completion() into .probe() call
      of the driver, to be issued only once.
      
      Note that such scenario is impossible, since two threads can never enter the
      mxs_spi_txrx_dma(), since whole this section is protected by mutex in SPI core.
      This by no means allows this issue to exit though.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Chris Ball <cjb@laptop.org>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      41682e03
    • M
      mxs/spi: Restart the block after unsuccessful transfer · c895db0f
      Marek Vasut 提交于
      Restart the SSP block in case the SSP transfer failed in any way.
      The block hung in some cases otherwise.
      Signed-off-by: NMarek Vasut <marex@denx.de>
      Cc: Chris Ball <cjb@laptop.org>
      Cc: Shawn Guo <shawn.guo@linaro.org>
      Cc: Mark Brown <broonie@opensource.wolfsonmicro.com>
      Cc: Fabio Estevam <fabio.estevam@freescale.com>
      Signed-off-by: NMark Brown <broonie@opensource.wolfsonmicro.com>
      c895db0f
  16. 23 8月, 2012 3 次提交