Linux PCI subsystem development
 help / color / mirror / Atom feed
* [PATCH] PCI: fix Sapphire PCI rebar quirk
@ 2025-02-17 15:10 Alex Deucher
  2025-02-17 15:30 ` Christian König
  2025-02-20 14:08 ` Alex Deucher
  0 siblings, 2 replies; 9+ messages in thread
From: Alex Deucher @ 2025-02-17 15:10 UTC (permalink / raw)
  To: bhelgaas, linux-pci, amd-gfx
  Cc: Mario.Limonciello, Alex Deucher, Christian König, Nirmoy Das

There was a quirk added to add a workaround for a Sapphire
RX 5600 XT Pulse.  However, the quirk only checks the vendor
ids and not the subsystem ids.  The quirk really should
have checked the subsystem vendor and device ids as now
this quirk gets applied to all RX 5600 and it seems to
cause problems on some Dell laptops.  Add a subsystem vendor
id check to limit the quirk to Sapphire boards.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>
Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
---
 drivers/pci/pci.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 225a6cd2e9ca3..dec917636974e 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -3766,6 +3766,7 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
 
 	/* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
 	if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
+	    pdev->subsystem_vendor == 0x1da2 &&
 	    bar == 0 && cap == 0x700)
 		return 0x3f00;
 
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] PCI: fix Sapphire PCI rebar quirk
  2025-02-17 15:10 [PATCH] PCI: fix Sapphire PCI rebar quirk Alex Deucher
@ 2025-02-17 15:30 ` Christian König
  2025-02-17 15:45   ` Alex Deucher
  2025-02-20 14:08 ` Alex Deucher
  1 sibling, 1 reply; 9+ messages in thread
From: Christian König @ 2025-02-17 15:30 UTC (permalink / raw)
  To: Alex Deucher, bhelgaas, linux-pci, amd-gfx; +Cc: Mario.Limonciello, Nirmoy Das

Am 17.02.25 um 16:10 schrieb Alex Deucher:
> There was a quirk added to add a workaround for a Sapphire
> RX 5600 XT Pulse.  However, the quirk only checks the vendor
> ids and not the subsystem ids.  The quirk really should
> have checked the subsystem vendor and device ids as now
> this quirk gets applied to all RX 5600 and it seems to
> cause problems on some Dell laptops.  Add a subsystem vendor
> id check to limit the quirk to Sapphire boards.

That's not correct. The issue is present on all RX 5600 boards, not just the Sapphire ones.

The problems with the Dell laptops are most likely the general instability of the RX 5600 again which this quirk just make more obvious because of the performance improvement.

Do you have a specific bug report for the Dell laptops?

Regards,
Christian.

>
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
> Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
> ---
>  drivers/pci/pci.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 225a6cd2e9ca3..dec917636974e 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -3766,6 +3766,7 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
>  
>  	/* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
>  	if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
> +	    pdev->subsystem_vendor == 0x1da2 &&




>  	    bar == 0 && cap == 0x700)
>  		return 0x3f00;
>  


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] PCI: fix Sapphire PCI rebar quirk
  2025-02-17 15:30 ` Christian König
@ 2025-02-17 15:45   ` Alex Deucher
  2025-02-17 16:00     ` Alex Deucher
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Deucher @ 2025-02-17 15:45 UTC (permalink / raw)
  To: Christian König
  Cc: Alex Deucher, bhelgaas, linux-pci, amd-gfx, Mario.Limonciello,
	Nirmoy Das

On Mon, Feb 17, 2025 at 10:38 AM Christian König
<christian.koenig@amd.com> wrote:
>
> Am 17.02.25 um 16:10 schrieb Alex Deucher:
> > There was a quirk added to add a workaround for a Sapphire
> > RX 5600 XT Pulse.  However, the quirk only checks the vendor
> > ids and not the subsystem ids.  The quirk really should
> > have checked the subsystem vendor and device ids as now
> > this quirk gets applied to all RX 5600 and it seems to
> > cause problems on some Dell laptops.  Add a subsystem vendor
> > id check to limit the quirk to Sapphire boards.
>
> That's not correct. The issue is present on all RX 5600 boards, not just the Sapphire ones.

I suppose the alternative would be to disable resizing on the
problematic DELL systems only.

>
> The problems with the Dell laptops are most likely the general instability of the RX 5600 again which this quirk just make more obvious because of the performance improvement.
>
> Do you have a specific bug report for the Dell laptops?
>
> Regards,
> Christian.
>
> >
> > Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707

^^^ this bug report

Alex


> > Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
> > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > Cc: Christian König <christian.koenig@amd.com>
> > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
> > ---
> >  drivers/pci/pci.c | 1 +
> >  1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > index 225a6cd2e9ca3..dec917636974e 100644
> > --- a/drivers/pci/pci.c
> > +++ b/drivers/pci/pci.c
> > @@ -3766,6 +3766,7 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
> >
> >       /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
> >       if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
> > +         pdev->subsystem_vendor == 0x1da2 &&
>
>
>
>
> >           bar == 0 && cap == 0x700)
> >               return 0x3f00;
> >
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] PCI: fix Sapphire PCI rebar quirk
  2025-02-17 15:45   ` Alex Deucher
@ 2025-02-17 16:00     ` Alex Deucher
  2025-02-17 16:04       ` Mario Limonciello
  0 siblings, 1 reply; 9+ messages in thread
From: Alex Deucher @ 2025-02-17 16:00 UTC (permalink / raw)
  To: Christian König
  Cc: Alex Deucher, bhelgaas, linux-pci, amd-gfx, Mario.Limonciello,
	Nirmoy Das

[-- Attachment #1: Type: text/plain, Size: 2325 bytes --]

On Mon, Feb 17, 2025 at 10:45 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>
> On Mon, Feb 17, 2025 at 10:38 AM Christian König
> <christian.koenig@amd.com> wrote:
> >
> > Am 17.02.25 um 16:10 schrieb Alex Deucher:
> > > There was a quirk added to add a workaround for a Sapphire
> > > RX 5600 XT Pulse.  However, the quirk only checks the vendor
> > > ids and not the subsystem ids.  The quirk really should
> > > have checked the subsystem vendor and device ids as now
> > > this quirk gets applied to all RX 5600 and it seems to
> > > cause problems on some Dell laptops.  Add a subsystem vendor
> > > id check to limit the quirk to Sapphire boards.
> >
> > That's not correct. The issue is present on all RX 5600 boards, not just the Sapphire ones.
>
> I suppose the alternative would be to disable resizing on the
> problematic DELL systems only.

How about this attached patch instead?

Alex

>
> >
> > The problems with the Dell laptops are most likely the general instability of the RX 5600 again which this quirk just make more obvious because of the performance improvement.
> >
> > Do you have a specific bug report for the Dell laptops?
> >
> > Regards,
> > Christian.
> >
> > >
> > > Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
>
> ^^^ this bug report
>
> Alex
>
>
> > > Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
> > > Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> > > Cc: Christian König <christian.koenig@amd.com>
> > > Cc: Bjorn Helgaas <bhelgaas@google.com>
> > > Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
> > > ---
> > >  drivers/pci/pci.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > >
> > > diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> > > index 225a6cd2e9ca3..dec917636974e 100644
> > > --- a/drivers/pci/pci.c
> > > +++ b/drivers/pci/pci.c
> > > @@ -3766,6 +3766,7 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
> > >
> > >       /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
> > >       if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
> > > +         pdev->subsystem_vendor == 0x1da2 &&
> >
> >
> >
> >
> > >           bar == 0 && cap == 0x700)
> > >               return 0x3f00;
> > >
> >

[-- Attachment #2: 0001-drm-amdgpu-disable-BAR-resize-on-Dell-G5-SE.patch --]
[-- Type: text/x-patch, Size: 1630 bytes --]

From 3841dd904844860863c489796710d2d9fee05bcb Mon Sep 17 00:00:00 2001
From: Alex Deucher <alexander.deucher@amd.com>
Date: Mon, 17 Feb 2025 10:55:05 -0500
Subject: [PATCH] drm/amdgpu: disable BAR resize on Dell G5 SE

There was a quirk added to add a workaround for a Sapphire
RX 5600 XT Pulse that didn't allow BAR resizing.  However,
the quirk casused a regression on Dell laptops using those
chips, rather than narrowing the scope of the resizing
quirk, add a quirk to prevent amdgpu from resizing the BAR
on those Dell platforms.

Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
index 512e642477a7e..56fd874a22de8 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
@@ -1662,6 +1662,12 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
 	if (amdgpu_sriov_vf(adev))
 		return 0;
 
+	/* skip resizing on Dell G5 SE platforms */
+	if (adev->pdev->vendor == PCI_VENDOR_ID_ATI &&
+	    adev->pdev->device == 0x731f &&
+	    adev->pdev->subsystem_vendor == PCI_VENDOR_ID_DELL)
+		return 0;
+
 	/* PCI_EXT_CAP_ID_VNDR extended capability is located at 0x100 */
 	if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_VNDR))
 		DRM_WARN("System can't access extended configuration space, please check!!\n");
