1. 26 Sep, 2018 26 commits
    • Randy Dunlap's avatar
      platform/x86: toshiba_acpi: Fix defined but not used build warnings · da189ebd
      Randy Dunlap authored
      [ Upstream commit c2e2a618 ]
      
      Fix a build warning in toshiba_acpi.c when CONFIG_PROC_FS is not enabled
      by marking the unused function as __maybe_unused.
      
      ../drivers/platform/x86/toshiba_acpi.c:1685:12: warning: 'version_proc_show' defined but not used [-Wunused-function]
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Azael Avalos <coproscefalo@gmail.com>
      Cc: platform-driver-x86@vger.kernel.org
      Cc: Andy Shevchenko <andy@infradead.org>
      Signed-off-by: default avatarDarren Hart (VMware) <dvhart@infradead.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      da189ebd
    • Julian Wiedmann's avatar
      s390/qeth: reset layer2 attribute on layer switch · a4b8132c
      Julian Wiedmann authored
      [ Upstream commit 70551dc4 ]
      
      After the subdriver's remove() routine has completed, the card's layer
      mode is undetermined again. Reflect this in the layer2 field.
      
      If qeth_dev_layer2_store() hits an error after remove() was called, the
      card _always_ requires a setup(), even if the previous layer mode is
      requested again.
      But qeth_dev_layer2_store() bails out early if the requested layer mode
      still matches the current one. So unless we reset the layer2 field,
      re-probing the card back to its previous mode is currently not possible.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a4b8132c
    • Julian Wiedmann's avatar
      s390/qeth: fix race in used-buffer accounting · 29162495
      Julian Wiedmann authored
      [ Upstream commit a702349a ]
      
      By updating q->used_buffers only _after_ do_QDIO() has completed, there
      is a potential race against the buffer's TX completion. In the unlikely
      case that the TX completion path wins, qeth_qdio_output_handler() would
      decrement the counter before qeth_flush_buffers() even incremented it.
      Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      29162495
    • Loic Poulain's avatar
      arm64: dts: qcom: db410c: Fix Bluetooth LED trigger · 4f3381ab
      Loic Poulain authored
      [ Upstream commit e53db018 ]
      
      Current LED trigger, 'bt', is not known/used by any existing driver.
      Fix this by renaming it to 'bluetooth-power' trigger which is
      controlled by the Bluetooth subsystem.
      
      Fixes: 9943230c ("arm64: dts: qcom: Add apq8016-sbc board LED's related device nodes")
      Signed-off-by: default avatarLoic Poulain <loic.poulain@linaro.org>
      Signed-off-by: default avatarAndy Gross <andy.gross@linaro.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4f3381ab
    • Vitaly Kuznetsov's avatar
      xen-netfront: fix queue name setting · 2e0c018c
      Vitaly Kuznetsov authored
      [ Upstream commit 2d408c0d ]
      
      Commit f599c64f ("xen-netfront: Fix race between device setup and
      open") changed the initialization order: xennet_create_queues() now
      happens before we do register_netdev() so using netdev->name in
      xennet_init_queue() is incorrect, we end up with the following in
      /proc/interrupts:
      
       60:        139          0   xen-dyn    -event     eth%d-q0-tx
       61:        265          0   xen-dyn    -event     eth%d-q0-rx
       62:        234          0   xen-dyn    -event     eth%d-q1-tx
       63:          1          0   xen-dyn    -event     eth%d-q1-rx
      
      and this looks ugly. Actually, using early netdev name (even when it's
      already set) is also not ideal: nowadays we tend to rename eth devices
      and queue name may end up not corresponding to the netdev name.
      
      Use nodename from xenbus device for queue naming: this can't change in VM's
      lifetime. Now /proc/interrupts looks like
      
       62:        202          0   xen-dyn    -event     device/vif/0-q0-tx
       63:        317          0   xen-dyn    -event     device/vif/0-q0-rx
       64:        262          0   xen-dyn    -event     device/vif/0-q1-tx
       65:         17          0   xen-dyn    -event     device/vif/0-q1-rx
      
      Fixes: f599c64f ("xen-netfront: Fix race between device setup and open")
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Reviewed-by: default avatarRoss Lagerwall <ross.lagerwall@citrix.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2e0c018c
    • Manikanta Pubbisetty's avatar
      mac80211: restrict delayed tailroom needed decrement · 77332078
      Manikanta Pubbisetty authored
      [ Upstream commit 133bf90d ]
      
      As explained in ieee80211_delayed_tailroom_dec(), during roam,
      keys of the old AP will be destroyed and new keys will be
      installed. Deletion of the old key causes
      crypto_tx_tailroom_needed_cnt to go from 1 to 0 and the new key
      installation causes a transition from 0 to 1.
      
      Whenever crypto_tx_tailroom_needed_cnt transitions from 0 to 1,
      we invoke synchronize_net(); the reason for doing this is to avoid
      a race in the TX path as explained in increment_tailroom_need_count().
      This synchronize_net() operation can be slow and can affect the station
      roam time. To avoid this, decrementing the crypto_tx_tailroom_needed_cnt
      is delayed for a while so that upon installation of new key the
      transition would be from 1 to 2 instead of 0 to 1 and thereby
      improving the roam time.
      
      This is all correct for a STA iftype, but deferring the tailroom_needed
      decrement for other iftypes may be unnecessary.
      
      For example, let's consider the case of a 4-addr client connecting to
      an AP for which AP_VLAN interface is also created, let the initial
      value for tailroom_needed on the AP be 1.
      
      * 4-addr client connects to the AP (AP: tailroom_needed = 1)
      * AP will clear old keys, delay decrement of tailroom_needed count
      * AP_VLAN is created, it takes the tailroom count from master
        (AP_VLAN: tailroom_needed = 1, AP: tailroom_needed = 1)
      * Install new key for the station, assume key is plumbed in the HW,
        there won't be any change in tailroom_needed count on AP iface
      * Delayed decrement of tailroom_needed count on AP
        (AP: tailroom_needed = 0, AP_VLAN: tailroom_needed = 1)
      
      Because of the delayed decrement on AP iface, tailroom_needed count goes
      out of sync between AP(master iface) and AP_VLAN(slave iface) and
      there would be unnecessary tailroom created for the packets going
      through AP_VLAN iface.
      
      Also, WARN_ONs were observed while trying to bring down the AP_VLAN
      interface:
      (warn_slowpath_common) (warn_slowpath_null+0x18/0x20)
      (warn_slowpath_null) (ieee80211_free_keys+0x114/0x1e4)
      (ieee80211_free_keys) (ieee80211_del_virtual_monitor+0x51c/0x850)
      (ieee80211_del_virtual_monitor) (ieee80211_stop+0x30/0x3c)
      (ieee80211_stop) (__dev_close_many+0x94/0xb8)
      (__dev_close_many) (dev_close_many+0x5c/0xc8)
      
      Restricting delayed decrement to station interface alone fixes the problem
      and it makes sense to do so because delayed decrement is done to improve
      roam time which is applicable only for client devices.
      Signed-off-by: default avatarManikanta Pubbisetty <mpubbise@codeaurora.org>
      Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      77332078
    • Paul Cercueil's avatar
      MIPS: jz4740: Bump zload address · 2ca7b66d
      Paul Cercueil authored
      [ Upstream commit c6ea7e97 ]
      
      Having the zload address at 0x8060.0000 means the size of the
      uncompressed kernel cannot be bigger than around 6 MiB, as it is
      deflated at address 0x8001.0000.
      
      This limit is too small; a kernel with some built-in drivers and things
      like debugfs enabled will already be over 6 MiB in size, and so will
      fail to extract properly.
      
      To fix this, we bump the zload address from 0x8060.0000 to 0x8100.0000.
      
      This is fine, as all the boards featuring Ingenic JZ SoCs have at least
      32 MiB of RAM, and use u-boot or compatible bootloaders which won't
      hardcode the load address but read it from the uImage's header.
      Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/19787/
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: James Hogan <jhogan@kernel.org>
      Cc: linux-mips@linux-mips.org
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2ca7b66d
    • Nicholas Piggin's avatar
      powerpc/powernv: opal_put_chars partial write fix · 8e8c3ba5
      Nicholas Piggin authored
      [ Upstream commit bd90284c ]
      
      The intention here is to consume and discard the remaining buffer
      upon error. This works if there has not been a previous partial write.
      If there has been, then total_len is no longer total number of bytes
      to copy. total_len is always "bytes left to copy", so it should be
      added to written bytes.
      
      This code may not be exercised any more if partial writes will not be
      hit, but this is a small bugfix before a larger change.
      Reviewed-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8e8c3ba5
    • Sandipan Das's avatar
      perf powerpc: Fix callchain ip filtering · d4aa4e4f
      Sandipan Das authored
      [ Upstream commit c715fcfd ]
      
      For powerpc64, redundant entries in the callchain are filtered out by
      determining the state of the return address and the stack frame using
      DWARF debug information.
      
      For making these filtering decisions we must analyze the debug
      information for the location corresponding to the program counter value,
      i.e. the first entry in the callchain, and not the LR value; otherwise,
      perf may filter out either the second or the third entry in the
      callchain incorrectly.
      
      This can be observed on a powerpc64le system running Fedora 27 as shown
      below.
      
      Case 1 - Attaching a probe at inet_pton+0x8 (binary offset 0x15af28).
               Return address is still in LR and a new stack frame is not yet
               allocated. The LR value, i.e. the second entry, should not be
      	 filtered out.
      
        # objdump -d /usr/lib64/libc-2.26.so | less
        ...
        000000000010eb10 <gaih_inet.constprop.7>:
        ...
          10fa48:       78 bb e4 7e     mr      r4,r23
          10fa4c:       0a 00 60 38     li      r3,10
          10fa50:       d9 b4 04 48     bl      15af28 <inet_pton+0x8>
          10fa54:       00 00 00 60     nop
          10fa58:       ac f4 ff 4b     b       10ef04 <gaih_inet.constprop.7+0x3f4>
        ...
        0000000000110450 <getaddrinfo>:
        ...
          1105a8:       54 00 ff 38     addi    r7,r31,84
          1105ac:       58 00 df 38     addi    r6,r31,88
          1105b0:       69 e5 ff 4b     bl      10eb18 <gaih_inet.constprop.7+0x8>
          1105b4:       78 1b 71 7c     mr      r17,r3
          1105b8:       50 01 7f e8     ld      r3,336(r31)
        ...
        000000000015af20 <inet_pton>:
          15af20:       0b 00 4c 3c     addis   r2,r12,11
          15af24:       e0 c1 42 38     addi    r2,r2,-15904
          15af28:       a6 02 08 7c     mflr    r0
          15af2c:       f0 ff c1 fb     std     r30,-16(r1)
          15af30:       f8 ff e1 fb     std     r31,-8(r1)
        ...
      
        # perf probe -x /usr/lib64/libc-2.26.so -a inet_pton+0x8
        # perf record -e probe_libc:inet_pton -g ping -6 -c 1 ::1
        # perf script
      
      Before:
      
        ping  4507 [002] 514985.546540: probe_libc:inet_pton: (7fffa7dbaf28)
                    7fffa7dbaf28 __GI___inet_pton+0x8 (/usr/lib64/libc-2.26.so)
                    7fffa7d705b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so)
                       13fb52d70 _init+0xbfc (/usr/bin/ping)
                    7fffa7c836a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so)
                    7fffa7c83898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so)
                               0 [unknown] ([unknown])
      
      After:
      
        ping  4507 [002] 514985.546540: probe_libc:inet_pton: (7fffa7dbaf28)
                    7fffa7dbaf28 __GI___inet_pton+0x8 (/usr/lib64/libc-2.26.so)
                    7fffa7d6fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so)
                    7fffa7d705b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so)
                       13fb52d70 _init+0xbfc (/usr/bin/ping)
                    7fffa7c836a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so)
                    7fffa7c83898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so)
                               0 [unknown] ([unknown])
      
      Case 2 - Attaching a probe at _int_malloc+0x180 (binary offset 0x9cf10).
               Return address in still in LR and a new stack frame has already
               been allocated but not used. The caller's caller, i.e. the third
      	 entry, is invalid and should be filtered out and not the second
      	 one.
      
        # objdump -d /usr/lib64/libc-2.26.so | less
        ...
        000000000009cd90 <_int_malloc>:
           9cd90:       17 00 4c 3c     addis   r2,r12,23
           9cd94:       70 a3 42 38     addi    r2,r2,-23696
           9cd98:       26 00 80 7d     mfcr    r12
           9cd9c:       f8 ff e1 fb     std     r31,-8(r1)
           9cda0:       17 00 e4 3b     addi    r31,r4,23
           9cda4:       d8 ff 61 fb     std     r27,-40(r1)
           9cda8:       78 23 9b 7c     mr      r27,r4
           9cdac:       1f 00 bf 2b     cmpldi  cr7,r31,31
           9cdb0:       f0 ff c1 fb     std     r30,-16(r1)
           9cdb4:       b0 ff c1 fa     std     r22,-80(r1)
           9cdb8:       78 1b 7e 7c     mr      r30,r3
           9cdbc:       08 00 81 91     stw     r12,8(r1)
           9cdc0:       11 ff 21 f8     stdu    r1,-240(r1)
           9cdc4:       4c 01 9d 41     bgt     cr7,9cf10 <_int_malloc+0x180>
           9cdc8:       20 00 a4 2b     cmpldi  cr7,r4,32
        ...
           9cf08:       00 00 00 60     nop
           9cf0c:       00 00 42 60     ori     r2,r2,0
           9cf10:       e4 06 ff 7b     rldicr  r31,r31,0,59
           9cf14:       40 f8 a4 7f     cmpld   cr7,r4,r31
           9cf18:       68 05 9d 41     bgt     cr7,9d480 <_int_malloc+0x6f0>
        ...
        000000000009e3c0 <tcache_init.part.4>:
        ...
           9e420:       40 02 80 38     li      r4,576
           9e424:       78 fb e3 7f     mr      r3,r31
           9e428:       71 e9 ff 4b     bl      9cd98 <_int_malloc+0x8>
           9e42c:       00 00 a3 2f     cmpdi   cr7,r3,0
           9e430:       78 1b 7e 7c     mr      r30,r3
        ...
        000000000009f7a0 <__libc_malloc>:
        ...
           9f8f8:       00 00 89 2f     cmpwi   cr7,r9,0
           9f8fc:       1c ff 9e 40     bne     cr7,9f818 <__libc_malloc+0x78>
           9f900:       c9 ea ff 4b     bl      9e3c8 <tcache_init.part.4+0x8>
           9f904:       00 00 00 60     nop
           9f908:       e8 90 22 e9     ld      r9,-28440(r2)
        ...
      
        # perf probe -x /usr/lib64/libc-2.26.so -a _int_malloc+0x180
        # perf record -e probe_libc:_int_malloc -g ./test-malloc
        # perf script
      
      Before:
      
        test-malloc  6554 [009] 515975.797403: probe_libc:_int_malloc: (7fffa6e6cf10)
                    7fffa6e6cf10 _int_malloc+0x180 (/usr/lib64/libc-2.26.so)
                    7fffa6dd0000 [unknown] (/usr/lib64/libc-2.26.so)
                    7fffa6e6f904 malloc+0x164 (/usr/lib64/libc-2.26.so)
                    7fffa6e6f9fc malloc+0x25c (/usr/lib64/libc-2.26.so)
                        100006b4 main+0x38 (/home/testuser/test-malloc)
                    7fffa6df36a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so)
                    7fffa6df3898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so)
                               0 [unknown] ([unknown])
      
      After:
      
        test-malloc  6554 [009] 515975.797403: probe_libc:_int_malloc: (7fffa6e6cf10)
                    7fffa6e6cf10 _int_malloc+0x180 (/usr/lib64/libc-2.26.so)
                    7fffa6e6e42c tcache_init.part.4+0x6c (/usr/lib64/libc-2.26.so)
                    7fffa6e6f904 malloc+0x164 (/usr/lib64/libc-2.26.so)
                    7fffa6e6f9fc malloc+0x25c (/usr/lib64/libc-2.26.so)
                        100006b4 main+0x38 (/home/sandipan/test-malloc)
                    7fffa6df36a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so)
                    7fffa6df3898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so)
                               0 [unknown] ([unknown])
      Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Maynard Johnson <maynard@us.ibm.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Fixes: a60335ba ("perf tools powerpc: Adjust callchain based on DWARF debug info")
      Link: http://lkml.kernel.org/r/24bb726d91ed173aebc972ec3f41a2ef2249434e.1530724939.git.sandipan@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d4aa4e4f
    • Krzysztof Kozlowski's avatar
      ARM: exynos: Clear global variable on init error path · 016353ef
      Krzysztof Kozlowski authored
      [ Upstream commit cd480691 ]
      
      For most of Exynos SoCs, Power Management Unit (PMU) address space is
      mapped into global variable 'pmu_base_addr' very early when initializing
      PMU interrupt controller.  A lot of other machine code depends on it so
      when doing iounmap() on this address, clear the global as well to avoid
      usage of invalid value (pointing to unmapped memory region).
      
      Properly mapped PMU address space is a requirement for all other machine
      code so this fix is purely theoretical.  Boot will fail immediately in
      many other places after following this error path.
      Signed-off-by: default avatarKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      016353ef
    • Fredrik Noring's avatar
      fbdev: Distinguish between interlaced and progressive modes · 57a1dd74
      Fredrik Noring authored
      [ Upstream commit 1ba0a59c ]
      
      I discovered the problem when developing a frame buffer driver for the
      PlayStation 2 (not yet merged), using the following video modes for the
      PlayStation 3 in drivers/video/fbdev/ps3fb.c:
      
          }, {
              /* 1080if */
              "1080if", 50, 1920, 1080, 13468, 148, 484, 36, 4, 88, 5,
              FB_SYNC_BROADCAST, FB_VMODE_INTERLACED
          }, {
              /* 1080pf */
              "1080pf", 50, 1920, 1080, 6734, 148, 484, 36, 4, 88, 5,
              FB_SYNC_BROADCAST, FB_VMODE_NONINTERLACED
          },
      
      In ps3fb_probe, the mode_option module parameter is used with fb_find_mode
      but it can only select the interlaced variant of 1920x1080 since the loop
      matching the modes does not take the difference between interlaced and
      progressive modes into account.
      
      In short, without the patch, progressive 1920x1080 cannot be chosen as a
      mode_option parameter since fb_find_mode (falsely) thinks interlace is a
      perfect match.
      Signed-off-by: default avatarFredrik Noring <noring@nocrew.org>
      Cc: "Maciej W. Rozycki" <macro@linux-mips.org>
      [b.zolnierkie: updated patch description]
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      57a1dd74
    • Sandipan Das's avatar
      perf powerpc: Fix callchain ip filtering when return address is in a register · e71975f0
      Sandipan Das authored
      [ Upstream commit 9068533e ]
      
      For powerpc64, perf will filter out the second entry in the callchain,
      i.e. the LR value, if the return address of the function corresponding
      to the probed location has already been saved on its caller's stack.
      
      The state of the return address is determined using debug information.
      At any point within a function, if the return address is already saved
      somewhere, a DWARF expression can tell us about its location. If the
      return address in still in LR only, no DWARF expression would exist.
      
      Typically, the instructions in a function's prologue first copy the LR
      value to R0 and then pushes R0 on to the stack. If LR has already been
      copied to R0 but R0 is yet to be pushed to the stack, we can still get a
      DWARF expression that says that the return address is in R0. This is
      indicating that getting a DWARF expression for the return address does
      not guarantee the fact that it has already been saved on the stack.
      
      This can be observed on a powerpc64le system running Fedora 27 as shown
      below.
      
        # objdump -d /usr/lib64/libc-2.26.so | less
        ...
        000000000015af20 <inet_pton>:
          15af20:       0b 00 4c 3c     addis   r2,r12,11
          15af24:       e0 c1 42 38     addi    r2,r2,-15904
          15af28:       a6 02 08 7c     mflr    r0
          15af2c:       f0 ff c1 fb     std     r30,-16(r1)
          15af30:       f8 ff e1 fb     std     r31,-8(r1)
          15af34:       78 1b 7f 7c     mr      r31,r3
          15af38:       78 23 83 7c     mr      r3,r4
          15af3c:       78 2b be 7c     mr      r30,r5
          15af40:       10 00 01 f8     std     r0,16(r1)
          15af44:       c1 ff 21 f8     stdu    r1,-64(r1)
          15af48:       28 00 81 f8     std     r4,40(r1)
        ...
      
        # readelf --debug-dump=frames-interp /usr/lib64/libc-2.26.so | less
        ...
        00027024 0000000000000024 00027028 FDE cie=00000000 pc=000000000015af20..000000000015af88
           LOC           CFA      r30   r31   ra
        000000000015af20 r1+0     u     u     u
        000000000015af34 r1+0     c-16  c-8   r0
        000000000015af48 r1+64    c-16  c-8   c+16
        000000000015af5c r1+0     c-16  c-8   c+16
        000000000015af78 r1+0     u     u
        ...
      
        # perf probe -x /usr/lib64/libc-2.26.so -a inet_pton+0x18
        # perf record -e probe_libc:inet_pton -g ping -6 -c 1 ::1
        # perf script
      
      Before:
      
        ping  2829 [005] 512917.460174: probe_libc:inet_pton: (7fff7e2baf38)
                    7fff7e2baf38 __GI___inet_pton+0x18 (/usr/lib64/libc-2.26.so)
                    7fff7e2705b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so)
                       12f152d70 _init+0xbfc (/usr/bin/ping)
                    7fff7e1836a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so)
                    7fff7e183898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so)
                               0 [unknown] ([unknown])
      
      After:
      
        ping  2829 [005] 512917.460174: probe_libc:inet_pton: (7fff7e2baf38)
                    7fff7e2baf38 __GI___inet_pton+0x18 (/usr/lib64/libc-2.26.so)
                    7fff7e26fa54 gaih_inet.constprop.7+0xf44 (/usr/lib64/libc-2.26.so)
                    7fff7e2705b4 getaddrinfo+0x164 (/usr/lib64/libc-2.26.so)
                       12f152d70 _init+0xbfc (/usr/bin/ping)
                    7fff7e1836a0 generic_start_main.isra.0+0x140 (/usr/lib64/libc-2.26.so)
                    7fff7e183898 __libc_start_main+0xb8 (/usr/lib64/libc-2.26.so)
                               0 [unknown] ([unknown])
      Reported-by: default avatarRavi Bangoria <ravi.bangoria@linux.ibm.com>
      Signed-off-by: default avatarSandipan Das <sandipan@linux.ibm.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Maynard Johnson <maynard@us.ibm.com>
      Cc: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com>
      Cc: Ravi Bangoria <ravi.bangoria@linux.vnet.ibm.com>
      Cc: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Link: http://lkml.kernel.org/r/66e848a7bdf2d43b39210a705ff6d828a0865661.1530724939.git.sandipan@linux.ibm.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e71975f0
    • Randy Dunlap's avatar
      fbdev/via: fix defined but not used warning · 5a85c8d6
      Randy Dunlap authored
      [ Upstream commit b6566b47 ]
      
      Fix a build warning in viafbdev.c when CONFIG_PROC_FS is not enabled
      by marking the unused function as __maybe_unused.
      
      ../drivers/video/fbdev/via/viafbdev.c:1471:12: warning: 'viafb_sup_odev_proc_show' defined but not used [-Wunused-function]
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Cc: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5a85c8d6
    • Anton Vasilyev's avatar
      video: goldfishfb: fix memory leak on driver remove · 1401b76d
      Anton Vasilyev authored
      [ Upstream commit 5958fde7 ]
      
      goldfish_fb_probe() allocates memory for fb, but goldfish_fb_remove() does
      not have deallocation of fb, which leads to memory leak on probe/remove.
      
      The patch adds deallocation into goldfish_fb_remove().
      
      Found by Linux Driver Verification project (linuxtesting.org).
      Signed-off-by: default avatarAnton Vasilyev <vasilyev@ispras.ru>
      Cc: Aleksandar Markovic <aleksandar.markovic@mips.com>
      Cc: Miodrag Dinic <miodrag.dinic@mips.com>
      Cc: Goran Ferenc <goran.ferenc@mips.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1401b76d
    • Dan Carpenter's avatar
      fbdev: omapfb: off by one in omapfb_register_client() · 98c05956
      Dan Carpenter authored
      [ Upstream commit 5ec1ec35 ]
      
      The omapfb_register_client[] array has OMAPFB_PLANE_NUM elements so the
      > should be >= or we are one element beyond the end of the array.
      
      Fixes: 8b08cf2b ("OMAP: add TI OMAP framebuffer driver")
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Cc: Imre Deak <imre.deak@solidboot.com>
      Signed-off-by: default avatarBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      98c05956
    • Randy Dunlap's avatar
      mtd/maps: fix solutionengine.c printk format warnings · 66e32b78
      Randy Dunlap authored
      [ Upstream commit 1d25e3ee ]
      
      Fix 2 printk format warnings (this driver is currently only used by
      arch/sh/) by using "%pap" instead of "%lx".
      
      Fixes these build warnings:
      
      ../drivers/mtd/maps/solutionengine.c: In function 'init_soleng_maps':
      ../include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 2 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
      ../drivers/mtd/maps/solutionengine.c:62:54: note: format string is defined here
        printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n",
                                                        ~~~~^
                                                        %08x
      ../include/linux/kern_levels.h:5:18: warning: format '%lx' expects argument of type 'long unsigned int', but argument 3 has type 'resource_size_t' {aka 'unsigned int'} [-Wformat=]
      ../drivers/mtd/maps/solutionengine.c:62:72: note: format string is defined here
        printk(KERN_NOTICE "Solution Engine: Flash at 0x%08lx, EPROM at 0x%08lx\n",
                                                                          ~~~~^
                                                                          %08x
      
      Cc: David Woodhouse <dwmw2@infradead.org>
      Cc: Brian Norris <computersforpeace@gmail.com>
      Cc: Boris Brezillon <boris.brezillon@bootlin.com>
      Cc: Marek Vasut <marek.vasut@gmail.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: linux-mtd@lists.infradead.org
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Cc: linux-sh@vger.kernel.org
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Signed-off-by: default avatarRandy Dunlap <rdunlap@infradead.org>
      Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      66e32b78
    • Hans Verkuil's avatar
      media: videobuf2-core: check for q->error in vb2_core_qbuf() · 0eda7472
      Hans Verkuil authored
      [ Upstream commit b509d733 ]
      
      The vb2_core_qbuf() function didn't check if q->error was set. It is
      checked in __buf_prepare(), but that function isn't called if the buffer
      was already prepared before with VIDIOC_PREPARE_BUF.
      
      So check it at the start of vb2_core_qbuf() as well.
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Acked-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
      Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
      Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0eda7472
    • Felix Fietkau's avatar
      MIPS: ath79: fix system restart · 9f6d6fb5
      Felix Fietkau authored
      [ Upstream commit f8a7bfe1 ]
      
      This patch disables irq on reboot to fix hang issues that were observed
      due to pending interrupts.
      Signed-off-by: default avatarFelix Fietkau <nbd@nbd.name>
      Signed-off-by: default avatarJohn Crispin <john@phrozen.org>
      Signed-off-by: default avatarPaul Burton <paul.burton@mips.com>
      Patchwork: https://patchwork.linux-mips.org/patch/19913/
      Cc: James Hogan <jhogan@kernel.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: linux-mips@linux-mips.org
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9f6d6fb5
    • John Keeping's avatar
      dmaengine: pl330: fix irq race with terminate_all · 46c66ac9
      John Keeping authored
      [ Upstream commit e4975654 ]
      
      In pl330_update() when checking if a channel has been aborted, the
      channel's lock is not taken, only the overall pl330_dmac lock.  But in
      pl330_terminate_all() the aborted flag (req_running==-1) is set under
      the channel lock and not the pl330_dmac lock.
      
      With threaded interrupts, this leads to a potential race:
      
          pl330_terminate_all	        pl330_update
          -------------------         ------------
          lock channel
                                      entry
          lock pl330
          _stop channel
          unlock pl330
                                      lock pl330
                                      check req_running != -1
          req_running = -1
                                      _start channel
      Signed-off-by: default avatarJohn Keeping <john@metanate.com>
      Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      46c66ac9
    • Masahiro Yamada's avatar
      kbuild: add .DELETE_ON_ERROR special target · d6ac46c7
      Masahiro Yamada authored
      [ Upstream commit 9c2af1c7 ]
      
      If Make gets a fatal signal while a shell is executing, it may delete
      the target file that the recipe was supposed to update.  This is needed
      to make sure that it is remade from scratch when Make is next run; if
      Make is interrupted after the recipe has begun to write the target file,
      it results in an incomplete file whose time stamp is newer than that
      of the prerequisites files.  Make automatically deletes the incomplete
      file on interrupt unless the target is marked .PRECIOUS.
      
      The situation is just the same as when the shell fails for some reasons.
      Usually when a recipe line fails, if it has changed the target file at
      all, the file is corrupted, or at least it is not completely updated.
      Yet the file’s time stamp says that it is now up to date, so the next
      time Make runs, it will not try to update that file.
      
      However, Make does not cater to delete the incomplete target file in
      this case.  We need to add .DELETE_ON_ERROR somewhere in the Makefile
      to request it.
      
      scripts/Kbuild.include seems a suitable place to add it because it is
      included from almost all sub-makes.
      
      Please note .DELETE_ON_ERROR is not effective for phony targets.
      
      The external module building should never ever touch the kernel tree.
      The following recipe fails if include/generated/autoconf.h is missing.
      However, include/config/auto.conf is not deleted since it is a phony
      target.
      
       PHONY += include/config/auto.conf
      
       include/config/auto.conf:
               $(Q)test -e include/generated/autoconf.h -a -e $@ || (          \
               echo >&2;                                                       \
               echo >&2 "  ERROR: Kernel configuration is invalid.";           \
               echo >&2 "         include/generated/autoconf.h or $@ are missing.";\
               echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it."; \
               echo >&2 ;                                                      \
               /bin/false)
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d6ac46c7
    • Nicholas Mc Guire's avatar
      clk: imx6ul: fix missing of_node_put() · 210006ef
      Nicholas Mc Guire authored
      [ Upstream commit 11177e7a ]
      
      of_find_compatible_node() is returning a device node with refcount
      incremented and must be explicitly decremented after the last use
      which is right after the us in of_iomap() here.
      Signed-off-by: default avatarNicholas Mc Guire <hofrat@osadl.org>
      Fixes: 787b4271 ("clk: imx: add imx6ul clk tree support")
      Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      210006ef
    • Andreas Gruenbacher's avatar
      gfs2: Special-case rindex for gfs2_grow · 9e8d585c
      Andreas Gruenbacher authored
      [ Upstream commit 77612578 ]
      
      To speed up the common case of appending to a file,
      gfs2_write_alloc_required presumes that writing beyond the end of a file
      will always require additional blocks to be allocated.  This assumption
      is incorrect for preallocates files, but there are no negative
      consequences as long as *some* space is still left on the filesystem.
      
      One special file that always has some space preallocated beyond the end
      of the file is the rindex: when growing a filesystem, gfs2_grow adds one
      or more new resource groups and appends records describing those
      resource groups to the rindex; the preallocated space ensures that this
      is always possible.
      
      However, when a filesystem is completely full, gfs2_write_alloc_required
      will indicate that an additional allocation is required, and appending
      the next record to the rindex will fail even though space for that
      record has already been preallocated.  To fix that, skip the incorrect
      optimization in gfs2_write_alloc_required, but for the rindex only.
      Other writes to preallocated space beyond the end of the file are still
      allowed to fail on completely full filesystems.
      Signed-off-by: default avatarAndreas Gruenbacher <agruenba@redhat.com>
      Reviewed-by: default avatarBob Peterson <rpeterso@redhat.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9e8d585c
    • YueHaibing's avatar
      xfrm: fix 'passing zero to ERR_PTR()' warning · 1e89472f
      YueHaibing authored
      [ Upstream commit 934ffce1 ]
      
      Fix a static code checker warning:
      
        net/xfrm/xfrm_policy.c:1836 xfrm_resolve_and_create_bundle() warn: passing zero to 'ERR_PTR'
      
      xfrm_tmpl_resolve return 0 just means no xdst found, return NULL
      instead of passing zero to ERR_PTR.
      
      Fixes: d809ec89 ("xfrm: do not assume that template resolving always returns xfrms")
      Signed-off-by: default avatarYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1e89472f
    • Takashi Iwai's avatar
      ALSA: usb-audio: Fix multiple definitions in AU0828_DEVICE() macro · 650ca59a
      Takashi Iwai authored
      [ Upstream commit bd1cd0eb ]
      
      AU0828_DEVICE() macro in quirks-table.h uses USB_DEVICE_VENDOR_SPEC()
      for expanding idVendor and idProduct fields.  However, the latter
      macro adds also match_flags and bInterfaceClass, which are different
      from the values AU0828_DEVICE() macro sets after that.
      
      For fixing them, just expand idVendor and idProduct fields manually in
      AU0828_DEVICE().
      
      This fixes sparse warnings like:
        sound/usb/quirks-table.h:2892:1: warning: Initializer entry defined twice
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      650ca59a
    • Takashi Iwai's avatar
      ALSA: msnd: Fix the default sample sizes · 5df13ba4
      Takashi Iwai authored
      [ Upstream commit 7c500f9e ]
      
      The default sample sizes set by msnd driver are bogus; it sets ALSA
      PCM format, not the actual bit width.
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5df13ba4
    • Miao Zhong's avatar
      iommu/arm-smmu-v3: sync the OVACKFLG to PRIQ consumer register · a8323a85
      Miao Zhong authored
      [ Upstream commit 0d535967 ]
      
      When PRI queue occurs overflow, driver should update the OVACKFLG to
      the PRIQ consumer register, otherwise subsequent PRI requests will not
      be processed.
      
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Signed-off-by: default avatarMiao Zhong <zhongmiao@hisilicon.com>
      Signed-off-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarSasha Levin <alexander.levin@microsoft.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a8323a85
  2. 19 Sep, 2018 14 commits