29 Nov, 2017

1 commit

  • The commit 8428a8ebde2d ("ALSA: usb-audio: Fix potential zero-division
    at parsing FU") is utterly bogus and breaks the case with csize=1
    instead of fixing anything. Just take it back again.

    Reported-by: Jörg Otte
    Fixes: 8428a8ebde2d ("ALSA: usb-audio: Fix potential zero-division at parsing FU"
    Signed-off-by: Takashi Iwai
    Signed-off-by: Linus Torvalds

    Takashi Iwai
     

26 Nov, 2017

1 commit

  • Pull timer updates from Thomas Gleixner:

    - The final conversion of timer wheel timers to timer_setup().

    A few manual conversions and a large coccinelle assisted sweep and
    the removal of the old initialization mechanisms and the related
    code.

    - Remove the now unused VSYSCALL update code

    - Fix permissions of /proc/timer_list. I still need to get rid of that
    file completely

    - Rename a misnomed clocksource function and remove a stale declaration

    * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (27 commits)
    m68k/macboing: Fix missed timer callback assignment
    treewide: Remove TIMER_FUNC_TYPE and TIMER_DATA_TYPE casts
    timer: Remove redundant __setup_timer*() macros
    timer: Pass function down to initialization routines
    timer: Remove unused data arguments from macros
    timer: Switch callback prototype to take struct timer_list * argument
    timer: Pass timer_list pointer to callbacks unconditionally
    Coccinelle: Remove setup_timer.cocci
    timer: Remove setup_*timer() interface
    timer: Remove init_timer() interface
    treewide: setup_timer() -> timer_setup() (2 field)
    treewide: setup_timer() -> timer_setup()
    treewide: init_timer() -> setup_timer()
    treewide: Switch DEFINE_TIMER callbacks to struct timer_list *
    s390: cmm: Convert timers to use timer_setup()
    lightnvm: Convert timers to use timer_setup()
    drivers/net: cris: Convert timers to use timer_setup()
    drm/vc4: Convert timers to use timer_setup()
    block/laptop_mode: Convert timers to use timer_setup()
    net/atm/mpc: Avoid open-coded assignment of timer callback function
    ...

    Linus Torvalds
     

24 Nov, 2017

1 commit

  • Pull sound fixes from Takashi Iwai:
    "All commits found here are small fixes for regression or stable:

    - PCM timestamp behavior fix that could be seen as a regression

    - Remove spurious WARN_ON() from ALSA timer 32bit compat ioctl

    - HD-audio HDMI/DP channel mapping fix for 32bit archs

    - Fix the previous fix for HD-audio initialization code

    - More hardening USB-audio against malicious USB descriptors

    - HD-audio quirks/fixes (Realtek codec, AMD controller)

    - Missing help text for the recent Intel SST kconfig change"

    * tag 'sound-fix-4.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
    ALSA: hda: Add Raven PCI ID
    ALSA: hda/realtek - Fix ALC700 family no sound issue
    ALSA: hda - Fix yet remaining issue with vmaster 0dB initialization
    ALSA: usb-audio: Add sanity checks in v2 clock parsers
    ALSA: usb-audio: Fix potential zero-division at parsing FU
    ALSA: usb-audio: Fix potential out-of-bound access at parsing SU
    ALSA: usb-audio: Add sanity checks to FE parser
    ALSA: timer: Remove kernel warning at compat ioctl error paths
    ALSA: pcm: update tstamp only if audio_tstamp changed
    ALSA: hda/realtek: Add headset mic support for Intel NUC Skull Canyon
    ALSA: hda: Fix too short HDMI/DP chmap reporting
    ALSA: usb-audio: uac1: Invalidate ctl on interrupt
    ALSA: hda/realtek - Fix ALC275 no sound issue
    ASoC: Intel: Add help text for SND_SOC_INTEL_SST_TOPLEVEL

    Linus Torvalds
     

23 Nov, 2017

2 commits


22 Nov, 2017

6 commits

  • The previous fix for addressing the breakage in vmaster slave
    initialization, commit a91d66129fb9 ("ALSA: hda - Fix incorrect TLV
    callback check introduced during set_fs() removal"), introduced a new
    helper to process over each slave kctl. However, this helper passes
    only the original kctl, not the virtual slave kctl. As a result,
    HD-audio driver (which is the only user so far) couldn't initialize
    the slave correctly because it's trying to update the value directly
    with the original kctl, not with the mapped kctl.

    This patch fixes the situation again by passing both the mapped slaved
    and original slave kctls to the function. Luckily there is a single
    caller as of now, so changing the call signature is no big matter.

    Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=197959
    Fixes: a91d66129fb9 ("ALSA: hda - Fix incorrect TLV callback check introduced during set_fs() removal")
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • With all callbacks converted, and the timer callback prototype
    switched over, the TIMER_FUNC_TYPE cast is no longer needed,
    so remove it. Conversion was done with the following scripts:

    perl -pi -e 's|\(TIMER_FUNC_TYPE\)||g' \
    $(git grep TIMER_FUNC_TYPE | cut -d: -f1 | sort -u)

    perl -pi -e 's|\(TIMER_DATA_TYPE\)||g' \
    $(git grep TIMER_DATA_TYPE | cut -d: -f1 | sort -u)

    The now unused macros are also dropped from include/linux/timer.h.

    Signed-off-by: Kees Cook

    Kees Cook
     
  • The helper functions to parse and look for the clock source, selector
    and multiplier unit may return the descriptor with a too short length
    than required, while there is no sanity check in the caller side.
    Add some sanity checks in the parsers, at least, to guarantee the
    given descriptor size, for avoiding the potential crashes.

    Fixes: 79f920fbff56 ("ALSA: usb-audio: parse clock topology of UAC2 devices")
    Reported-by: Andrey Konovalov
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • parse_audio_feature_unit() contains a code dividing potentially with
    zero when a malformed FU descriptor is passed. Although there is
    already a sanity check, it checks only the value zero, hence it can
    still lead to a zero-division when a value 1 is passed there.

    Fix it by correcting the sanity check (and the error message
    thereof).

    Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0")
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • The usb-audio driver may trigger an out-of-bound access at parsing a
    malformed selector unit, as it checks the header length only after
    evaluating bNrInPins field, which can be already above the given
    length. Fix it by adding the length check beforehand.

    Fixes: 99fc86450c43 ("ALSA: usb-mixer: parse descriptors with structs")
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • When the usb-audio descriptor contains the malformed feature unit
    description with a too short length, the driver may access
    out-of-bounds. Add a sanity check of the header size at the beginning
    of parse_audio_feature_unit().

    Fixes: 23caaf19b11e ("ALSA: usb-mixer: Add support for Audio Class v2.0")
    Reported-by: Andrey Konovalov
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

21 Nov, 2017

2 commits

  • Some timer compat ioctls have NULL checks of timer instance with
    snd_BUG_ON() that bring up WARN_ON() when the debug option is set.
    Actually the condition can be met in the normal situation and it's
    confusing and bad to spew kernel warnings with stack trace there.
    Let's remove snd_BUG_ON() invocation and replace with the simple
    checks. Also, correct the error code to EBADFD to follow the native
    ioctl error handling.

    Reported-by: syzbot
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • commit 3179f6200188 ("ALSA: core: add .get_time_info") had a side effect
    of changing the behaviour of the PCM runtime tstamp. Prior to this
    change tstamp was not updated by snd_pcm_update_hw_ptr0() unless the
    hw_ptr had moved, after this change tstamp was always updated.

    For an application using alsa-lib, doing snd_pcm_readi() followed by
    snd_pcm_status() to estimate the age of the read samples by subtracting
    status->avail * [sample rate] from status->tstamp this change degraded
    the accuracy of the estimate on devices where the pcm hw does not
    provide a granular hw_ptr, e.g., devices using
    soc-generic-dmaengine-pcm.c and a dma-engine with residue_granularity
    DMA_RESIDUE_GRANULARITY_DESCRIPTOR. The accuracy of the estimate
    depended on the latency between the PCM hw completing a period and the
    driver called snd_pcm_period_elapsed() to notify ALSA core, typically
    determined by interrupt handling latency. After the change the accuracy
    of the estimate depended on the latency between the PCM hw completing a
    period and the application calling snd_pcm_status(), determined by the
    scheduling of the application process. The maximum error of the
    estimate is one period length in both cases, but the error average and
    variance is smaller when it depends on interrupt latency.

    Instead of always updating tstamp, update it only if audio_tstamp
    changed.

    Fixes: 3179f6200188 ("ALSA: core: add .get_time_info")
    Suggested-by: Pierre-Louis Bossart
    Signed-off-by: Henrik Eriksson
    Cc:
    Signed-off-by: Takashi Iwai

    Henrik Eriksson
     

20 Nov, 2017

1 commit


17 Nov, 2017

2 commits

  • We got a regression report about the HD-audio HDMI chmap, where some
    surround channels are reported as UNKNOWN. The git bisection pointed
    the culprit at the commit 9b3dc8aa3fb1 ("ALSA: hda - Register chmap
    obj as priv data instead of codec"). The story behind scene is like
    this:

    - While moving the code out of the legacy HDA to the HDA common place,
    the patch modifies the code to obtain the chmap array indirectly in
    a byte array, and it expands it to kctl value array.
    - At the latter operation, the size of the array is wrongly passed by
    sizeof() to the pointer.
    - It can be 4 on 32bit arch, thus too short for 6+ channels.
    (And that's the reason why it didn't hit other persons; it's 8 on
    64bit arch, thus it's usually enough.)

    The code was further changed meanwhile, but the problem persisted.
    Let's fix it by correctly evaluating the array size.

    Fixes: 9b3dc8aa3fb1 ("ALSA: hda - Register chmap obj as priv data instead of codec")
    Reported-by: VDR User
    Cc:
    Signed-off-by: Takashi Iwai

    Takashi Iwai
     
  • When an interrupt occurs, the value of at least one of the belonging
    controls should have changed. To make sure they get re-read from device
    on the next read, invalidate the cache. This was correctly implemented
    for uac2 already, but missing for uac1.

    Signed-off-by: Julian Scheel
    Signed-off-by: Takashi Iwai

    Julian Scheel
     

16 Nov, 2017

2 commits


15 Nov, 2017

2 commits

  • Symbol SND_SOC_INTEL_SST_TOPLEVEL is user selectable so add the
    help text for this symbol.

    Signed-off-by: Vinod Koul
    Signed-off-by: Mark Brown

    Vinod Koul
     
  • Pull sound updates from Takashi Iwai:
    "There are no big surprising changes in this cycle, yet not too boring,
    either. The biggest change from diffstat POV is the removal of the
    legacy OSS driver codes that have been already disabled for a long
    time. This will bring a few trivial merge conflicts.

    As new features in ASoC side, there are two things: a new AC97 bus
    implementation and AMD Stony platform support. Both include the
    relevant changes shared with other subsystems, e.g. AC97 MFD changes
    and DRM AMD changes.

    Some other highlighted topics are:

    - A bunch of USB-audio drivers got the hardening against the
    malicious device accesses with a new helper code for endpoint
    sanity check

    - Lots of cleanups for ASoC Intel platform code, including support
    for their open source audio firmware

    - Continued ASoC core componentization works

    - Support for scaling MCLK with sample rate in ASoC simple-card

    - Stabler PCM hot-unplug capability, especially for ASoC usages"

    * tag 'sound-4.15-rc1' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (302 commits)
    Documentation: sound: hd-audio: notes.rst
    ASoC: bcm2835: Support left/right justified and DSP modes
    ASoC: bcm2835: Enforce full symmetry
    ASoC: bcm2835: Support additional samplerates up to 384kHz
    ASoC: bcm2835: Add support for TDM modes
    ASoC: add mclk-fs support to audio graph card
    ASoC: add mclk-fs to audio graph card binding
    ASoC: rt5514: work around link error
    ASoC: rt5514: mark PM functions as __maybe_unused
    ASoC: rt5663: Check the JD status in the button pushing
    ASoC: amd: Modified DMA transfer Mechanism for Playback
    ASoC: rt5645: Wait for 400msec before concluding on value of RT5645_VENDOR_ID2
    ASoC: sun4i-codec: fixed 32bit audio capture support for H3/H2+
    ASoC: da7213: add support for DSP modes
    ASoC: sun8i-codec: Add a comment on the LRCK inversion
    ASoC: sun8i-codec: Set the BCLK divider
    ASoC: rt5663: Delay and retry reading rt5663 ID register
    ASoC: amd: use do_div rather than 64 bit division to fix 32 bit builds
    ASoC: cs42l56: Fix reset GPIO name in example DT binding
    ASoC: rt5514-spi: check irq status to schedule data copy in resume function
    ...

    Linus Torvalds
     

14 Nov, 2017

2 commits

  • Pull timer updates from Thomas Gleixner:
    "Yet another big pile of changes:

    - More year 2038 work from Arnd slowly reaching the point where we
    need to think about the syscalls themself.

    - A new timer function which allows to conditionally (re)arm a timer
    only when it's either not running or the new expiry time is sooner
    than the armed expiry time. This allows to use a single timer for
    multiple timeout requirements w/o caring about the first expiry
    time at the call site.

    - A new NMI safe accessor to clock real time for the printk timestamp
    work. Can be used by tracing, perf as well if required.

    - A large number of timer setup conversions from Kees which got
    collected here because either maintainers requested so or they
    simply got ignored. As Kees pointed out already there are a few
    trivial merge conflicts and some redundant commits which was
    unavoidable due to the size of this conversion effort.

    - Avoid a redundant iteration in the timer wheel softirq processing.

    - Provide a mechanism to treat RTC implementations depending on their
    hardware properties, i.e. don't inflict the write at the 0.5
    seconds boundary which originates from the PC CMOS RTC to all RTCs.
    No functional change as drivers need to be updated separately.

    - The usual small updates to core code clocksource drivers. Nothing
    really exciting"

    * 'timers-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (111 commits)
    timers: Add a function to start/reduce a timer
    pstore: Use ktime_get_real_fast_ns() instead of __getnstimeofday()
    timer: Prepare to change all DEFINE_TIMER() callbacks
    netfilter: ipvs: Convert timers to use timer_setup()
    scsi: qla2xxx: Convert timers to use timer_setup()
    block/aoe: discover_timer: Convert timers to use timer_setup()
    ide: Convert timers to use timer_setup()
    drbd: Convert timers to use timer_setup()
    mailbox: Convert timers to use timer_setup()
    crypto: Convert timers to use timer_setup()
    drivers/pcmcia: omap1: Fix error in automated timer conversion
    ARM: footbridge: Fix typo in timer conversion
    drivers/sgi-xp: Convert timers to use timer_setup()
    drivers/pcmcia: Convert timers to use timer_setup()
    drivers/memstick: Convert timers to use timer_setup()
    drivers/macintosh: Convert timers to use timer_setup()
    hwrng/xgene-rng: Convert timers to use timer_setup()
    auxdisplay: Convert timers to use timer_setup()
    sparc/led: Convert timers to use timer_setup()
    mips: ip22/32: Convert timers to use timer_setup()
    ...

    Linus Torvalds
     
  • Pull core locking updates from Ingo Molnar:
    "The main changes in this cycle are:

    - Another attempt at enabling cross-release lockdep dependency
    tracking (automatically part of CONFIG_PROVE_LOCKING=y), this time
    with better performance and fewer false positives. (Byungchul Park)

    - Introduce lockdep_assert_irqs_enabled()/disabled() and convert
    open-coded equivalents to lockdep variants. (Frederic Weisbecker)

    - Add down_read_killable() and use it in the VFS's iterate_dir()
    method. (Kirill Tkhai)

    - Convert remaining uses of ACCESS_ONCE() to
    READ_ONCE()/WRITE_ONCE(). Most of the conversion was Coccinelle
    driven. (Mark Rutland, Paul E. McKenney)

    - Get rid of lockless_dereference(), by strengthening Alpha atomics,
    strengthening READ_ONCE() with smp_read_barrier_depends() and thus
    being able to convert users of lockless_dereference() to
    READ_ONCE(). (Will Deacon)

    - Various micro-optimizations:

    - better PV qspinlocks (Waiman Long),
    - better x86 barriers (Michael S. Tsirkin)
    - better x86 refcounts (Kees Cook)

    - ... plus other fixes and enhancements. (Borislav Petkov, Juergen
    Gross, Miguel Bernal Marin)"

    * 'locking-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (70 commits)
    locking/x86: Use LOCK ADD for smp_mb() instead of MFENCE
    rcu: Use lockdep to assert IRQs are disabled/enabled
    netpoll: Use lockdep to assert IRQs are disabled/enabled
    timers/posix-cpu-timers: Use lockdep to assert IRQs are disabled/enabled
    sched/clock, sched/cputime: Use lockdep to assert IRQs are disabled/enabled
    irq_work: Use lockdep to assert IRQs are disabled/enabled
    irq/timings: Use lockdep to assert IRQs are disabled/enabled
    perf/core: Use lockdep to assert IRQs are disabled/enabled
    x86: Use lockdep to assert IRQs are disabled/enabled
    smp/core: Use lockdep to assert IRQs are disabled/enabled
    timers/hrtimer: Use lockdep to assert IRQs are disabled/enabled
    timers/nohz: Use lockdep to assert IRQs are disabled/enabled
    workqueue: Use lockdep to assert IRQs are disabled/enabled
    irq/softirqs: Use lockdep to assert IRQs are disabled/enabled
    locking/lockdep: Add IRQs disabled/enabled assertion APIs: lockdep_assert_irqs_enabled()/disabled()
    locking/pvqspinlock: Implement hybrid PV queued/unfair locks
    locking/rwlocks: Fix comments
    x86/paravirt: Set up the virt_spin_lock_key after static keys get initialized
    block, locking/lockdep: Assign a lock_class per gendisk used for wait_for_completion()
    workqueue: Remove now redundant lock acquisitions wrt. workqueue flushes
    ...

    Linus Torvalds
     

13 Nov, 2017

2 commits

  • …e/sound into for-linus

    ASoC: Updates for v4.15

    The biggest thing this release has been the conversion of the AC98 bus
    to the driver model, that's been a long time coming so thanks to Robert
    Jarzmik for his dedication there. Due to there being some AC97 MFD
    there's a few fairly large changes in input and the MFD layer, mainly to
    the wm97xx driver.

    There's also some drivers/drm changes to support the new AMD Stoney
    platform, these are shared with the DRM subsystem and should be being
    merged via both.

    Within the subsystem the overwhelming bulk of the changes is in the
    Intel drivers which continue to need lots of cleanups and fixes, this
    release they've also gained support for their open source firmware.
    There's also some large changs in the core as Morimoto-san continues to
    mirror operations into the component level in preparation for conversion
    of drivers to that.

    - The AC97 bus has finally caught up with the driver model thanks to
    some dedicated and persistent work from Robert Jarzmik.
    - Continued work from Morimoto-san on moving us towards being able to
    use components for everything.
    - Lots of cleanups for the Intel platform code, including support for
    their open source audio firmware.
    - Support for scaling MCLK with sample rate in simple-card.
    - Support for AMD Stoney platform.

    Takashi Iwai
     
  • Pull 4.15 updates to take over the previous urgent fixes.

    Signed-off-by: Takashi Iwai

    Takashi Iwai
     

11 Nov, 2017

16 commits