1. 04 9月, 2019 6 次提交
  2. 03 9月, 2019 2 次提交
  3. 24 8月, 2019 2 次提交
  4. 23 8月, 2019 6 次提交
    • M
      dm table: fix invalid memory accesses with too high sector number · 1cfd5d33
      Mikulas Patocka 提交于
      If the sector number is too high, dm_table_find_target() should return a
      pointer to a zeroed dm_target structure (the caller should test it with
      dm_target_is_valid).
      
      However, for some table sizes, the code in dm_table_find_target() that
      performs btree lookup will access out of bound memory structures.
      
      Fix this bug by testing the sector number at the beginning of
      dm_table_find_target(). Also, add an "inline" keyword to the function
      dm_table_get_size() because this is a hot path.
      
      Fixes: 512875bd ("dm: table detect io beyond device")
      Cc: stable@vger.kernel.org
      Reported-by: NZhang Tao <kontais@zoho.com>
      Signed-off-by: NMikulas Patocka <mpatocka@redhat.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      1cfd5d33
    • L
      gpio: Fix irqchip initialization order · 48057ed1
      Linus Walleij 提交于
      The new API for registering a gpio_irq_chip along with a
      gpio_chip has a different semantic ordering than the old
      API which added the irqchip explicitly after registering
      the gpio_chip.
      
      Move the calls to add the gpio_irq_chip *last* in the
      function, so that the different hooks setting up OF and
      ACPI and machine gpio_chips are called *before* we try
      to register the interrupts, preserving the elder semantic
      order.
      
      This cropped up in the PL061 driver which used to work
      fine with no special ACPI quirks, but started to misbehave
      using the new API.
      
      Fixes: e0d89728 ("gpio: Implement tighter IRQ chip integration")
      Cc: Thierry Reding <treding@nvidia.com>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
      Reported-by: NWei Xu <xuwei5@hisilicon.com>
      Tested-by: NWei Xu <xuwei5@hisilicon.com>
      Reported-by: NAndy Shevchenko <andy.shevchenko@gmail.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      Link: https://lore.kernel.org/r/20190820080527.11796-1-linus.walleij@linaro.org
      48057ed1
    • L
      drm/nouveau: Don't retry infinitely when receiving no data on i2c over AUX · c358ebf5
      Lyude Paul 提交于
      While I had thought I had fixed this issue in:
      
      commit 342406e4 ("drm/nouveau/i2c: Disable i2c bus access after
      ->fini()")
      
      It turns out that while I did fix the error messages I was seeing on my
      P50 when trying to access i2c busses with the GPU in runtime suspend, I
      accidentally had missed one important detail that was mentioned on the
      bug report this commit was supposed to fix: that the CPU would only lock
      up when trying to access i2c busses _on connected devices_ _while the
      GPU is not in runtime suspend_. Whoops. That definitely explains why I
      was not able to get my machine to hang with i2c bus interactions until
      now, as plugging my P50 into it's dock with an HDMI monitor connected
      allowed me to finally reproduce this locally.
      
      Now that I have managed to reproduce this issue properly, it looks like
      the problem is much simpler then it looks. It turns out that some
      connected devices, such as MST laptop docks, will actually ACK i2c reads
      even if no data was actually read:
      
      [  275.063043] nouveau 0000:01:00.0: i2c: aux 000a: 1: 0000004c 1
      [  275.063447] nouveau 0000:01:00.0: i2c: aux 000a: 00 01101000 10040000
      [  275.063759] nouveau 0000:01:00.0: i2c: aux 000a: rd 00000001
      [  275.064024] nouveau 0000:01:00.0: i2c: aux 000a: rd 00000000
      [  275.064285] nouveau 0000:01:00.0: i2c: aux 000a: rd 00000000
      [  275.064594] nouveau 0000:01:00.0: i2c: aux 000a: rd 00000000
      
      Because we don't handle the situation of i2c ack without any data, we
      end up entering an infinite loop in nvkm_i2c_aux_i2c_xfer() since the
      value of cnt always remains at 0. This finally properly explains how
      this could result in a CPU hang like the ones observed in the
      aforementioned commit.
      
      So, fix this by retrying transactions if no data is written or received,
      and give up and fail the transaction if we continue to not write or
      receive any data after 32 retries.
      Signed-off-by: NLyude Paul <lyude@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: NBen Skeggs <bskeggs@redhat.com>
      c358ebf5
    • A
      drm/amdgpu/powerplay: silence a warning in smu_v11_0_setup_pptable · 75710f08
      Alex Deucher 提交于
      I think gcc is confused as I don't see how size could be used
      unitialized, but go ahead and silence the warning.
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Reviewed-by: NEvan Quan <evan.quan@amd.com>
      Signed-off-by: NDave Airlie <airlied@redhat.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20190822032527.1376-1-alexander.deucher@amd.com
      75710f08
    • Z
      dm space map metadata: fix missing store of apply_bops() return value · ae148243
      ZhangXiaoxu 提交于
      In commit 6096d91a ("dm space map metadata: fix occasional leak
      of a metadata block on resize"), we refactor the commit logic to a new
      function 'apply_bops'.  But when that logic was replaced in out() the
      return value was not stored.  This may lead out() returning a wrong
      value to the caller.
      
      Fixes: 6096d91a ("dm space map metadata: fix occasional leak of a metadata block on resize")
      Cc: stable@vger.kernel.org
      Signed-off-by: NZhangXiaoxu <zhangxiaoxu5@huawei.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      ae148243
    • Z
      dm btree: fix order of block initialization in btree_split_beneath · e4f9d601
      ZhangXiaoxu 提交于
      When btree_split_beneath() splits a node to two new children, it will
      allocate two blocks: left and right.  If right block's allocation
      failed, the left block will be unlocked and marked dirty.  If this
      happened, the left block'ss content is zero, because it wasn't
      initialized with the btree struct before the attempot to allocate the
      right block.  Upon return, when flushing the left block to disk, the
      validator will fail when check this block.  Then a BUG_ON is raised.
      
      Fix this by completely initializing the left block before allocating and
      initializing the right block.
      
      Fixes: 4dcb8b57 ("dm btree: fix leak of bufio-backed block in btree_split_beneath error path")
      Cc: stable@vger.kernel.org
      Signed-off-by: NZhangXiaoxu <zhangxiaoxu5@huawei.com>
      Signed-off-by: NMike Snitzer <snitzer@redhat.com>
      e4f9d601
  5. 22 8月, 2019 8 次提交
    • B
      RDMA/siw: Fix SGL mapping issues · fab4f97e
      Bernard Metzler 提交于
      All user level and most in-kernel applications submit WQEs
      where the SG list entries are all of a single type.
      iSER in particular, however, will send us WQEs with mixed SG
      types: sge[0] = kernel buffer, sge[1] = PBL region.
      Check and set is_kva on each SG entry individually instead of
      assuming the first SGE type carries through to the last.
      This fixes iSER over siw.
      
      Fixes: b9be6f18 ("rdma/siw: transmit path")
      Reported-by: NKrishnamraju Eraparaju <krishna2@chelsio.com>
      Tested-by: NKrishnamraju Eraparaju <krishna2@chelsio.com>
      Signed-off-by: NBernard Metzler <bmt@zurich.ibm.com>
      Link: https://lore.kernel.org/r/20190822150741.21871-1-bmt@zurich.ibm.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      fab4f97e
    • S
      RDMA/bnxt_re: Fix stack-out-of-bounds in bnxt_qplib_rcfw_send_message · d37b1e53
      Selvin Xavier 提交于
      Driver copies FW commands to the HW queue as  units of 16 bytes. Some
      of the command structures are not exact multiple of 16. So while copying
      the data from those structures, the stack out of bounds messages are
      reported by KASAN. The following error is reported.
      
      [ 1337.530155] ==================================================================
      [ 1337.530277] BUG: KASAN: stack-out-of-bounds in bnxt_qplib_rcfw_send_message+0x40a/0x850 [bnxt_re]
      [ 1337.530413] Read of size 16 at addr ffff888725477a48 by task rmmod/2785
      
      [ 1337.530540] CPU: 5 PID: 2785 Comm: rmmod Tainted: G           OE     5.2.0-rc6+ #75
      [ 1337.530541] Hardware name: Dell Inc. PowerEdge R730/0599V5, BIOS 1.0.4 08/28/2014
      [ 1337.530542] Call Trace:
      [ 1337.530548]  dump_stack+0x5b/0x90
      [ 1337.530556]  ? bnxt_qplib_rcfw_send_message+0x40a/0x850 [bnxt_re]
      [ 1337.530560]  print_address_description+0x65/0x22e
      [ 1337.530568]  ? bnxt_qplib_rcfw_send_message+0x40a/0x850 [bnxt_re]
      [ 1337.530575]  ? bnxt_qplib_rcfw_send_message+0x40a/0x850 [bnxt_re]
      [ 1337.530577]  __kasan_report.cold.3+0x37/0x77
      [ 1337.530581]  ? _raw_write_trylock+0x10/0xe0
      [ 1337.530588]  ? bnxt_qplib_rcfw_send_message+0x40a/0x850 [bnxt_re]
      [ 1337.530590]  kasan_report+0xe/0x20
      [ 1337.530592]  memcpy+0x1f/0x50
      [ 1337.530600]  bnxt_qplib_rcfw_send_message+0x40a/0x850 [bnxt_re]
      [ 1337.530608]  ? bnxt_qplib_creq_irq+0xa0/0xa0 [bnxt_re]
      [ 1337.530611]  ? xas_create+0x3aa/0x5f0
      [ 1337.530613]  ? xas_start+0x77/0x110
      [ 1337.530615]  ? xas_clear_mark+0x34/0xd0
      [ 1337.530623]  bnxt_qplib_free_mrw+0x104/0x1a0 [bnxt_re]
      [ 1337.530631]  ? bnxt_qplib_destroy_ah+0x110/0x110 [bnxt_re]
      [ 1337.530633]  ? bit_wait_io_timeout+0xc0/0xc0
      [ 1337.530641]  bnxt_re_dealloc_mw+0x2c/0x60 [bnxt_re]
      [ 1337.530648]  bnxt_re_destroy_fence_mr+0x77/0x1d0 [bnxt_re]
      [ 1337.530655]  bnxt_re_dealloc_pd+0x25/0x60 [bnxt_re]
      [ 1337.530677]  ib_dealloc_pd_user+0xbe/0xe0 [ib_core]
      [ 1337.530683]  srpt_remove_one+0x5de/0x690 [ib_srpt]
      [ 1337.530689]  ? __srpt_close_all_ch+0xc0/0xc0 [ib_srpt]
      [ 1337.530692]  ? xa_load+0x87/0xe0
      ...
      [ 1337.530840]  do_syscall_64+0x6d/0x1f0
      [ 1337.530843]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
      [ 1337.530845] RIP: 0033:0x7ff5b389035b
      [ 1337.530848] Code: 73 01 c3 48 8b 0d 2d 0b 2c 00 f7 d8 64 89 01 48 83 c8 ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa b8 b0 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d fd 0a 2c 00 f7 d8 64 89 01 48
      [ 1337.530849] RSP: 002b:00007fff83425c28 EFLAGS: 00000206 ORIG_RAX: 00000000000000b0
      [ 1337.530852] RAX: ffffffffffffffda RBX: 00005596443e6750 RCX: 00007ff5b389035b
      [ 1337.530853] RDX: 000000000000000a RSI: 0000000000000800 RDI: 00005596443e67b8
      [ 1337.530854] RBP: 0000000000000000 R08: 00007fff83424ba1 R09: 0000000000000000
      [ 1337.530856] R10: 00007ff5b3902960 R11: 0000000000000206 R12: 00007fff83425e50
      [ 1337.530857] R13: 00007fff8342673c R14: 00005596443e6260 R15: 00005596443e6750
      
      [ 1337.530885] The buggy address belongs to the page:
      [ 1337.530962] page:ffffea001c951dc0 refcount:0 mapcount:0 mapping:0000000000000000 index:0x0
      [ 1337.530964] flags: 0x57ffffc0000000()
      [ 1337.530967] raw: 0057ffffc0000000 0000000000000000 ffffffff1c950101 0000000000000000
      [ 1337.530970] raw: 0000000000000000 0000000000000000 00000000ffffffff 0000000000000000
      [ 1337.530970] page dumped because: kasan: bad access detected
      
      [ 1337.530996] Memory state around the buggy address:
      [ 1337.531072]  ffff888725477900: 00 00 00 00 f1 f1 f1 f1 00 00 00 00 00 f2 f2 f2
      [ 1337.531180]  ffff888725477980: 00 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1 00
      [ 1337.531288] >ffff888725477a00: 00 f2 f2 f2 f2 f2 f2 00 00 00 f2 00 00 00 00 00
      [ 1337.531393]                                                  ^
      [ 1337.531478]  ffff888725477a80: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [ 1337.531585]  ffff888725477b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
      [ 1337.531691] ==================================================================
      
      Fix this by passing the exact size of each FW command to
      bnxt_qplib_rcfw_send_message as req->cmd_size. Before sending
      the command to HW, modify the req->cmd_size to number of 16 byte units.
      
      Fixes: 1ac5a404 ("RDMA/bnxt_re: Add bnxt_re RoCE driver")
      Signed-off-by: NSelvin Xavier <selvin.xavier@broadcom.com>
      Link: https://lore.kernel.org/r/1566468170-489-1-git-send-email-selvin.xavier@broadcom.comSigned-off-by: NDoug Ledford <dledford@redhat.com>
      d37b1e53
    • N
      drm/amd/display: Calculate bpc based on max_requested_bpc · ec6e4913
      Nicholas Kazlauskas 提交于
      [Why]
      The only place where state->max_bpc is updated on the connector is
      at the start of atomic check during drm_atomic_connector_check. It
      isn't updated when adding the connectors to the atomic state after
      the fact. It also doesn't necessarily reflect the right value when
      called in amdgpu during mode validation outside of atomic check.
      
      This can cause the wrong bpc to be used even if the max_requested_bpc
      is the correct value.
      
      [How]
      Don't rely on state->max_bpc reflecting the real bpc value and just
      do the min(...) based on display info bpc and max_requested_bpc.
      
      Fixes: 01933ba4 ("drm/amd/display: Use current connector state if NULL when checking bpc")
      Signed-off-by: NNicholas Kazlauskas <nicholas.kazlauskas@amd.com>
      Reviewed-by: NLeo Li <sunpeng.li@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      ec6e4913
    • N
      drm/amdgpu: prevent memory leaks in AMDGPU_CS ioctl · 1a701ea9
      Nicolai Hähnle 提交于
      Error out if the AMDGPU_CS ioctl is called with multiple SYNCOBJ_OUT and/or
      TIMELINE_SIGNAL chunks, since otherwise the last chunk wins while the
      allocated array as well as the reference counts of sync objects are leaked.
      Signed-off-by: NNicolai Hähnle <nicolai.haehnle@amd.com>
      Reviewed-by: NChristian König <christian.koenig@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      1a701ea9
    • K
      drm/amd/amdgpu: disable MMHUB PG for navi10 · 221a2bdb
      Kenneth Feng 提交于
      Disable MMHUB PG for navi10 according to the production requirement.
      Signed-off-by: NKenneth Feng <kenneth.feng@amd.com>
      Reviewed-by: NHawking Zhang <Hawking.Zhang@amd.com>
      Reviewed-by: NKevin Wang <kevin1.wang@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      221a2bdb
    • K
      drm/amd/powerplay: remove duplicate macro smu_get_uclk_dpm_states in amdgpu_smu.h · 155f85c0
      Kevin Wang 提交于
      remove duplicate macro smu_get_uclk_dpm_states in amdgpu_smu.h
      
      "
       #define smu_get_uclk_dpm_states(smu, clocks_in_khz, num_states) \
               ((smu)->ppt_funcs->get_uclk_dpm_states ? (smu)->ppt_funcs->get_uclk_dpm_states((smu), (clocks_in_khz), (num_states)) : 0)
       #define smu_get_max_sustainable_clocks_by_dc(smu, max_clocks) \
               ((smu)->funcs->get_max_sustainable_clocks_by_dc ? (smu)->funcs->get_max_sustainable_clocks_by_dc((smu), (max_clocks)) : 0)
       #define smu_get_uclk_dpm_states(smu, clocks_in_khz, num_states) \
               ((smu)->ppt_funcs->get_uclk_dpm_states ? (smu)->ppt_funcs->get_uclk_dpm_states((smu), (clocks_in_khz), (num_states)) : 0)
      "
      Signed-off-by: NKevin Wang <kevin1.wang@amd.com>
      Reviewed-by: NHuang Rui <ray.huang@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      155f85c0
    • K
      drm/amd/powerplay: fix variable type errors in smu_v11_0_setup_pptable · 00430144
      Kevin Wang 提交于
      fix size type errors, from uint32_t to uint16_t.
      it will cause only initializes the highest 16 bits in
      smu_get_atom_data_table function.
      
      bug report:
      This fixes the following static checker warning.
              drivers/gpu/drm/amd/amdgpu/../powerplay/smu_v11_0.c:390 smu_v11_0_setup_pptable()
              warn: passing casted pointer '&size' to 'smu_get_atom_data_table()' 32 vs 16.
      Signed-off-by: NKevin Wang <kevin1.wang@amd.com>
      Reported-by: NDan Carpenter <dan.carpenter@oracle.com>
      Reviewed-by: NEvan Quan <evan.quan@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      00430144
    • A
      drm/amdgpu/gfx9: update pg_flags after determining if gfx off is possible · 98f58ada
      Alex Deucher 提交于
      We need to set certain power gating flags after we determine
      if the firmware version is sufficient to support gfxoff.
      Previously we set the pg flags in early init, but we later
      we might have disabled gfxoff if the firmware versions didn't
      support it.  Move adding the additional pg flags after we
      determine whether or not to support gfxoff.
      
      Fixes: 00544006 ("drm/amdgpu: enable gfxoff again on raven series (v2)")
      Tested-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Tested-by: NTom St Denis <tom.stdenis@amd.com>
      Signed-off-by: NAlex Deucher <alexander.deucher@amd.com>
      Cc: Kai-Heng Feng <kai.heng.feng@canonical.com>
      Cc: stable@vger.kernel.org
      98f58ada
  6. 21 8月, 2019 16 次提交