1. 25 6月, 2019 40 次提交
    • N
      selftests: vm: install test_vmalloc.sh for run_vmtests · bf51ec92
      Naresh Kamboju 提交于
      [ Upstream commit bc2cce3f2ebcae02aa4bb29e3436bf75ee674c32 ]
      
      Add test_vmalloc.sh to TEST_FILES to make sure it gets installed for
      run_vmtests.
      
      Fixed below error:
      ./run_vmtests: line 217: ./test_vmalloc.sh: No such file or directory
      
      Tested with: make TARGETS=vm install INSTALL_PATH=$PWD/x
      Signed-off-by: NNaresh Kamboju <naresh.kamboju@linaro.org>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      bf51ec92
    • A
      kselftest/cgroup: fix incorrect test_core skip · a0e8215e
      Alex Shi 提交于
      [ Upstream commit f97f3f8839eb9de5843066d80819884f7722c8c5 ]
      
      The test_core will skip the
      test_cgcore_no_internal_process_constraint_on_threads test case if the
      'cpu' controller missing in root's subtree_control. In fact we need to
      set the 'cpu' in subtree_control, to make the testing meaningful.
      
      ./test_core
      ...
      ok 4 # skip test_cgcore_no_internal_process_constraint_on_threads
      ...
      Signed-off-by: NAlex Shi <alex.shi@linux.alibaba.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Roman Gushchin <guro@fb.com>
      Cc: Claudio Zumbo <claudioz@fb.com>
      Cc: Claudio <claudiozumbo@gmail.com>
      Cc: linux-kselftest@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Reviewed-by: NRoman Gushchin <guro@fb.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      a0e8215e
    • A
      kselftest/cgroup: fix unexpected testing failure on test_core · 59243d6f
      Alex Shi 提交于
      [ Upstream commit 00e38a5d753d7788852f81703db804a60a84c26e ]
      
      The cgroup testing relys on the root cgroup's subtree_control setting,
      If the 'memory' controller isn't set, some test cases will be failed
      as following:
      
      $sudo  ./test_core
      not ok 1 test_cgcore_internal_process_constraint
      ok 2 test_cgcore_top_down_constraint_enable
      not ok 3 test_cgcore_top_down_constraint_disable
      ...
      
      To correct this unexpected failure, this patch write the 'memory' to
      subtree_control of root to get a right result.
      Signed-off-by: NAlex Shi <alex.shi@linux.alibaba.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Roman Gushchin <guro@fb.com>
      Cc: Claudio Zumbo <claudioz@fb.com>
      Cc: Claudio <claudiozumbo@gmail.com>
      Cc: linux-kselftest@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Reviewed-by: NRoman Gushchin <guro@fb.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      59243d6f
    • A
      kselftest/cgroup: fix unexpected testing failure on test_memcontrol · 9c2eebe3
      Alex Shi 提交于
      [ Upstream commit f6131f28057d4fd8922599339e701a2504e0f23d ]
      
      The cgroup testing relies on the root cgroup's subtree_control setting,
      If the 'memory' controller isn't set, all test cases will be failed
      as following:
      
      $ sudo ./test_memcontrol
      not ok 1 test_memcg_subtree_control
      not ok 2 test_memcg_current
      ok 3 # skip test_memcg_min
      not ok 4 test_memcg_low
      not ok 5 test_memcg_high
      not ok 6 test_memcg_max
      not ok 7 test_memcg_oom_events
      ok 8 # skip test_memcg_swap_max
      not ok 9 test_memcg_sock
      not ok 10 test_memcg_oom_group_leaf_events
      not ok 11 test_memcg_oom_group_parent_events
      not ok 12 test_memcg_oom_group_score_events
      
      To correct this unexpected failure, this patch write the 'memory' to
      subtree_control of root to get a right result.
      Signed-off-by: NAlex Shi <alex.shi@linux.alibaba.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Roman Gushchin <guro@fb.com>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Mike Rapoport <rppt@linux.vnet.ibm.com>
      Cc: Jay Kamat <jgkamat@fb.com>
      Cc: linux-kselftest@vger.kernel.org
      Cc: linux-kernel@vger.kernel.org
      Reviewed-by: NRoman Gushchin <guro@fb.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      9c2eebe3
    • G
      xtensa: Fix section mismatch between memblock_reserve and mem_reserve · ae0d1c08
      Guenter Roeck 提交于
      [ Upstream commit adefd051a6707a6ca0ebad278d3c1c05c960fc3b ]
      
      Since commit 9012d011660ea5cf2 ("compiler: allow all arches to enable
      CONFIG_OPTIMIZE_INLINING"), xtensa:tinyconfig fails to build with section
      mismatch errors.
      
      WARNING: vmlinux.o(.text.unlikely+0x68): Section mismatch in reference
      	from the function ___pa()
      	to the function .meminit.text:memblock_reserve()
      WARNING: vmlinux.o(.text.unlikely+0x74): Section mismatch in reference
      	from the function mem_reserve()
      	to the function .meminit.text:memblock_reserve()
      FATAL: modpost: Section mismatches detected.
      
      This was not seen prior to the above mentioned commit because mem_reserve()
      was always inlined.
      
      Mark mem_reserve(() as __init_memblock to have it reside in the same
      section as memblock_reserve().
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Message-Id: <1559220098-9955-1-git-send-email-linux@roeck-us.net>
      Signed-off-by: NMax Filippov <jcmvbkbc@gmail.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      ae0d1c08
    • Y
      MIPS: uprobes: remove set but not used variable 'epc' · 3089c0ea
      YueHaibing 提交于
      [ Upstream commit f532beeeff0c0a3586cc15538bc52d249eb19e7c ]
      
      Fixes gcc '-Wunused-but-set-variable' warning:
      
      arch/mips/kernel/uprobes.c: In function 'arch_uprobe_pre_xol':
      arch/mips/kernel/uprobes.c:115:17: warning: variable 'epc' set but not used [-Wunused-but-set-variable]
      
      It's never used since introduction in
      commit 40e084a5 ("MIPS: Add uprobes support.")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NPaul Burton <paul.burton@mips.com>
      Cc: <ralf@linux-mips.org>
      Cc: <jhogan@kernel.org>
      Cc: <linux-kernel@vger.kernel.org>
      Cc: <linux-mips@vger.kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      3089c0ea
    • K
      IB/hfi1: Validate page aligned for a given virtual address · 63542eb2
      Kamenee Arumugam 提交于
      [ Upstream commit 97736f36dbebf2cda2799db3b54717ba5b388255 ]
      
      User applications can register memory regions for TID buffers that are not
      aligned on page boundaries. Hfi1 is expected to pin those pages in memory
      and cache the pages with mmu_rb. The rb tree will fail to insert pages
      that are not aligned correctly.
      
      Validate whether a given virtual address is page aligned before pinning.
      
      Fixes: 7e7a436e ("staging/hfi1: Add TID entry program function body")
      Reviewed-by: NMichael J. Ruhl <michael.j.ruhl@intel.com>
      Signed-off-by: NKamenee Arumugam <kamenee.arumugam@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      63542eb2
    • M
      IB/{qib, hfi1, rdmavt}: Correct ibv_devinfo max_mr value · 4d61fc38
      Mike Marciniszyn 提交于
      [ Upstream commit 35164f5259a47ea756fa1deb3e463ac2a4f10dc9 ]
      
      The command 'ibv_devinfo -v' reports 0 for max_mr.
      
      Fix by assigning the query values after the mr lkey_table has been built
      rather than early on in the driver.
      
      Fixes: 7b1e2099 ("IB/rdmavt: Move memory registration into rdmavt")
      Reviewed-by: NJosh Collier <josh.d.collier@intel.com>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4d61fc38
    • M
      IB/hfi1: Insure freeze_work work_struct is canceled on shutdown · 83099112
      Mike Marciniszyn 提交于
      [ Upstream commit 6d517353c70bb0818b691ca003afdcb5ee5ea44e ]
      
      By code inspection, the freeze_work is never canceled.
      
      Fix by adding a cancel_work_sync in the shutdown path to insure it is no
      longer running.
      
      Fixes: 77241056 ("IB/hfi1: add driver files")
      Reviewed-by: NMichael J. Ruhl <michael.j.ruhl@intel.com>
      Reviewed-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      83099112
    • M
      IB/rdmavt: Fix alloc_qpn() WARN_ON() · 3fe551cc
      Mike Marciniszyn 提交于
      [ Upstream commit 2abae62a26a265129b364d8c1ef3be55e2c01309 ]
      
      The qpn allocation logic has a WARN_ON() that intends to detect the use of
      an index that will introduce bits in the lower order bits of the QOS bits
      in the QPN.
      
      Unfortunately, it has the following bugs:
      - it misfires when wrapping QPN allocation for non-QOS
      - it doesn't correctly detect low order QOS bits (despite the comment)
      
      The WARN_ON() should not be applied to non-QOS (qos_shift == 1).
      
      Additionally, it SHOULD test the qpn bits per the table below:
      
      2 data VLs:   [qp7, qp6, qp5, qp4, qp3, qp2, qp1] ^
                    [  0,   0,   0,   0,   0,   0, sc0],  qp bit 1 always 0*
      3-4 data VLs: [qp7, qp6, qp5, qp4, qp3, qp2, qp1] ^
                    [  0,   0,   0,   0,   0, sc1, sc0], qp bits [21] always 0
      5-8 data VLs: [qp7, qp6, qp5, qp4, qp3, qp2, qp1] ^
                    [  0,   0,   0,   0, sc2, sc1, sc0] qp bits [321] always 0
      
      Fix by qualifying the warning for qos_shift > 1 and producing the correct
      mask to insure the above bits are zero without generating a superfluous
      warning.
      
      Fixes: 501edc42 ("IB/rdmavt: Correct warning during QPN allocation")
      Reviewed-by: NKaike Wan <kaike.wan@intel.com>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      3fe551cc
    • H
      parisc: Fix compiler warnings in float emulation code · 3333e040
      Helge Deller 提交于
      [ Upstream commit 6b98d9134e14f5ef4bcf64b27eedf484ed19a1ec ]
      
      Avoid such compiler warnings:
      arch/parisc/math-emu/cnv_float.h:71:27: warning: ‘<<’ in boolean context, did you mean ‘<’ ? [-Wint-in-bool-context]
           ((Dintp1(dint_valueA) << 33 - SGL_EXP_LENGTH) || Dintp2(dint_valueB))
      arch/parisc/math-emu/fcnvxf.c:257:6: note: in expansion of macro ‘Dint_isinexact_to_sgl’
        if (Dint_isinexact_to_sgl(srcp1,srcp2)) {
      Signed-off-by: NHelge Deller <deller@gmx.de>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      3333e040
    • Y
      parport: Fix mem leak in parport_register_dev_model · f9dd0f09
      YueHaibing 提交于
      [ Upstream commit 1c7ebeabc9e5ee12e42075a597de40fdb9059530 ]
      
      BUG: memory leak
      unreferenced object 0xffff8881df48cda0 (size 16):
        comm "syz-executor.0", pid 5077, jiffies 4295994670 (age 22.280s)
        hex dump (first 16 bytes):
          00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
        backtrace:
          [<00000000d2d0d5fe>] parport_register_dev_model+0x141/0x6e0 [parport]
          [<00000000782f6dab>] 0xffffffffc15d1196
          [<00000000d2ca6ae4>] platform_drv_probe+0x7e/0x100
          [<00000000628c2a94>] really_probe+0x342/0x4d0
          [<000000006874f5da>] driver_probe_device+0x8c/0x170
          [<00000000424de37a>] __device_attach_driver+0xda/0x100
          [<000000002acab09a>] bus_for_each_drv+0xfe/0x170
          [<000000003d9e5f31>] __device_attach+0x190/0x230
          [<0000000035d32f80>] bus_probe_device+0x123/0x140
          [<00000000a05ba627>] device_add+0x7cc/0xce0
          [<000000003f7560bf>] platform_device_add+0x230/0x3c0
          [<000000002a0be07d>] 0xffffffffc15d0949
          [<000000007361d8d2>] port_check+0x3b/0x50 [parport]
          [<000000004d67200f>] bus_for_each_dev+0x115/0x180
          [<000000003ccfd11c>] __parport_register_driver+0x1f0/0x210 [parport]
          [<00000000987f06fc>] 0xffffffffc15d803e
      
      After commit 4e5a74f1 ("parport: Revert "parport: fix
      memory leak""), free_pardevice do not free par_dev->state,
      we should free it in error path of parport_register_dev_model
      before return.
      Reported-by: NHulk Robot <hulkci@huawei.com>
      Fixes: 4e5a74f1 ("parport: Revert "parport: fix memory leak"")
      Signed-off-by: NYueHaibing <yuehaibing@huawei.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      f9dd0f09
    • S
      fpga: dfl: Add lockdep classes for pdata->lock · 4c950c8b
      Scott Wood 提交于
      [ Upstream commit dfe3de8d397bf878b31864d4e489d41118ec475f ]
      
      struct dfl_feature_platform_data (and it's mutex) is used
      by both fme and port devices, and when lockdep is enabled it
      complains about nesting between these locks.  Tell lockdep about
      the difference so it can track each class separately.
      
      Here's the lockdep complaint:
      [  409.680668] WARNING: possible recursive locking detected
      [  409.685983] 5.1.0-rc3.fpga+ #1 Tainted: G            E
      [  409.691469] --------------------------------------------
      [  409.696779] fpgaconf/9348 is trying to acquire lock:
      [  409.701746] 00000000a443fe2e (&pdata->lock){+.+.}, at: port_enable_set+0x24/0x60 [dfl_afu]
      [  409.710006]
      [  409.710006] but task is already holding lock:
      [  409.715837] 0000000063b78782 (&pdata->lock){+.+.}, at: fme_pr_ioctl+0x21d/0x330 [dfl_fme]
      [  409.724012]
      [  409.724012] other info that might help us debug this:
      [  409.730535]  Possible unsafe locking scenario:
      [  409.730535]
      [  409.736457]        CPU0
      [  409.738910]        ----
      [  409.741360]   lock(&pdata->lock);
      [  409.744679]   lock(&pdata->lock);
      [  409.747999]
      [  409.747999]  *** DEADLOCK ***
      [  409.747999]
      [  409.753920]  May be due to missing lock nesting notation
      [  409.753920]
      [  409.760704] 4 locks held by fpgaconf/9348:
      [  409.764805]  #0: 0000000063b78782 (&pdata->lock){+.+.}, at: fme_pr_ioctl+0x21d/0x330 [dfl_fme]
      [  409.773408]  #1: 00000000213c8a66 (&region->mutex){+.+.}, at: fpga_region_program_fpga+0x24/0x200 [fpga_region]
      [  409.783489]  #2: 00000000fe63afb9 (&mgr->ref_mutex){+.+.}, at: fpga_mgr_lock+0x15/0x40 [fpga_mgr]
      [  409.792354]  #3: 000000000b2285c5 (&bridge->mutex){+.+.}, at: __fpga_bridge_get+0x26/0xa0 [fpga_bridge]
      [  409.801740]
      [  409.801740] stack backtrace:
      [  409.806102] CPU: 45 PID: 9348 Comm: fpgaconf Kdump: loaded Tainted: G            E     5.1.0-rc3.fpga+ #1
      [  409.815658] Hardware name: Intel Corporation S2600BT/S2600BT, BIOS SE5C620.86B.01.00.0763.022420181017 02/24/2018
      [  409.825911] Call Trace:
      [  409.828369]  dump_stack+0x5e/0x8b
      [  409.831686]  __lock_acquire+0xf3d/0x10e0
      [  409.835612]  ? find_held_lock+0x3c/0xa0
      [  409.839451]  lock_acquire+0xbc/0x1d0
      [  409.843030]  ? port_enable_set+0x24/0x60 [dfl_afu]
      [  409.847823]  ? port_enable_set+0x24/0x60 [dfl_afu]
      [  409.852616]  __mutex_lock+0x86/0x970
      [  409.856195]  ? port_enable_set+0x24/0x60 [dfl_afu]
      [  409.860989]  ? port_enable_set+0x24/0x60 [dfl_afu]
      [  409.865777]  ? __mutex_unlock_slowpath+0x4b/0x290
      [  409.870486]  port_enable_set+0x24/0x60 [dfl_afu]
      [  409.875106]  fpga_bridges_disable+0x36/0x50 [fpga_bridge]
      [  409.880502]  fpga_region_program_fpga+0xea/0x200 [fpga_region]
      [  409.886338]  fme_pr_ioctl+0x13e/0x330 [dfl_fme]
      [  409.890870]  fme_ioctl+0x66/0xe0 [dfl_fme]
      [  409.894973]  do_vfs_ioctl+0xa9/0x720
      [  409.898548]  ? lockdep_hardirqs_on+0xf0/0x1a0
      [  409.902907]  ksys_ioctl+0x60/0x90
      [  409.906225]  __x64_sys_ioctl+0x16/0x20
      [  409.909981]  do_syscall_64+0x5a/0x220
      [  409.913644]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [  409.918698] RIP: 0033:0x7f9d31b9b8d7
      [  409.922276] Code: 44 00 00 48 8b 05 b9 15 2d 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 89 15 2d 00 f7 d8 64 89 01 48
      [  409.941020] RSP: 002b:00007ffe4cae0d68 EFLAGS: 00000202 ORIG_RAX: 0000000000000010
      [  409.948588] RAX: ffffffffffffffda RBX: 00007f9d32ade6a0 RCX: 00007f9d31b9b8d7
      [  409.955719] RDX: 00007ffe4cae0df0 RSI: 000000000000b680 RDI: 0000000000000003
      [  409.962852] RBP: 0000000000000003 R08: 00007f9d2b70a177 R09: 00007ffe4cae0e40
      [  409.969984] R10: 00007ffe4cae0160 R11: 0000000000000202 R12: 00007ffe4cae0df0
      [  409.977115] R13: 000000000000b680 R14: 0000000000000000 R15: 00007ffe4cae0f60
      Signed-off-by: NScott Wood <swood@redhat.com>
      Acked-by: NWu Hao <hao.wu@intel.com>
      Acked-by: NAlan Tull <atull@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4c950c8b
    • S
      fpga: dfl: afu: Pass the correct device to dma_mapping_error() · 505de32e
      Scott Wood 提交于
      [ Upstream commit 13069847a475b60069918dc9971f5adb42811ce3 ]
      
      dma_mapping_error() was being called on a different device struct than
      what was passed to map/unmap.  Besides rendering the error checking
      ineffective, it caused a debug splat with CONFIG_DMA_API_DEBUG.
      Signed-off-by: NScott Wood <swood@redhat.com>
      Acked-by: NWu Hao <hao.wu@intel.com>
      Acked-by: NMoritz Fischer <mdf@kernel.org>
      Acked-by: NAlan Tull <atull@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      505de32e
    • J
      ARC: [plat-hsdk]: Add missing FIFO size entry in GMAC node · 7b2145e2
      Jose Abreu 提交于
      [ Upstream commit 4c70850aeb2e40016722cd1abd43c679666d3ca0 ]
      
      Add the binding for RX/TX fifo size of GMAC node.
      
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Tested-by: NEugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Acked-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      7b2145e2
    • J
      ARC: [plat-hsdk]: Add missing multicast filter bins number to GMAC node · 15004afd
      Jose Abreu 提交于
      [ Upstream commit ecc906a11c2a0940e1a380debd8bd5bc09faf454 ]
      
      GMAC controller on HSDK boards supports 256 Hash Table size so we need to
      add the multicast filter bins property. This allows for the Hash filter
      to work properly using stmmac driver.
      
      Cc: Joao Pinto <jpinto@synopsys.com>
      Cc: Rob Herring <robh+dt@kernel.org>
      Cc: Mark Rutland <mark.rutland@arm.com>
      Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
      Acked-by: NAlexey Brodkin <abrodkin@synopsys.com>
      Signed-off-by: NJose Abreu <joabreu@synopsys.com>
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      15004afd
    • E
      dmaengine: sprd: Fix block length overflow · 8f3793bf
      Eric Long 提交于
      [ Upstream commit 89d03b3c126d683f7b2cd5b07178493993d12448 ]
      
      The maximum value of block length is 0xffff, so if the configured transfer length
      is more than 0xffff, that will cause block length overflow to lead a configuration
      error.
      
      Thus we can set block length as the maximum burst length to avoid this issue, since
      the maximum burst length will not be a big value which is more than 0xffff.
      Signed-off-by: NEric Long <eric.long@unisoc.com>
      Signed-off-by: NBaolin Wang <baolin.wang@linaro.org>
      Signed-off-by: NVinod Koul <vkoul@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      8f3793bf
    • C
      dmaengine: dw-axi-dmac: fix null dereference when pointer first is null · e478abd4
      Colin Ian King 提交于
      [ Upstream commit 0788611c9a0925c607de536b2449de5ed98ef8df ]
      
      In the unlikely event that axi_desc_get returns a null desc in the
      very first iteration of the while-loop the error exit path ends
      up calling axi_desc_put on a null pointer 'first' and this causes
      a null pointer dereference.  Fix this by adding a null check on
      pointer 'first' before calling axi_desc_put.
      
      Addresses-Coverity: ("Explicit null dereference")
      Fixes: 1fe20f1b ("dmaengine: Introduce DW AXI DMAC driver")
      Signed-off-by: NColin Ian King <colin.king@canonical.com>
      Signed-off-by: NVinod Koul <vkoul@kernel.org>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      e478abd4
    • V
      ARC: fix build warnings · 4c21b761
      Vineet Gupta 提交于
      [ Upstream commit 89c92142f75eb80064f5b9f1111484b1b4d81790 ]
      
      | arch/arc/mm/tlb.c:914:2: warning: variable length array 'pd0' is used [-Wvla]
      | arch/arc/include/asm/cmpxchg.h:95:29: warning: value computed is not used [-Wunused-value]
      Signed-off-by: NVineet Gupta <vgupta@synopsys.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4c21b761
    • D
      brcmfmac: sdio: Don't tune while the card is off · d64f99ef
      Douglas Anderson 提交于
      commit 65dade6044079a5c206fd1803642ff420061417a upstream.
      
      When Broadcom SDIO cards are idled they go to sleep and a whole
      separate subsystem takes over their SDIO communication.  This is the
      Always-On-Subsystem (AOS) and it can't handle tuning requests.
      
      Specifically, as tested on rk3288-veyron-minnie (which reports having
      BCM4354/1 in dmesg), if I force a retune in brcmf_sdio_kso_control()
      when "on = 1" (aka we're transition from sleep to wake) by whacking:
        bus->sdiodev->func1->card->host->need_retune = 1
      ...then I can often see tuning fail.  In this case dw_mmc reports "All
      phases bad!").  Note that I don't get 100% failure, presumably because
      sometimes the card itself has already transitioned away from the AOS
      itself by the time we try to wake it up.  If I force retuning when "on
      = 0" (AKA force retuning right before sending the command to go to
      sleep) then retuning is always OK.
      
      NOTE: we need _both_ this patch and the patch to avoid triggering
      tuning due to CRC errors in the sleep/wake transition, AKA ("brcmfmac:
      sdio: Disable auto-tuning around commands expected to fail").  Though
      both patches handle issues with Broadcom's AOS, the problems are
      distinct:
      1. We want to defer (but not ignore) asynchronous (like
         timer-requested) tuning requests till the card is awake.  However,
         we want to ignore CRC errors during the transition, we don't want
         to queue deferred tuning request.
      2. You could imagine that the AOS could implement retuning but we
         could still get errors while transitioning in and out of the AOS.
         Similarly you could imagine a seamless transition into and out of
         the AOS (with no CRC errors) even if the AOS couldn't handle
         tuning.
      
      ALSO NOTE: presumably there is never a desperate need to retune in
      order to wake up the card, since doing so is impossible.  Luckily the
      only way the card can get into sleep state is if we had a good enough
      tuning to send it the command to put it into sleep, so presumably that
      "good enough" tuning is enough to wake us up, at least with a few
      retries.
      
      Cc: stable@vger.kernel.org #v4.18+
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Reviewed-by: NArend van Spriel <arend.vanspriel@broadcom.com>
      Acked-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d64f99ef
    • D
      brcmfmac: sdio: Disable auto-tuning around commands expected to fail · 0ad82f2e
      Douglas Anderson 提交于
      commit 2de0b42da263c97d330d276f5ccf7c4470e3324f upstream.
      
      There are certain cases, notably when transitioning between sleep and
      active state, when Broadcom SDIO WiFi cards will produce errors on the
      SDIO bus.  This is evident from the source code where you can see that
      we try commands in a loop until we either get success or we've tried
      too many times.  The comment in the code reinforces this by saying
      "just one write attempt may fail"
      
      Unfortunately these failures sometimes end up causing an "-EILSEQ"
      back to the core which triggers a retuning of the SDIO card and that
      blocks all traffic to the card until it's done.
      
      Let's disable retuning around the commands we expect might fail.
      
      Cc: stable@vger.kernel.org #v4.18+
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Reviewed-by: NArend van Spriel <arend.vanspriel@broadcom.com>
      Acked-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0ad82f2e
    • J
      apparmor: enforce nullbyte at end of tag string · 31c99580
      Jann Horn 提交于
      commit 8404d7a674c49278607d19726e0acc0cae299357 upstream.
      
      A packed AppArmor policy contains null-terminated tag strings that are read
      by unpack_nameX(). However, unpack_nameX() uses string functions on them
      without ensuring that they are actually null-terminated, potentially
      leading to out-of-bounds accesses.
      
      Make sure that the tag string is null-terminated before passing it to
      strcmp().
      
      Cc: stable@vger.kernel.org
      Fixes: 736ec752 ("AppArmor: policy routines for loading and unpacking policy")
      Signed-off-by: NJann Horn <jannh@google.com>
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      31c99580
    • J
      apparmor: fix PROFILE_MEDIATES for untrusted input · eb2b0bf5
      John Johansen 提交于
      commit 23375b13f98c5464c2b4d15f983cc062940f1f4e upstream.
      
      While commit 11c236b8 ("apparmor: add a default null dfa") ensure
      every profile has a policy.dfa it does not resize the policy.start[]
      to have entries for every possible start value. Which means
      PROFILE_MEDIATES is not safe to use on untrusted input. Unforunately
      commit b9590ad4 ("apparmor: remove POLICY_MEDIATES_SAFE") did not
      take into account the start value usage.
      
      The input string in profile_query_cb() is user controlled and is not
      properly checked to be within the limited start[] entries, even worse
      it can't be as userspace policy is allowed to make us of entries types
      the kernel does not know about. This mean usespace can currently cause
      the kernel to access memory up to 240 entries beyond the start array
      bounds.
      
      Cc: stable@vger.kernel.org
      Fixes: b9590ad4 ("apparmor: remove POLICY_MEDIATES_SAFE")
      Signed-off-by: NJohn Johansen <john.johansen@canonical.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      eb2b0bf5
    • D
      Input: silead - add MSSL0017 to acpi_device_id · 1d08fe25
      Daniel Smith 提交于
      commit 0e658060e5fc50dc282885dc424a94b5d95547e5 upstream.
      
      On Chuwi Hi10 Plus, the Silead device id is MSSL0017.
      Signed-off-by: NDaniel Smith <danct12@disroot.org>
      Reviewed-by: NHans de Goede <hdegoede@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1d08fe25
    • A
      Input: uinput - add compat ioctl number translation for UI_*_FF_UPLOAD · ebd7dda8
      Andrey Smirnov 提交于
      commit 7c7da40da1640ce6814dab1e8031b44e19e5a3f6 upstream.
      
      In the case of compat syscall ioctl numbers for UI_BEGIN_FF_UPLOAD and
      UI_END_FF_UPLOAD need to be adjusted before being passed on
      uinput_ioctl_handler() since code built with -m32 will be passing
      slightly different values. Extend the code already covering
      UI_SET_PHYS to cover UI_BEGIN_FF_UPLOAD and UI_END_FF_UPLOAD as well.
      Reported-by: NPierre-Loup A. Griffais <pgriffais@valvesoftware.com>
      Signed-off-by: NAndrey Smirnov <andrew.smirnov@gmail.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      ebd7dda8
    • A
      Input: synaptics - enable SMBus on ThinkPad E480 and E580 · 9f3559e4
      Alexander Mikhaylenko 提交于
      commit 9843f3e08e2144724be7148e08d77a195dea257a upstream.
      
      They are capable of using intertouch and it works well with
      psmouse.synaptics_intertouch=1, so add them to the list.
      
      Without it, scrolling and gestures are jumpy, three-finger pinch gesture
      doesn't work and three- or four-finger swipes sometimes get stuck.
      Signed-off-by: NAlexander Mikhaylenko <exalm7659@gmail.com>
      Reviewed-by: NBenjamin Tissoires <benjamin.tissoires@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9f3559e4
    • C
      iio: temperature: mlx90632 Relax the compatibility check · e61e41ff
      Crt Mori 提交于
      commit 389fc70b60f534d679aea9a3f05146040ce20d77 upstream.
      
      Register EE_VERSION contains mixture of calibration information and DSP
      version. So far, because calibrations were definite, the driver
      compatibility depended on whole contents, but in the newer production
      process the calibration part changes. Because of that, value in EE_VERSION
      will be changed and to avoid that calibration value is same as DSP version
      the MSB in calibration part was fixed to 1.
      That means existing calibrations (medical and consumer) will now have
      hex values (bits 8 to 15) of 83 and 84 respectively. Driver compatibility
      should be based only on DSP version part of the EE_VERSION (bits 0 to 7)
      register.
      Signed-off-by: NCrt Mori <cmo@melexis.com>
      Cc: <Stable@vger.kernel.org>
      Signed-off-by: NJonathan Cameron <Jonathan.Cameron@huawei.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e61e41ff
    • M
      IB/hfi1: Silence txreq allocation warnings · 303386b3
      Mike Marciniszyn 提交于
      commit 3230f4a8d44e4a0bb7afea814b280b5129521f52 upstream.
      
      The following warning can happen when a memory shortage
      occurs during txreq allocation:
      
      [10220.939246] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
      [10220.939246] Hardware name: Intel Corporation S2600WT2R/S2600WT2R, BIOS SE5C610.86B.01.01.0018.C4.072020161249 07/20/2016
      [10220.939247]   cache: mnt_cache, object size: 384, buffer size: 384, default order: 2, min order: 0
      [10220.939260] Workqueue: hfi0_0 _hfi1_do_send [hfi1]
      [10220.939261]   node 0: slabs: 1026568, objs: 43115856, free: 0
      [10220.939262] Call Trace:
      [10220.939262]   node 1: slabs: 820872, objs: 34476624, free: 0
      [10220.939263]  dump_stack+0x5a/0x73
      [10220.939265]  warn_alloc+0x103/0x190
      [10220.939267]  ? wake_all_kswapds+0x54/0x8b
      [10220.939268]  __alloc_pages_slowpath+0x86c/0xa2e
      [10220.939270]  ? __alloc_pages_nodemask+0x2fe/0x320
      [10220.939271]  __alloc_pages_nodemask+0x2fe/0x320
      [10220.939273]  new_slab+0x475/0x550
      [10220.939275]  ___slab_alloc+0x36c/0x520
      [10220.939287]  ? hfi1_make_rc_req+0x90/0x18b0 [hfi1]
      [10220.939299]  ? __get_txreq+0x54/0x160 [hfi1]
      [10220.939310]  ? hfi1_make_rc_req+0x90/0x18b0 [hfi1]
      [10220.939312]  __slab_alloc+0x40/0x61
      [10220.939323]  ? hfi1_make_rc_req+0x90/0x18b0 [hfi1]
      [10220.939325]  kmem_cache_alloc+0x181/0x1b0
      [10220.939336]  hfi1_make_rc_req+0x90/0x18b0 [hfi1]
      [10220.939348]  ? hfi1_verbs_send_dma+0x386/0xa10 [hfi1]
      [10220.939359]  ? find_prev_entry+0xb0/0xb0 [hfi1]
      [10220.939371]  hfi1_do_send+0x1d9/0x3f0 [hfi1]
      [10220.939372]  process_one_work+0x171/0x380
      [10220.939374]  worker_thread+0x49/0x3f0
      [10220.939375]  kthread+0xf8/0x130
      [10220.939377]  ? max_active_store+0x80/0x80
      [10220.939378]  ? kthread_bind+0x10/0x10
      [10220.939379]  ret_from_fork+0x35/0x40
      [10220.939381] SLUB: Unable to allocate memory on node -1, gfp=0xa20(GFP_ATOMIC)
      
      The shortage is handled properly so the message isn't needed. Silence by
      adding the no warn option to the slab allocation.
      
      Fixes: 45842abb ("staging/rdma/hfi1: move txreq header code")
      Cc: <stable@vger.kernel.org>
      Reviewed-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NDoug Ledford <dledford@redhat.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      303386b3
    • K
      IB/hfi1: Validate fault injection opcode user input · 7cc9c993
      Kaike Wan 提交于
      commit 5f90677ed31963abb184ee08ebee4a4a68225dd8 upstream.
      
      The opcode range for fault injection from user should be validated before
      it is applied to the fault->opcodes[] bitmap to avoid out-of-bound
      error.
      
      Cc: <stable@vger.kernel.org>
      Fixes: a74d5307 ("IB/hfi1: Rework fault injection machinery")
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NMike Marciniszyn <mike.marciniszyn@intel.com>
      Signed-off-by: NKaike Wan <kaike.wan@intel.com>
      Signed-off-by: NDennis Dalessandro <dennis.dalessandro@intel.com>
      Signed-off-by: NJason Gunthorpe <jgg@mellanox.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7cc9c993
    • M
      usb: xhci: Don't try to recover an endpoint if port is in error state. · 17027034
      Mathias Nyman 提交于
      commit b8c3b718087bf7c3c8e388eb1f72ac1108a4926e upstream.
      
      A USB3 device needs to be reset and re-enumarated if the port it
      connects to goes to a error state, with link state inactive.
      
      There is no use in trying to recover failed transactions by resetting
      endpoints at this stage. Tests show that in rare cases, after multiple
      endpoint resets of a roothub port the whole host controller might stop
      completely.
      
      Several retries to recover from transaction error can happen as
      it can take a long time before the hub thread discovers the USB3
      port error and inactive link.
      
      We can't reliably detect the port error from slot or endpoint context
      due to a limitation in xhci, see xhci specs section 4.8.3:
      "There are several cases where the EP State field in the Output
      Endpoint Context may not reflect the current state of an endpoint"
      and
      "Software should maintain an accurate value for EP State, by tracking it
      with an internal variable that is driven by Events and Doorbell accesses"
      
      Same appears to be true for slot state.
      
      set a flag to the corresponding slot if a USB3 roothub port link goes
      inactive to prevent both queueing new URBs and resetting endpoints.
      Reported-by: NRapolu Chiranjeevi <chiranjeevi.rapolu@intel.com>
      Tested-by: NRapolu Chiranjeevi <chiranjeevi.rapolu@intel.com>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      17027034
    • M
      xhci: detect USB 3.2 capable host controllers correctly · d606a82c
      Mathias Nyman 提交于
      commit ddd57980a0fde30f7b5d14b888a2cc84d01610e8 upstream.
      
      USB 3.2 capability in a host can be detected from the
      xHCI Supported Protocol Capability major and minor revision fields.
      
      If major is 0x3 and minor 0x20 then the host is USB 3.2 capable.
      
      For USB 3.2 capable hosts set the root hub lane count to 2.
      
      The Major Revision and Minor Revision fields contain a BCD version number.
      The value of the Major Revision field is JJh and the value of the Minor
      Revision field is MNh for version JJ.M.N, where JJ = major revision number,
      M - minor version number, N = sub-minor version number,
      e.g. version 3.1 is represented with a value of 0310h.
      
      Also fix the extra whitespace printed out when announcing regular
      SuperSpeed hosts.
      
      Cc: <stable@vger.kernel.org> # v4.18+
      Signed-off-by: NMathias Nyman <mathias.nyman@linux.intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d606a82c
    • P
      usb: chipidea: udc: workaround for endpoint conflict issue · e6563039
      Peter Chen 提交于
      commit c19dffc0a9511a7d7493ec21019aefd97e9a111b upstream.
      
      An endpoint conflict occurs when the USB is working in device mode
      during an isochronous communication. When the endpointA IN direction
      is an isochronous IN endpoint, and the host sends an IN token to
      endpointA on another device, then the OUT transaction may be missed
      regardless the OUT endpoint number. Generally, this occurs when the
      device is connected to the host through a hub and other devices are
      connected to the same hub.
      
      The affected OUT endpoint can be either control, bulk, isochronous, or
      an interrupt endpoint. After the OUT endpoint is primed, if an IN token
      to the same endpoint number on another device is received, then the OUT
      endpoint may be unprimed (cannot be detected by software), which causes
      this endpoint to no longer respond to the host OUT token, and thus, no
      corresponding interrupt occurs.
      
      There is no good workaround for this issue, the only thing the software
      could do is numbering isochronous IN from the highest endpoint since we
      have observed most of device number endpoint from the lowest.
      
      Cc: <stable@vger.kernel.org> #v3.14+
      Cc: Fabio Estevam <festevam@gmail.com>
      Cc: Greg KH <gregkh@linuxfoundation.org>
      Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
      Cc: Jun Li <jun.li@nxp.com>
      Signed-off-by: NPeter Chen <peter.chen@nxp.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e6563039
    • S
      scsi: ufs: Avoid runtime suspend possibly being blocked forever · 0746b2f5
      Stanley Chu 提交于
      commit 24e2e7a19f7e4b83d0d5189040d997bce3596473 upstream.
      
      UFS runtime suspend can be triggered after pm_runtime_enable() is invoked
      in ufshcd_pltfrm_init(). However if the first runtime suspend is triggered
      before binding ufs_hba structure to ufs device structure via
      platform_set_drvdata(), then UFS runtime suspend will be no longer
      triggered in the future because its dev->power.runtime_error was set in the
      first triggering and does not have any chance to be cleared.
      
      To be more clear, dev->power.runtime_error is set if hba is NULL in
      ufshcd_runtime_suspend() which returns -EINVAL to rpm_callback() where
      dev->power.runtime_error is set as -EINVAL. In this case, any future
      rpm_suspend() for UFS device fails because rpm_check_suspend_allowed()
      fails due to non-zero
      dev->power.runtime_error.
      
      To resolve this issue, make sure the first UFS runtime suspend get valid
      "hba" in ufshcd_runtime_suspend(): Enable UFS runtime PM only after hba is
      successfully bound to UFS device structure.
      
      Fixes: 62694735 ([SCSI] ufs: Add runtime PM support for UFS host controller driver)
      Cc: stable@vger.kernel.org
      Signed-off-by: NStanley Chu <stanley.chu@mediatek.com>
      Reviewed-by: NAvri Altman <avri.altman@wdc.com>
      Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0746b2f5
    • U
      mmc: core: Prevent processing SDIO IRQs when the card is suspended · 98467b8f
      Ulf Hansson 提交于
      commit 83293386bc95cf5e9f0c0175794455835bd1cb4a upstream.
      
      Processing of SDIO IRQs must obviously be prevented while the card is
      system suspended, otherwise we may end up trying to communicate with an
      uninitialized SDIO card.
      
      Reports throughout the years shows that this is not only a theoretical
      problem, but a real issue. So, let's finally fix this problem, by keeping
      track of the state for the card and bail out before processing the SDIO
      IRQ, in case the card is suspended.
      
      Cc: stable@vger.kernel.org
      Reported-by: NDouglas Anderson <dianders@chromium.org>
      Tested-by: NDouglas Anderson <dianders@chromium.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      98467b8f
    • D
      mmc: core: Add sdio_retune_hold_now() and sdio_retune_release() · 0349dbeb
      Douglas Anderson 提交于
      commit b4c9f938d542d5f88c501744d2d12fad4fd2915f upstream.
      
      We want SDIO drivers to be able to temporarily stop retuning when the
      driver knows that the SDIO card is not in a state where retuning will
      work (maybe because the card is asleep).  We'll move the relevant
      functions to a place where drivers can call them.
      
      Cc: stable@vger.kernel.org #v4.18+
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0349dbeb
    • D
      mmc: core: API to temporarily disable retuning for SDIO CRC errors · 7ed49e1b
      Douglas Anderson 提交于
      commit 0a55f4ab9678413a01e740c86e9367ba0c612b36 upstream.
      
      Normally when the MMC core sees an "-EILSEQ" error returned by a host
      controller then it will trigger a retuning of the card.  This is
      generally a good idea.
      
      However, if a command is expected to sometimes cause transfer errors
      then these transfer errors shouldn't cause a re-tuning.  This
      re-tuning will be a needless waste of time.  One example case where a
      transfer is expected to cause errors is when transitioning between
      idle (sometimes referred to as "sleep" in Broadcom code) and active
      state on certain Broadcom WiFi SDIO cards.  Specifically if the card
      was already transitioning between states when the command was sent it
      could cause an error on the SDIO bus.
      
      Let's add an API that the SDIO function drivers can call that will
      temporarily disable the auto-tuning functionality.  Then we can add a
      call to this in the Broadcom WiFi driver and any other driver that
      might have similar needs.
      
      NOTE: this makes the assumption that the card is already tuned well
      enough that it's OK to disable the auto-retuning during one of these
      error-prone situations.  Presumably the driver code performing the
      error-prone transfer knows how to recover / retry from errors.  ...and
      after we can get back to a state where transfers are no longer
      error-prone then we can enable the auto-retuning again.  If we truly
      find ourselves in a case where the card needs to be retuned sometimes
      to handle one of these error-prone transfers then we can always try a
      few transfers first without auto-retuning and then re-try with
      auto-retuning if the first few fail.
      
      Without this change on rk3288-veyron-minnie I periodically see this in
      the logs of a machine just sitting there idle:
        dwmmc_rockchip ff0d0000.dwmmc: Successfully tuned phase to XYZ
      
      Cc: stable@vger.kernel.org #v4.18+
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Acked-by: NKalle Valo <kvalo@codeaurora.org>
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      7ed49e1b
    • R
      mmc: sdhci: sdhci-pci-o2micro: Correctly set bus width when tuning · 4b6d290c
      Raul E Rangel 提交于
      commit 0f7b79a44e7d7dd3ef1f59758c1a341f217ff5e5 upstream.
      
      The O2Micro controller only supports tuning at 4-bits. So the host driver
      needs to change the bus width while tuning and then set it back when done.
      
      There was a bug in the original implementation in that mmc->ios.bus_width
      also wasn't updated. Thus setting the incorrect blocksize in
      sdhci_send_tuning which results in a tuning failure.
      Signed-off-by: NRaul E Rangel <rrangel@chromium.org>
      Fixes: 0086fc21 ("mmc: sdhci: Add support for O2 hardware tuning")
      Acked-by: NAdrian Hunter <adrian.hunter@intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4b6d290c
    • H
      s390/ap: rework assembler functions to use unions for in/out register variables · 4c15ded5
      Harald Freudenberger 提交于
      [ Upstream commit 159491f3b509bd8101199944dc7b0673b881c734 ]
      
      The inline assembler functions ap_aqic() and ap_qact() used two
      variables declared on the very same register. One variable was for
      input only, the other for output. Looks like newer versions of the gcc
      don't like this. Anyway it is a better coding to use one variable
      (which may have a union data type) on one register for input and
      output. So this patch introduces unions and uses only one variable now
      for input and output for GR1 for the PQAP(QACT) and PQAP(QIC)
      invocation.
      Signed-off-by: NHarald Freudenberger <freude@linux.ibm.com>
      Acked-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      4c15ded5
    • I
      s390/jump_label: Use "jdd" constraint on gcc9 · fb48fb15
      Ilya Leoshkevich 提交于
      [ Upstream commit 146448524bddbf6dfc62de31957e428de001cbda ]
      
      [heiko.carstens@de.ibm.com]:
      -----
      Laura Abbott reported that the kernel doesn't build anymore with gcc 9,
      due to the "X" constraint. Ilya provided the gcc 9 patch "S/390:
      Introduce jdd constraint" which introduces the new "jdd" constraint
      which fixes this.
      -----
      
      The support for section anchors on S/390 introduced in gcc9 has changed
      the behavior of "X" constraint, which can now produce register
      references. Since existing constraints, in particular, "i", do not fit
      the intended use case on S/390, the new machine-specific "jdd"
      constraint was introduced. This patch makes jump labels use "jdd"
      constraint when building with gcc9.
      Reported-by: NLaura Abbott <labbott@redhat.com>
      Signed-off-by: NIlya Leoshkevich <iii@linux.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      fb48fb15
    • A
      ovl: fix bogus -Wmaybe-unitialized warning · 0319ef1d
      Arnd Bergmann 提交于
      [ Upstream commit 1dac6f5b0ed2601be21bb4e27a44b0c3e667b7f4 ]
      
      gcc gets a bit confused by the logic in ovl_setup_trap() and
      can't figure out whether the local 'trap' variable in the caller
      was initialized or not:
      
      fs/overlayfs/super.c: In function 'ovl_fill_super':
      fs/overlayfs/super.c:1333:4: error: 'trap' may be used uninitialized in this function [-Werror=maybe-uninitialized]
          iput(trap);
          ^~~~~~~~~~
      fs/overlayfs/super.c:1312:17: note: 'trap' was declared here
      
      Reword slightly to make it easier for the compiler to understand.
      
      Fixes: 146d62e5a586 ("ovl: detect overlapping layers")
      Signed-off-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NMiklos Szeredi <mszeredi@redhat.com>
      Signed-off-by: NSasha Levin <sashal@kernel.org>
      0319ef1d