-- 
2.48.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] PCI: fix Sapphire PCI rebar quirk
  2025-02-17 16:00     ` Alex Deucher
@ 2025-02-17 16:04       ` Mario Limonciello
  2025-02-18  8:03         ` Christian König
  0 siblings, 1 reply; 9+ messages in thread
From: Mario Limonciello @ 2025-02-17 16:04 UTC (permalink / raw)
  To: Alex Deucher, Christian König
  Cc: Alex Deucher, bhelgaas, linux-pci, amd-gfx, Nirmoy Das

On 2/17/2025 10:00, Alex Deucher wrote:
> On Mon, Feb 17, 2025 at 10:45 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>>
>> On Mon, Feb 17, 2025 at 10:38 AM Christian König
>> <christian.koenig@amd.com> wrote:
>>>
>>> Am 17.02.25 um 16:10 schrieb Alex Deucher:
>>>> There was a quirk added to add a workaround for a Sapphire
>>>> RX 5600 XT Pulse.  However, the quirk only checks the vendor
>>>> ids and not the subsystem ids.  The quirk really should
>>>> have checked the subsystem vendor and device ids as now
>>>> this quirk gets applied to all RX 5600 and it seems to
>>>> cause problems on some Dell laptops.  Add a subsystem vendor
>>>> id check to limit the quirk to Sapphire boards.
>>>
>>> That's not correct. The issue is present on all RX 5600 boards, not just the Sapphire ones.
>>
>> I suppose the alternative would be to disable resizing on the
>> problematic DELL systems only.
> 
> How about this attached patch instead?

JFYI Typo in the commit message:

s,casused,caused,

> 
> Alex
> 
>>
>>>
>>> The problems with the Dell laptops are most likely the general instability of the RX 5600 again which this quirk just make more obvious because of the performance improvement.
>>>
>>> Do you have a specific bug report for the Dell laptops?
>>>
>>> Regards,
>>> Christian.
>>>
>>>>
>>>> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
>>
>> ^^^ this bug report
>>
>> Alex
>>
>>
>>>> Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>>> Cc: Christian König <christian.koenig@amd.com>
>>>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>>>> Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
>>>> ---
>>>>   drivers/pci/pci.c | 1 +
>>>>   1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>>>> index 225a6cd2e9ca3..dec917636974e 100644
>>>> --- a/drivers/pci/pci.c
>>>> +++ b/drivers/pci/pci.c
>>>> @@ -3766,6 +3766,7 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
>>>>
>>>>        /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
>>>>        if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
>>>> +         pdev->subsystem_vendor == 0x1da2 &&
>>>
>>>
>>>
>>>
>>>>            bar == 0 && cap == 0x700)
>>>>                return 0x3f00;
>>>>
>>>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] PCI: fix Sapphire PCI rebar quirk
  2025-02-17 16:04       ` Mario Limonciello
