Skip to content
  1. Apr 08, 2020
    • Mario Kleiner's avatar
      drm/amd/display: Add link_rate quirk for Apple 15" MBP 2017 · f8abcff4
      Mario Kleiner authored
      [ Upstream commit dec9de2a ]
      
      This fixes a problem found on the MacBookPro 2017 Retina panel:
      
      The panel reports 10 bpc color depth in its EDID, and the
      firmware chooses link settings at boot which support enough
      bandwidth for 10 bpc (324000 kbit/sec aka LINK_RATE_RBR2
      aka 0xc), but the DP_MAX_LINK_RATE dpcd register only reports
      2.7 Gbps (multiplier value 0xa) as possible, in direct
      contradiction of what the firmware successfully set up.
      
      This restricts the panel to 8 bpc, not providing the full
      color depth of the panel on Linux <= 5.5. Additionally, commit
      '4a8ca46b
      
       ("drm/amd/display: Default max bpc to 16 for eDP")'
      introduced into Linux 5.6-rc1 will unclamp panel depth to
      its full 10 bpc, thereby requiring a eDP bandwidth for all
      modes that exceeds the bandwidth available and causes all modes
      to fail validation -> No modes for the laptop panel -> failure
      to set any mode -> Panel goes dark.
      
      This patch adds a quirk specific to the MBP 2017 15" Retina
      panel to override reported max link rate to the correct maximum
      of 0xc = LINK_RATE_RBR2 to fix the darkness and reduced display
      precision.
      
      Please apply for Linux 5.6+ to avoid regressing Apple MBP panel
      support.
      
      Signed-off-by: default avatarMario Kleiner <mario.kleiner.de@gmail.com>
      Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      f8abcff4
    • Masahiro Yamada's avatar
      kconfig: introduce m32-flag and m64-flag · 205b5f80
      Masahiro Yamada authored
      [ Upstream commit 8cc4fd73 ]
      
      When a compiler supports multiple architectures, some compiler features
      can be dependent on the target architecture.
      
      This is typical for Clang, which supports multiple LLVM backends.
      Even for GCC, we need to take care of biarch compiler cases.
      
      It is not a problem when we evaluate cc-option in Makefiles because
      cc-option is tested against the flag in question + $(KBUILD_CFLAGS).
      
      The cc-option in Kconfig, on the other hand, does not accumulate
      tested flags. Due to this simplification, it could potentially test
      cc-option against a different target.
      
      At first, Kconfig always evaluated cc-option against the host
      architecture.
      
      Since commit e8de12fb ("kbuild: Check for unknown options with
      cc-option usage in Kconfig and clang"), in case of cross-compiling
      with Clang, the target triple is correctly passed to Kconfig.
      
      The case with biarch GCC (and native build with Clang) is still not
      handled properly. We need to pass some flags to specify the target
      machine bit.
      
      Due to the design, all the macros in Kconfig are expanded in the
      parse stage, where we do not know the target bit size yet.
      
      For example, arch/x86/Kconfig allows a user to toggle CONFIG_64BIT.
      If a compiler flag -foo depends on the machine bit, it must be tested
      twice, one with -m32 and the other with -m64.
      
      However, -m32/-m64 are not always recognized. So, this commits adds
      m64-flag and m32-flag macros. They expand to -m32, -m64, respectively
      if supported. Or, they expand to an empty string if unsupported.
      
      The typical usage is like this:
      
        config FOO
                bool
                default $(cc-option,$(m64-flag) -foo) if 64BIT
                default $(cc-option,$(m32-flag) -foo)
      
      This is clumsy, but there is no elegant way to handle this in the
      current static macro expansion.
      
      There was discussion for static functions vs dynamic functions.
      The consensus was to go as far as possible with the static functions.
      (https://lkml.org/lkml/2018/3/2/22
      
      )
      
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: default avatarGeorge Spelvin <lkml@sdf.org>
      Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      205b5f80
    • Prabhath Sajeepa's avatar
      nvme-rdma: Avoid double freeing of async event data · 91358d0f
      Prabhath Sajeepa authored
      [ Upstream commit 9134ae2a
      
       ]
      
      The timeout of identify cmd, which is invoked as part of admin queue
      creation, can result in freeing of async event data both in
      nvme_rdma_timeout handler and error handling path of
      nvme_rdma_configure_admin queue thus causing NULL pointer reference.
      Call Trace:
       ? nvme_rdma_setup_ctrl+0x223/0x800 [nvme_rdma]
       nvme_rdma_create_ctrl+0x2ba/0x3f7 [nvme_rdma]
       nvmf_dev_write+0xa54/0xcc6 [nvme_fabrics]
       __vfs_write+0x1b/0x40
       vfs_write+0xb2/0x1b0
       ksys_write+0x61/0xd0
       __x64_sys_write+0x1a/0x20
       do_syscall_64+0x60/0x1e0
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Reviewed-by: default avatarRoland Dreier <roland@purestorage.com>
      Reviewed-by: default avatarMax Gurtovoy <maxg@mellanox.com>
      Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
      Signed-off-by: default avatarPrabhath Sajeepa <psajeepa@purestorage.com>
      Signed-off-by: default avatarKeith Busch <kbusch@kernel.org>
      Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
      91358d0f
  2. Apr 02, 2020
  3. Apr 01, 2020