1. 29 10月, 2016 1 次提交
    • M
      ASoC: samsung: get access to DMA engine early to defer probe properly · 73f5dfc6
      Marek Szyprowski 提交于
      ASoC Samsung sub-drivers tried to get access to their DMA engine
      controllers as a last step in driver probe. If a DMA engine was not
      available yet, samsung_asoc_dma_platform_register() function ended in
      -EPROBE_DEFER, but the driver already registered its component to ASoC
      core. This patch moves samsung_asoc_dma_platform_register() call before
      registering any components, to the common place, where driver was gathering
      all needed resources.
      
      In case of Samsung Exynos i2s driver the issue was even worse. The driver
      managed already to register its secondary DAI platform device before
      even getting the DMA engine access. That together with -EPROBE_DEFER error
      code from samsung_i2s_probe() immediately triggered another round of
      deferred probe retry and in turn endless loop of driver probing.
      
      This patch fixes broken boot on Odroid XU3 and other Exynos5422-based
      boards.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Reviewed-by: NJavier Martinez Canillas <javier@osg.samsung.com>
      Reviewed-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      73f5dfc6
  2. 24 8月, 2016 1 次提交
  3. 08 8月, 2016 1 次提交
  4. 22 7月, 2016 2 次提交
  5. 30 5月, 2016 3 次提交
  6. 19 2月, 2016 1 次提交
    • C
      ASoC: samsung: Use IRQ safe spin lock calls · 316fa9e0
      Charles Keepax 提交于
      Lockdep warns of a potential lock inversion, i2s->lock is held numerous
      times whilst we are under the substream lock (snd_pcm_stream_lock). If
      we use the IRQ unsafe spin lock calls, you can also end up locking
      snd_pcm_stream_lock whilst under i2s->lock (if an IRQ happens whilst we
      are holding i2s->lock). This could result in deadlock.
      
      [   18.147001]        CPU0                    CPU1
      [   18.151509]        ----                    ----
      [   18.156022]   lock(&(&pri_dai->spinlock)->rlock);
      [   18.160701]                                local_irq_disable();
      [   18.166622]                                lock(&(&substream->self_group.lock)->rlock);
      [   18.174595]                                lock(&(&pri_dai->spinlock)->rlock);
      [   18.181806]   <Interrupt>
      [   18.184408]     lock(&(&substream->self_group.lock)->rlock);
      [   18.190045]
      [   18.190045]  *** DEADLOCK ***
      
      This patch changes to using the irq safe spinlock calls, to avoid this
      issue.
      
      Fixes: ce8bcdbb ("ASoC: samsung: i2s: Protect more registers with a spinlock")
      Signed-off-by: NCharles Keepax <ckeepax@opensource.wolfsonmicro.com>
      Tested-by: NAnand Moon <linux.amoon@gmail.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      Cc: stable@vger.kernel.org
      316fa9e0
  7. 21 11月, 2015 1 次提交
    • A
      ASoC: samsung: pass filter function as pointer · 9bdca822
      Arnd Bergmann 提交于
      As we are now passing the filter data as pointers to the drivers,
      we can take the final step and also pass the filter function the
      same way. I'm keeping this change separate, as there it's less
      obvious that this is a net win.
      
      Upsides of this are:
      
      - The ASoC drivers are completely independent from the DMA engine
        implementation, which simplifies the Kconfig logic and in theory
        allows the same sound drivers to be built in a kernel that supports
        different kinds of dmaengine drivers.
      
      - Consistency with other subsystems and drivers
      
      On the other hand, we have a few downsides:
      
      - The s3c24xx-dma driver now needs to be built-in for the ac97 platform
        device to be instantiated on s3c2440.
      
      - samsung_dmaengine_pcm_config cannot be marked 'const' any more
        because the filter function pointer needs to be set at runtime.
        This is safe as long we don't have multiple different DMA engines
        in thet same system at runtime, but is nonetheless ugly.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      9bdca822
  8. 19 11月, 2015 1 次提交
    • A
      ASoC: samsung: pass DMA channels as pointers · b9a1a743
      Arnd Bergmann 提交于
      ARM64 allmodconfig produces a bunch of warnings when building the
      samsung ASoC code:
      
      sound/soc/samsung/dmaengine.c: In function 'samsung_asoc_init_dma_data':
      sound/soc/samsung/dmaengine.c:53:32: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         playback_data->filter_data = (void *)playback->channel;
      sound/soc/samsung/dmaengine.c:60:31: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
         capture_data->filter_data = (void *)capture->channel;
      
      We could easily shut up the warning by adding an intermediate cast,
      but there is a bigger underlying problem: The use of IORESOURCE_DMA
      to pass data from platform code to device drivers is dubious to start
      with, as what we really want is a pointer that can be passed into
      a filter function.
      
      Note that on s3c64xx, the pl08x DMA data is already a pointer, but
      gets cast to resource_size_t so we can pass it as a resource, and it
      then gets converted back to a pointer. In contrast, the data we pass
      for s3c24xx is an index into a device specific table, and we artificially
      convert that into a pointer for the filter function.
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Reviewed-by: NKrzysztof Kozlowski <k.kozlowski@samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      b9a1a743
  9. 02 5月, 2015 1 次提交
  10. 15 1月, 2015 10 次提交
  11. 07 1月, 2015 1 次提交
  12. 13 12月, 2014 1 次提交
  13. 09 12月, 2014 1 次提交
    • S
      ASoC: samsung: i2s: Add missing assignment of variant_regs · 7e5d8706
      Sylwester Nawrocki 提交于
      Add assignment of the variant_regs field which is missing in commit
      a5a56871 ("ASoC: samsung: add support
      for exynos7 I2S controller"). Without this attempting to probe the
      secondary DAI fails with an error like:
      
      [    1.763026] Unable to handle kernel NULL pointer dereference at virtual address 0000000c
      [    1.780895] pgd = c0004000
      [    1.783606] [0000000c] *pgd=00000000
      [    1.838255] Internal error: Oops: 5 [#1] PREEMPT SMP ARM
      [    1.843514] Modules linked in:
      [    1.846558] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.18.0-rc1-00009-g5dcb01e-dirty #1521
      [    1.854887] task: ee00a800 ti: ee088000 task.ti: ee088000
      [    1.860284] PC is at i2s_txctrl+0x40/0x2d4
      [    1.864350] LR is at i2s_txctrl+0x28/0x2d4
      [    1.868428] pc : [<c036ffd4>]    lr : [<c036ffbc>]    psr: 60000153
      [    1.868428] sp : ee089dc0  ip : 00000000  fp : ee21f000
      [    1.879883] r10: 00000000  r9 : ee21fb00  r8 : c06406c4
      [    1.885091] r7 : ee21fb00  r6 : 00000000  r5 : f00f6000  r4 : ed943410
      [    1.891601] r3 : 0000016c  r2 : c0464550  r1 : c055cef8  r0 : ed943610
      [    1.898113] Flags: nZCv  IRQs on  FIQs off  Mode SVC_32  ISA ARM  Segment kernel
      [    1.905490] Control: 10c5387d  Table: 4000404a  DAC: 00000015
      [    1.911218] Process swapper/0 (pid: 1, stack limit = 0xee088240)
      [    1.917208] Stack: (0xee089dc0 to 0xee08a000)
      ...
      [    2.068431] [<c036ffd4>] (i2s_txctrl) from [<c03719fc>] (samsung_i2s_dai_probe+0xb8/0x450)
      [    2.076676] [<c03719fc>] (samsung_i2s_dai_probe) from [<c03607e0>] (snd_soc_register_card+0xd98/0x1348)
      [    2.086044] [<c03607e0>] (snd_soc_register_card) from [<c03726e4>] (odroidx2_audio_probe+0xa8/0x11c)
      [    2.095160] [<c03726e4>] (odroidx2_audio_probe) from [<c0249dd0>] (platform_drv_probe+0x48/0xa4)
      [    2.103922] [<c0249dd0>] (platform_drv_probe) from [<c0248988>] (driver_probe_device+0x10c/0x22c)
      [    2.112773] [<c0248988>] (driver_probe_device) from [<c0248b34>] (__driver_attach+0x8c/0x90)
      [    2.121192] [<c0248b34>] (__driver_attach) from [<c02471c8>] (bus_for_each_dev+0x54/0x88)
      [    2.129352] [<c02471c8>] (bus_for_each_dev) from [<c0248188>] (bus_add_driver+0xd4/0x1d0)
      [    2.137510] [<c0248188>] (bus_add_driver) from [<c024915c>] (driver_register+0x78/0xf4)
      [    2.145499] [<c024915c>] (driver_register) from [<c0008924>] (do_one_initcall+0x80/0x1b8)
      [    2.153670] [<c0008924>] (do_one_initcall) from [<c05b7d40>] (kernel_init_freeable+0xfc/0x1c8)
      [    2.162260] [<c05b7d40>] (kernel_init_freeable) from [<c04146c0>] (kernel_init+0x8/0xec)
      [    2.170330] [<c04146c0>] (kernel_init) from [<c000e7f8>] (ret_from_fork+0x14/0x3c)
      [    2.177873] Code: e5940000 e59f128c e59f228c e2800010 (e59c700c)
      Signed-off-by: NSylwester Nawrocki <s.nawrocki@samsung.com>
      Signed-off-by: NMark Brown <broonie@kernel.org>
      7e5d8706
  14. 08 12月, 2014 1 次提交
    • M
      ASoC: samsung: Fix non-DT use of I2S controller · 3f024980
      Mark Brown 提交于
      The changes in commit a5a56871 (ASoC: samsung: add support for exynos7
      I2S controller) introduce a new variant_regs structure in the driver data
      which is now mandatory for accessing registers. Unfortunately this is only
      hooked up for DT platforms so non-DT platforms like my primary development
      platform for audio are broken by this change and crash on boot.
      
      Since the only non-DT user of these device is s3c64xx fix this by making
      the standard samsung-i2s device be of type I2Sv3 and add a new I2Sv4 name
      to the platform data section, currently using the I2Sv5 information which
      should be about right.
      Signed-off-by: NMark Brown <broonie@kernel.org>
      3f024980
  15. 06 12月, 2014 1 次提交
  16. 22 11月, 2014 1 次提交
  17. 07 11月, 2014 2 次提交
  18. 20 10月, 2014 1 次提交
  19. 10 9月, 2014 1 次提交
  20. 15 7月, 2014 1 次提交
  21. 11 7月, 2014 1 次提交
  22. 05 7月, 2014 1 次提交
  23. 27 5月, 2014 1 次提交
  24. 23 5月, 2014 1 次提交
  25. 22 5月, 2014 1 次提交
  26. 21 5月, 2014 1 次提交
  27. 23 4月, 2014 1 次提交
    • T
      ASoC: samsung: Don't clear clock setting during i2s_startup · d66eac3e
      Tushar Behera 提交于
      In exiting kernel, if DAIFMT flags are set in dai_link and I2S is
      set to run in master mode, the I2S clocks are not getting configured
      resulting in no output.
      
      Existing code clears the current I2S clock settings during i2s_startup
      and requires that the clocks are reconfigured. It then assumes that
      sound-card driver would call snd_soc_dai_{set_sysclk/set_fmt} to
      configure the root clock.
      
      1. Since I2S clock settings remain fixed for a board, it would be better
      to set the clocks once during sound-card probe.
      
      2. Also if the DAIFMT flags are set in dai_link, snd_soc_dai_set_fmt is
      called during DAI probe.
      
      If both these conditions are true, then I2S clock remains unconfigured
      during audio playback. Fix this by removing the code to clear
      rclk_srcrate in i2s_startup. Instead, reset this during DAI probe.
      Signed-off-by: NTushar Behera <tushar.behera@linaro.org>
      Signed-off-by: NMark Brown <broonie@linaro.org>
      d66eac3e