Skip to content

Commit

Permalink
origin
Browse files Browse the repository at this point in the history
GIT ea3a859

commit 6e4cac2
Author: Takashi Iwai <tiwai@suse.de>
Date:   Mon Apr 24 14:09:55 2017 +0200

    ASoC: intel: Fix PM and non-atomic crash in bytcr drivers
    
    The FE setups of Intel SST bytcr_rt5640 and bytcr_rt5651 drivers carry
    the ignore_suspend flag, and this prevents the suspend/resume working
    properly while the stream is running, since SST core code has the
    check of the running streams and returns -EBUSY.  Drop these
    superfluous flags for fixing the behavior.
    
    Also, the bytcr_rt5640 driver lacks of nonatomic flag in some FE
    definitions, which leads to the kernel Oops at suspend/resume like:
    
      BUG: scheduling while atomic: systemd-sleep/3144/0x00000003
      Call Trace:
       dump_stack+0x5c/0x7a
       __schedule_bug+0x55/0x70
       __schedule+0x63c/0x8c0
       schedule+0x3d/0x90
       schedule_timeout+0x16b/0x320
       ? del_timer_sync+0x50/0x50
       ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
       ? sst_wait_timeout+0xa9/0x170 [snd_intel_sst_core]
       ? remove_wait_queue+0x60/0x60
       ? sst_prepare_and_post_msg+0x275/0x960 [snd_intel_sst_core]
       ? sst_pause_stream+0x9b/0x110 [snd_intel_sst_core]
       ....
    
    This patch addresses these appropriately, too.
    
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
    Acked-by: Vinod Koul <vinod.koul@intel.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>
    Cc: <stable@vger.kernel.org> # v4.1+

commit 3d5e801
Author: Vineet Gupta <vgupta@synopsys.com>
Date:   Thu Apr 20 15:36:51 2017 -0700

    ARCv2: entry: save Accumulator register pair (r58:59) if present
    
    Accumulator is present in configs with FPU and/or DSP MPY (mpy > 6)
    
    Instead of doing this in pt_regs (and thus every kernel entry/exit),
    this could have been done in context switch (and for user task only) as
    currently kernel doesn't clobber these registers for its own accord.
    However we will soon start using 64-bit multiply instructions for kernel
    which can clobber these. Also gcc folks also plan to start using these
    as GPRs, hence better to always save/restore them
    
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

commit 6492f09
Author: Noam Camus <noamca@mellanox.com>
Date:   Tue Apr 4 11:00:41 2017 +0300

    ARC: [plat-eznps] Fix build error
    
    Make ATOMIC_INIT available for all ARC platforms (including plat-eznps)
    
    Cc: <stable@vger.kernel.org>    # 4.9+
    Signed-off-by: Noam Camus <noamca@mellanox.com>
    Signed-off-by: Vineet Gupta <vgupta@synopsys.com>

commit dfb00a5
Author: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Date:   Fri Apr 14 12:43:01 2017 +0900

    ALSA: firewire-lib: fix inappropriate assignment between signed/unsigned type
    
    An abstraction of asynchronous transaction for transmission of MIDI
    messages was introduced in Linux v4.4. Each driver can utilize this
    abstraction to transfer MIDI messages via fixed-length payload of
    transaction to a certain unit address. Filling payload of the transaction
    is done by callback. In this callback, each driver can return negative
    error code, however current implementation assigns the return value to
    unsigned variable.
    
    This commit changes type of the variable to fix the bug.
    
    Reported-by: Julia Lawall <Julia.Lawall@lip6.fr>
    Cc: <stable@vger.kernel.org> # 4.4+
    Fixes: 585d7cb ("ALSA: firewire-lib: add helper functions for asynchronous transactions to transfer MIDI messages")
    Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>