@ 2025-02-18  8:03         ` Christian König
  2025-02-18  9:58           ` Lazar, Lijo
  0 siblings, 1 reply; 9+ messages in thread
From: Christian König @ 2025-02-18  8:03 UTC (permalink / raw)
  To: Mario Limonciello, Alex Deucher, Christian König
  Cc: Alex Deucher, bhelgaas, linux-pci, amd-gfx, Nirmoy Das

Am 17.02.25 um 17:04 schrieb Mario Limonciello:
> On 2/17/2025 10:00, Alex Deucher wrote:
>> On Mon, Feb 17, 2025 at 10:45 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>>>
>>> On Mon, Feb 17, 2025 at 10:38 AM Christian König
>>> <christian.koenig@amd.com> wrote:
>>>>
>>>> Am 17.02.25 um 16:10 schrieb Alex Deucher:
>>>>> There was a quirk added to add a workaround for a Sapphire
>>>>> RX 5600 XT Pulse.  However, the quirk only checks the vendor
>>>>> ids and not the subsystem ids.  The quirk really should
>>>>> have checked the subsystem vendor and device ids as now
>>>>> this quirk gets applied to all RX 5600 and it seems to
>>>>> cause problems on some Dell laptops.  Add a subsystem vendor
>>>>> id check to limit the quirk to Sapphire boards.
>>>>
>>>> That's not correct. The issue is present on all RX 5600 boards, not just the Sapphire ones.
>>>
>>> I suppose the alternative would be to disable resizing on the
>>> problematic DELL systems only.
>>
>> How about this attached patch instead?
>
> JFYI Typo in the commit message:
>
> s,casused,caused,

