- Sep 07, 2021
-
-
Nirmoy Das authored
debugfs APIs returns encoded error so use IS_ERR for checking return value. v2: return PTR_ERR(ent) References: drm/amd#1686 Signed-off-by:
Nirmoy Das <nirmoy.das@amd.com> Reviewed-by:
Christian König <christian.koenig@amd.com> Reviewed-By:
Shashank Sharma <shashank.sharma@amd.com>
-
chongjiapeng authored
drm/amd/display: make configure_lttpr_mode_transparent and configure_lttpr_mode_non_transparent static This symbols is not used outside of dc_link_dp.c, so marks it static. Fix the following sparse warning: drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1766:16: warning: symbol 'configure_lttpr_mode_non_transparent' was not declared. Should it be static? drivers/gpu/drm/amd/amdgpu/../display/dc/core/dc_link_dp.c:1755:16: warning: symbol 'configure_lttpr_mode_transparent' was not declared. Should it be static? Reported-by:
Abaci Robot <abaci@linux.alibaba.com> Signed-off-by:
chongjiapeng <jiapeng.chong@linux.alibaba.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
chongjiapeng authored
Fix the following coccicheck warning: ./drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c:643:35-36: WARNING comparing pointer to 0. Reported-by:
Abaci Robot <abaci@linux.alibaba.com> Signed-off-by:
chongjiapeng <jiapeng.chong@linux.alibaba.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
Colin Ian King authored
The variables hi_sidd and lo_sidd are being initialized with a values that are never read, they are being updated later on. The assignments are redundant and can be removed. Addresses-Coverity: ("Unused value") Signed-off-by:
Colin Ian King <colin.king@canonical.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
Simon Ser authored
In amdgpu_dm_atomic_check, dc_validate_global_state is called. On failure this logs a warning to the kernel journal. However warnings shouldn't be used for atomic test-only commit failures: user-space might be perfoming a lot of atomic test-only commits to find the best hardware configuration. Downgrade the log to a regular DRM atomic message. While at it, use the new device-aware logging infrastructure. This fixes error messages in the kernel when running gamescope [1]. [1]: https://github.com/Plagman/gamescope/issues/245 Reviewed-by:
Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by:
Simon Ser <contact@emersion.fr> Cc: Alex Deucher <alexander.deucher@amd.com> Cc: Harry Wentland <hwentlan@amd.com> Cc: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
Len Baker authored
As noted in the "Deprecated Interfaces, Language Features, Attributes, and Conventions" documentation [1], size calculations (especially multiplication) should not be performed in memory allocator (or similar) function arguments due to the risk of them overflowing. This could lead to values wrapping around and a smaller allocation being made than the caller was expecting. Using those allocations could lead to linear overflows of heap memory and other misbehaviors. So, refactor the code a bit to use the purpose specific kcalloc() function instead of the calculated size argument in the kzalloc() function. [1] https://www.kernel.org/doc/html/v5.14/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments Signed-off-by:
Len Baker <len.baker@gmx.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
Colin Ian King authored
There is a statement that is indented incorrectly. Clean it up. Reviewed-by:
Christian König <christian.koenig@amd.com> Signed-off-by:
Colin Ian King <colin.king@canonical.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
Colin Ian King authored
There are a couple of statements that are indented one character too deeply, clean these up. Reviewed-by:
Christian König <christian.koenig@amd.com> Signed-off-by:
Colin Ian King <colin.king@canonical.com> Signed-off-by:
Alex Deucher <alexander.deucher@amd.com>
-
Christian König authored
Just drop some dead code. Signed-off-by:
Christian König <christian.koenig@amd.com> Reviewed-by:
Nirmoy Das <nirmoy.das@amd.com>
-
Christian König authored
The memory backing old_mem is already freed at that point, move the check a bit more up. Signed-off-by:
Christian König <christian.koenig@amd.com> Fixes: bfa3357e ("drm/ttm: allocate resource object instead of embedding it v2") Bug: drm/amd#1699 Acked-by:
Nirmoy Das <nirmoy.das@amd.com>
-
- Sep 06, 2021
-
-
Candice Li authored
Creat common PSP TA load function and update PSP ta_mem_context with size information. Signed-off-by:
Candice Li <candice.li@amd.com> Reviewed-by:
John Clements <john.clements@amd.com>
-
Kenneth Feng authored
fix the issue of uploading powerplay table due to the dependancy of rlc. Signed-off-by:
Kenneth Feng <kenneth.feng@amd.com> Reviewed-by: Jack Gui < Jack.Gui@amd.com >
-
- Sep 03, 2021
-
-
xinhui pan authored
The ret value might be -EBUSY, caller will think lru lock is still locked but actually NOT. So return -ENOSPC instead. Otherwise we hit list corruption. ttm_bo_cleanup_refs might fail too if BO is not idle. If we return 0, caller(ttm_tt_populate -> ttm_global_swapout ->ttm_device_swapout) will be stuck as we actually did not free any BO memory. This usually happens when the fence is not signaled for a long time. Signed-off-by:
xinhui pan <xinhui.pan@amd.com> Reviewed-by:
Christian König <christian.koenig@amd.com>
-
- Sep 02, 2021
-
-
Mario Limonciello authored
It was reported that on "HP ENVY x360" that power LED does not come back, certain keys like brightness controls do not work, and the fan never spins up, even under load on 5.14 final. In analysis of the SSDT it's clear that the Microsoft UUID doesn't provide functional support, but rather the AMD UUID should be supporting this system. Because this is a gap in the expected logic, we checked back with internal team. The conclusion was that on Windows AMD uPEP *does* run even when Microsoft UUID present, but most OEM systems have adopted value of "0x3" for supported functions and hence nothing runs. Henceforth add support for running both Microsoft and AMD methods. This approach will also allow the same logic on Intel systems if desired at a future time as well by pulling the evaluation of `lps0_dsm_func_mask_microsoft` out of the `if` block for `acpi_s2idle_vendor_amd`. Link: https://gitlab.freedesktop.org/drm/amd/uploads/9fbcd7ec3a385cc6949c9bacf45dc41b/acpi-f.20.bin BugLink: drm/amd#1691 Reported-by:
Maxwell Beck <max@ryt.one> Signed-off-by:
Mario Limonciello <mario.limonciello@amd.com> [ rjw: Edits of the new comments ] Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-
Mario Limonciello authored
It was reported by a user with a Dell m15 R5 (5800H) that the keyboard backlight was turning on when entering suspend and turning off when exiting (the opposite of how it should be). The user bisected it back to commit 5dbf5099 ("ACPI: PM: s2idle: Add support for new Microsoft UUID"). Previous to that commit the LEDs didn't turn off at all. Confirming in the spec, these were reversed when introduced. Fix them to match the spec. BugLink: drm/amd#1230 (comment 1021836) Fixes: 5dbf5099 ("ACPI: PM: s2idle: Add support for new Microsoft UUID") Signed-off-by:
Mario Limonciello <mario.limonciello@amd.com> Signed-off-by:
Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-
In tb_switch_default_link_ports(), while linking of ports, only odd-numbered ports (1,3,5..) are considered and even-numbered ports are not considered. AMD host router has lane adapters at 2 and 3 and link ports at adapter 2 is not considered due to which lane bonding gets disabled. Hence added a fix such that all ports are considered during linking of ports. Signed-off-by:
Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by:
Sanjay R Mehta <sanju.mehta@amd.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: I21e659bb7dbf1a4f41b6f3e1d09045909aed5a12
-
Adapter 0 is the control adapter and as per USB4 spec in section 2.2.6.2 control Adapters do not have an adapter configuration space. For this reason skip reading adapter config space in tb_port_init() when the port number is 0. This actually simplifies the rest of the function as we don't need to check for the port->port == 0 anymore. While there drop the extra empty line at the end of the function. Signed-off-by:
Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by:
Sanjay R Mehta <sanju.mehta@amd.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: I0afa189e56cb20a03119442f48ba753e9ca810d8
-
As per USB4 specification by default "Disable ISR Auto-Clear" bit is set to zero and the Tx/Rx ring interrupt status needs to be cleared. Hence handle it by reading the interrupt status register (ISR) in the MSI-X handler. Signed-off-by:
Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by:
Sanjay R Mehta <sanju.mehta@amd.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: I71cf801e3a540d8730932ca8b2c4298cc5a62503
-
Introduce nhi_check_quirks() routine to handle any vendor specific quirks to manage a hardware specific implementation. On Intel hardware the USB4 controller supports clearing the interrupt status register automatically right after it is being issued. For this reason add a new quirk that does that on all Intel hardware. Signed-off-by:
Basavaraj Natikar <Basavaraj.Natikar@amd.com> Signed-off-by:
Sanjay R Mehta <sanju.mehta@amd.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: I50f5eb4d4cb5e94643c7b2b6afeeb23b9dd34325
-
This reverts commit 6f3badea. It turns out bolt depends on having authorized attribute visible under each device. Hiding it makes bolt crash as several people have reported on various bug trackers. For this reason revert the commit. Link: bolt/bolt#174 Link: https://bugzilla.redhat.com/show_bug.cgi?id=1979765 Link: https://bugs.archlinux.org/task/71569 Cc: stable@vger.kernel.org Cc: Christian Kellner <ckellner@redhat.com> Fixes: 6f3badea ("thunderbolt: Hide authorized attribute if router does not support PCIe tunnels") Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Link: https://lore.kernel.org/r/20210727142501.27476-1-mika.westerberg@linux.intel.com Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I8716ffcefe3c2691ea7fb3a6e359381d05004efb
-
Partially revert "thunderbolt: test: Remove some casts which are no longer required". It turns out that typeof() doesn't support bitfields, so these still need to be cast to the appropriate enum. The only mention of typeof() and bitfields I can find is in the proposal to standardise them: http://www.open-std.org/jtc1/sc22/wg14/www/docs/n2619.htm This was caught by the kernel test robot: https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org/thread/FDKBHAV7QNLNFU5NBI2RKV56DWDSOLGM/ Fixes: 8f0877c2 ("thunderbolt: test: Remove some casts which are no longer required") Reported-by:
kernel test robot <lkp@intel.com> Signed-off-by:
David Gow <davidgow@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org> Change-Id: Idc252f2388d23cc7cccabc4fe0f63d5687644ba8
-
With some of the stricter type checking in KUnit's EXPECT macros removed, several casts in the thunderbolt KUnit tests are no longer required. Remove the unnecessary casts, making the conditions clearer. Signed-off-by:
David Gow <davidgow@google.com> Acked-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Brendan Higgins <brendanhiggins@google.com> Signed-off-by:
Shuah Khan <skhan@linuxfoundation.org> Change-Id: Ibd8cdd0c7ee03240ca1cbbae47ca30bd5d9920fb
-
DROM for USB4 host/device has a shorter header than Thunderbolt DROM header. This patch addresses host/device with USB4 DROM (According to spec: Universal Serial Bus 4 (USB4) Device ROM Specification, Rev 1.0, Feb-2021). While there correct the data_len field to be 12 bits and rename __unknown1 to reserved following the spec. Signed-off-by:
Gil Fine <gil.fine@intel.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: I3f1f7df0a29a3792c6a65f4d555ebd069fcc8ee5
-
Alder Lake has the same integrated Thunderbolt/USB4 controller as Intel Tiger Lake. By default it is still using firmware based connection manager so we can use most of the Tiger Lake flows. Add the Alder Lake PCI IDs to the driver list of supported devices. Signed-off-by:
Azhar Shaikh <azhar.shaikh@intel.com> Reviewed-by:
Yehezkel Bernat <YehezkelShB@gmail.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: I2410d94f545268b4d13fb7dc0b1ad7d8c169e4a3
-
This include is not needed so drop it. Reported-by:
kernel test robot <lkp@intel.com> Reviewed-by:
Yehezkel Bernat <YehezkelShB@gmail.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: Ifc53878782f84ed9e9e8ee7098f7d8c830d8aa65
-
In Intel Tiger Lake and beyond it takes some time after the force power is set until the firmware connection manager is ready. So instead of reading it once we poll it for 10ms before giving up. Signed-off-by:
Gil Fine <gil.fine@intel.com> Reviewed-by:
Yehezkel Bernat <YehezkelShB@gmail.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: If03086abe75ab0ae7e22a72b44043ce1b335ba2d
-
We only need to set up the device links when software connection manager path is used. The firmware connection manager does not need them and if they are present they may even cause problems. Reviewed-by:
Yehezkel Bernat <YehezkelShB@gmail.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: If16d72b80b96b3c7ba9a81ae2103612d7f710290
-
We should not dereference ->dual_link_port if it is NULL and lane bonding is requested. For this reason move lane bonding configuration happen inside the block where ->dual_link_port != NULL. Fixes: 54509f50 ("thunderbolt: Add KUnit tests for path walking") Reported-by:
kernel test robot <lkp@intel.com> Reported-by:
Dan Carpenter <dan.carpenter@oracle.com> Reviewed-by:
Yehezkel Bernat <YehezkelShB@gmail.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: I59dc9fc947098bc6b993f97184cdab0460702419
-
If the NVM authentication fails immediately, like if the firmware detects that the image is not valid for some reason, better to read the status once and if set to non-zero fail the operation accordingly. Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I07d17164b5437c40910d0ed9654deedb4f778b1a
-
The same way we support these two operations for USB4 routers we can extend the retimer NVM operations to support retimers also. Signed-off-by:
Rajmohan Mani <rajmohan.mani@intel.com> Co-developed-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: Ied96e5becd9a1f627ce5a76576e1dce90c634553
-
It may be useful if the actual NVM authentication can be delayed to be run later, for instance when the user logs out. For this reason add a new NVM operation (AUHENTICATE_ONLY) that just triggers the authentication procedure over whatever was written to the NVM storage. This is not supported with Thunderbolt 1-3 devices, though. Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I7cf39448fb6e443e3bfbee77d4d6ee151496b47d
-
Currently these write ops are used for updating router firmware images only. Moving to tb.h helps the retimers also to use the same ops. Also add tb_ prefix to the enum while there. Signed-off-by:
Rajmohan Mani <rajmohan.mani@intel.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I5b69eaff3fe2a0e10eb4d29cd30b57ec8a94d9bb
-
With help from platform firmware (ACPI) it is possible to power on retimers even when there is no USB4 link (e.g nothing is connected to the USB4 ports). This allows us to bring the USB4 sideband up so that we can access retimers and upgrade their NVM firmware. If the platform has support for this, we expose two additional attributes under USB4 ports: offline and rescan. These can be used to bring the port offline, rescan for the retimers and put the port online again. The retimer NVM upgrade itself works the same way than with cable connected. Signed-off-by:
Rajmohan Mani <rajmohan.mani@intel.com> Co-developed-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: Ia88f656cc1924dd2bbab99631df0f001004b90e9
-
When accessing retimers when there is no cable connected we are going to need additional USB4 port operations. First the port needs to be put into offline mode, and then the sideband channel transactions must be enabled on the SBTX line. This adds support for these operations. Signed-off-by:
Rajmohan Mani <rajmohan.mani@intel.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: Id8cbdd11d72fb6b7d9290599e33c028fb430b8d2
-
Typically retimers can be accessed only when the USB4 link is up (e.g there is a cable connected). However, sometimes it is useful to be able to access retimers even if there is nothing connected to the USB4 port. For instance we may still want to be able to upgrade the retimer NVM firmware even if the user does not have any USB4 devices. This is something that USB4 spec leaves to implementers. In case of ACPI based systems, we can support this by providing a special _DSM method under each USB4 port. This _DSM can be used to turn on power to on-board retimers (and cycle it through different modes so that the sideband becomes usable). This patch adds support for this _DSM and makes the functionality available to the rest of the driver through tb_acpi_power_[on|off]_retimers(). Signed-off-by:
Rajmohan Mani <rajmohan.mani@intel.com> Co-developed-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I864edfca3a91e0f592fb285422143a67dd253f1a
-
Create devices for each USB4 port. This is needed when we add retimer access when there is no device connected but may be useful for other purposes too following what USB subsystem does. This exports a single attribute "link" that shows the type of the USB4 link (or "none" if there is no cable connected). Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I3752a80379c2d624ef81adb291685982c42fee7c
-
The upstream port can be connected to any previous generation Thunderbolt port so logging as "TBT" is more accurate than "TBT3. No functional changes. Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Reviewed-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Change-Id: I23abbf6ed43d2e379fd853352729f8c55969aafb
-
This adds a couple of KUnit tests for USB4 credit allocation. Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: I2efc38d4deef8987198dceac30733a7e2fc31c4d
-
Intel Goshen Ridge reports wrong DP main credits in NVM 27 and earlier, so add a quirk that fixes it. We also need to expand the quirk table to match on hardware vendor/device IDs too. Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: If2524296de145bcbb66555a299dedf4db54073ca
-
The USB4 Connection Manager guide provides detailed information how the USB4 router buffer (credit) allocation information should be used by the connection manager when it allocates buffers for different paths. This patch implements it for Linux. For USB 3.x and DisplayPort we use directly the router preferences. The rest of the buffer space is then used for PCIe and DMA (peer-to-peer, XDomain) traffic. DMA tunnels require at least one buffer and PCIe six, so if there is not enough buffers we fail the tunnel creation. For the legacy Thunderbolt 1-3 devices we use the existing hard-coded scheme except for DMA where we use the values suggested by the USB4 spec chapter 13. Co-developed-by:
Gil Fine <gil.fine@intel.com> Signed-off-by:
Gil Fine <gil.fine@intel.com> Signed-off-by:
Mika Westerberg <mika.westerberg@linux.intel.com> Change-Id: Ic940b2d13166c5903ba2c78e36d4d32aa4131a5b
-