18 May, 2015

4 commits

  • It's no longer a part of API but merely a local function.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • Just a minor refactoring, no functional changes.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The commit [c560a6797e3b: ALSA: core: Remove child proc file elements
    recursively] converted snd_card_proc_new() with the normal
    snd_info_*() call and removed snd_device chain for such info
    entries. However, it misses one point: the creation of the proc entry
    was managed by snd_device chain in the former code, and now it's also
    gone, which results in no proc files creation at all. Mea culpa.

    This patch makes snd_info_card_register() creating the all pending
    child proc entries in a shot. Also, since snd_card_register() might
    be called multiple times, this function is also changed to be callable
    multiple times.

    Along with the changes above, now the linked list of snd_info_entry is
    added at creation time instead of snd_info_register() for keeping eyes
    of pending info entries.

    Fixes: c560a6797e3b ('ALSA: core: Remove child proc file elements recursively')
    Reported-by: "Lu, Han"
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • snd_info_free_entry() releases the all children nodes as well, but due
    to the wrong timing of releasing the link, the children nodes may be
    disconnected but left unreleased. This patch fixes it by moving the
    link free at the right position. Also it eases list_for_each_entry()
    without _safe option in snd_info_disconnect() because it no longer
    frees the children nodes there.

    Fixes: c560a6797e3b ('ALSA: core: Remove child proc file elements recursively')
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

24 Apr, 2015

6 commits


23 Apr, 2015

2 commits

  • Currently, snd_info_init() just returns an error without releasing the
    previously assigned resources at error path. The assigned proc and
    info entries have to be released properly. This patch covers it.

    While we are at it, refactor the code a bit, too.

    Acked-by: Jaroslav Kysela
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • seq_file is _the_ standard interface for simple text proc files.
    Though, we still need to support the binary proc files and the text
    file write, and also we need to manage the device disconnection
    gracefully. Thus this patch just replaces the text file read code
    with seq_file while keeping the rest intact.

    snd_iprintf() helper function is now a macro to expand itself to
    seq_printf() to be compatible with the existing code. The seq_file
    object is stored to the unused entry->rbuffer->buffer pointer.

    When the output size is expected to be large (greater than PAGE_SIZE),
    the driver should set entry->size field beforehand. Then the given
    size will be preallocated and the multiple show calls can be avoided.

    Acked-by: Jaroslav Kysela
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

22 Aug, 2014

1 commit

  • snd_info_get_line() documents that its last parameter must be one
    less than the buffer size, but this API design guarantees that
    (literally) every caller gets it wrong.

    Just change this parameter to have its obvious meaning.

    Reported-by: Tommi Rantala
    Cc: # v2.2.26+
    Signed-off-by: Clemens Ladisch
    Signed-off-by: Takashi Iwai

    Clemens Ladisch
     

14 Feb, 2014

1 commit


10 Feb, 2014

1 commit

  • Replace the lengthy #if defined(XXX) || defined(XXX_MODULE) with the
    new IS_ENABLED() macro.

    The patch still doesn't cover all ifdefs. For example, the dependency
    on CONFIG_GAMEPORT is still open-coded because this also has an extra
    dependency on MODULE. Similarly, an open-coded ifdef in pcm_oss.c and
    some sequencer-related stuff are left untouched.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

04 May, 2013

