Skip to content
  1. Oct 25, 2019
    • Linus Torvalds's avatar
      Merge tag 'pm-5.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 5fa2845f
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix problems related to frequency limits management in cpufreq
        that were introduced during the 5.3 cycle (when PM QoS had started to
        be used for that), fix a few issues in the OPP (operating performance
        points) library code and fix up the recently added haltpoll cpuidle
        driver.
      
        The cpufreq changes are somewhat bigger that I would like them to be
        at this stage of the cycle, but the problems fixed by them include
        crashes on boot and shutdown in some cases (among other things) and in
        my view it is better to address the root of the issue right away.
      
        Specifics:
      
         - Using device PM QoS of CPU devices for managing frequency limits in
           cpufreq does not work, so introduce frequency QoS (based on the
           original low-level PM QoS) for this purpose, switch cpufreq and
           related code over to using it and fix a race involving deferred
           updates of frequency limits on top of that (Rafael Wysocki, Sudeep
           Holla).
      
         - Avoid calling regulator_enable()/disable() from the OPP framework
           to avoid side-effects on boot-enabled regulators that may change
           their initial voltage due to performing initial voltage balancing
           without all restrictions from the consumers (Marek Szyprowski).
      
         - Avoid a kref management issue in the OPP library code and drop an
           incorrectly added lockdep_assert_held() from it (Viresh Kumar).
      
         - Make the recently added haltpoll cpuidle driver take the 'idle='
           override into account as appropriate (Zhenzhong Duan)"
      
      * tag 'pm-5.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        opp: Reinitialize the list_kref before adding the static OPPs again
        cpufreq: Cancel policy update work scheduled before freeing
        cpuidle: haltpoll: Take 'idle=' override into account
        opp: core: Revert "add regulators enable and disable"
        PM: QoS: Drop frequency QoS types from device PM QoS
        cpufreq: Use per-policy frequency QoS
        PM: QoS: Introduce frequency QoS
        opp: of: drop incorrect lockdep_assert_held()
      5fa2845f
    • Linus Torvalds's avatar
      Merge tag 'gfs2-v5.4-rc4.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 65b15b7f
      Linus Torvalds authored
      Pull gfs2 fix from Andreas Gruenbacher:
       "Fix a memory leak introduced in -rc1"
      
      * tag 'gfs2-v5.4-rc4.fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: Fix memory leak when gfs2meta's fs_context is freed
      65b15b7f
  2. Oct 24, 2019
  3. Oct 23, 2019
  4. Oct 22, 2019
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix copy&paste error in the validator · ba8bf096
      Takashi Iwai authored
      The recently introduced USB-audio descriptor validator had a stupid
      copy&paste error that may lead to an unexpected overlook of too short
      descriptors for processing and extension units.  It's likely the cause
      of the report triggered by syzkaller fuzzer.  Let's fix it.
      
      Fixes: 57f87706
      
       ("ALSA: usb-audio: More validations of descriptor units")
      Reported-by: default avatar <syzbot+0620f79a1978b1133fd7@syzkaller.appspotmail.com>
      Link: https://lore.kernel.org/r/s5hsgnkdbsl.wl-tiwai@suse.de
      
      
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      ba8bf096
    • Linus Torvalds's avatar
      Merge tag 'pinctrl-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl · 3b7c59a1
      Linus Torvalds authored
      Pull pin control fixes from Linus Walleij:
       "Here is a bunch of pin control fixes. I was lagging behind on this
        one, some fixes should have come in earlier, sorry about that.
      
        Anyways here it is, pretty straight-forward fixes, the Strago fix
        stand out as something serious affecting a lot of machines.
      
        Summary:
         - Handle multiple instances of Intel chips without complaining.
         - Restore the Intel Strago DMI workaround
         - Make the Armada 37xx handle pins over 32
         - Fix the polarity of the LED group on Armada 37xx
         - Fix an off-by-one bug in the NS2 driver
         - Fix error path for iproc's platform_get_irq()
         - Fix error path on the STMFX driver
         - Fix a typo in the Berlin AS370 driver
         - Fix up misc errors in the Aspeed 2600 BMC support
         - Fix a stray SPDX tag"
      
      * tag 'pinctrl-v5.4-2' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
        pinctrl: aspeed-g6: Rename SD3 to EMMC and rework pin groups
        pinctrl: aspeed-g6: Fix UART13 group pinmux
        pinctrl: aspeed-g6: Make SIG_DESC_CLEAR() behave intuitively
        pinctrl: aspeed-g6: Fix I3C3/I3C4 pinmux configuration
        pinctrl: aspeed-g6: Fix I2C14 SDA description
        pinctrl: aspeed-g6: Sort pins for sanity
        dt-bindings: pinctrl: aspeed-g6: Rework SD3 function and groups
        pinctrl: berlin: as370: fix a typo s/spififib/spdifib
        pinctrl: armada-37xx: swap polarity on LED group
        pinctrl: stmfx: fix null pointer on remove
        pinctrl: iproc: allow for error from platform_get_irq()
        pinctrl: ns2: Fix off by one bugs in ns2_pinmux_enable()
        pinctrl: bcm-iproc: Use SPDX header
        pinctrl: armada-37xx: fix control of pins 32 and up
        pinctrl: cherryview: restore Strago DMI workaround for all versions
        pinctrl: intel: Allocate IRQ chip dynamic
      3b7c59a1
    • Zhenzhong Duan's avatar
      cpuidle: haltpoll: Take 'idle=' override into account · 31d85140
      Zhenzhong Duan authored
      
      
      Currenly haltpoll isn't aware of the 'idle=' override, the priority is
      'idle=poll' > haltpoll > 'idle=halt'. When 'idle=poll' is used, cpuidle
      driver is bypassed but current_driver in sys still shows 'haltpoll'.
      
      When 'idle=halt' is used, haltpoll takes precedence and makes
      'idle=halt' have no effect.
      
      Add a check to prevent the haltpoll driver from loading if 'idle=' is
      present.
      
      Signed-off-by: default avatarZhenzhong Duan <zhenzhong.duan@oracle.com>
      Co-developed-by: default avatarJoao Martins <joao.m.martins@oracle.com>
      [ rjw: Subject ]
      Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
      31d85140
    • Prateek Sood's avatar
      tracing: Fix race in perf_trace_buf initialization · 6b1340cc
      Prateek Sood authored
      A race condition exists while initialiazing perf_trace_buf from
      perf_trace_init() and perf_kprobe_init().
      
            CPU0                                        CPU1
      perf_trace_init()
        mutex_lock(&event_mutex)
          perf_trace_event_init()
            perf_trace_event_reg()
              total_ref_count == 0
      	buf = alloc_percpu()
              perf_trace_buf[i] = buf
              tp_event->class->reg() //fails       perf_kprobe_init()
      	goto fail                              perf_trace_event_init()
                                                       perf_trace_event_reg()
              fail:
      	  total_ref_count == 0
      
                                                         total_ref_count == 0
                                                         buf = alloc_percpu()
                                                         perf_trace_buf[i] = buf
                                                         tp_event->class->reg()
                                                         total_ref_count++
      
                free_percpu(perf_trace_buf[i])
                perf_trace_buf[i] = NULL
      
      Any subsequent call to perf_trace_event_reg() will observe total_ref_count > 0,
      causing the perf_trace_buf to be always NULL. This can result in perf_trace_buf
      getting accessed from perf_trace_buf_alloc() without being initialized. Acquiring
      event_mutex in perf_kprobe_init() before calling perf_trace_event_init() should
      fix this race.
      
      The race caused the following bug:
      
       Unable to handle kernel paging request at virtual address 0000003106f2003c
       Mem abort info:
         ESR = 0x96000045
         Exception class = DABT (current EL), IL = 32 bits
         SET = 0, FnV = 0
         EA = 0, S1PTW = 0
       Data abort info:
         ISV = 0, ISS = 0x00000045
         CM = 0, WnR = 1
       user pgtable: 4k pages, 39-bit VAs, pgdp = ffffffc034b9b000
       [0000003106f2003c] pgd=0000000000000000, pud=0000000000000000
       Internal error: Oops: 96000045 [#1] PREEMPT SMP
       Process syz-executor (pid: 18393, stack limit = 0xffffffc093190000)
       pstate: 80400005 (Nzcv daif +PAN -UAO)
       pc : __memset+0x20/0x1ac
       lr : memset+0x3c/0x50
       sp : ffffffc09319fc50
      
        __memset+0x20/0x1ac
        perf_trace_buf_alloc+0x140/0x1a0
        perf_trace_sys_enter+0x158/0x310
        syscall_trace_enter+0x348/0x7c0
        el0_svc_common+0x11c/0x368
        el0_svc_handler+0x12c/0x198
        el0_svc+0x8/0xc
      
      Ramdumps showed the following:
        total_ref_count = 3
        perf_trace_buf = (
            0x0 -> NULL,
            0x0 -> NULL,
            0x0 -> NULL,
            0x0 -> NULL)
      
      Link: http://lkml.kernel.org/r/1571120245-4186-1-git-send-email-prsood@codeaurora.org
      
      Cc: stable@vger.kernel.org
      Fixes: e12f03d7
      
       ("perf/core: Implement the 'perf_kprobe' PMU")
      Acked-by: default avatarSong Liu <songliubraving@fb.com>
      Signed-off-by: default avatarPrateek Sood <prsood@codeaurora.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      6b1340cc
    • afzal mohammed's avatar
      ARM: 8926/1: v7m: remove register save to stack before svc · 2ecb2879
      afzal mohammed authored
      r0-r3 & r12 registers are saved & restored, before & after svc
      respectively. Intention was to preserve those registers across thread to
      handler mode switch.
      
      On v7-M, hardware saves the register context upon exception in AAPCS
      complaint way. Restoring r0-r3 & r12 is done from stack location where
      hardware saves it, not from the location on stack where these registers
      were saved.
      
      To clarify, on stm32f429 discovery board:
      
      1. before svc, sp - 0x90009ff8
      2. r0-r3,r12 saved to 0x90009ff8 - 0x9000a00b
      3. upon svc, h/w decrements sp by 32 & pushes registers onto stack
      4. after svc,  sp - 0x90009fd8
      5. r0-r3,r12 restored from 0x90009fd8 - 0x90009feb
      
      Above means r0-r3,r12 is not restored from the location where they are
      saved, but since hardware pushes the registers onto stack, the registers
      are restored correctly.
      
      Note that during register saving to stack (step 2), it goes past
      0x9000a000. And it seems, based on objdump, there are global symbols
      residing there, and it perhaps can cause issues on a non-XIP Kernel
      (on XIP, data section is setup later).
      
      Based on the analysis above, manually saving registers onto stack is at
      best no-op and at worst can cause data section corruption. Hence remove
      storing of registers onto stack before svc.
      
      Fixes: b70cd406
      
       ("ARM: 8671/1: V7M: Preserve registers across switch from Thread to Handler mode")
      Signed-off-by: default avatarafzal mohammed <afzal.mohd.ma@gmail.com>
      Acked-by: default avatarVladimir Murzin <vladimir.murzin@arm.com>
      Signed-off-by: default avatarRussell King <rmk+kernel@armlinux.org.uk>
      2ecb2879
  5. Oct 21, 2019
  6. Oct 20, 2019
    • Linus Torvalds's avatar
      Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4fe34d61
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A small set of x86 fixes:
      
         - Prevent a NULL pointer dereference in the X2APIC code in case of a
           CPU hotplug failure.
      
         - Prevent boot failures on HP superdome machines by invalidating the
           level2 kernel pagetable entries outside of the kernel area as
           invalid so BIOS reserved space won't be touched unintentionally.
      
           Also ensure that memory holes are rounded up to the next PMD
           boundary correctly.
      
         - Enable X2APIC support on Hyper-V to prevent boot failures.
      
         - Set the paravirt name when running on Hyper-V for consistency
      
         - Move a function under the appropriate ifdef guard to prevent build
           warnings"
      
      * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/boot/acpi: Move get_cmdline_acpi_rsdp() under #ifdef guard
        x86/hyperv: Set pv_info.name to "Hyper-V"
        x86/apic/x2apic: Fix a NULL pointer deref when handling a dying cpu
        x86/hyperv: Make vapic support x2apic mode
        x86/boot/64: Round memory hole size up to next PMD page
        x86/boot/64: Make level2_kernel_pgt pages invalid outside kernel area
      4fe34d61
    • Linus Torvalds's avatar
      Merge branch 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 81c4bc31
      Linus Torvalds authored
      Pull irq fixes from Thomas Gleixner:
       "A small set of irq chip driver fixes and updates:
      
         - Update the SIFIVE PLIC interrupt driver to use the fasteoi handler
           to address the shortcomings of the existing flow handling which was
           prone to lose interrupts
      
         - Use the proper limit for GIC interrupt line numbers
      
         - Add retrigger support for the recently merged Anapurna Labs Fabric
           interrupt controller to make it complete
      
         - Enable the ATMEL AIC5 interrupt controller driver on the new
           SAM9X60 SoC"
      
      * 'irq-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        irqchip/sifive-plic: Switch to fasteoi flow
        irqchip/gic-v3: Fix GIC_LINE_NR accessor
        irqchip/atmel-aic5: Add support for sam9x60 irqchip
        irqchip/al-fic: Add support for irq retrigger
      81c4bc31
    • Linus Torvalds's avatar
      Merge branch 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 188768f3
      Linus Torvalds authored
      Pull hrtimer fixlet from Thomas Gleixner:
       "A single commit annotating the lockcless access to timer->base with
        READ_ONCE() and adding the WRITE_ONCE() counterparts for completeness"
      
      * 'timers-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        hrtimer: Annotate lockless access to timer->base
      188768f3
    • Linus Torvalds's avatar
      Merge branch 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 589f1222
      Linus Torvalds authored
      Pull stop-machine fix from Thomas Gleixner:
       "A single fix, amending stop machine with WRITE/READ_ONCE() to address
        the fallout of KCSAN"
      
      * 'core-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        stop_machine: Avoid potential race behaviour
      589f1222
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 531e93d1
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "I was battling a cold after some recent trips, so quite a bit piled up
        meanwhile, sorry about that.
      
        Highlights:
      
         1) Fix fd leak in various bpf selftests, from Brian Vazquez.
      
         2) Fix crash in xsk when device doesn't support some methods, from
            Magnus Karlsson.
      
         3) Fix various leaks and use-after-free in rxrpc, from David Howells.
      
         4) Fix several SKB leaks due to confusion of who owns an SKB and who
            should release it in the llc code. From Eric Biggers.
      
         5) Kill a bunc of KCSAN warnings in TCP, from Eric Dumazet.
      
         6) Jumbo packets don't work after resume on r8169, as the BIOS resets
            the chip into non-jumbo mode during suspend. From Heiner Kallweit.
      
         7) Corrupt L2 header during MPLS push, from Davide Caratti.
      
         8) Prevent possible infinite loop in tc_ctl_action, from Eric
            Dumazet.
      
         9) Get register bits right in bcmgenet driver, based upon chip
            version. From Florian Fainelli.
      
        10) Fix mutex problems in microchip DSA driver, from Marek Vasut.
      
        11) Cure race between route lookup and invalidation in ipv4, from Wei
            Wang.
      
        12) Fix performance regression due to false sharing in 'net'
            structure, from Eric Dumazet"
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (145 commits)
        net: reorder 'struct net' fields to avoid false sharing
        net: dsa: fix switch tree list
        net: ethernet: dwmac-sun8i: show message only when switching to promisc
        net: aquantia: add an error handling in aq_nic_set_multicast_list
        net: netem: correct the parent's backlog when corrupted packet was dropped
        net: netem: fix error path for corrupted GSO frames
        macb: propagate errors when getting optional clocks
        xen/netback: fix error path of xenvif_connect_data()
        net: hns3: fix mis-counting IRQ vector numbers issue
        net: usb: lan78xx: Connect PHY before registering MAC
        vsock/virtio: discard packets if credit is not respected
        vsock/virtio: send a credit update when buffer size is changed
        mlxsw: spectrum_trap: Push Ethernet header before reporting trap
        net: ensure correct skb->tstamp in various fragmenters
        net: bcmgenet: reset 40nm EPHY on energy detect
        net: bcmgenet: soft reset 40nm EPHYs before MAC init
        net: phy: bcm7xxx: define soft_reset for 40nm EPHY
        net: bcmgenet: don't set phydev->link from MAC
        net: Update address for MediaTek ethernet driver in MAINTAINERS
        ipv4: fix race condition between route lookup and invalidation
        ...
      531e93d1
    • Eric Dumazet's avatar
      net: reorder 'struct net' fields to avoid false sharing · 2a06b898
      Eric Dumazet authored
      Intel test robot reported a ~7% regression on TCP_CRR tests
      that they bisected to the cited commit.
      
      Indeed, every time a new TCP socket is created or deleted,
      the atomic counter net->count is touched (via get_net(net)
      and put_net(net) calls)
      
      So cpus might have to reload a contended cache line in
      net_hash_mix(net) calls.
      
      We need to reorder 'struct net' fields to move @hash_mix
      in a read mostly cache line.
      
      We move in the first cache line fields that can be
      dirtied often.
      
      We probably will have to address in a followup patch
      the __randomize_layout that was added in linux-4.13,
      since this might break our placement choices.
      
      Fixes: 355b9855
      
       ("netns: provide pure entropy for net_hash_mix()")
      Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      2a06b898
    • Vivien Didelot's avatar
      net: dsa: fix switch tree list · 50c7d2ba
      Vivien Didelot authored
      If there are multiple switch trees on the device, only the last one
      will be listed, because the arguments of list_add_tail are swapped.
      
      Fixes: 83c0afae
      
       ("net: dsa: Add new binding implementation")
      Signed-off-by: default avatarVivien Didelot <vivien.didelot@gmail.com>
      Reviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      50c7d2ba
    • Mans Rullgard's avatar
      net: ethernet: dwmac-sun8i: show message only when switching to promisc · 05908d72
      Mans Rullgard authored
      
      
      Printing the info message every time more than the max number of mac
      addresses are requested generates unnecessary log spam.  Showing it only
      when the hw is not already in promiscous mode is equally informative
      without being annoying.
      
      Signed-off-by: default avatarMans Rullgard <mans@mansr.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      05908d72
    • Chenwandun's avatar
      net: aquantia: add an error handling in aq_nic_set_multicast_list · 3d00cf2f
      Chenwandun authored
      
      
      add an error handling in aq_nic_set_multicast_list, it may not
      work when hw_multicast_list_set error; and at the same time
      it will remove gcc Wunused-but-set-variable warning.
      
      Signed-off-by: default avatarChenwandun <chenwandun@huawei.com>
      Reviewed-by: default avatarIgor Russkikh <igor.russkikh@aquantia.com>
      Reviewed-by: default avatarAndrew Lunn <andrew@lunn.ch>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      3d00cf2f