25 Feb, 2018

40 commits

  • [ Upstream commit 7465894e90e5a47e0e52aa5f1f708653fc40020f ]

    vgic_set_owner acquires the irq lock without disabling interrupts,
    resulting in a lockdep splat (an interrupt could fire and result
    in the same lock being taken if the same virtual irq is to be
    injected).

    In practice, it is almost impossible to trigger this bug, but
    better safe than sorry. Convert the lock acquisition to a
    spin_lock_irqsave() and keep lockdep happy.

    Reported-by: James Morse
    Signed-off-by: Marc Zyngier
    Signed-off-by: Christoffer Dall
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Marc Zyngier
     
  • [ Upstream commit 044d71bc6cdee8980d0fdc35ec79a0d5818b2ce3 ]

    I've noticed the following message while booting a S905X based board:

    soc soc0: Amlogic Meson GXL (S905D) Revision 21:82 (b:2) Detected

    The S905D string is obviously wrong. The vendor code does:
    ...
    ver = (readl(assist_hw_rev) >> 8) & 0xff;
    meson_cpu_version[MESON_CPU_VERSION_LVL_MINOR] = ver;
    ver = (readl(assist_hw_rev) >> 16) & 0xff;
    meson_cpu_version[MESON_CPU_VERSION_LVL_PACK] = ver;
    ...

    while the current code does:
    ...
    ...

    This means that the current mainline code has package id and minor
    version reversed.

    Fixes: a9daaba2965e8 ("soc: Add Amlogic SoC Information driver")
    Signed-off-by: Arnaud Patard
    Acked-by: Neil Armstrong
    Signed-off-by: Kevin Hilman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Arnaud Patard
     
  • [ Upstream commit 8935780b9f7bbad0f2eb5dd43f61ba7b509a1575 ]

    It is possible the bth1 variable could be used uninitialized so going
    ahead and giving it a default value.

    Otherwise we leak stack memory to the network.

    Fixes: 5b6cabb0db77 ("IB/hfi1: Add 16B RC/UC support")
    Reviewed-by: Don Hiatt
    Signed-off-by: Dennis Dalessandro
    Signed-off-by: Jason Gunthorpe
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Dennis Dalessandro
     
  • [ Upstream commit 7c5c2c2d18d778e51fd8b899965097168306031c ]

    To use pin PF4 as the RX signal of UART0, we have to write 0b011 into
    the respective pin controller register.
    Fix the wrong value we had in our table so far.

    Fixes: 96851d391d02 ("drivers: pinctrl: add driver for Allwinner A64 SoC")
    Signed-off-by: Andre Przywara
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Andre Przywara
     
  • [ Upstream commit 6ad4cc8d1ac483e0fd33f605fb2788b0ecf51ed4 ]

    On the A80 the pins on port B can trigger interrupts, and those are
    assigned to the second interrupt bank.
    Having two pins assigned to the same interrupt bank/pin combination does
    not look healthy (instead more like a copy&paste bug from pins PA14-PA16),
    so fix the interrupt bank for pins PB14-PB16, which is actually 1.

    I don't have any A80 board, so could not test this.

    Fixes: d5e9fb31baa2 ("pinctrl: sunxi: Add A80 pinctrl muxing options")
    Signed-off-by: Andre Przywara
    Acked-by: Chen-Yu Tsai
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Andre Przywara
     
  • [ Upstream commit 7f8e2a85c1b0bd440ffe87be82c79fdc319e8291 ]

    As per the re-design assign the first bank regs for unbanked
    irq case. This was missed out in the original patch.

    Signed-off-by: Keerthy
    Fixes: b5cf3fd827d2e1 ("gpio: davinci: Redesign driver to accommodate ngpios in one gpio chip")
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Keerthy
     
  • [ Upstream commit a158531f3c92467df0e93e000d58185acae78a6e ]

    Commit 7ebc194d0fd4bb0f ("gpio: 74x164: Introduce 'enable-gpios'
    property") added a new member gpiod_oe to the end of the struct
    gen_74x164_chip, after the zero-length buffer array.

    However, this buffer is a flexible array, allocated together with the
    structure during .probe(). As the buffer is no longer the last member,
    writing to it corrupts the newly added member after it.
    During device removal, the corrupted member will be used as a pointer,
    leading to a crash.

    This went unnoticed, as the flexible array was declared as "buffer[0]"
    instead of "buffer[]", and thus did not trigger a "flexible array member
    not at end of struct" error from gcc.

    Move the gpiod_oe field up to fix this, and drop the zero from the array
    size to prevent future similar bugs.

    Fixes: 7ebc194d0fd4bb0f ("gpio: 74x164: Introduce 'enable-gpios' property")
    Signed-off-by: Geert Uytterhoeven
    Reviewed-by: Fabio Estevam
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Geert Uytterhoeven
     
  • [ Upstream commit a154f8e399a063137fc42b961f437248d55ece29 ]

    Reserved and unused fields in the Tx descriptors should be 0. The PPv2
    driver doesn't clear them at run-time (for performance reasons) but
    these descriptors aren't zeroed when allocated, which can lead to
    unpredictable behaviors. This patch fixes this by using
    dma_zalloc_coherent instead of dma_alloc_coherent.

    Fixes: 3f518509dedc ("ethernet: Add new driver for Marvell Armada 375 network unit")
    Signed-off-by: Yan Markman
    [Antoine: commit message]
    Signed-off-by: Antoine Tenart
    Signed-off-by: David S. Miller

    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Yan Markman
     
  • [ Upstream commit fce8ba670b7418319da14a6fc6668db1f1a96267 ]

    The ov13858 driver depends on the V4L2 fwnode, thus add that to Kconfig.

    Fixes: 5fcf092e0c9f ("[media] ov13858: add support for OV13858 sensor")

    Signed-off-by: Sakari Ailus
    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Sakari Ailus
     
  • [ Upstream commit 070250a1715cee2297de0d9e7e2cea58be999d37 ]

    as warned:
    drivers/media/i2c/s5k6aa.c:429: warning: No description found for parameter 's5k6aa'
    drivers/media/i2c/s5k6aa.c:679: warning: No description found for parameter 's5k6aa'
    drivers/media/i2c/s5k6aa.c:733: warning: No description found for parameter 's5k6aa'
    drivers/media/i2c/s5k6aa.c:733: warning: No description found for parameter 'preset'
    drivers/media/i2c/s5k6aa.c:787: warning: No description found for parameter 'sd'

    Signed-off-by: Mauro Carvalho Chehab
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Mauro Carvalho Chehab
     
  • [ Upstream commit 23721a755f98ac846897a013c92cccb281c1bcc8 ]

    We meet this compile warning, which caused by missing bpf.h in xdp.h.

    In file included from ./include/trace/events/xdp.h:10:0,
    from ./include/linux/bpf_trace.h:6,
    from drivers/net/ethernet/intel/i40e/i40e_txrx.c:29:
    ./include/trace/events/xdp.h:93:17: warning: ‘struct bpf_map’ declared inside parameter list will not be visible outside of this definition or declaration
    const struct bpf_map *map, u32 map_index),
    ^
    ./include/linux/tracepoint.h:187:34: note: in definition of macro ‘__DECLARE_TRACE’
    static inline void trace_##name(proto) \
    ^~~~~
    ./include/linux/tracepoint.h:352:24: note: in expansion of macro ‘PARAMS’
    __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
    ^~~~~~
    ./include/linux/tracepoint.h:477:2: note: in expansion of macro ‘DECLARE_TRACE’
    DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
    ^~~~~~~~~~~~~
    ./include/linux/tracepoint.h:477:22: note: in expansion of macro ‘PARAMS’
    DECLARE_TRACE(name, PARAMS(proto), PARAMS(args))
    ^~~~~~
    ./include/trace/events/xdp.h:89:1: note: in expansion of macro ‘DEFINE_EVENT’
    DEFINE_EVENT(xdp_redirect_template, xdp_redirect,
    ^~~~~~~~~~~~
    ./include/trace/events/xdp.h:90:2: note: in expansion of macro ‘TP_PROTO’
    TP_PROTO(const struct net_device *dev,
    ^~~~~~~~
    ./include/trace/events/xdp.h:93:17: warning: ‘struct bpf_map’ declared inside parameter list will not be visible outside of this definition or declaration
    const struct bpf_map *map, u32 map_index),
    ^
    ./include/linux/tracepoint.h:203:38: note: in definition of macro ‘__DECLARE_TRACE’
    register_trace_##name(void (*probe)(data_proto), void *data) \
    ^~~~~~~~~~
    ./include/linux/tracepoint.h:354:4: note: in expansion of macro ‘PARAMS’
    PARAMS(void *__data, proto), \
    ^~~~~~

    Reported-by: Huang Daode
    Cc: Hanjun Guo
    Fixes: 8d3b778ff544 ("xdp: tracepoint xdp_redirect also need a map argument")
    Signed-off-by: Xie XiuQi
    Acked-by: Jesper Dangaard Brouer
    Acked-by: Steven Rostedt (VMware)
    Signed-off-by: Daniel Borkmann
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Xie XiuQi
     
  • [ Upstream commit 58d0d19a204604ca0da26058828a53558b265da3 ]

    Since it is perfectly legal to run the kernel at EL1, it is not
    actually an error if HYP mode is not available when attempting to
    initialize KVM, given that KVM support cannot be built as a module.
    So demote the kvm_err() to kvm_info(), which prevents the error from
    appearing on an otherwise 'quiet' console.

    Acked-by: Marc Zyngier
    Acked-by: Christoffer Dall
    Signed-off-by: Ard Biesheuvel
    Signed-off-by: Christoffer Dall
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ard Biesheuvel
     
  • [ Upstream commit 4bd6683da2e64590bdc27ecf7e61ad8376861768 ]

    UART2 RTS is mode 2 of the pin.

    Signed-off-by: Andy Shevchenko
    Acked-by: Mika Westerberg
    Signed-off-by: Linus Walleij
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Andy Shevchenko
     
  • [ Upstream commit 996548499df61babae5306544c7daf5fd39db31c ]

    Test case 21 (Number of exit events of a simple workload) fails on
    s390x. The reason is the invalid sample frequency supplied for this
    test. On s390x the minimum sample frequency is much higher (see output
    of /proc/service_levels).

    Supply a save sample frequency value for s390x to fix this. The value
    will be adjusted by the s390x CPUMF frequency convertion function to a
    value well below the sysctl kernel.perf_event_max_sample_rate value.

    Signed-off-by: Thomas Richter
    Reviewed-by: Hendrik Brueckner
    Cc: Martin Schwidefsky
    LPU-Reference: 20171123114611.93397-1-tmricht@linux.vnet.ibm.com
    Link: https://lkml.kernel.org/n/tip-1ynblyhi1n81idpido59nt1y@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Thomas Richter
     
  • [ Upstream commit 321a7c35c90cc834851ceda18a8ee18f1d032b92 ]

    Certain systems are designed to have sparse/discontiguous nodes. On
    such systems, 'perf bench numa' hangs, shows wrong number of nodes and
    shows values for non-existent nodes. Handle this by only taking nodes
    that are exposed by kernel to userspace.

    Signed-off-by: Satheesh Rajendran
    Reviewed-by: Srikar Dronamraju
    Acked-by: Naveen N. Rao
    Link: http://lkml.kernel.org/r/1edbcd353c009e109e93d78f2f46381930c340fe.1511368645.git.sathnaga@linux.vnet.ibm.com
    Signed-off-by: Balamuruhan S
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Satheesh Rajendran
     
  • [ Upstream commit 89d0aeab4252adc2a7ea693637dd21c588bfa2d1 ]

    The stdio perf top crashes when we change the terminal
    window size. The reason is that we assumed we get the
    perf_top pointer as a signal handler argument which is
    not the case.

    Changing the SIGWINCH handler logic to change global
    resize variable, which is checked in the main thread
    loop.

    Signed-off-by: Jiri Olsa
    Tested-by: Arnaldo Carvalho de Melo
    Tested-by: Ravi Bangoria
    Cc: Adrian Hunter
    Cc: Andi Kleen
    Cc: David Ahern
    Cc: Namhyung Kim
    Cc: Wang Nan
    Link: http://lkml.kernel.org/n/tip-ysuzwz77oev1ftgvdscn9bpu@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jiri Olsa
     
  • [ Upstream commit 34900ec5c9577cc1b0f22887ac7349f458ba8ac2 ]

    Reset header size for namespace events, otherwise it only gets bigger in
    ctx iterations.

    Signed-off-by: Jiri Olsa
    Acked-by: Peter Zijlstra (Intel)
    Fixes: e422267322cd ("perf: Add PERF_RECORD_NAMESPACES to include namespaces related info")
    Link: http://lkml.kernel.org/n/tip-nlo4gonz9d4guyb8153ukzt0@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Jiri Olsa
     
  • [ Upstream commit ccafc38f1c778847ab6d53dd7933260426731cf3 ]

    This 'perf test' case fails on s390x. The 'touch' command on s390x uses
    the 'openat' system call to open the file named on the command line:

    [root@s35lp76 perf]# perf probe -l
    probe:vfs_getname (on getname_flags:72@fs/namei.c with pathname)
    [root@s35lp76 perf]# perf trace -e open touch /tmp/abc
    0.400 ( 0.015 ms): touch/27542 open(filename:
    /usr/lib/locale/locale-archive, flags: CLOEXEC) = 3
    [root@s35lp76 perf]#

    There is no 'open' system call for file '/tmp/abc'. Instead the 'openat'
    system call is used:

    [root@s35lp76 perf]# strace touch /tmp/abc
    execve("/usr/bin/touch", ["touch", "/tmp/abc"], 0x3ffd547ec98
    /* 30 vars */) = 0
    [...]
    openat(AT_FDCWD, "/tmp/abc", O_WRONLY|O_CREAT|O_NOCTTY|O_NONBLOCK, 0666) = 3
    [...]

    On s390x the 'egrep' command does not find a matching pattern and
    returns an error.

    Fix this for s390x create a platform dependent command line to enable
    the 'perf probe' call to listen to the 'openat' system call and get the
    expected output.

    Signed-off-by: Thomas-Mich Richter
    Tested-by: Arnaldo Carvalho de Melo
    Cc: Hendrik Brueckner
    Cc: Thomas-Mich Richter
    LPU-Reference: 20171114071847.2381-1-tmricht@linux.vnet.ibm.com
    Link: http://lkml.kernel.org/n/tip-3qf38jk0prz54rhmhyu871my@git.kernel.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Thomas Richter
     
  • [ Upstream commit 05d0e62d9fa0f1002cf82009ef31b36174da5472 ]

    There are many instructions, esp on PowerPC, whose mnemonics are longer
    than 6 characters. Using precision limit causes truncation of such
    mnemonics.

    Fix this by removing precision limit. Note that, 'width' is still 6, so
    alignment won't get affected for length
    Signed-off-by: Ravi Bangoria
    Cc: Alexander Shishkin
    Cc: Jiri Olsa
    Cc: Namhyung Kim
    Cc: Peter Zijlstra
    Cc: Taeung Song
    Link: http://lkml.kernel.org/r/20171114032540.4564-1-ravi.bangoria@linux.vnet.ibm.com
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Ravi Bangoria
     
  • [ Upstream commit af98f2273fd0af31ce327cd1406b67c7be0b6734 ]

    The commit 8e99b6d4533c changed prefixcmp() to strstart() but missed to
    change the return value in some place. It makes perf help print
    annoying output even for sane config items like below:

    $ perf help
    '.root': unsupported man viewer sub key.
    ...

    Reported-by: Arnaldo Carvalho de Melo
    Signed-off-by: Namhyung Kim
    Tested-by: Arnaldo Carvalho de Melo
    Tested-by: Taeung Song
    Cc: Jiri Olsa
    Cc: Sihyeon Jang
    Cc: kernel-team@lge.com
    Link: http://lkml.kernel.org/r/20171114001542.GA16464@sejong
    Fixes: 8e99b6d4533c ("tools include: Adopt strstarts() from the kernel")
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Namhyung Kim
     
  • [ Upstream commit 59622fd496a3175c7bf549046e091d81c303ecff ]

    The Intel PMU event aliases have a implicit period= specifier to set the
    default period.

    Unfortunately this breaks overriding these periods with -c or -F,
    because the alias terms look like they are user specified to the
    internal parser, and user specified event qualifiers override the
    command line options.

    Track that they are coming from aliases by adding a "weak" state to the
    term. Any weak terms don't override command line options.

    I only did it for -c/-F for now, I think that's the only case that's
    broken currently.

    Before:

    $ perf record -c 1000 -vv -e uops_issued.any
    ...
    { sample_period, sample_freq } 2000003

    After:

    $ perf record -c 1000 -vv -e uops_issued.any
    ...
    { sample_period, sample_freq } 1000

    Signed-off-by: Andi Kleen
    Acked-by: Jiri Olsa
    Link: http://lkml.kernel.org/r/20171020202755.21410-2-andi@firstfloor.org
    Signed-off-by: Arnaldo Carvalho de Melo
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Andi Kleen
     
  • [ Upstream commit ca41e244517d6d3f1600c229ff7ca615049c1e9c ]

    The DMA binding for eDMA needs 2 parameters, not 1.
    The second, missing parameter is the tptc to be used for the channel.

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Peter Ujfalusi
     
  • [ Upstream commit 627395a6f8091c0aa18f49dca7df59ba3ec147ef ]

    Fixes the following warnings:

    arch/arm/boot/dts/am437x-cm-t43.dtb: Warning (interrupts_property):
    interrupts size is (8), expected multiple of 12 in
    /ocp@44000000/mcasp@48038000

    arch/arm/boot/dts/am437x-cm-t43.dtb: Warning (interrupts_property):
    interrupts size is (8), expected multiple of 12 in
    /ocp@44000000/mcasp@4803C000

    Signed-off-by: Peter Ujfalusi
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Peter Ujfalusi
     
  • [ Upstream commit cd7594ac3281722cb8f10d6f6c7e4287747c7a9d ]

    The pin assignment for the wl127x interrupt was incorrect. I am
    not sure how this every worked. This also eliminates a conflict with
    the SMC911x ethernet driver and properly moves pinmuxes for the
    related gpio to omap3_pmx_wkup from omap3_pmx_core.

    Fixes: ab8dd3aed011 ("ARM: DTS: Add minimal Support for Logic PD
    DM3730 SOM-LV")

    Signed-off-by: Adam Ford
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Adam Ford
     
  • [ Upstream commit 3c18bbf3d11d2005da08b57ff26f44ff1c2b12d0 ]

    This patch fixes and issue where the NAND and GPMC based ethernet
    controller stopped working. This also updates the GPMC settings
    to be consistent with the Logic PD Torpedo development from the
    commit listed above.

    Fixes: 44e4716499b8 ("ARM: dts: omap3: Fix NAND device nodes")

    Signed-off-by: Adam Ford
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Adam Ford
     
  • [ Upstream commit cf87634c8b24e24bf379b8c6807c8b0fb5f23567 ]

    There's been a reproducable USB OHCI/EHCI cpuidle related hang on omap4
    for a while that happens after about 20 - 40 minutes on an idle system
    with some data feeding device being connected, like a USB GPS device or
    a cellular modem.

    This issue happens in cpuidle states C2 and C3 and does not happen if
    cpuidle is limited to C1 state only. The symptoms are that the whole
    system hangs and never wakes up from idle, and if a watchdog is
    configured the system reboots after a while.

    Turns out that OHCI/EHCI devices on omap4 are trying to use the GIC
    interrupt controller directly as a parent instead of the WUGEN. We
    need to pass the interrupts through WUGEN to GIC to provide the wakeup
    events for the processor.

    Let's fix the issue by removing the gic interrupt-parent and use the
    default interrupt-parent wakeupgen instead. Note that omap5.dtsi had
    this already fixes earlier by commit 7136d457f365 ("ARM: omap: convert
    wakeupgen to stacked domains") but we somehow missed omap4 at that
    point.

    Fixes: 7136d457f365 ("ARM: omap: convert wakeupgen to stacked domains")
    Cc: Dave Gerlach
    Cc: Nishanth Menon
    Cc: Marc Zyngier
    Cc: Sebastian Reichel
    Reviewed-by: Roger Quadros
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Tony Lindgren
     
  • [ Upstream commit b6d6af7226465b6d11eac09d0be2ab78a4a9eb62 ]

    Referring TRM Am335X series:
    http://www.ti.com/lit/ug/spruh73p/spruh73p.pdf

    The LastPowerStateEntered bitfield is present only for PM_CEFUSE
    domain. This is not present in any of the other power domains. Hence
    remove the generic am33xx_pwrdm_read_prev_pwrst hook which wrongly
    reads the reserved bit fields for all the other power domains.

    Reading the reserved bits leads to wrongly interpreting the low
    power transitions for various power domains that do not have the
    LastPowerStateEntered field. The pm debug counters values are wrong
    currently as we are incrementing them based on the reserved bits.

    Signed-off-by: Keerthy
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Keerthy
     
  • [ Upstream commit d09220a887f70368afa79e850c95e74890c0a32d ]

    With the CMA changes from Joonsoo Kim , it
    was noticed that n900 stopped booting. After investigating it turned
    out that n900 save_secure_ram_context does some whacky virtual to
    physical address translation for the SRAM data address.

    As we now only have minimal parts of omap3 idle code copied to SRAM,
    running save_secure_ram_context() in SRAM is not needed. It only gets
    called on PM init. And it seems there's no need to ever call this from
    SRAM idle code.

    So let's just keep save_secure_ram_context() in DDR, and pass it the
    physical address of the parameters. We can do everything else in
    omap-secure.c like we already do for other secure code.

    And since we don't have any documentation, I still have no clue what
    the values for 0, 1 and 1 for the parameters might be. If somebody has
    figured it out, please do send a patch to add some comments.

    Debugged-by: Joonsoo Kim
    Signed-off-by: Tony Lindgren
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Tony Lindgren
     
  • [ Upstream commit fd00cf81a9a84776ba58e56bd042c726dcf75cf3 ]

    The receive_buf callback is supposed to return the number of bytes
    processed and should specifically not return a negative errno.

    Due to missing sanity checks in the serdev tty-port controller, a driver
    not providing a receive_buf callback could cause the flush_to_ldisc()
    worker to spin in a tight loop when the tty buffer pointers are
    incremented with -EINVAL (-22).

    The missing sanity checks have now been added to the tty-port
    controller, but let's fix up the serdev-controller helper as well.

    Signed-off-by: Johan Hovold
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Johan Hovold
     
  • [ Upstream commit c9d24f78268be444e803fb2bb138a2f598de9c23 ]

    PHY drivers can use ULPI interfaces when CONFIG_USB (which is host side
    support) is not enabled, so also build drivers/usb/ when CONFIG_USB_SUPPORT
    is enabled so that drivers/usb/common/ is built.

    ERROR: "ulpi_unregister_driver" [drivers/phy/ti/phy-tusb1210.ko] undefined!
    ERROR: "__ulpi_register_driver" [drivers/phy/ti/phy-tusb1210.ko] undefined!
    ERROR: "ulpi_read" [drivers/phy/ti/phy-tusb1210.ko] undefined!
    ERROR: "ulpi_write" [drivers/phy/ti/phy-tusb1210.ko] undefined!
    ERROR: "ulpi_unregister_driver" [drivers/phy/qualcomm/phy-qcom-usb-hs.ko] undefined!
    ERROR: "__ulpi_register_driver" [drivers/phy/qualcomm/phy-qcom-usb-hs.ko] undefined!
    ERROR: "ulpi_write" [drivers/phy/qualcomm/phy-qcom-usb-hs.ko] undefined!

    Signed-off-by: Randy Dunlap
    Signed-off-by: Greg Kroah-Hartman
    Signed-off-by: Sasha Levin
    Signed-off-by: Greg Kroah-Hartman

    Randy Dunlap
     
  • commit 009f41aed4b3e11e6dc1e3c07377a10c20f1a5ed upstream.

    Keep usbip_device sockfd state in sync with tcp_socket. When tcp_socket
    is reset to null, reset sockfd to -1 to keep it in sync.

    Signed-off-by: Shuah Khan
    Cc: stable@vger.kernel.org
    Signed-off-by: Greg Kroah-Hartman

    Shuah Khan
     
  • commit 7d2b8e6aaf9ee87910c2337e1c59bb5d3e3ba8c5 upstream.

    Since commit 152a6a884ae1 ("staging:iio:accel:sca3000 move
    to hybrid hard / soft buffer design.")
    the buffer mechanism has changed and the
    INDIO_BUFFER_HARDWARE flag has been unused.

    Since commit 2d6ca60f3284 ("iio: Add a DMAengine framework
    based buffer")
    the INDIO_BUFFER_HARDWARE flag has been re-purposed for
    DMA buffers.

    This driver has lagged behind these changes, and
    in order for buffers to work, the INDIO_BUFFER_SOFTWARE
    needs to be used.

    Signed-off-by: Alexandru Ardelean
    Fixes: 2d6ca60f3284 ("iio: Add a DMAengine framework based buffer")
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Alexandru Ardelean
     
  • commit e31b617d0a63c6558485aaa730fd162faa95a766 upstream.

    The external clock frequency was set only when selecting
    the internal clock, which is fixed at 4.9152 Mhz.

    This is incorrect, since it should be set when any of
    the external clock or crystal settings is selected.

    Added range validation for the external (crystal/clock)
    frequency setting.
    Valid values are between 2.4576 and 5.12 Mhz.

    Signed-off-by: Alexandru Ardelean
    Cc:
    Signed-off-by: Jonathan Cameron
    Signed-off-by: Greg Kroah-Hartman

    Alexandru Ardelean
     
  • commit 02b7b2844c2ffd3b614ec2b9293e8c7f041d60da upstream.

    Selecting GENERIC_MSI_IRQ_DOMAIN on x86 causes a compile-time error in
    some configurations:

    drivers/base/platform-msi.c:37:19: error: field 'arg' has incomplete type

    On the other architectures, we are fine, but here we should have an additional
    dependency on X86_LOCAL_APIC so we can get the PCI_MSI_IRQ_DOMAIN symbol.

    Cc: stable@vger.kernel.org
    Signed-off-by: Arnd Bergmann
    Signed-off-by: Greg Kroah-Hartman

    Arnd Bergmann
     
  • commit 8ca86f1639ec5890d400fff9211aca22d0a392eb upstream.

    The format specifier "%p" can leak kernel addresses. Use
    "%pK" instead. There were 4 remaining cases in binder.c.

    Signed-off-by: Todd Kjos
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Todd Kjos
     
  • commit f88982679f54f75daa5b8eff3da72508f1e7422f upstream.

    If the kzalloc() in binder_get_thread() fails, binder_poll()
    dereferences the resulting NULL pointer.

    Fix it by returning POLLERR if the memory allocation failed.

    This bug was found by syzkaller using fault injection.

    Reported-by: syzbot
    Fixes: 457b9a6f09f0 ("Staging: android: add binder driver")
    Cc: stable@vger.kernel.org
    Signed-off-by: Eric Biggers
    Signed-off-by: Greg Kroah-Hartman

    Eric Biggers
     
  • commit ce8a3a9e76d0193e2e8d74a06d275b3c324ca652 upstream.

    ashmem_pin_unpin() reads asma->file and asma->size before taking the
    ashmem_mutex, so it can race with other operations that modify them.

    Build-tested only.

    Signed-off-by: Ben Hutchings
    Signed-off-by: Greg Kroah-Hartman

    Ben Hutchings
     
  • commit 5eeb2ca02a2f6084fc57ae5c244a38baab07033a upstream.

    To prevent races with ep_remove_waitqueue() removing the
    waitqueue at the same time.

    Reported-by: syzbot+a2a3c4909716e271487e@syzkaller.appspotmail.com
    Signed-off-by: Martijn Coenen
    Cc: stable # 4.14+
    Signed-off-by: Greg Kroah-Hartman

    Martijn Coenen
     
  • commit e46a3b3ba7509cb7fda0e07bc7c63a2cd90f579b upstream.

    binder_send_failed_reply() is called when a synchronous
    transaction fails. It reports an error to the thread that
    is waiting for the completion. Given that the transaction
    is synchronous, there should never be more than 1 error
    response to that thread -- this was being asserted with
    a WARN().

    However, when exercising the driver with syzbot tests, cases
    were observed where multiple "synchronous" requests were
    sent without waiting for responses, so it is possible that
    multiple errors would be reported to the thread. This testing
    was conducted with panic_on_warn set which forced the crash.

    This is easily reproduced by sending back-to-back
    "synchronous" transactions without checking for any
    response (eg, set read_size to 0):

    bwr.write_buffer = (uintptr_t)&bc1;
    bwr.write_size = sizeof(bc1);
    bwr.read_buffer = (uintptr_t)&br;
    bwr.read_size = 0;
    ioctl(fd, BINDER_WRITE_READ, &bwr);
    sleep(1);
    bwr2.write_buffer = (uintptr_t)&bc2;
    bwr2.write_size = sizeof(bc2);
    bwr2.read_buffer = (uintptr_t)&br;
    bwr2.read_size = 0;
    ioctl(fd, BINDER_WRITE_READ, &bwr2);
    sleep(1);

    The first transaction is sent to the servicemanager and the reply
    fails because no VMA is set up by this client. After
    binder_send_failed_reply() is called, the BINDER_WORK_RETURN_ERROR
    is sitting on the thread's todo list since the read_size was 0 and
    the client is not waiting for a response.

    The 2nd transaction is sent and the BINDER_WORK_RETURN_ERROR has not
    been consumed, so the thread's reply_error.cmd is still set (normally
    cleared when the BINDER_WORK_RETURN_ERROR is handled). Therefore
    when the servicemanager attempts to reply to the 2nd failed
    transaction, the error is already set and it triggers this warning.

    This is a user error since it is not waiting for the synchronous
    transaction to complete. If it ever does check, it will see an
    error.

    Changed the WARN() to a pr_warn().

    Signed-off-by: Todd Kjos
    Reported-by: syzbot
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Todd Kjos
     
  • commit dfec091439bb2acf763497cfc58f2bdfc67c56b7 upstream.

    After commit 3f34cfae1238 ("netfilter: on sockopt() acquire sock lock
    only in the required scope"), the caller of nf_{get/set}sockopt() must
    not hold any lock, but, in such changeset, I forgot to cope with DECnet.

    This commit addresses the issue moving the nf call outside the lock,
    in the dn_{get,set}sockopt() with the same schema currently used by
    ipv4 and ipv6. Also moves the unhandled sockopts of the end of the main
    switch statements, to improve code readability.

    Reported-by: Petr Vandrovec
    BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=198791#c2
    Fixes: 3f34cfae1238 ("netfilter: on sockopt() acquire sock lock only in the required scope")
    Signed-off-by: Paolo Abeni
    Signed-off-by: David S. Miller
    Signed-off-by: Greg Kroah-Hartman

    Paolo Abeni