1 commit

  • Pull sound updates from Takashi Iwai:
    "Mostly many small changes spread as seen in diffstat in sound/*
    directory by this update. A significant change in the subsystem level
    is the introduction of snd_soc_component, which will help more generic
    handling of SoC and off-SoC components.

    Also, snd_BUG_ON() macro is enabled unconditionally now due to its
    misuses, so people might hit kernel warnings (it's a good thing for
    us).

    - compress-offload: support for capture by Charles Keepax
    - HD-audio: codec delay support by Dylan Reid
    - HD-audio: improvements/fixes in generic parser: better headphone
    mic and headset mic support, jack_modes hint consolidation, proper
    beep attach/detachment, generalized power filter controls by David
    Henningsson, et al
    - HD-audio: Improved management of HDMI codec pins/converters
    - HD-audio: Better pin/DAC assignment for VIA codecs
    - HD-audio: Haswell HDMI workarounds
    - HD-audio: ALC268 codec support, a few new quirks for Chromebooks
    - USB: regression fixes: USB-MIDI autopm fix, the recent ISO latency
    fix by Clemens Ladisch
    - USB: support for DSD formats by Daniel Mack
    - USB: A few UAC2 device endian/cock fixes by Eldad Zack
    - USB: quirks for Emu 192kHz support, Novation Twitch DJ controller,
    Yamaha THRxx devices
    - HDSPM: updates for TCO controls by Adrian Knoth
    - ASoC: Add a snd_soc_component object type for generic handling of
    SoC and off-SoC components by Kuninori Morimoto,
    - dmaengine: a large set of cleanups and conversions by Lars-Peter
    Clausen
    - ASoC DAPM: performance optimizations from Ryo Tsutsui
    - ASoC DAPM: support for mixer control sharing by Stephen Warren
    - ASoC: multiplatform ARM cleanups from Arnd Bergmann
    - ASoC: new codec drivers for AK5385 and TAS5086 from Daniel Mack"

    * tag 'sound-3.10' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (315 commits)
    ALSA: usb-audio: caiaq: fix endianness bug in snd_usb_caiaq_maschine_dispatch
    ALSA: asihpi: add format support check in snd_card_asihpi_capture_formats
    ALSA: pcm_format_to_bits strong-typed conversion
    ALSA: compress: fix the states to check for allowing read
    ALSA: hda - Move Thinkpad X220 to use auto parser
    ALSA: USB: adjust for changed 3.8 USB API
    ALSA: usb - Avoid unnecessary sample rate changes on USB 2.0 clock sources
    sound: oss/dmabuf: use dma_map_single
    ALSA: ali5451: use mdelay instead of large udelay constants
    ALSA: hda - Add the support for ALC286 codec
    ALSA: usb-audio: USB quirk for Yamaha THR10C
    ALSA: usb-audio: USB quirk for Yamaha THR5A
    ALSA: usb-audio: USB quirk for Yamaha THR10
    ALSA: usb-audio: Fix autopm error during probing
    ALSA: snd-usb: try harder to find USB_DT_CS_ENDPOINT
    ALSA: sound kconfig typo
    ALSA: emu10k1: Fix dock firmware loading
    ASoC: ux500: forward declare msp_i2s_platform_data
    ASoC: davinci-mcasp: Add Support BCLK-to-LRCLK ratio for TDM modes
    ASoC: davinci-pcm, davinci-mcasp: Clean up active_serializers
    ...

    Linus Torvalds
     

02 May, 2013

2 commits

  • Supply a function (proc_remove()) to remove a proc entry (and any subtree
    rooted there) by proc_dir_entry pointer rather than by name and (optionally)
    root dir entry pointer. This allows us to eliminate all remaining pde->name
    accesses outside of procfs.

    Signed-off-by: David Howells
    Acked-by: Grant Likely
    cc: linux-acpi@vger.kernel.org
    cc: openipmi-developer@lists.sourceforge.net
    cc: devicetree-discuss@lists.ozlabs.org
    cc: linux-pci@vger.kernel.org
    cc: netdev@vger.kernel.org
    cc: netfilter-devel@vger.kernel.org
    cc: alsa-devel@alsa-project.org
    Signed-off-by: Al Viro

    David Howells
     
  • Supply accessor functions to set attributes in proc_dir_entry structs.

    The following are supplied: proc_set_size() and proc_set_user().

    Signed-off-by: David Howells
    Acked-by: Mauro Carvalho Chehab
    cc: linuxppc-dev@lists.ozlabs.org
    cc: linux-media@vger.kernel.org
    cc: netdev@vger.kernel.org
    cc: linux-wireless@vger.kernel.org
    cc: linux-pci@vger.kernel.org
    cc: netfilter-devel@vger.kernel.org
    cc: alsa-devel@alsa-project.org
    Signed-off-by: Al Viro

    David Howells
     

10 Apr, 2013

2 commits


13 Mar, 2013

2 commits


12 Mar, 2013

1 commit

  • script/kernel-doc reports the following type of warnings (when run in verbose
    mode):

    Warning(sound/core/init.c:152): No description found for return value of
    'snd_card_create'

    To fix that:
    - add missing descriptions of function return values
    - use "Return:" sections to describe those return values

    Along the way:
    - complete some descriptions
    - fix some typos

    Signed-off-by: Yacine Belkadi
    Signed-off-by: Takashi Iwai

    Yacine Belkadi
     