With that fixed feel free to add my rb. It's just that the Dell systems are unstable even without the resizing.

The resizing just makes it more likely to hit the issue because ti massively improves performance on the RX 5600 boards.

Regards,
Christian.

>
>>
>> Alex
>>
>>>
>>>>
>>>> The problems with the Dell laptops are most likely the general instability of the RX 5600 again which this quirk just make more obvious because of the performance improvement.
>>>>
>>>> Do you have a specific bug report for the Dell laptops?
>>>>
>>>> Regards,
>>>> Christian.
>>>>
>>>>>
>>>>> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
>>>
>>> ^^^ this bug report
>>>
>>> Alex
>>>
>>>
>>>>> Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
>>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>>>>> Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
>>>>> ---
>>>>>   drivers/pci/pci.c | 1 +
>>>>>   1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>>>>> index 225a6cd2e9ca3..dec917636974e 100644
>>>>> --- a/drivers/pci/pci.c
>>>>> +++ b/drivers/pci/pci.c
>>>>> @@ -3766,6 +3766,7 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
>>>>>
>>>>>        /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
>>>>>        if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
>>>>> +         pdev->subsystem_vendor == 0x1da2 &&
>>>>
>>>>
>>>>
>>>>
>>>>>            bar == 0 && cap == 0x700)
>>>>>                return 0x3f00;
>>>>>
>>>>
>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] PCI: fix Sapphire PCI rebar quirk
  2025-02-18  8:03         ` Christian König
@ 2025-02-18  9:58           ` Lazar, Lijo
  2025-02-18 11:31             ` Christian König
  0 siblings, 1 reply; 9+ messages in thread
From: Lazar, Lijo @ 2025-02-18  9:58 UTC (permalink / raw)
  To: Christian König, Mario Limonciello, Alex Deucher,
	Christian König
  Cc: Alex Deucher, bhelgaas, linux-pci, amd-gfx, Nirmoy Das



On 2/18/2025 1:33 PM, Christian König wrote:
> Am 17.02.25 um 17:04 schrieb Mario Limonciello:
>> On 2/17/2025 10:00, Alex Deucher wrote:
>>> On Mon, Feb 17, 2025 at 10:45 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>>>>
>>>> On Mon, Feb 17, 2025 at 10:38 AM Christian König
>>>> <christian.koenig@amd.com> wrote:
>>>>>
>>>>> Am 17.02.25 um 16:10 schrieb Alex Deucher:
>>>>>> There was a quirk added to add a workaround for a Sapphire
>>>>>> RX 5600 XT Pulse.  However, the quirk only checks the vendor
>>>>>> ids and not the subsystem ids.  The quirk really should
>>>>>> have checked the subsystem vendor and device ids as now
>>>>>> this quirk gets applied to all RX 5600 and it seems to
>>>>>> cause problems on some Dell laptops.  Add a subsystem vendor
>>>>>> id check to limit the quirk to Sapphire boards.
>>>>>
>>>>> That's not correct. The issue is present on all RX 5600 boards, not just the Sapphire ones.
>>>>
>>>> I suppose the alternative would be to disable resizing on the
>>>> problematic DELL systems only.
>>>
>>> How about this attached patch instead?
>>
>> JFYI Typo in the commit message:
>>
>> s,casused,caused,
> 
> With that fixed feel free to add my rb. It's just that the Dell systems are unstable even without the resizing.
> 
> The resizing just makes it more likely to hit the issue because ti massively improves performance on the RX 5600 boards.
> 

As a workaround, from the thread, the most reliable one seems to be to
disable runpm on the device.

Thanks,
Lijo

> Regards,
> Christian.
> 
>>
>>>
>>> Alex
>>>
>>>>
>>>>>
>>>>> The problems with the Dell laptops are most likely the general instability of the RX 5600 again which this quirk just make more obvious because of the performance improvement.
>>>>>
>>>>> Do you have a specific bug report for the Dell laptops?
>>>>>
>>>>> Regards,
>>>>> Christian.
>>>>>
>>>>>>
>>>>>> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
>>>>
>>>> ^^^ this bug report
>>>>
>>>> Alex
>>>>
>>>>
>>>>>> Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
>>>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>>>>>> Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
>>>>>> ---
>>>>>>   drivers/pci/pci.c | 1 +
>>>>>>   1 file changed, 1 insertion(+)
>>>>>>
>>>>>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>>>>>> index 225a6cd2e9ca3..dec917636974e 100644
>>>>>> --- a/drivers/pci/pci.c
>>>>>> +++ b/drivers/pci/pci.c
>>>>>> @@ -3766,6 +3766,7 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
>>>>>>
>>>>>>        /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
>>>>>>        if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
>>>>>> +         pdev->subsystem_vendor == 0x1da2 &&
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>>            bar == 0 && cap == 0x700)
>>>>>>                return 0x3f00;
>>>>>>
>>>>>
>>
> 


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] PCI: fix Sapphire PCI rebar quirk
  2025-02-18  9:58           ` Lazar, Lijo
