1. 14 3月, 2019 40 次提交
    • P
      x86: Add TSX Force Abort CPUID/MSR · fdd82094
      Peter Zijlstra (Intel) 提交于
      commit 52f64909409c17adf54fcf5f9751e0544ca3a6b4 upstream
      
      Skylake systems will receive a microcode update to address a TSX
      errata. This microcode will (by default) clobber PMC3 when TSX
      instructions are (speculatively or not) executed.
      
      It also provides an MSR to cause all TSX transaction to abort and
      preserve PMC3.
      
      Add the CPUID enumeration and MSR definition.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fdd82094
    • P
      perf/x86/intel: Generalize dynamic constraint creation · 9e071aa6
      Peter Zijlstra (Intel) 提交于
      commit 11f8b2d65ca9029591c8df26bb6bd063c312b7fe upstream
      
      Such that we can re-use it.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9e071aa6
    • P
      perf/x86/intel: Make cpuc allocations consistent · f99f7dae
      Peter Zijlstra (Intel) 提交于
      commit d01b1f96a82e5dd7841a1d39db3abfdaf95f70ab upstream
      
      The cpuc data structure allocation is different between fake and real
      cpuc's; use the same code to init/free both.
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f99f7dae
    • G
      driver core: Postpone DMA tear-down until after devres release · 7053a6fa
      Geert Uytterhoeven 提交于
      commit 376991db4b6464e906d699ef07681e2ffa8ab08c upstream.
      
      When unbinding the (IOMMU-enabled) R-Car SATA device on Salvator-XS
      (R-Car H3 ES2.0), in preparation of rebinding against vfio-platform for
      device pass-through for virtualization:
      
          echo ee300000.sata > /sys/bus/platform/drivers/sata_rcar/unbind
      
      the kernel crashes with:
      
          Unable to handle kernel paging request at virtual address ffffffbf029ffffc
          Mem abort info:
            ESR = 0x96000006
            Exception class = DABT (current EL), IL = 32 bits
            SET = 0, FnV = 0
            EA = 0, S1PTW = 0
          Data abort info:
            ISV = 0, ISS = 0x00000006
            CM = 0, WnR = 0
          swapper pgtable: 4k pages, 39-bit VAs, pgdp = 000000007e8c586c
          [ffffffbf029ffffc] pgd=000000073bfc6003, pud=000000073bfc6003, pmd=0000000000000000
          Internal error: Oops: 96000006 [#1] SMP
          Modules linked in:
          CPU: 0 PID: 1098 Comm: bash Not tainted 5.0.0-rc5-salvator-x-00452-g37596f884f4318ef #287
          Hardware name: Renesas Salvator-X 2nd version board based on r8a7795 ES2.0+ (DT)
          pstate: 60400005 (nZCv daif +PAN -UAO)
          pc : __free_pages+0x8/0x58
          lr : __dma_direct_free_pages+0x50/0x5c
          sp : ffffff801268baa0
          x29: ffffff801268baa0 x28: 0000000000000000
          x27: ffffffc6f9c60bf0 x26: ffffffc6f9c60bf0
          x25: ffffffc6f9c60810 x24: 0000000000000000
          x23: 00000000fffff000 x22: ffffff8012145000
          x21: 0000000000000800 x20: ffffffbf029fffc8
          x19: 0000000000000000 x18: ffffffc6f86c42c8
          x17: 0000000000000000 x16: 0000000000000070
          x15: 0000000000000003 x14: 0000000000000000
          x13: ffffff801103d7f8 x12: 0000000000000028
          x11: ffffff8011117604 x10: 0000000000009ad8
          x9 : ffffff80110126d0 x8 : ffffffc6f7563000
          x7 : 6b6b6b6b6b6b6b6b x6 : 0000000000000018
          x5 : ffffff8011cf3cc8 x4 : 0000000000004000
          x3 : 0000000000080000 x2 : 0000000000000001
          x1 : 0000000000000000 x0 : ffffffbf029fffc8
          Process bash (pid: 1098, stack limit = 0x00000000c38e3e32)
          Call trace:
           __free_pages+0x8/0x58
           __dma_direct_free_pages+0x50/0x5c
           arch_dma_free+0x1c/0x98
           dma_direct_free+0x14/0x24
           dma_free_attrs+0x9c/0xdc
           dmam_release+0x18/0x20
           release_nodes+0x25c/0x28c
           devres_release_all+0x48/0x4c
           device_release_driver_internal+0x184/0x1f0
           device_release_driver+0x14/0x1c
           unbind_store+0x70/0xb8
           drv_attr_store+0x24/0x34
           sysfs_kf_write+0x4c/0x64
           kernfs_fop_write+0x154/0x1c4
           __vfs_write+0x34/0x164
           vfs_write+0xb4/0x16c
           ksys_write+0x5c/0xbc
           __arm64_sys_write+0x14/0x1c
           el0_svc_common+0x98/0x114
           el0_svc_handler+0x1c/0x24
           el0_svc+0x8/0xc
          Code: d51b4234 17fffffa a9bf7bfd 910003fd (b9403404)
          ---[ end trace 8c564cdd3a1a840f ]---
      
      While I've bisected this to commit e8e683ae9a736407 ("iommu/of: Fix
      probe-deferral"), and reverting that commit on post-v5.0-rc4 kernels
      does fix the problem, this turned out to be a red herring.
      
      On arm64, arch_teardown_dma_ops() resets dev->dma_ops to NULL.
      Hence if a driver has used a managed DMA allocation API, the allocated
      DMA memory will be freed using the direct DMA ops, while it may have
      been allocated using a custom DMA ops (iommu_dma_ops in this case).
      
      Fix this by reversing the order of the calls to devres_release_all() and
      arch_teardown_dma_ops().
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Cc: stable <stable@vger.kernel.org>
      Reviewed-by: NRobin Murphy <robin.murphy@arm.com>
      [rm: backport for 4.12-4.19 - kernels before 5.0 will not see
       the crash above, but may get silent memory corruption instead]
      Signed-off-by: NRobin Murphy <robin.murphy@arm.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7053a6fa
    • D
      ath9k: Avoid OF no-EEPROM quirks without qca,no-eeprom · adaa310f
      Daniel F. Dickinson 提交于
      commit ce938231bd3b1d7af3cbd8836f084801090470e1 upstream.
      
      ath9k_of_init() function[0] was initially written on the assumption that
      if someone had an explicit ath9k OF node that "there must be something
      wrong, why would someone add an OF node if everything is fine"[1]
      (Quoting Martin Blumenstingl <martin.blumenstingl@googlemail.com>)
      
      "it turns out it's not that simple. with your requirements I'm now aware
      of two use-cases where the current code in ath9k_of_init() doesn't work
      without modifications"[1]
      
      The "your requirements" Martin speaks of is the result of the fact that I
      have a device (PowerCloud Systems CR5000) has some kind of default - not
      unique mac address - set and requires to set the correct MAC address via
      mac-address devicetree property, however:
      
      "some cards come with a physical EEPROM chip [or OTP] so "qca,no-eeprom"
      should not be set (your use-case). in this case AH_USE_EEPROM should be
      set (which is the default when there is no OF node)"[1]
      
      The other use case is:
      
      the firmware on some PowerMac G5 seems to add a OF node for the ath9k
      card automatically. depending on the EEPROM on the card AH_NO_EEP_SWAP
      should be unset (which is the default when there is no OF node). see [3]
      
      After this patch to ath9k_of_init() the new behavior will be:
      
          if there's no OF node then everything is the same as before
          if there's an empty OF node then ath9k will use the hardware EEPROM
            (before ath9k would fail to initialize because no EEPROM data was
            provided by userspace)
          if there's an OF node with only a MAC address then ath9k will use
            the MAC address and the hardware EEPROM (see the case above)
          with "qca,no-eeprom" EEPROM data from userspace will be requested.
            the behavior here will not change
      [1]
      
      Martin provides additional background on EEPROM swapping[1].
      
      Thanks to Christian Lamparter <chunkeey@gmail.com> for all his help on
      troubleshooting this issue and the basis for this patch.
      
      [0]https://elixir.bootlin.com/linux/v4.20-rc7/source/drivers/net/wireless/ath/ath9k/init.c#L615
      [1]https://github.com/openwrt/openwrt/pull/1645#issuecomment-448027058
      [2]https://github.com/openwrt/openwrt/pull/1613
      [3]https://patchwork.kernel.org/patch/10241731/
      
      Fixes: 138b4125 ("ath9k: parse the device configuration from an OF node")
      Reviewed-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Tested-by: NMartin Blumenstingl <martin.blumenstingl@googlemail.com>
      Signed-off-by: NDaniel F. Dickinson <cshored@thecshore.com>
      Signed-off-by: NKalle Valo <kvalo@codeaurora.org>
      Cc: Christian Lamparter <chunkeey@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      adaa310f
    • R
      cifs: allow calling SMB2_xxx_free(NULL) · b4d965a3
      Ronnie Sahlberg 提交于
      commit 32a1fb36f6e50183871c2c1fcf5493c633e84732 upstream.
      
      Change these free functions to allow passing NULL as the argument and
      treat it as a no-op just like free(NULL) would.
      Or, if rqst->rq_iov is NULL.
      
      The second scenario could happen for smb2_queryfs() if the call
      to SMB2_query_info_init() fails and we go to qfs_exit to clean up
      and free all resources.
      In that case we have not yet assigned rqst[2].rq_iov and thus
      the rq_iov dereference in SMB2_close_free() will cause a NULL pointer
      dereference.
      
      [ bp: upstream patch also fixes SMB2_set_info_free which was introduced in 4.20 ]
      
      Fixes:  1eb9fb52 ("cifs: create SMB2_open_init()/SMB2_open_free() helpers")
      Signed-off-by: NRonnie Sahlberg <lsahlber@redhat.com>
      Signed-off-by: NSteve French <stfrench@microsoft.com>
      Reviewed-by: NAurelien Aptel <aaptel@suse.com>
      CC: Stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b4d965a3
    • G
      staging: erofs: keep corrupted fs from crashing kernel in erofs_namei() · e5d7b94c
      Gao Xiang 提交于
      commit 419d6efc50e94bcf5d6b35cd8c71f79edadec564 upstream.
      
      As Al pointed out, "
      ... and while we are at it, what happens to
      	unsigned int nameoff = le16_to_cpu(de[mid].nameoff);
      	unsigned int matched = min(startprfx, endprfx);
      
      	struct qstr dname = QSTR_INIT(data + nameoff,
      		unlikely(mid >= ndirents - 1) ?
      			maxsize - nameoff :
      			le16_to_cpu(de[mid + 1].nameoff) - nameoff);
      
      	/* string comparison without already matched prefix */
      	int ret = dirnamecmp(name, &dname, &matched);
      if le16_to_cpu(de[...].nameoff) is not monotonically increasing?  I.e.
      what's to prevent e.g. (unsigned)-1 ending up in dname.len?
      
      Corrupted fs image shouldn't oops the kernel.. "
      
      Revisit the related lookup flow to address the issue.
      
      Fixes: d72d1ce6 ("staging: erofs: add namei functions")
      Cc: <stable@vger.kernel.org> # 4.19+
      Suggested-by: NAl Viro <viro@ZenIV.linux.org.uk>
      Signed-off-by: NGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e5d7b94c
    • G
      staging: erofs: fix race of initializing xattrs of a inode at the same time · 28b8f234
      Gao Xiang 提交于
      commit 62dc45979f3f8cb0ea67302a93bff686f0c46c5a upstream.
      
      In real scenario, there could be several threads accessing xattrs
      of the same xattr-uninitialized inode, and init_inode_xattrs()
      almost at the same time.
      
      That's actually an unexpected behavior, this patch closes the race.
      
      Fixes: b17500a0 ("staging: erofs: introduce xattr & acl support")
      Cc: <stable@vger.kernel.org> # 4.19+
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      28b8f234
    • G
      staging: erofs: fix memleak of inode's shared xattr array · 53a989a9
      Gao Xiang 提交于
      From: Sheng Yong <shengyong1@huawei.com>
      
      commit 3b1b5291f79d040d549d7c746669fc30e8045b9b upstream.
      
      If it fails to read a shared xattr page, the inode's shared xattr array
      is not freed. The next time the inode's xattr is accessed, the previously
      allocated array is leaked.
      Signed-off-by: NSheng Yong <shengyong1@huawei.com>
      Fixes: b17500a0 ("staging: erofs: introduce xattr & acl support")
      Cc: <stable@vger.kernel.org> # 4.19+
      Reviewed-by: NGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: NGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      53a989a9
    • G
      staging: erofs: fix fast symlink w/o xattr when fs xattr is on · 9dc84155
      Gao Xiang 提交于
      commit 7077fffcb0b0b65dc75e341306aeef4d0e7f2ec6 upstream.
      
      Currently, this will hit a BUG_ON for these symlinks as follows:
      
      - kernel message
      ------------[ cut here ]------------
      kernel BUG at drivers/staging/erofs/xattr.c:59!
      SMP PTI
      CPU: 1 PID: 1170 Comm: getllxattr Not tainted 4.20.0-rc6+ #92
      Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-2.fc27 04/01/2014
      RIP: 0010:init_inode_xattrs+0x22b/0x270
      Code: 48 0f 45 ea f0 ff 4d 34 74 0d 41 83 4c 24 e0 01 31 c0 e9 00 fe ff ff 48 89 ef e8 e0 31 9e ff eb e9 89 e8 e9 ef fd ff ff 0f 0$
       <0f> 0b 48 89 ef e8 fb f6 9c ff 48 8b 45 08 a8 01 75 24 f0 ff 4d 34
      RSP: 0018:ffffa03ac026bdf8 EFLAGS: 00010246
      ------------[ cut here ]------------
      ...
      Call Trace:
       erofs_listxattr+0x30/0x2c0
       ? selinux_inode_listxattr+0x5a/0x80
       ? kmem_cache_alloc+0x33/0x170
       ? security_inode_listxattr+0x27/0x40
       listxattr+0xaf/0xc0
       path_listxattr+0x5a/0xa0
       do_syscall_64+0x43/0xf0
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      ...
      ---[ end trace 3c24b49408dc0c72 ]---
      
      Fix it by checking ->xattr_isize in init_inode_xattrs(),
      and it also fixes improper return value -ENOTSUPP
      (it should be -ENODATA if xattr is enabled) for those inodes.
      
      Fixes: b17500a0 ("staging: erofs: introduce xattr & acl support")
      Cc: <stable@vger.kernel.org> # 4.19+
      Reported-by: NLi Guifu <bluce.liguifu@huawei.com>
      Tested-by: NLi Guifu <bluce.liguifu@huawei.com>
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9dc84155
    • G
      staging: erofs: add error handling for xattr submodule · f581642c
      Gao Xiang 提交于
      commit cadf1ccf1b0021d0b7a9347e102ac5258f9f98c8 upstream.
      
      This patch enhances the missing error handling code for
      xattr submodule, which improves the stability for the rare cases.
      Reviewed-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NChao Yu <yuchao0@huawei.com>
      Signed-off-by: NGao Xiang <gaoxiang25@huawei.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f581642c
    • A
      gfs2: Fix missed wakeups in find_insert_glock · 4f5a4c88
      Andreas Gruenbacher 提交于
      commit 605b0487f0bc1ae9963bf52ece0f5c8055186f81 upstream.
      
      Mark Syms has reported seeing tasks that are stuck waiting in
      find_insert_glock.  It turns out that struct lm_lockname contains four padding
      bytes on 64-bit architectures that function glock_waitqueue doesn't skip when
      hashing the glock name.  As a result, we can end up waking up the wrong
      waitqueue, and the waiting tasks may be stuck forever.
      
      Fix that by using ht_parms.key_len instead of sizeof(struct lm_lockname) for
      the key length.
      Reported-by: NMark Syms <mark.syms@citrix.com>
      Signed-off-by: NAndreas Gruenbacher <agruenba@redhat.com>
      Signed-off-by: NBob Peterson <rpeterso@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4f5a4c88
    • T
      netfilter: xt_TEE: add missing code to get interface index in checkentry. · e6e00017
      Taehee Yoo 提交于
      [ Upstream commit 18c0ab87364ac5128a152055fdcb1d27e01caf01 ]
      
      checkentry(tee_tg_check) should initialize priv->oif from dev if possible.
      But only netdevice notifier handler can set that.
      Hence priv->oif is always -1 until notifier handler is called.
      
      Fixes: 9e2f6c5d ("netfilter: Rework xt_TEE netdevice notifier")
      Signed-off-by: NTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e6e00017
    • T
      netfilter: xt_TEE: fix wrong interface selection · 02d86085
      Taehee Yoo 提交于
      [ Upstream commit f24d2d4f9586985509320f90308723d3d0c4e47f ]
      
      TEE netdevice notifier handler checks only interface name. however
      each netns can have same interface name. hence other netns's interface
      could be selected.
      
      test commands:
         %ip netns add vm1
         %iptables -I INPUT -p icmp -j TEE --gateway 192.168.1.1 --oif enp2s0
         %ip link set enp2s0 netns vm1
      
      Above rule is in the root netns. but that rule could get enp2s0
      ifindex of vm1 by notifier handler.
      
      After this patch, TEE rule is added to the per-netns list.
      
      Fixes: 9e2f6c5d ("netfilter: Rework xt_TEE netdevice notifier")
      Signed-off-by: NTaehee Yoo <ap420073@gmail.com>
      Signed-off-by: NPablo Neira Ayuso <pablo@netfilter.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      02d86085
    • A
      drm: disable uncached DMA optimization for ARM and arm64 · f9a0a08d
      Ard Biesheuvel 提交于
      [ Upstream commit e02f5c1bb2283cfcee68f2f0feddcc06150f13aa ]
      
      The DRM driver stack is designed to work with cache coherent devices
      only, but permits an optimization to be enabled in some cases, where
      for some buffers, both the CPU and the GPU use uncached mappings,
      removing the need for DMA snooping and allocation in the CPU caches.
      
      The use of uncached GPU mappings relies on the correct implementation
      of the PCIe NoSnoop TLP attribute by the platform, otherwise the GPU
      will use cached mappings nonetheless. On x86 platforms, this does not
      seem to matter, as uncached CPU mappings will snoop the caches in any
      case. However, on ARM and arm64, enabling this optimization on a
      platform where NoSnoop is ignored results in loss of coherency, which
      breaks correct operation of the device. Since we have no way of
      detecting whether NoSnoop works or not, just disable this
      optimization entirely for ARM and arm64.
      
      Cc: Christian Koenig <christian.koenig@amd.com>
      Cc: Alex Deucher <alexander.deucher@amd.com>
      Cc: David Zhou <David1.Zhou@amd.com>
      Cc: Huang Rui <ray.huang@amd.com>
      Cc: Junwei Zhang <Jerry.Zhang@amd.com>
      Cc: Michel Daenzer <michel.daenzer@amd.com>
      Cc: David Airlie <airlied@linux.ie>
      Cc: Daniel Vetter <daniel@ffwll.ch>
      Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
      Cc: Maxime Ripard <maxime.ripard@bootlin.com>
      Cc: Sean Paul <sean@poorly.run>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Christoph Hellwig <hch@infradead.org>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: amd-gfx list <amd-gfx@lists.freedesktop.org>
      Cc: dri-devel <dri-devel@lists.freedesktop.org>
      Reported-by: NCarsten Haitzler <Carsten.Haitzler@arm.com>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Reviewed-by: NAlex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.kernel.org/patch/10778815/Signed-off-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      f9a0a08d
    • M
      ARM: dts: exynos: Fix max voltage for buck8 regulator on Odroid XU3/XU4 · bb2c205c
      Marek Szyprowski 提交于
      commit a3238924a820c1d7c977b632b769f3b5690cba09 upstream.
      
      The maximum voltage value for buck8 regulator on Odroid XU3/XU4 boards is
      set too low. Increase it to the 2000mV as specified on the board schematic.
      So far the board worked fine, because of the bug in the PMIC driver, which
      used incorrect step value for that regulator. It interpreted the voltage
      value set by the bootloader as 1225mV and kept it unchanged. The regulator
      driver has been however fixed recently in the commit 56b5d4ea778c
      ("regulator: s2mps11: Fix steps for buck7, buck8 and LDO35"), what results
      in reading the proper buck8 value and forcing it to 1500mV on boot. This
      is not enough for proper board operation and results in eMMC errors during
      heavy IO traffic. Increasing maximum voltage value for buck8 restores
      original driver behavior and fixes eMMC issues.
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Fixes: 86a2d2ac ("ARM: dts: Add dts file for Odroid XU3 board")
      Fixes: 56b5d4ea778c ("regulator: s2mps11: Fix steps for buck7, buck8 and LDO35")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bb2c205c
    • M
      ARM: dts: exynos: Add minimal clkout parameters to Exynos3250 PMU · bfc341b6
      Marek Szyprowski 提交于
      commit a66352e005488ecb4b534ba1af58a9f671eba9b8 upstream.
      
      Add minimal parameters needed by the Exynos CLKOUT driver to Exynos3250
      PMU node. This fixes the following warning on boot:
      
      exynos_clkout_init: failed to register clkout clock
      
      Fixes: d19bb397 ("ARM: dts: exynos: Update PMU node with CLKOUT related data")
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bfc341b6
    • M
      ARM: dts: exynos: Fix pinctrl definition for eMMC RTSN line on Odroid X2/U3 · cd10bc82
      Marek Szyprowski 提交于
      commit ec33745bccc8f336957c751f4153421cc9ef5a54 upstream.
      
      Commit 225da7e6 ("ARM: dts: add eMMC reset line for
      exynos4412-odroid-common") added MMC power sequence for eMMC card of
      Odroid X2/U3. It reused generic sd1_cd pin control configuration node
      and only disabled pull-up. However that time the pinctrl configuration
      was not applied during MMC power sequence driver initialization. This
      has been changed later by commit d97a1e5d ("mmc: pwrseq: convert to
      proper platform device").
      
      It turned out then, that the provided pinctrl configuration is not
      correct, because the eMMC_RTSN line is being re-configured as 'special
      function/card detect function for mmc1 controller' not the simple
      'output', thus the power sequence driver doesn't really set the pin
      value. This in effect broke the reboot of Odroid X2/U3 boards. Fix this
      by providing separate node with eMMC_RTSN pin configuration.
      
      Cc: <stable@vger.kernel.org>
      Reported-by: NMarkus Reichl <m.reichl@fivetechno.de>
      Suggested-by: NUlf Hansson <ulf.hansson@linaro.org>
      Fixes: 225da7e6 ("ARM: dts: add eMMC reset line for exynos4412-odroid-common")
      Signed-off-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NKrzysztof Kozlowski <krzk@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      cd10bc82
    • A
      arm64: dts: hikey: Revert "Enable HS200 mode on eMMC" · 103ec440
      Alistair Strachan 提交于
      commit 8d26c1390aec795d492b8de5e4437751e8805a1d upstream.
      
      This reverts commit abd7d097. This
      change was already partially reverted by John Stultz in
      commit 9c6d26df ("arm64: dts: hikey: Fix eMMC corruption regression").
      
      This change appears to cause controller resets and block read failures
      which prevents successful booting on some hikey boards.
      
      Cc: Ryan Grachek <ryan@edited.us>
      Cc: Wei Xu <xuwei5@hisilicon.com>
      Cc: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: linux-arm-kernel@lists.infradead.org
      Cc: devicetree@vger.kernel.org
      Cc: stable <stable@vger.kernel.org> #4.17+
      Signed-off-by: NAlistair Strachan <astrachan@google.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      Signed-off-by: NWei Xu <xuwei5@hisilicon.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      103ec440
    • J
      arm64: dts: hikey: Give wifi some time after power-on · e6eb5e35
      Jan Kiszka 提交于
      commit 83b944174ad79825ae84a47af1a0354485b24602 upstream.
      
      Somewhere along recent changes to power control of the wl1835, power-on
      became very unreliable on the hikey, failing like this:
      
      wl1271_sdio: probe of mmc2:0001:1 failed with error -16
      wl1271_sdio: probe of mmc2:0001:2 failed with error -16
      
      After playing with some dt parameters and comparing to other users of
      this chip, it turned out we need some power-on delay to make things
      stable again. In contrast to those other users which define 200 ms, the
      hikey would already be happy with 1 ms. Still, we use the safer 10 ms,
      like on the Ultra96.
      
      Fixes: ea452678 ("arm64: dts: hikey: Fix WiFi support")
      Cc: <stable@vger.kernel.org> #4.12+
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NWei Xu <xuwei5@hisilicon.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e6eb5e35
    • J
      arm64: dts: zcu100-revC: Give wifi some time after power-on · 271c5a5d
      Jan Kiszka 提交于
      commit 35a4f89cd4731ac6ec985cd29ddc1630903006b7 upstream.
      
      Somewhere along recent changes to power control of the wl1831, power-on
      became very unreliable on the Ultra96, failing like this:
      
      wl1271_sdio: probe of mmc2:0001:1 failed with error -16
      wl1271_sdio: probe of mmc2:0001:2 failed with error -16
      
      After playing with some dt parameters and comparing to other users of
      this chip, it turned out we need some power-on delay to make things
      stable again. In contrast to those other users which define 200 ms,
      Ultra96 is already happy with 10 ms.
      
      Fixes: 5869ba06 ("arm64: zynqmp: Add support for Xilinx zcu100-revC")
      Signed-off-by: NJan Kiszka <jan.kiszka@siemens.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NMichal Simek <michal.simek@xilinx.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      271c5a5d
    • A
      x86/PCI: Fixup RTIT_BAR of Intel Denverton Trace Hub · 36e3673d
      Alexander Shishkin 提交于
      commit 2e095ce7b6ecce2f3e2ff330527f12056ed1e1a1 upstream.
      
      On Denverton's integration of the Intel(R) Trace Hub (for a reference and
      overview see Documentation/trace/intel_th.rst) the reported size of one of
      its resources (RTIT_BAR) doesn't match its actual size, which leads to
      overlaps with other devices' resources.
      
      In practice, it overlaps with XHCI MMIO space, which results in the xhci
      driver bailing out after seeing its registers as 0xffffffff, and perceived
      disappearance of all USB devices:
      
        intel_th_pci 0000:00:1f.7: enabling device (0004 -> 0006)
        xhci_hcd 0000:00:15.0: xHCI host controller not responding, assume dead
        xhci_hcd 0000:00:15.0: xHC not responding in xhci_irq, assume controller is dead
        xhci_hcd 0000:00:15.0: HC died; cleaning up
        usb 1-1: USB disconnect, device number 2
      
      For this reason, we need to resize the RTIT_BAR on Denverton to its actual
      size, which in this case is 4MB.  The corresponding erratum is DNV36 at the
      link below:
      
        DNV36.       Processor Host Root Complex May Incorrectly Route Memory
                     Accesses to Intel® Trace Hub
      
        Problem:     The Intel® Trace Hub RTIT_BAR (B0:D31:F7 offset 20h) is
      	       reported as a 2KB memory range.  Due to this erratum, the
      	       processor Host Root Complex will forward addresses from
      	       RTIT_BAR to RTIT_BAR + 4MB -1 to Intel® Trace Hub.
      
        Implication: Devices assigned within the RTIT_BAR to RTIT_BAR + 4MB -1
                     space may not function correctly.
      
        Workaround:  A BIOS code change has been identified and may be
                     implemented as a workaround for this erratum.
      
        Status:      No Fix.
      
      Note that 5118ccd3 ("intel_th: pci: Add Denverton SOC support") updates
      the Trace Hub driver so it claims the Denverton device, but the resource
      overlap exists regardless of whether that driver is loaded or that commit
      is included.
      
      Link: https://www.intel.com/content/dam/www/public/us/en/documents/specification-updates/atom-c3000-family-spec-update.pdfSigned-off-by: NAlexander Shishkin <alexander.shishkin@linux.intel.com>
      [bhelgaas: include erratum text, clarify relationship with 5118ccd3]
      Signed-off-by: NBjorn Helgaas <bhelgaas@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      36e3673d
    • G
      scsi: aacraid: Fix missing break in switch statement · 917f9437
      Gustavo A. R. Silva 提交于
      commit 5e420fe635813e5746b296cfc8fff4853ae205a2 upstream.
      
      Add missing break statement and fix identation issue.
      
      This bug was found thanks to the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Fixes: 9cb62fa2 ("aacraid: Log firmware AIF messages")
      Cc: stable@vger.kernel.org
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      917f9437
    • G
      iscsi_ibft: Fix missing break in switch statement · dcdd1bcb
      Gustavo A. R. Silva 提交于
      commit df997abeebadaa4824271009e2d2b526a70a11cb upstream.
      
      Add missing break statement in order to prevent the code from falling
      through to case ISCSI_BOOT_TGT_NAME, which is unnecessary.
      
      This bug was found thanks to the ongoing efforts to enable
      -Wimplicit-fallthrough.
      
      Fixes: b33a84a3 ("ibft: convert iscsi_ibft module to iscsi boot lib")
      Cc: stable@vger.kernel.org
      Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com>
      Signed-off-by: NKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dcdd1bcb
    • V
      Input: elan_i2c - add id for touchpad found in Lenovo s21e-20 · fe34541a
      Vincent Batts 提交于
      commit e154ab69321ce2c54f19863d75c77b4e2dc9d365 upstream.
      
      Lenovo s21e-20 uses ELAN0601 in its ACPI tables for the Elan touchpad.
      Signed-off-by: NVincent Batts <vbatts@hashbangbash.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fe34541a
    • J
      Input: wacom_serial4 - add support for Wacom ArtPad II tablet · b3b29dc5
      Jason Gerecke 提交于
      commit 44fc95e218a09d7966a9d448941fdb003f6bb69f upstream.
      
      Tablet initially begins communicating at 9600 baud, so this command
      should be used to connect to the device:
      
          $ inputattach --daemon --baud 9600 --wacom_iv /dev/ttyS0
      
      https://github.com/linuxwacom/xf86-input-wacom/issues/40Signed-off-by: NJason Gerecke <jason.gerecke@wacom.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b3b29dc5
    • K
      nvme-pci: add missing unlock for reset error · 7066774e
      Keith Busch 提交于
      [ Upstream commit 4726bcf30fad37cc555cd9dcd6c73f2b2668c879 ]
      
      The reset work holds a mutex to prevent races with removal modifying the
      same resources, but was unlocking only on success. Unlock on failure
      too.
      
      Fixes: 5c959d73dba64 ("nvme-pci: fix rapid add remove sequence")
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      7066774e
    • L
      blk-iolatency: fix IO hang due to negative inflight counter · 6d482bc5
      Liu Bo 提交于
      [ Upstream commit 8c772a9bfc7c07c76f4a58b58910452fbb20843b ]
      
      Our test reported the following stack, and vmcore showed that
      ->inflight counter is -1.
      
      [ffffc9003fcc38d0] __schedule at ffffffff8173d95d
      [ffffc9003fcc3958] schedule at ffffffff8173de26
      [ffffc9003fcc3970] io_schedule at ffffffff810bb6b6
      [ffffc9003fcc3988] blkcg_iolatency_throttle at ffffffff813911cb
      [ffffc9003fcc3a20] rq_qos_throttle at ffffffff813847f3
      [ffffc9003fcc3a48] blk_mq_make_request at ffffffff8137468a
      [ffffc9003fcc3b08] generic_make_request at ffffffff81368b49
      [ffffc9003fcc3b68] submit_bio at ffffffff81368d7d
      [ffffc9003fcc3bb8] ext4_io_submit at ffffffffa031be00 [ext4]
      [ffffc9003fcc3c00] ext4_writepages at ffffffffa03163de [ext4]
      [ffffc9003fcc3d68] do_writepages at ffffffff811c49ae
      [ffffc9003fcc3d78] __filemap_fdatawrite_range at ffffffff811b6188
      [ffffc9003fcc3e30] filemap_write_and_wait_range at ffffffff811b6301
      [ffffc9003fcc3e60] ext4_sync_file at ffffffffa030cee8 [ext4]
      [ffffc9003fcc3ea8] vfs_fsync_range at ffffffff8128594b
      [ffffc9003fcc3ee8] do_fsync at ffffffff81285abd
      [ffffc9003fcc3f18] sys_fsync at ffffffff81285d50
      [ffffc9003fcc3f28] do_syscall_64 at ffffffff81003c04
      [ffffc9003fcc3f50] entry_SYSCALL_64_after_swapgs at ffffffff81742b8e
      
      The ->inflight counter may be negative (-1) if
      
      1) blk-iolatency was disabled when the IO was issued,
      
      2) blk-iolatency was enabled before this IO reached its endio,
      
      3) the ->inflight counter is decreased from 0 to -1 in endio()
      
      In fact the hang can be easily reproduced by the below script,
      
      H=/sys/fs/cgroup/unified/
      P=/sys/fs/cgroup/unified/test
      
      echo "+io" > $H/cgroup.subtree_control
      mkdir -p $P
      
      echo $$ > $P/cgroup.procs
      
      xfs_io -f -d -c "pwrite 0 4k" /dev/sdg
      
      echo "`cat /sys/block/sdg/dev` target=1000000" > $P/io.latency
      
      xfs_io -f -d -c "pwrite 0 4k" /dev/sdg
      
      This fixes the problem by freezing the queue so that while
      enabling/disabling iolatency, there is no inflight rq running.
      
      Note that quiesce_queue is not needed as this only updating iolatency
      configuration about which dispatching request_queue doesn't care.
      Signed-off-by: NLiu Bo <bo.liu@linux.alibaba.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      6d482bc5
    • S
      qede: Fix system crash on configuring channels. · 1781ae6f
      Sudarsana Reddy Kalluru 提交于
      [ Upstream commit 0aa4febb420d91df5b56b1864a2465765da85f4b ]
      
      Under heavy traffic load, when changing number of channels via
      ethtool (ethtool -L) which will cause interface to be reloaded,
      it was observed that some packets gets transmitted on old TX
      channel/queue id which doesn't really exist after the channel
      configuration leads to system crash.
      
      Add a safeguard in the driver by validating queue id through
      ndo_select_queue() which is called before the ndo_start_xmit().
      Signed-off-by: NSudarsana Reddy Kalluru <skalluru@marvell.com>
      Signed-off-by: NAriel Elior <aelior@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      1781ae6f
    • S
      qed: Consider TX tcs while deriving the max num_queues for PF. · 84828dd2
      Sudarsana Reddy Kalluru 提交于
      [ Upstream commit fb1faab74ddef9ec2d841d54e5d0912a097b3abe ]
      
      Max supported queues is derived incorrectly in the case of multi-CoS.
      Need to consider TCs while calculating num_queues for PF.
      Signed-off-by: NSudarsana Reddy Kalluru <skalluru@marvell.com>
      Signed-off-by: NAriel Elior <aelior@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      84828dd2
    • M
      qed: Fix EQ full firmware assert. · d727c0ed
      Manish Chopra 提交于
      [ Upstream commit 660492bcf4a7561b5fdc13be0ae0b0c0a8c120be ]
      
      When slowpath messages are sent with high rate, the resulting
      events can lead to a FW assert in case they are not handled fast
      enough (Event Queue Full assert). Attempt to send queued slowpath
      messages only after the newly evacuated entries in the EQ ring
      are indicated to FW.
      Signed-off-by: NManish Chopra <manishc@marvell.com>
      Signed-off-by: NAriel Elior <aelior@marvell.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      d727c0ed
    • T
      fs: ratelimit __find_get_block_slow() failure message. · 72426ed2
      Tetsuo Handa 提交于
      [ Upstream commit 43636c804df0126da669c261fc820fb22f62bfc2 ]
      
      When something let __find_get_block_slow() hit all_mapped path, it calls
      printk() for 100+ times per a second. But there is no need to print same
      message with such high frequency; it is just asking for stall warning, or
      at least bloating log files.
      
        [  399.866302][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8
        [  399.873324][T15342] b_state=0x00000029, b_size=512
        [  399.878403][T15342] device loop0 blocksize: 4096
        [  399.883296][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8
        [  399.890400][T15342] b_state=0x00000029, b_size=512
        [  399.895595][T15342] device loop0 blocksize: 4096
        [  399.900556][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8
        [  399.907471][T15342] b_state=0x00000029, b_size=512
        [  399.912506][T15342] device loop0 blocksize: 4096
      
      This patch reduces frequency to up to once per a second, in addition to
      concatenating three lines into one.
      
        [  399.866302][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8, b_state=0x00000029, b_size=512, device loop0 blocksize: 4096
      Signed-off-by: NTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
      Reviewed-by: NJan Kara <jack@suse.cz>
      Cc: Dmitry Vyukov <dvyukov@google.com>
      Signed-off-by: NJens Axboe <axboe@kernel.dk>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      72426ed2
    • K
      nvme-pci: fix rapid add remove sequence · 3cc6703d
      Keith Busch 提交于
      [ Upstream commit 5c959d73dba6495ec01d04c206ee679d61ccb2b0 ]
      
      A surprise removal may fail to tear down request queues if it is racing
      with the initial asynchronous probe. If that happens, the remove path
      won't see the queue resources to tear down, and the controller reset
      path may create a new request queue on a removed device, but will not
      be able to make forward progress, deadlocking the pci removal.
      
      Protect setting up non-blocking resources from a shutdown by holding the
      same mutex, and transition to the CONNECTING state after these resources
      are initialized so the probe path may see the dead controller state
      before dispatching new IO.
      
      Link: https://bugzilla.kernel.org/show_bug.cgi?id=202081Reported-by: NAlex Gagniuc <Alex_Gagniuc@Dellteam.com>
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Tested-by: NAlex Gagniuc <mr.nuke.me@gmail.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      3cc6703d
    • K
      nvme: lock NS list changes while handling command effects · e3aabe4c
      Keith Busch 提交于
      [ Upstream commit e7ad43c3eda6a1690c4c3c341f95dc1c6898da83 ]
      
      If a controller supports the NS Change Notification, the namespace
      scan_work is automatically triggered after attaching a new namespace.
      
      Occasionally the namespace scan_work may append the new namespace to the
      list before the admin command effects handling is completed. The effects
      handling unfreezes namespaces, but if it unfreezes the newly attached
      namespace, its request_queue freeze depth will be off and we'll hit the
      warning in blk_mq_unfreeze_queue().
      
      On the next namespace add, we will fail to freeze that queue due to the
      previous bad accounting and deadlock waiting for frozen.
      
      Fix that by preventing scan work from altering the namespace list while
      command effects handling needs to pair freeze with unfreeze.
      Reported-by: NWen Xiong <wenxiong@us.ibm.com>
      Tested-by: NWen Xiong <wenxiong@us.ibm.com>
      Signed-off-by: NKeith Busch <keith.busch@intel.com>
      Reviewed-by: NChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e3aabe4c
    • P
      drm/amdgpu: use spin_lock_irqsave to protect vm_manager.pasid_idr · 25aa5c8b
      Philip Yang 提交于
      [ Upstream commit 0a5f49cbf9d6ad3721c16f8a6d823363ea7a160f ]
      
      amdgpu_vm_get_task_info is called from interrupt handler and sched timeout
      workqueue, we should use irq version spin_lock to avoid deadlock.
      Signed-off-by: NPhilip Yang <Philip.Yang@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      25aa5c8b
    • T
      i2c: omap: Use noirq system sleep pm ops to idle device for suspend · ee84b62f
      Tony Lindgren 提交于
      [ Upstream commit c6e2bd956936d925748581e4d0294f10f1d92f2c ]
      
      We currently get the following error with pixcir_ts driver during a
      suspend resume cycle:
      
      omap_i2c 4802a000.i2c: controller timed out
      pixcir_ts 1-005c: pixcir_int_enable: can't read reg 0x34 : -110
      pixcir_ts 1-005c: Failed to disable interrupt generation: -110
      pixcir_ts 1-005c: Failed to stop
      dpm_run_callback(): pixcir_i2c_ts_resume+0x0/0x98
      [pixcir_i2c_ts] returns -110
      PM: Device 1-005c failed to resume: error -110
      
      And at least am437x based devices with pixcir_ts will fail to resume
      to a touchscreen that is configured as the wakeup-source in device
      tree for these devices.
      
      This is because pixcir_ts tries to reconfigure it's registers for
      noirq suspend which fails. This also leaves i2c-omap in enabled state
      for suspend.
      
      Let's fix the pixcir_ts issue and make sure i2c-omap is suspended by
      adding SET_NOIRQ_SYSTEM_SLEEP_PM_OPS.
      
      Let's also get rid of some ifdefs while at it and replace them with
      __maybe_unused as SET_RUNTIME_PM_OPS and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS
      already deal with the various PM Kconfig options.
      Reported-by: NKeerthy <j-keerthy@ti.com>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Acked-by: NVignesh R <vigneshr@ti.com>
      Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ee84b62f
    • R
      Revert "scsi: libfc: Add WARN_ON() when deleting rports" · 29f7b376
      Ross Lagerwall 提交于
      [ Upstream commit d8f6382a7d026989029e2e50c515df954488459b ]
      
      This reverts commit bbc0f8bd.
      
      It added a warning whose intent was to check whether the rport was still
      linked into the peer list. It doesn't work as intended and gives false
      positive warnings for two reasons:
      
      1) If the rport is never linked into the peer list it will not be
      considered empty since the list_head is never initialized.
      
      2) If the rport is deleted from the peer list using list_del_rcu(), then
      the list_head is in an undefined state and it is not considered empty.
      Signed-off-by: NRoss Lagerwall <ross.lagerwall@citrix.com>
      Reviewed-by: NHannes Reinecke <hare@suse.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      29f7b376
    • J
      MIPS: Remove function size check in get_frame_info() · cd8520a2
      Jun-Ru Chang 提交于
      [ Upstream commit 2b424cfc69728224fcb5fad138ea7260728e0901 ]
      
      Patch (b6c7a324 "MIPS: Fix get_frame_info() handling of
      microMIPS function size.") introduces additional function size
      check for microMIPS by only checking insn between ip and ip + func_size.
      However, func_size in get_frame_info() is always 0 if KALLSYMS is not
      enabled. This causes get_frame_info() to return immediately without
      calculating correct frame_size, which in turn causes "Can't analyze
      schedule() prologue" warning messages at boot time.
      
      This patch removes func_size check, and let the frame_size check run
      up to 128 insns for both MIPS and microMIPS.
      Signed-off-by: NJun-Ru Chang <jrjang@realtek.com>
      Signed-off-by: NTony Wu <tonywu@realtek.com>
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Fixes: b6c7a324 ("MIPS: Fix get_frame_info() handling of microMIPS function size.")
      Cc: <ralf@linux-mips.org>
      Cc: <jhogan@kernel.org>
      Cc: <macro@mips.com>
      Cc: <yamada.masahiro@socionext.com>
      Cc: <peterz@infradead.org>
      Cc: <mingo@kernel.org>
      Cc: <linux-mips@vger.kernel.org>
      Cc: <linux-kernel@vger.kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      cd8520a2
    • A
      perf trace: Support multiple "vfs_getname" probes · 738f9e27
      Arnaldo Carvalho de Melo 提交于
      [ Upstream commit 6ab3bc240ade47a0f52bc16d97edd9accbe0024e ]
      
      With a suitably defined "probe:vfs_getname" probe, 'perf trace' can
      "beautify" its output, so syscalls like open() or openat() can print the
      "filename" argument instead of just its hex address, like:
      
        $ perf trace -e open -- touch /dev/null
        [...]
             0.590 ( 0.014 ms): touch/18063 open(filename: /dev/null, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3
        [...]
      
      The output without such beautifier looks like:
      
           0.529 ( 0.011 ms): touch/18075 open(filename: 0xc78cf288, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3
      
      However, when the vfs_getname probe expands to multiple probes and it is
      not the first one that is hit, the beautifier fails, as following:
      
           0.326 ( 0.010 ms): touch/18072 open(filename: , flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3
      
      Fix it by hooking into all the expanded probes (inlines), now, for instance:
      
        [root@quaco ~]# perf probe -l
          probe:vfs_getname    (on getname_flags:73@fs/namei.c with pathname)
          probe:vfs_getname_1  (on getname_flags:73@fs/namei.c with pathname)
        [root@quaco ~]# perf trace -e open* sleep 1
             0.010 ( 0.005 ms): sleep/5588 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: RDONLY|CLOEXEC)   = 3
             0.029 ( 0.006 ms): sleep/5588 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: RDONLY|CLOEXEC)   = 3
             0.194 ( 0.008 ms): sleep/5588 openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: RDONLY|CLOEXEC) = 3
        [root@quaco ~]#
      
      Works, further verified with:
      
        [root@quaco ~]# perf test vfs
        65: Use vfs_getname probe to get syscall args filenames   : Ok
        66: Add vfs_getname probe to get syscall args filenames   : Ok
        67: Check open filename arg using perf trace + vfs_getname: Ok
        [root@quaco ~]#
      Reported-by: NMichael Petlan <mpetlan@redhat.com>
      Tested-by: NMichael Petlan <mpetlan@redhat.com>
      Cc: Adrian Hunter <adrian.hunter@intel.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Link: https://lkml.kernel.org/n/tip-mv8kolk17xla1smvmp3qabv1@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      738f9e27
    • J
      perf symbols: Filter out hidden symbols from labels · 47e3f3c0
      Jiri Olsa 提交于
      [ Upstream commit 59a17706915fe5ea6f711e1f92d4fb706bce07fe ]
      
      When perf is built with the annobin plugin (RHEL8 build) extra symbols
      are added to its binary:
      
        # nm perf | grep annobin | head -10
        0000000000241100 t .annobin_annotate.c
        0000000000326490 t .annobin_annotate.c
        0000000000249255 t .annobin_annotate.c_end
        00000000003283a8 t .annobin_annotate.c_end
        00000000001bce18 t .annobin_annotate.c_end.hot
        00000000001bce18 t .annobin_annotate.c_end.hot
        00000000001bc3e2 t .annobin_annotate.c_end.unlikely
        00000000001bc400 t .annobin_annotate.c_end.unlikely
        00000000001bce18 t .annobin_annotate.c.hot
        00000000001bce18 t .annobin_annotate.c.hot
        ...
      
      Those symbols have no use for report or annotation and should be
      skipped.  Moreover they interfere with the DWARF unwind test on the PPC
      arch, where they are mixed with checked symbols and then the test fails:
      
        # perf test dwarf -v
        59: Test dwarf unwind                                     :
        --- start ---
        test child forked, pid 8515
        unwind: .annobin_dwarf_unwind.c:ip = 0x10dba40dc (0x2740dc)
        ...
        got: .annobin_dwarf_unwind.c 0x10dba40dc, expecting test__arch_unwind_sample
        unwind: failed with 'no error'
      
      The annobin symbols are defined as NOTYPE/LOCAL/HIDDEN:
      
        # readelf -s ./perf | grep annobin | head -1
          40: 00000000001bce4f     0 NOTYPE  LOCAL  HIDDEN    13 .annobin_init.c
      
      They can still pass the check for the label symbol. Adding check for
      HIDDEN and INTERNAL (as suggested by Nick below) visibility and filter
      out such symbols.
      
      >   Just to be awkward, if you are going to ignore STV_HIDDEN
      >   symbols then you should probably also ignore STV_INTERNAL ones
      >   as well...  Annobin does not generate them, but you never know,
      >   one day some other tool might create some.
      Signed-off-by: NJiri Olsa <jolsa@kernel.org>
      Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Michael Petlan <mpetlan@redhat.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Nick Clifton <nickc@redhat.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/20190128133526.GD15461@kravaSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      47e3f3c0