23 Feb, 2013

1 commit


04 Sep, 2012

1 commit

  • Remove the main ALSA version number from the kernel ALSA driver.
    The ALSA driver package release diverges from the upstream. This may
    confuse users to see the same ALSA version for many kernel releases
    and this version lost it's original purpose and connection.

    The "ioctl" APIs have own version numbers, so the user space may check
    for specific API changes only.

    Signed-off-by: Jaroslav Kysela

    Jaroslav Kysela
     

01 Nov, 2011

1 commit


24 Jul, 2011

1 commit


18 Nov, 2010

1 commit


13 Apr, 2010

3 commits


08 Apr, 2010

1 commit


30 Mar, 2010

1 commit

  • …it 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: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

10 Sep, 2009

1 commit

  • * topic/dummy:
    ALSA: dummy - Increase MAX_PCM_SUBSTREAMS to 128
    ALSA: dummy - Add debug proc file
    ALSA: Add const prefix to proc helper functions
    ALSA: Re-export snd_pcm_format_name() function
    ALSA: dummy - Fake buffer allocations
    ALSA: dummy - Fix the timer calculation in systimer mode
    ALSA: dummy - Add more description
    ALSA: dummy - Better jiffies handling
    ALSA: dummy - Support high-res timer mode

    Takashi Iwai
     

08 Sep, 2009

1 commit


06 Jul, 2009

1 commit


31 Mar, 2009

1 commit

  • Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
    as correctly noted at bug #12454. Someone can lookup entry with NULL
    ->owner, thus not pinning enything, and release it later resulting
    in module refcount underflow.

    We can keep ->owner and supply it at registration time like ->proc_fops
    and ->data.

    But this leaves ->owner as easy-manipulative field (just one C assignment)
    and somebody will forget to unpin previous/pin current module when
    switching ->owner. ->proc_fops is declared as "const" which should give
    some thoughts.

    ->read_proc/->write_proc were just fixed to not require ->owner for
    protection.

    rmmod'ed directories will be empty and return "." and ".." -- no harm.
    And directories with tricky enough readdir and lookup shouldn't be modular.
    We definitely don't want such modular code.

    Removing ->owner will also make PDE smaller.

    So, let's nuke it.

    Kudos to Jeff Layton for reminding about this, let's say, oversight.

    http://bugzilla.kernel.org/show_bug.cgi?id=12454

    Signed-off-by: Alexey Dobriyan

    Alexey Dobriyan
     

13 Nov, 2008

1 commit


13 Aug, 2008

1 commit


25 Jul, 2008

1 commit

  • On 32-bit architectures PAGE_ALIGN() truncates 64-bit values to the 32-bit
    boundary. For example:

    u64 val = PAGE_ALIGN(size);

    always returns a value < 4GB even if size is greater than 4GB.

    The problem resides in PAGE_MASK definition (from include/asm-x86/page.h for
    example):

    #define PAGE_SHIFT 12
    #define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
    #define PAGE_MASK (~(PAGE_SIZE-1))
    ...
    #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)

    The "~" is performed on a 32-bit value, so everything in "and" with
    PAGE_MASK greater than 4GB will be truncated to the 32-bit boundary.
    Using the ALIGN() macro seems to be the right way, because it uses
    typeof(addr) for the mask.

    Also move the PAGE_ALIGN() definitions out of include/asm-*/page.h in
    include/linux/mm.h.

    See also lkml discussion: http://lkml.org/lkml/2008/6/11/237

    [akpm@linux-foundation.org: fix drivers/media/video/uvc/uvc_queue.c]
    [akpm@linux-foundation.org: fix v850]
    [akpm@linux-foundation.org: fix powerpc]
    [akpm@linux-foundation.org: fix arm]
    [akpm@linux-foundation.org: fix mips]
    [akpm@linux-foundation.org: fix drivers/media/video/pvrusb2/pvrusb2-dvb.c]
    [akpm@linux-foundation.org: fix drivers/mtd/maps/uclinux.c]
    [akpm@linux-foundation.org: fix powerpc]
    Signed-off-by: Andrea Righi
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrea Righi