commit e7661a8
Author: Johannes Thumshirn <jthumshirn@suse.de>
Date:   Wed Apr 12 09:21:19 2017 +0200

    scsi: return correct blkprep status code in case scsi_init_io() fails.
    
    When instrumenting the SCSI layer to run into the
    !blk_rq_nr_phys_segments(rq) case the following warning emitted from the
    block layer:
    
    blk_peek_request: bad return=-22
    
    This happens because since commit fd3fc0b ("scsi: don't BUG_ON()
    empty DMA transfers") we return the wrong error value from
    scsi_prep_fn() back to the block layer.
    
    [mkp: silenced checkpatch]
    
    Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
    Fixes: fd3fc0b scsi: don't BUG_ON() empty DMA transfers
    Cc: <stable@vger.kernel.org>
    Reviewed-by: Christoph Hellwig <hch@lst.de>
    Reviewed-by: Hannes Reinecke <hare@suse.com>
    Reviewed-by: Bart Van Assche <bart.vanassche@sandisk.com>
    Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>

commit 4e7655f
Author: Takashi Iwai <tiwai@suse.de>
Date:   Sun Apr 9 10:41:27 2017 +0200

    ALSA: seq: Don't break snd_use_lock_sync() loop by timeout
    
    The snd_use_lock_sync() (thus its implementation
    snd_use_lock_sync_helper()) has the 5 seconds timeout to break out of
    the sync loop.  It was introduced from the beginning, just to be
    "safer", in terms of avoiding the stupid bugs.
    
    However, as Ben Hutchings suggested, this timeout rather introduces a
    potential leak or use-after-free that was apparently fixed by the
    commit 2d7d540 ("ALSA: seq: Fix race during FIFO resize"):
    for example, snd_seq_fifo_event_in() -> snd_seq_event_dup() ->
    copy_from_user() could block for a long time, and snd_use_lock_sync()
    goes timeout and still leaves the cell at releasing the pool.
    
    For fixing such a problem, we remove the break by the timeout while
    still keeping the warning.
    
    Suggested-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
    Cc: <stable@vger.kernel.org>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>

commit edb0b6a
Author: Mathias Kresin <dev@kresin.me>
Date:   Sun Mar 26 19:05:36 2017 +0200

    MIPS: PCI: add controllers before the specified head
    
    With commit 23dac14 ("MIPS: PCI: Use struct list_head lists") new
    controllers are added after the specified head where they where added
    before the specified head previously.
    
    Use list_add_tail to restore the former order.
    
    This patches fixes the following PCI error on lantiq:
    
      pci 0000:01:00.0: BAR 0: error updating (0x1c000004 != 0x000000)
    
    Fixes: 23dac14 ("MIPS: PCI: Use struct list_head lists")
    Signed-off-by: Mathias Kresin <dev@kresin.me>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/15808/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit 162b270
Author: James Hogan <james.hogan@imgtec.com>
Date:   Thu Mar 30 16:06:02 2017 +0100

    MIPS: KGDB: Use kernel context for sleeping threads
    
    KGDB is a kernel debug stub and it can't be used to debug userland as it
    can only safely access kernel memory.
    
    On MIPS however KGDB has always got the register state of sleeping
    processes from the userland register context at the beginning of the
    kernel stack. This is meaningless for kernel threads (which never enter
    userland), and for user threads it prevents the user seeing what it is
    doing while in the kernel:
    
    (gdb) info threads
      Id   Target Id         Frame
      ...
      3    Thread 2 (kthreadd) 0x0000000000000000 in ?? ()
      2    Thread 1 (init)   0x000000007705c4b4 in ?? ()
      1    Thread -2 (shadowCPU0) 0xffffffff8012524c in arch_kgdb_breakpoint () at arch/mips/kernel/kgdb.c:201
    
    Get the register state instead from the (partial) kernel register
    context stored in the task's thread_struct for resume() to restore. All
    threads now correctly appear to be in context_switch():
    
    (gdb) info threads
      Id   Target Id         Frame
      ...
      3    Thread 2 (kthreadd) context_switch (rq=<optimized out>, cookie=..., next=<optimized out>, prev=0x0) at kernel/sched/core.c:2903
      2    Thread 1 (init)   context_switch (rq=<optimized out>, cookie=..., next=<optimized out>, prev=0x0) at kernel/sched/core.c:2903
      1    Thread -2 (shadowCPU0) 0xffffffff8012524c in arch_kgdb_breakpoint () at arch/mips/kernel/kgdb.c:201
    
    Call clobbered registers which aren't saved and exception registers
    (BadVAddr & Cause) which can't be easily determined without stack
    unwinding are reported as 0. The PC is taken from the return address,
    such that the state presented matches that found immediately after
    returning from resume().
    
    Fixes: 8854700 ("[MIPS] kgdb: add arch support for the kernel's kgdb core")
    Signed-off-by: James Hogan <james.hogan@imgtec.com>
    Cc: Jason Wessel <jason.wessel@windriver.com>
    Cc: linux-mips@linux-mips.org
    Cc: stable@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/15829/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit bac06cf
Author: Matt Redfearn <matt.redfearn@imgtec.com>
Date:   Fri Mar 31 11:51:08 2017 +0100

    MIPS: smp-cps: Fix potentially uninitialised value of core
    
    Turning on DEBUG in smp-cps.c, or compiling the kernel with
    CONFIG_DYNAMIC_DEBUG enabled results the build error:
    
    arch/mips/kernel/smp-cps.c: In function 'play_dead':
    ./include/linux/dynamic_debug.h:126:3: error: 'core' may be used
    uninitialized in this function [-Werror=maybe-uninitialized]
    
    Fix this by always initialising the variable.
    
    Fixes: 0d2808f ("MIPS: smp-cps: Add support for CPU hotplug of MIPSr6 processors")
    Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
    Cc: James Hogan <james.hogan@imgtec.com>
    Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
    Cc: Paul Burton <paul.burton@imgtec.com>
    Cc: Ingo Molnar <mingo@kernel.org>
    Cc: Andrew Morton <akpm@linux-foundation.org>
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/15848/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit ec62a3b
Author: Matt Redfearn <matt.redfearn@imgtec.com>
Date:   Fri Mar 31 11:51:33 2017 +0100

    MIPS: KASLR: Add missing header files
    
    After the split of linux/sched.h, KASLR stopped building.
    
    Fix this by including the correct header file for init_thread_union
    
    Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
    Cc: James Hogan <james.hogan@imgtec.com>
    Cc: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
    Cc: Steven J. Hill <Steven.Hill@cavium.com>
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/15849/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit c46f59e
Author: James Cowgill <James.Cowgill@imgtec.com>
Date:   Tue Apr 11 13:51:07 2017 +0100

    MIPS: Avoid BUG warning in arch_check_elf
    
    arch_check_elf contains a usage of current_cpu_data that will call
    smp_processor_id() with preemption enabled and therefore triggers a
    "BUG: using smp_processor_id() in preemptible" warning when an fpxx
    executable is loaded.
    
    As a follow-up to commit b244614 ("MIPS: Avoid a BUG warning during
    prctl(PR_SET_FP_MODE, ...)"), apply the same fix to arch_check_elf by
    using raw_current_cpu_data instead. The rationale quoted from the previous
    commit:
    
    "It is assumed throughout the kernel that if any CPU has an FPU, then
    all CPUs would have an FPU as well, so it is safe to perform the check
    with preemption enabled - change the code to use raw_ variant of the
    check to avoid the warning."
    
    Fixes: 46490b5 ("MIPS: kernel: elf: Improve the overall ABI and FPU mode checks")
    Signed-off-by: James Cowgill <James.Cowgill@imgtec.com>
    CC: <stable@vger.kernel.org> # 4.0+
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/15951/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit e021132
Author: James Cowgill <James.Cowgill@imgtec.com>
Date:   Tue Apr 11 13:51:08 2017 +0100

    MIPS: Fix modversioning of _mcount symbol
    
    In commit 827456e ("MIPS: Export _mcount alongside its definition")
    the EXPORT_SYMBOL macro exporting _mcount was moved from C code into
    assembly. Unlike C, exported assembly symbols need to have a function
    prototype in asm/asm-prototypes.h for modversions to work properly.
    Without this, modpost prints out this warning:
    
         WARNING: EXPORT symbol "_mcount" [vmlinux] version generation failed,
         symbol will not be versioned.
    
    Fix by including asm/ftrace.h (where _mcount is declared) in
    asm/asm-prototypes.h.
    
    Fixes: 827456e ("MIPS: Export _mcount alongside its definition")
    Signed-off-by: James Cowgill <James.Cowgill@imgtec.com>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/15952/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit b6e38b2
Author: Mousumi Jana <mousumix.jana@intel.com>
Date:   Tue Apr 11 13:06:22 2017 +0530

    ASoC: topology: Fix to store enum text values
    
    Add missing enum texts store in soc_enum.
    
    Signed-off-by: Mousumi Jana <mousumix.jana@intel.com>
    Signed-off-by: Pardha Saradhi K <pardha.saradhi.kesapragada@intel.com>
    Signed-off-by: Kranthikumar, GudishaX <gudishax.kranthikumar@intel.com>
    Signed-off-by: Subhransu S. Prusty <subhransu.s.prusty@intel.com>
    Acked-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>

commit 337b775
Author: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
Date:   Mon Mar 13 15:57:14 2017 +0100

    MIPS: generic: fix out-of-tree defconfig target builds
    
    When specifying a generic defconfig target with O=... option set, make
    is invoked in the output location before a target makefile wrapper is
    created. Ensure that the correct makefile is used by specifying the
    kernel source makefile during make invocation.
    
    This fixes the either of the following errors:
    
    $ make sead3_defoncifg ARCH=mips O=test
    make[1]: Entering directory '/mnt/ssd/MIPS/linux-next/test'
    make[2]: *** No rule to make target '32r2el_defconfig'.  Stop.
    arch/mips/Makefile:506: recipe for target 'sead3_defconfig' failed
    make[1]: *** [sead3_defconfig] Error 2
    make[1]: Leaving directory '/mnt/ssd/MIPS/linux-next/test'
    Makefile:152: recipe for target 'sub-make' failed
    make: *** [sub-make] Error 2
    
    $ make 32r2el_defconfig ARCH=mips O=test
    make[1]: Entering directory '/mnt/ssd/MIPS/linux-next/test'
    Using ../arch/mips/configs/generic_defconfig as base
    Merging ../arch/mips/configs/generic/32r2.config
    Merging ../arch/mips/configs/generic/el.config
    Merging ../arch/mips/configs/generic/board-sead-3.config
    !
    ! merged configuration written to .config (needs make)
    !
    make[2]: *** No rule to make target 'olddefconfig'.  Stop.
    arch/mips/Makefile:489: recipe for target '32r2el_defconfig' failed
    make[1]: *** [32r2el_defconfig] Error 2
    make[1]: Leaving directory '/mnt/ssd/MIPS/linux-next/test'
    Makefile:152: recipe for target 'sub-make' failed
    make: *** [sub-make] Error 2
    
    Fixes: eed0eab ('MIPS: generic: Introduce generic DT-based board support')
    Fixes: 3f5f0a4 ('MIPS: generic: Convert SEAD-3 to a generic board')
    Signed-off-by: Marcin Nowakowski <marcin.nowakowski@imgtec.com>
    Cc: Paul Burton <paul.burton@imgtec.com>
    Cc: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/15464/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit 9d7f29c
Author: James Hogan <james.hogan@imgtec.com>
Date:   Wed Apr 5 16:32:45 2017 +0100

    MIPS: cevt-r4k: Fix out-of-bounds array access
    
    calculate_min_delta() may incorrectly access a 4th element of buf2[]
    which only has 3 elements. This may trigger undefined behaviour and has
    been reported to cause strange crashes in start_kernel() sometime after
    timer initialization when built with GCC 5.3, possibly due to
    register/stack corruption:
    
    sched_clock: 32 bits at 200MHz, resolution 5ns, wraps every 10737418237ns
    CPU 0 Unable to handle kernel paging request at virtual address ffffb0aa, epc == 8067daa8, ra == 8067da84
    Oops[#1]:
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.18 torvalds#51
    task: 8065e3e0 task.stack: 80644000
    $ 0   : 00000000 00000001 00000000 00000000
    $ 4   : 8065b4d0 00000000 805d0000 00000010
    $ 8   : 00000010 80321400 fffff000 812de408
    $12   : 00000000 00000000 00000000 ffffffff
    $16   : 00000002 ffffffff 80660000 806a666c
    $20   : 806c0000 00000000 00000000 00000000
    $24   : 00000000 00000010
    $28   : 80644000 80645ed0 00000000 8067da84
    Hi    : 00000000
    Lo    : 00000000
    epc   : 8067daa8 start_kernel+0x33c/0x500
    ra    : 8067da84 start_kernel+0x318/0x500
    Status: 11000402 KERNEL EXL
    Cause : 4080040c (ExcCode 03)
    BadVA : ffffb0aa
    PrId  : 0501992c (MIPS 1004Kc)
    Modules linked in:
    Process swapper/0 (pid: 0, threadinfo=80644000, task=8065e3e0, tls=00000000)
    Call Trace:
    [<8067daa8>] start_kernel+0x33c/0x500
    Code: 24050240  0c0131f9  24849c64 <a200b0a8> 41606020  000000c0  0c1a45e6 00000000  0c1a5f44
    
    UBSAN also detects the same issue:
    
    ================================================================
    UBSAN: Undefined behaviour in arch/mips/kernel/cevt-r4k.c:85:41
    load of address 80647e4c with insufficient space
    for an object of type 'unsigned int'
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.18 torvalds#47
    Call Trace:
    [<80028f70>] show_stack+0x88/0xa4
    [<80312654>] dump_stack+0x84/0xc0
    [<8034163c>] ubsan_epilogue+0x14/0x50
    [<803417d8>] __ubsan_handle_type_mismatch+0x160/0x168
    [<8002dab0>] r4k_clockevent_init+0x544/0x764
    [<80684d34>] time_init+0x18/0x90
    [<8067fa5c>] start_kernel+0x2f0/0x500
    =================================================================
    
    buf2[] is intentionally only 3 elements so that the last element is the
    median once 5 samples have been inserted, so explicitly prevent the
    possibility of comparing against the 4th element rather than extending
    the array.
    
    Fixes: 1fa4055 ("MIPS: cevt-r4k: Dynamically calculate min_delta_ns")
    Reported-by: Rabin Vincent <rabinv@axis.com>
    Signed-off-by: James Hogan <james.hogan@imgtec.com>
    Tested-by: Rabin Vincent <rabinv@axis.com>
    Cc: linux-mips@linux-mips.org
    Cc: <stable@vger.kernel.org> # 4.7.x-
    Patchwork: https://patchwork.linux-mips.org/patch/15892/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit f2b4286
Author: Rabin Vincent <rabinv@axis.com>
Date:   Wed Apr 5 15:14:08 2017 +0200

    MIPS: perf: fix deadlock
    
    mipsxx_pmu_handle_shared_irq() calls irq_work_run() while holding the
    pmuint_rwlock for read.  irq_work_run() can, via perf_pending_event(),
    call try_to_wake_up() which can try to take rq->lock.
    
    However, perf can also call perf_pmu_enable() (and thus take the
    pmuint_rwlock for write) while holding the rq->lock, from
    finish_task_switch() via perf_event_context_sched_in().
    
    This leads to an ABBA deadlock:
    
     PID: 3855   TASK: 8f7ce288  CPU: 2   COMMAND: "process"
      #0 [89c39ac8] __delay at 803b5be4
      #1 [89c39ac8] do_raw_spin_lock at 8008fdcc
      #2 [89c39af8] try_to_wake_up at 8006e47c
      #3 [89c39b38] pollwake at 8018eab0
      #4 [89c39b68] __wake_up_common at 800879f4
      #5 [89c39b98] __wake_up at 800880e4
      torvalds#6 [89c39bc8] perf_event_wakeup at 8012109c
      torvalds#7 [89c39be8] perf_pending_event at 80121184
      torvalds#8 [89c39c08] irq_work_run_list at 801151f0
      torvalds#9 [89c39c38] irq_work_run at 80115274
     torvalds#10 [89c39c50] mipsxx_pmu_handle_shared_irq at 8002cc7c
    
     PID: 1481   TASK: 8eaac6a8  CPU: 3   COMMAND: "process"
      #0 [8de7f900] do_raw_write_lock at 800900e0
      #1 [8de7f918] perf_event_context_sched_in at 80122310
      #2 [8de7f938] __perf_event_task_sched_in at 80122608
      #3 [8de7f958] finish_task_switch at 8006b8a4
      #4 [8de7f998] __schedule at 805e4dc4
      #5 [8de7f9f8] schedule at 805e5558
      torvalds#6 [8de7fa10] schedule_hrtimeout_range_clock at 805e9984
      torvalds#7 [8de7fa70] poll_schedule_timeout at 8018e8f8
      torvalds#8 [8de7fa88] do_select at 8018f338
      torvalds#9 [8de7fd88] core_sys_select at 8018f5cc
     torvalds#10 [8de7fee0] sys_select at 8018f854
     torvalds#11 [8de7ff28] syscall_common at 80028fc8
    
    The lock seems to be there to protect the hardware counters so there is
    no need to hold it across irq_work_run().
    
    Signed-off-by: Rabin Vincent <rabinv@axis.com>
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit 9eec1c0
Author: Matt Redfearn <matt.redfearn@imgtec.com>
Date:   Thu Apr 6 16:58:09 2017 +0100

    MIPS: Malta: Fix i8259 irqchip setup
    
    Since commit 4cfffcf ("irqchip/mips-gic: Fix local interrupts"),
    the gic driver has been allocating virq's for local interrupts during
    its initialisation. Unfortunately on Malta platforms, these are the
    first IRQs to be allocated and so are allocated virqs 1-3. The i8259
    driver uses a legacy irq domain which expects to map virqs 0-15. Probing
    of that driver therefore fails because some of those virqs are already
    taken, with the warning:
    
    WARNING: CPU: 0 PID: 0 at kernel/irq/irqdomain.c:344
    irq_domain_associate+0x1e8/0x228
    error: virq1 is already associated
    Modules linked in:
    CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.10.0-rc6-00011-g4cfffcfa5106 torvalds#368
    Stack : 00000000 00000000 807ae03a 0000004d 00000000 806c1010 0000000b ffff0a01
            80725467 807258f4 806a64a4 00000000 00000000 807a9acc 00000100 80713e68
            806d5598 8017593c 8072bf90 8072bf94 806ac358 00000000 806abb60 80713ce4
            00000100 801b22d4 806d5598 8017593c 807ae03a 00000000 80713ce4 80720000
            00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
            ...
    Call Trace:
    [<8010c480>] show_stack+0x88/0xa4
    [<80376758>] dump_stack+0x88/0xd0
    [<8012c4a8>] __warn+0x104/0x118
    [<8012c4ec>] warn_slowpath_fmt+0x30/0x3c
    [<8017edfc>] irq_domain_associate+0x1e8/0x228
    [<8017efd0>] irq_domain_add_legacy+0x7c/0xb0
    [<80764c50>] __init_i8259_irqs+0x64/0xa0
    [<80764ca4>] i8259_of_init+0x18/0x74
    [<8076ddc0>] of_irq_init+0x19c/0x310
    [<80752dd8>] arch_init_irq+0x28/0x19c
    [<80750a08>] start_kernel+0x2a8/0x434
    
    Fix this by reserving the required i8259 virqs in malta platform code
    before probing any irq chips.
    
    Fixes: 4cfffcf ("irqchip/mips-gic: Fix local interrupts")
    Signed-off-by: Matt Redfearn <matt.redfearn@imgtec.com>
    Cc: James Hogan <james.hogan@imgtec.com>
    Cc: Paul Burton <paul.burton@imgtec.com>
    Cc: linux-mips@linux-mips.org
    Cc: linux-kernel@vger.kernel.org
    Patchwork: https://patchwork.linux-mips.org/patch/15919/
    Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

commit d05d862
Author: Arnaud Pouliquen <arnaud.pouliquen@st.com>
Date:   Tue Mar 28 15:04:55 2017 +0200

    ASoC: STI: Fix null ptr deference in IRQ handler
    
    With RTlinux a race condition has been found that leads to NULL ptr crash:
    - On CPU 0: uni_player_irq_handler is called to treat XRUN
     "(player->state == UNIPERIF_STATE_STOPPED)" is FALSE so status is checked,
     dev_err(player->dev, "FIFO underflow error detected") is printed
    and then snd_pcm_stream_lock should be called to lock stream for stopping.
    - On CPU 1: application stop and close the stream.
    Issue is that the stop and shutdown functions are executed while
    "FIFO underflow error detected" is printed.
    So when CPU 0 calls snd_pcm_stream_lock, player->substream is already null.
    
    Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@st.com>
    Signed-off-by: Mark Brown <broonie@kernel.org>

commit 3d016d5
Author: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Date:   Mon Apr 3 21:13:40 2017 +0900

    ALSA: oxfw: fix regression to handle Stanton SCS.1m/1d
    
    At a commit 6c29230 ("ALSA: oxfw: delayed registration of sound
    card"), ALSA oxfw driver fails to handle SCS.1m/1d, due to -EBUSY at a call
    of snd_card_register(). The cause is that the driver manages to register
    two rawmidi instances with the same device number 0. This is a regression
    introduced since kernel 4.7.
    
    This commit fixes the regression, by fixing up device property after
    discovering stream formats.
    
    Fixes: 6c29230 ("ALSA: oxfw: delayed registration of sound card")
    Cc: <stable@vger.kernel.org> # 4.7+
    Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
    Signed-off-by: Takashi Iwai <tiwai@suse.de>
  • Loading branch information
akpm00 authored and hnaz committed Apr 27, 2017
1 parent 5a7ad11 commit d3ec754
Show file tree
Hide file tree
Showing 25 changed files with 159 additions and 68 deletions.
8 changes: 8 additions & 0 deletions arch/arc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -406,6 +406,14 @@ config ARC_HAS_DIV_REM
bool "Insn: div, divu, rem, remu"
default y

config ARC_HAS_ACCL_REGS
bool "Reg Pair ACCL:ACCH (FPU and/or MPY > 6)"
default n
help
Depending on the configuration, CPU can contain accumulator reg-pair
(also referred to as r58:r59). These can also be used by gcc as GPR so
kernel needs to save/restore per process

endif # ISA_ARCV2

endmenu # "ARC CPU Configuration"
Expand Down
3 changes: 2 additions & 1 deletion arch/arc/include/asm/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@
#include <asm/barrier.h>
#include <asm/smp.h>

#define ATOMIC_INIT(i) { (i) }

#ifndef CONFIG_ARC_PLAT_EZNPS

#define atomic_read(v) READ_ONCE((v)->counter)
#define ATOMIC_INIT(i) { (i) }

#ifdef CONFIG_ARC_HAS_LLSC

Expand Down
10 changes: 10 additions & 0 deletions arch/arc/include/asm/entry-arcv2.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,11 @@
;
; Now manually save: r12, sp, fp, gp, r25

#ifdef CONFIG_ARC_HAS_ACCL_REGS
PUSH r59
PUSH r58
#endif

PUSH r30
PUSH r12

Expand Down Expand Up @@ -75,6 +80,11 @@
POP r12
POP r30

#ifdef CONFIG_ARC_HAS_ACCL_REGS
POP r58
POP r59
#endif

.endm

/*------------------------------------------------------------------------*/
Expand Down
4 changes: 4 additions & 0 deletions arch/arc/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ struct pt_regs {

unsigned long r12, r30;

#ifdef CONFIG_ARC_HAS_ACCL_REGS
unsigned long r58, r59; /* ACCL/ACCH used by FPU / DSP MPY */
#endif

/*------- Below list auto saved by h/w -----------*/
unsigned long r0, r1, r2, r3, r4, r5, r6, r7, r8, r9, r10, r11;

Expand Down
30 changes: 21 additions & 9 deletions arch/arc/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,8 @@ static char *arc_extn_mumbojumbo(int cpu_id, char *buf, int len)
static void arc_chk_core_config(void)
{
struct cpuinfo_arc *cpu = &cpuinfo_arc700[smp_processor_id()];
int fpu_enabled;
int saved = 0, present = 0;
char *opt_nm = NULL;;

if (!cpu->extn.timer0)
panic("Timer0 is not present!\n");
Expand All @@ -346,17 +347,28 @@ static void arc_chk_core_config(void)

/*
* FP hardware/software config sanity
* -If hardware contains DPFP, kernel needs to save/restore FPU state
* -If hardware present, kernel needs to save/restore FPU state
* -If not, it will crash trying to save/restore the non-existant regs
*
* (only DPDP checked since SP has no arch visible regs)
*/
fpu_enabled = IS_ENABLED(CONFIG_ARC_FPU_SAVE_RESTORE);

if (cpu->extn.fpu_dp && !fpu_enabled)
pr_warn("CONFIG_ARC_FPU_SAVE_RESTORE needed for working apps\n");
else if (!cpu->extn.fpu_dp && fpu_enabled)
panic("FPU non-existent, disable CONFIG_ARC_FPU_SAVE_RESTORE\n");
if (is_isa_arcompact()) {
opt_nm = "CONFIG_ARC_FPU_SAVE_RESTORE";
saved = IS_ENABLED(CONFIG_ARC_FPU_SAVE_RESTORE);

/* only DPDP checked since SP has no arch visible regs */
present = cpu->extn.fpu_dp;
} else {
opt_nm = "CONFIG_ARC_HAS_ACCL_REGS";
saved = IS_ENABLED(CONFIG_ARC_HAS_ACCL_REGS);

/* Accumulator Low:High pair (r58:59) present if DSP MPY or FPU */
present = cpu->extn_mpy.dsp | cpu->extn.fpu_sp | cpu->extn.fpu_dp;
}

if (present && !saved)
pr_warn("Enable %s for working apps\n", opt_nm);
else if (!present && saved)
panic("Disable %s, hardware NOT present\n", opt_nm);
}

/*
Expand Down
6 changes: 3 additions & 3 deletions arch/mips/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -489,7 +489,7 @@ $(generic_defconfigs):
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh \
-m -O $(objtree) $(srctree)/arch/$(ARCH)/configs/generic_defconfig $^ \
$(foreach board,$(BOARDS),$(generic_config_dir)/board-$(board).config)
$(Q)$(MAKE) olddefconfig
$(Q)$(MAKE) -f $(srctree)/Makefile olddefconfig

#
# Prevent generic merge_config rules attempting to merge single fragments
Expand All @@ -503,8 +503,8 @@ $(generic_config_dir)/%.config: ;
#
.PHONY: sead3_defconfig
sead3_defconfig:
$(Q)$(MAKE) 32r2el_defconfig BOARDS=sead-3
$(Q)$(MAKE) -f $(srctree)/Makefile 32r2el_defconfig BOARDS=sead-3

.PHONY: sead3micro_defconfig
sead3micro_defconfig:
$(Q)$(MAKE) micro32r2el_defconfig BOARDS=sead-3
$(Q)$(MAKE) -f $(srctree)/Makefile micro32r2el_defconfig BOARDS=sead-3
1 change: 1 addition & 0 deletions arch/mips/include/asm/asm-prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
#include <asm/fpu.h>
#include <asm-generic/asm-prototypes.h>
#include <asm/uaccess.h>
#include <asm/ftrace.h>
2 changes: 1 addition & 1 deletion arch/mips/kernel/cevt-r4k.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static unsigned int calculate_min_delta(void)
}

/* Sorted insert of 75th percentile into buf2 */
for (k = 0; k < i; ++k) {
for (k = 0; k < i && k < ARRAY_SIZE(buf2); ++k) {
if (buf1[ARRAY_SIZE(buf1) - 1] < buf2[k]) {
l = min_t(unsigned int,
i, ARRAY_SIZE(buf2) - 1);
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/elf.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ int arch_check_elf(void *_ehdr, bool has_interpreter, void *_interp_ehdr,
else if ((prog_req.fr1 && prog_req.frdefault) ||
(prog_req.single && !prog_req.frdefault))
/* Make sure 64-bit MIPS III/IV/64R1 will not pick FR1 */
state->overall_fp_mode = ((current_cpu_data.fpu_id & MIPS_FPIR_F64) &&
state->overall_fp_mode = ((raw_current_cpu_data.fpu_id & MIPS_FPIR_F64) &&
cpu_has_mips_r2_r6) ?
FP_FR1 : FP_FR0;
else if (prog_req.fr1)
Expand Down
48 changes: 33 additions & 15 deletions arch/mips/kernel/kgdb.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,35 +244,53 @@ static int compute_signal(int tt)
void sleeping_thread_to_gdb_regs(unsigned long *gdb_regs, struct task_struct *p)
{
int reg;
struct thread_info *ti = task_thread_info(p);
unsigned long ksp = (unsigned long)ti + THREAD_SIZE - 32;
struct pt_regs *regs = (struct pt_regs *)ksp - 1;
#if (KGDB_GDB_REG_SIZE == 32)
u32 *ptr = (u32 *)gdb_regs;
#else
u64 *ptr = (u64 *)gdb_regs;
#endif

for (reg = 0; reg < 16; reg++)
*(ptr++) = regs->regs[reg];
*(ptr++) = 0;

/* S0 - S7 */
for (reg = 16; reg < 24; reg++)
*(ptr++) = regs->regs[reg];
*(ptr++) = p->thread.reg16;
*(ptr++) = p->thread.reg17;
*(ptr++) = p->thread.reg18;
*(ptr++) = p->thread.reg19;
*(ptr++) = p->thread.reg20;
*(ptr++) = p->thread.reg21;
*(ptr++) = p->thread.reg22;
*(ptr++) = p->thread.reg23;

for (reg = 24; reg < 28; reg++)
*(ptr++) = 0;

/* GP, SP, FP, RA */
for (reg = 28; reg < 32; reg++)
*(ptr++) = regs->regs[reg];

*(ptr++) = regs->cp0_status;
*(ptr++) = regs->lo;
*(ptr++) = regs->hi;
*(ptr++) = regs->cp0_badvaddr;
*(ptr++) = regs->cp0_cause;
*(ptr++) = regs->cp0_epc;
*(ptr++) = (long)p;
*(ptr++) = p->thread.reg29;
*(ptr++) = p->thread.reg30;
*(ptr++) = p->thread.reg31;

*(ptr++) = p->thread.cp0_status;

/* lo, hi */
*(ptr++) = 0;
*(ptr++) = 0;

/*
* BadVAddr, Cause
* Ideally these would come from the last exception frame up the stack
* but that requires unwinding, otherwise we can't know much for sure.
*/
*(ptr++) = 0;
*(ptr++) = 0;

/*
* PC
* use return address (RA), i.e. the moment after return from resume()
*/
*(ptr++) = p->thread.reg31;
}

void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc)
Expand Down
9 changes: 5 additions & 4 deletions arch/mips/kernel/perf_event_mipsxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,11 @@ static int mipsxx_pmu_handle_shared_irq(void)
HANDLE_COUNTER(0)
}

#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
read_unlock(&pmuint_rwlock);
#endif
resume_local_counters();

/*
* Do all the work for the pending perf events. We can do this
* in here because the performance counter interrupt is a regular
Expand All @@ -1454,10 +1459,6 @@ static int mipsxx_pmu_handle_shared_irq(void)
if (handled == IRQ_HANDLED)
irq_work_run();

#ifdef CONFIG_MIPS_PERF_SHARED_TC_COUNTERS
read_unlock(&pmuint_rwlock);
#endif
resume_local_counters();
return handled;
}

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/relocate.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include <linux/kernel.h>
#include <linux/libfdt.h>
#include <linux/of_fdt.h>
#include <linux/sched.h>
#include <linux/sched/task.h>
#include <linux/start_kernel.h>
#include <linux/string.h>
#include <linux/printk.h>
Expand Down
3 changes: 1 addition & 2 deletions arch/mips/kernel/smp-cps.c
Original file line number Diff line number Diff line change
Expand Up @@ -422,13 +422,12 @@ void play_dead(void)
local_irq_disable();
idle_task_exit();
cpu = smp_processor_id();
core = cpu_data[cpu].core;
cpu_death = CPU_DEATH_POWER;

pr_debug("CPU%d going offline\n", cpu);

if (cpu_has_mipsmt || cpu_has_vp) {
core = cpu_data[cpu].core;

/* Look for another online VPE within the core */
for_each_online_cpu(cpu_death_sibling) {
if (cpu_data[cpu_death_sibling].core != core)
Expand Down
11 changes: 11 additions & 0 deletions arch/mips/mti-malta/malta-int.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,17 @@ void __init arch_init_irq(void)
{
int corehi_irq;

/*
* Preallocate the i8259's expected virq's here. Since irqchip_init()
* will probe the irqchips in hierarchial order, i8259 is probed last.
* If anything allocates a virq before the i8259 is probed, it will
* be given one of the i8259's expected range and consequently setup
* of the i8259 will fail.
*/
WARN(irq_alloc_descs(I8259A_IRQ_BASE, I8259A_IRQ_BASE,
16, numa_node_id()) < 0,
"Cannot reserve i8259 virqs at IRQ%d\n", I8259A_IRQ_BASE);

i8259_set_poll(mips_pcibios_iack);
irqchip_init();

Expand Down
2 changes: 1 addition & 1 deletion arch/mips/pci/pci-legacy.c
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ void register_pci_controller(struct pci_controller *hose)
}

INIT_LIST_HEAD(&hose->list);
list_add(&hose->list, &controllers);
list_add_tail(&hose->list, &controllers);

/*
* Do not panic here but later - this might happen before console init.
Expand Down
4 changes: 2 additions & 2 deletions drivers/scsi/scsi_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,10 +1061,10 @@ int scsi_init_io(struct scsi_cmnd *cmd)
struct scsi_device *sdev = cmd->device;
struct request *rq = cmd->request;
bool is_mq = (rq->mq_ctx != NULL);
int error;
int error = BLKPREP_KILL;

if (WARN_ON_ONCE(!blk_rq_nr_phys_segments(rq)))
return -EINVAL;
goto err_exit;

error = scsi_init_sgtable(rq, &cmd->sdb);
if (error)
Expand Down
9 changes: 3 additions & 6 deletions sound/core/seq/seq_lock.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,16 @@
/* wait until all locks are released */
void snd_use_lock_sync_helper(snd_use_lock_t *lockp, const char *file, int line)
{
int max_count = 5 * HZ;
int warn_count = 5 * HZ;

if (atomic_read(lockp) < 0) {
pr_warn("ALSA: seq_lock: lock trouble [counter = %d] in %s:%d\n", atomic_read(lockp), file, line);
return;
}
while (atomic_read(lockp) > 0) {
if (max_count == 0) {
pr_warn("ALSA: seq_lock: timeout [%d left] in %s:%d\n", atomic_read(lockp), file, line);
break;
}
if (warn_count-- == 0)
pr_warn("ALSA: seq_lock: waiting [%d left] in %s:%d\n", atomic_read(lockp), file, line);
schedule_timeout_uninterruptible(1);
max_count--;
}
}

Expand Down
2 changes: 1 addition & 1 deletion sound/firewire/lib.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct snd_fw_async_midi_port {

struct snd_rawmidi_substream *substream;
snd_fw_async_midi_port_fill fill;
unsigned int consume_bytes;
int consume_bytes;
};

int snd_fw_async_midi_port_init(struct snd_fw_async_midi_port *port,
Expand Down
4 changes: 2 additions & 2 deletions sound/firewire/oxfw/oxfw.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,11 @@ static void do_registration(struct work_struct *work)
if (err < 0)
goto error;

err = detect_quirks(oxfw);
err = snd_oxfw_stream_discover(oxfw);
if (err < 0)
goto error;

err = snd_oxfw_stream_discover(oxfw);
err = detect_quirks(oxfw);
if (err < 0)
goto error;

Expand Down
4 changes: 2 additions & 2 deletions sound/soc/intel/boards/bytcr_rt5640.c
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,7 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.platform_name = "sst-mfld-platform",
.ignore_suspend = 1,
.nonatomic = true,
.dynamic = 1,
.dpcm_playback = 1,
.dpcm_capture = 1,
Expand All @@ -634,7 +634,6 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.platform_name = "sst-mfld-platform",
.ignore_suspend = 1,
.nonatomic = true,
.dynamic = 1,
.dpcm_playback = 1,
Expand All @@ -661,6 +660,7 @@ static struct snd_soc_dai_link byt_rt5640_dais[] = {
| SND_SOC_DAIFMT_CBS_CFS,
.be_hw_params_fixup = byt_rt5640_codec_fixup,
.ignore_suspend = 1,
.nonatomic = true,
.dpcm_playback = 1,
.dpcm_capture = 1,
.init = byt_rt5640_init,
Expand Down
2 changes: 0 additions & 2 deletions sound/soc/intel/boards/bytcr_rt5651.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,6 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.platform_name = "sst-mfld-platform",
.ignore_suspend = 1,
.nonatomic = true,
.dynamic = 1,
.dpcm_playback = 1,
Expand All @@ -249,7 +248,6 @@ static struct snd_soc_dai_link byt_rt5651_dais[] = {
.codec_dai_name = "snd-soc-dummy-dai",
.codec_name = "snd-soc-dummy",
.platform_name = "sst-mfld-platform",
.ignore_suspend = 1,
.nonatomic = true,
.dynamic = 1,
.dpcm_playback = 1,
Expand Down
Loading

0 comments on commit d3ec754

Please sign in to comment.