@ 2025-02-18 11:31             ` Christian König
  0 siblings, 0 replies; 9+ messages in thread
From: Christian König @ 2025-02-18 11:31 UTC (permalink / raw)
  To: Lazar, Lijo, Christian König, Mario Limonciello,
	Alex Deucher
  Cc: Alex Deucher, bhelgaas, linux-pci, amd-gfx, Nirmoy Das

Am 18.02.25 um 10:58 schrieb Lazar, Lijo:
> On 2/18/2025 1:33 PM, Christian König wrote:
>> Am 17.02.25 um 17:04 schrieb Mario Limonciello:
>>> On 2/17/2025 10:00, Alex Deucher wrote:
>>>> On Mon, Feb 17, 2025 at 10:45 AM Alex Deucher <alexdeucher@gmail.com> wrote:
>>>>> On Mon, Feb 17, 2025 at 10:38 AM Christian König
>>>>> <christian.koenig@amd.com> wrote:
>>>>>> Am 17.02.25 um 16:10 schrieb Alex Deucher:
>>>>>>> There was a quirk added to add a workaround for a Sapphire
>>>>>>> RX 5600 XT Pulse.  However, the quirk only checks the vendor
>>>>>>> ids and not the subsystem ids.  The quirk really should
>>>>>>> have checked the subsystem vendor and device ids as now
>>>>>>> this quirk gets applied to all RX 5600 and it seems to
>>>>>>> cause problems on some Dell laptops.  Add a subsystem vendor
>>>>>>> id check to limit the quirk to Sapphire boards.
>>>>>> That's not correct. The issue is present on all RX 5600 boards, not just the Sapphire ones.
>>>>> I suppose the alternative would be to disable resizing on the
>>>>> problematic DELL systems only.
>>>> How about this attached patch instead?
>>> JFYI Typo in the commit message:
>>>
>>> s,casused,caused,
>> With that fixed feel free to add my rb. It's just that the Dell systems are unstable even without the resizing.
>>
>> The resizing just makes it more likely to hit the issue because ti massively improves performance on the RX 5600 boards.
>>
> As a workaround, from the thread, the most reliable one seems to be to
> disable runpm on the device.

Yeah, really good point. Actually trying to fix the underlying issue is my strong preference as well.

Regards,
Christian.

>
> Thanks,
> Lijo
>
>> Regards,
>> Christian.
>>
>>>> Alex
>>>>
>>>>>> The problems with the Dell laptops are most likely the general instability of the RX 5600 again which this quirk just make more obvious because of the performance improvement.
>>>>>>
>>>>>> Do you have a specific bug report for the Dell laptops?
>>>>>>
>>>>>> Regards,
>>>>>> Christian.
>>>>>>
>>>>>>> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
>>>>> ^^^ this bug report
>>>>>
>>>>> Alex
>>>>>
>>>>>
>>>>>>> Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
>>>>>>> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
>>>>>>> Cc: Christian König <christian.koenig@amd.com>
>>>>>>> Cc: Bjorn Helgaas <bhelgaas@google.com>
>>>>>>> Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
>>>>>>> ---
>>>>>>>   drivers/pci/pci.c | 1 +
>>>>>>>   1 file changed, 1 insertion(+)
>>>>>>>
>>>>>>> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
>>>>>>> index 225a6cd2e9ca3..dec917636974e 100644
>>>>>>> --- a/drivers/pci/pci.c
>>>>>>> +++ b/drivers/pci/pci.c
>>>>>>> @@ -3766,6 +3766,7 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
>>>>>>>
>>>>>>>        /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
>>>>>>>        if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
>>>>>>> +         pdev->subsystem_vendor == 0x1da2 &&
>>>>>>
>>>>>>
>>>>>>
>>>>>>>            bar == 0 && cap == 0x700)
>>>>>>>                return 0x3f00;
>>>>>>>


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] PCI: fix Sapphire PCI rebar quirk
  2025-02-17 15:10 [PATCH] PCI: fix Sapphire PCI rebar quirk Alex Deucher
  2025-02-17 15:30 ` Christian König
@ 2025-02-20 14:08 ` Alex Deucher
  1 sibling, 0 replies; 9+ messages in thread
From: Alex Deucher @ 2025-02-20 14:08 UTC (permalink / raw)
  To: Alex Deucher
  Cc: bhelgaas, linux-pci, amd-gfx, Mario.Limonciello,
	Christian König, Nirmoy Das

Dropping this patch.  Will work around this in the driver.

Alex

On Mon, Feb 17, 2025 at 10:48 AM Alex Deucher <alexander.deucher@amd.com> wrote:
>
> There was a quirk added to add a workaround for a Sapphire
> RX 5600 XT Pulse.  However, the quirk only checks the vendor
> ids and not the subsystem ids.  The quirk really should
> have checked the subsystem vendor and device ids as now
> this quirk gets applied to all RX 5600 and it seems to
> cause problems on some Dell laptops.  Add a subsystem vendor
> id check to limit the quirk to Sapphire boards.
>
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1707
> Fixes: 907830b0fc9e ("PCI: Add a REBAR size quirk for Sapphire RX 5600 XT Pulse")
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
> Cc: Christian König <christian.koenig@amd.com>
> Cc: Bjorn Helgaas <bhelgaas@google.com>
> Cc: Nirmoy Das <nirmoy.aiemd@gmail.com>
> ---
>  drivers/pci/pci.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
> index 225a6cd2e9ca3..dec917636974e 100644
> --- a/drivers/pci/pci.c
> +++ b/drivers/pci/pci.c
> @@ -3766,6 +3766,7 @@ u32 pci_rebar_get_possible_sizes(struct pci_dev *pdev, int bar)
>
>         /* Sapphire RX 5600 XT Pulse has an invalid cap dword for BAR 0 */
>         if (pdev->vendor == PCI_VENDOR_ID_ATI && pdev->device == 0x731f &&
> +           pdev->subsystem_vendor == 0x1da2 &&
>             bar == 0 && cap == 0x700)
>                 return 0x3f00;
>
> --
> 2.48.1
>

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-02-20 14:08 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-02-17 15:10 [PATCH] PCI: fix Sapphire PCI rebar quirk Alex Deucher
2025-02-17 15:30 ` Christian König
2025-02-17 15:45   ` Alex Deucher
2025-02-17 16:00     ` Alex Deucher
2025-02-17 16:04       ` Mario Limonciello
2025-02-18  8:03         ` Christian König
2025-02-18  9:58           ` Lazar, Lijo
2025-02-18 11:31             ` Christian König
2025-02-20 14:08 ` Alex Deucher

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox