Patch "drm/nouveau: don't detect DSM for non-NVIDIA device" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    drm/nouveau: don't detect DSM for non-NVIDIA device

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     drm-nouveau-don-t-detect-dsm-for-non-nvidia-device.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 0420c6c1681073ef59a748dcfcb834d7a0104a15
Author: Ratchanan Srirattanamet <peathot@xxxxxxxxxxx>
Date:   Wed May 24 04:11:56 2023 +0700

    drm/nouveau: don't detect DSM for non-NVIDIA device
    
    [ Upstream commit 11d24327c2d7ad7f24fcc44fb00e1fa91ebf6525 ]
    
    The call site of nouveau_dsm_pci_probe() uses single set of output
    variables for all invocations. So, we must not write anything to them
    unless it's an NVIDIA device. Otherwise, if we are called with another
    device after the NVIDIA device, we'll clober the result of the NVIDIA
    device.
    
    For example, if the other device doesn't have _PR3 resources, the
    detection later would miss the presence of power resource support, and
    the rest of the code will keep using Optimus DSM, breaking power
    management for that machine.
    
    Also, because we're detecting NVIDIA's DSM, it doesn't make sense to run
    this detection on a non-NVIDIA device anyway. Thus, check at the
    beginning of the detection code if this is an NVIDIA card, and just
    return if it isn't.
    
    This, together with commit d22915d22ded ("drm/nouveau/devinit/tu102-:
    wait for GFW_BOOT_PROGRESS == COMPLETED") developed independently and
    landed earlier, fixes runtime power management of the NVIDIA card in
    Lenovo Legion 5-15ARH05. Without this patch, the GPU resumption code
    will "timeout", sometimes hanging userspace.
    
    As a bonus, we'll also stop preventing _PR3 usage from the bridge for
    unrelated devices, which is always nice, I guess.
    
    Fixes: ccfc2d5cdb02 ("drm/nouveau: Use generic helper to check _PR3 presence")
    Signed-off-by: Ratchanan Srirattanamet <peathot@xxxxxxxxxxx>
    Closes: https://gitlab.freedesktop.org/drm/nouveau/-/issues/79
    Reviewed-by: Karol Herbst <kherbst@xxxxxxxxxx>
    Signed-off-by: Karol Herbst <kherbst@xxxxxxxxxx>
    Link: https://patchwork.freedesktop.org/patch/msgid/DM6PR19MB2780805D4BE1E3F9B3AC96D0BC409@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/gpu/drm/nouveau/nouveau_acpi.c b/drivers/gpu/drm/nouveau/nouveau_acpi.c
index 8cf096f841a90..a2ae8c21e4dce 100644
--- a/drivers/gpu/drm/nouveau/nouveau_acpi.c
+++ b/drivers/gpu/drm/nouveau/nouveau_acpi.c
@@ -220,6 +220,9 @@ static void nouveau_dsm_pci_probe(struct pci_dev *pdev, acpi_handle *dhandle_out
 	int optimus_funcs;
 	struct pci_dev *parent_pdev;
 
+	if (pdev->vendor != PCI_VENDOR_ID_NVIDIA)
+		return;
+
 	*has_pr3 = false;
 	parent_pdev = pci_upstream_bridge(pdev);
 	if (parent_pdev) {



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux