04 Feb, 2016

1 commit

  • We use the devm_snd_dmaengine_pcm_register() for platform,
    don't use devm_snd_soc_register_platform(), their close
    funtion is different. One will release the dma channel,
    but another one won't release channel.

    When system enter suspend mode, alsa library is in draining
    state, it will not resume alsa driver in system resume, just
    call close directly. But the alsa driver is in state
    SNDRV_PCM_STATE_SUSPENDED, which is not a running state, so
    the trigger stop is not called, and dmaengine_terminate_all()
    is not called, then dma resource is not released. Which cause
    that in the next playback the sdma driver will not be started.
    Then there is a lot of SAI underrun error.

    If we use the devm_snd_soc_register_platform() for platfrom
    driver, there will be no issue, because it will release dma
    channel, release dma resource. But we use the
    devm_snd_dmaengine_pcm_register() for platform driver. So this
    patch is to add dmaengine_terminate_all() in the
    snd_dmaengine_pcm_close() to fix this issue.

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit ff62968ea8c8b5414f3f049e61addcd4d2bec3b9)

    Shengjiu Wang
     

15 Jan, 2016

2 commits

  • cherry-pick below patch from imx_3.14.y
    ENGR00307835-2 ASoC: dmaengine: Add two function for dmaengine_pcm

    Add check_xrun and device_reset for dmaengine_pcm

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 405588f31e432e5c6634a0817e4d804ead87882b)

    Shengjiu Wang
     
  • There is occasion that dma callback come late after the substream is released.
    Then there will be kernel dump.

    [] (imx_pcm_dma_complete) from [] (sdma_handle_channel_loop.isra.25+0x48/0x54)
    [] (sdma_handle_channel_loop.isra.25) from [] (sdma_tasklet+0xa0/0x1d4)
    [] (sdma_tasklet) from [] (tasklet_action+0x64/0xf8)
    [] (tasklet_action) from [] (__do_softirq+0x104/0x218)
    [] (__do_softirq) from [] (irq_exit+0xa8/0xec)
    [] (irq_exit) from [] (handle_IRQ+0x3c/0x90)
    [] (handle_IRQ) from [] (gic_handle_irq+0x28/0x5c)
    [] (gic_handle_irq) from [] (__irq_svc+0x40/0x70)

    The reason is the sdma tasklet is async with audio substream release. ALSA
    think when terminate dma, the dma should be stopped and no callback be called.

    This patch is to add new api dma_sync_wait_tasklet(), which is called in
    snd_dmaengine_pcm_close(). It will make sure the callback not be called
    after this funtion. Tasklet_kill is to wait scheduled tasklet end.

    Tasklet_kill can't be added to terminate dma function, because terminate dma
    function may be called in interrupt, but tasklet_kill can't be called in
    interrupt context.

    Signed-off-by: Shengjiu Wang
    (cherry picked from commit 9815881b6acaa72a705e1fa3c26a852fc81bfce5)

    Shengjiu Wang
     

11 Aug, 2015

1 commit

  • commit 67756e3191c90e7c0b94b8b2fb63de255b6cd337 upstream.

    With the nonatomic PCM ops, the system may spew lockdep warnings like:

    =============================================
    [ INFO: possible recursive locking detected ]
    4.2.0-rc1-jeejaval3 #12 Not tainted
    ---------------------------------------------
    aplay/4029 is trying to acquire lock:
    (snd_pcm_link_rwsem){.+.+.+}, at: [] snd_pcm_stream_lock+0x43/0x60

    but task is already holding lock:
    (snd_pcm_link_rwsem){.+.+.+}, at: [] snd_pcm_action_nonatomic+0x29/0x80

    other info that might help us debug this:
    Possible unsafe locking scenario:

    CPU0
    ----
    lock(snd_pcm_link_rwsem);
    lock(snd_pcm_link_rwsem);

    Although this is false-positive as the rwsem is taken always as
    read-only for these code paths, it's certainly annoying to see this at
    any occasion. A simple fix is to use down_read_nested() in
    snd_pcm_stream_lock() that can be called inside another lock.

    Reported-by: Vinod Koul
    Reported-by: Jeeja Kp
    Tested-by: Jeeja Kp
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

22 Jul, 2015

1 commit

  • commit 60b93030b44a8c2cd015cebe5624fd7552ec67ec upstream.

    The pcm_class sysfs of each PCM substream gives only "none" since the
    recent code change to embed the struct device. Fix the code to point
    directly to the embedded device object properly.

    Fixes: ef46c7af93f9 ('ALSA: pcm: Embed struct device')
    Signed-off-by: Takashi Iwai
    Signed-off-by: Greg Kroah-Hartman

    Takashi Iwai
     

19 May, 2015

1 commit

  • Currently in snd_pcm_update_hw_ptr0 during interrupt,
    we consider there were double acknowledged interrupts when:
    1. HW reported pointer is smaller than expected, and
    2. Time from last update time (hdelta) is over half a buffer time.

    However, when HW reported pointer is only a few bytes smaller than
    expected, and when hdelta is just a little larger than half a buffer time
    (e.g. ping-pong buffer), it wrongly treats this IRQ as double acknowledged.

    The condition #2 uses jiffies, but jiffies is not high resolution
    since it is integer. We should consider jiffies inaccuracy.

    Signed-off-by: Koro Chen
    Signed-off-by: Takashi Iwai

    Koro Chen
     

16 Apr, 2015

1 commit

  • Pull sound updates from Takashi Iwai:
    "There have been major modernization with the standard bus: in ALSA
    sequencer core and HD-audio. Also, HD-audio receives the regmap
    support replacing the in-house cache register cache code. These
    changes shouldn't impact the existing behavior, but rather
    refactoring.

    In addition, HD-audio got the code split to a core library part and
    the "legacy" driver parts. This is a preliminary work for adapting
    the upcoming ASoC HD-audio driver, and the whole transition is still
    work in progress, likely finished in 4.1.

    Along with them, there are many updates in ASoC area as usual, too:
    lots of cleanups, Intel code shuffling, etc.

    Here are some highlights:

    ALSA core:
    - PCM: the audio timestamp / wallclock enhancement
    - PCM: fixes in DPCM management
    - Fixes / cleanups of user-space control element management
    - Sequencer: modernization using the standard bus

    HD-audio:
    - Modernization using the standard bus
    - Regmap support
    - Use standard runtime PM for codec power saving
    - Widget-path based power-saving for IDT, VIA and Realtek codecs
    - Reorganized sysfs entries for each codec object
    - More Dell headset support

    ASoC:
    - Move of jack registration to the card level
    - Lots of ASoC cleanups, mainly moving things from the CODEC level to
    the card level
    - Support for DAPM routes specified by both the machine driver and DT
    - Continuing improvements to rcar
    - pcm512x enhacements
    - Intel platforms updates
    - rt5670 updates / fixes
    - New platforms / devices: some non-DSP Qualcomm platforms, Google's
    Storm platform, Maxmim MAX98925 CODECs and the Ingenic JZ4780 SoC

    Misc:
    - ice1724: Improved ESI W192M support
    - emu10k1: Emu 1010 fixes/enhancement"

    * tag 'sound-4.1-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (411 commits)
    ALSA: hda - set GET bit when adding a vendor verb to the codec regmap
    ALSA: hda/realtek - Enable the ALC292 dock fixup on the Thinkpad T450
    ALSA: hda - Fix another race in runtime PM refcounting
    ALSA: hda - Expose codec type sysfs
    ALSA: ctl: fix to handle several elements added by one operation for userspace element
    ASoC: Intel: fix array_size.cocci warnings
    ASoC: n810: Automatically disconnect non-connected pins
    ASoC: n810: Consistently pass the card DAPM context to n810_ext_control()
    ASoC: davinci-evm: Use card DAPM context to access widgets
    ASoC: mop500_ab8500: Use card DAPM context to access widgets
    ASoC: wm1133-ev1: Use card DAPM context to access widgets
    ASoC: atmel: Improve machine driver compile test coverage
    ASoC: atmel: Add dependency to SND_SOC_I2C_AND_SPI where necessary
    ALSA: control: Fix a typo of SNDRV_CTL_ELEM_ACCESS_TLV_* with SNDRV_CTL_TLV_OP_*
    ALSA: usb-audio: Don't attempt to get Microsoft Lifecam Cinema sample rate
    ASoC: rnsd: fix build regression without CONFIG_OF
    ALSA: emu10k1: add toggles for E-mu 1010 optical ports
    ALSA: ctl: fill identical information to return value when adding userspace elements
    ALSA: ctl: fix a bug to return no identical information in info operation for userspace controls
    ALSA: ctl: confirm to return all identical information in 'activate' event
    ...

    Linus Torvalds
     

13 Apr, 2015

1 commit

  • An element instance can have several elements with the same feature.
    Some userspace applications can add such an element instance by add
    operation with the number of elements. Then, the element instance
    gets a memory object to keep states of these elements.

    But the element instance has just one memory object for the elements.
    This causes the same result to each read/write operations to the
    different elements.

    This commit fixes this bug by allocating enough memory objects to the
    element instance for each of elements.

    Signed-off-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Sakamoto
     

12 Apr, 2015

3 commits

  • The commit [39d118677baa: ALSA: ctl: evaluate macro instead of
    numerical value] replaced the numbers with constants, but one place
    was replaced wrongly with a different type. Fixed now.

    Fixes: 39d118677baa ('ALSA: ctl: evaluate macro instead of numerical value')
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • readv() and writev() should _not_ ignore all but the first ->iov_len,
    among other things. Really weird abuse of those syscalls - it
    expects a vector element per channel, with identical lengths (it
    actually assumes them to be identical - no checking is done).
    readv() and writev() are really bad match for that. Unfortunately,
    userland API is userland API and we can't do anything about them.

    Converted to ->read_iter/->write_iter. Please, _please_ don't do
    anything of that kind when designing new interfaces.

    Signed-off-by: Al Viro

    Al Viro
     
  • Al Viro
     

11 Apr, 2015

4 commits


10 Apr, 2015

1 commit


26 Mar, 2015

1 commit


16 Mar, 2015

1 commit


13 Mar, 2015

1 commit

  • In the commit [2225e79b9b03: 'ALSA: core: reduce stack usage related
    to snd_ctl_new()'], the id field of the newly added kctl is untouched,
    thus all attribute like name string remain empty. The fix is just to
    add the forgotten memcpy of the id field.

    Fixes: 2225e79b9b03 ('ALSA: core: reduce stack usage related to snd_ctl_new()')
    Reviewed-by: Takashi Sakamoto
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

12 Mar, 2015

2 commits


11 Mar, 2015

1 commit

  • When the sequencer driver is built in kernel, it may panic at boot
    because of the uninitialized snd_seq_bus_type. Initialize it properly
    via subsys_initcall() instead of module_init() to assure that the bus
    is registered beforehand.

    Reported-by: Fengguang Wu
    Fixes: 7c37ae5c625a ('ALSA: seq: Rewrite sequencer device binding with standard bus')
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

10 Mar, 2015

5 commits


06 Mar, 2015

1 commit


04 Mar, 2015

1 commit


03 Mar, 2015

1 commit


23 Feb, 2015

4 commits


21 Feb, 2015

6 commits