From: "Ma, Jun" <majun@amd.com>
To: "Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Ma Jun" <Jun.Ma2@amd.com>,
amd-gfx@lists.freedesktop.org
Cc: Alexander.Deucher@amd.com, mario.limonciello@amd.com
Subject: Re: [PATCH] drm/amdgpu: Check resize bar register when system uses large bar
Date: Thu, 21 Dec 2023 09:58:38 +0800 [thread overview]
Message-ID: <8fd5d4dc-e781-475e-b90f-b43001ab224b@amd.com> (raw)
In-Reply-To: <5c64d777-510d-4440-b1b6-aaccd7bb71a0@gmail.com>
Hi Christian,
On 12/20/2023 10:10 PM, Christian König wrote:
> Am 19.12.23 um 06:58 schrieb Ma Jun:
>> Print a warnning message if the system can't access
>> the resize bar register when using large bar.
>
> Well pretty clear NAK, we have embedded use cases where this would
> trigger an incorrect warning.
>
> What should that be good for in the first place?
>
Some customer platforms do not enable mmconfig for various reasons, such as
bios bug, and therefore cannot access the GPU extend configuration
space through mmio.
Therefore, when the system enters the d3cold state and resumes,
the amdgpu driver fails to resume because the extend configuration
space registers of GPU can't be restored. At this point, Usually we
only see some failure dmesg log printed by amdgpu driver, it is
difficult to find the root cause.
So I thought it would be helpful to print some warning messages at
the beginning to identify problems quickly.
Regards,
Ma Jun
> Regards,
> Christian.
>
>>
>> Signed-off-by: Ma Jun <Jun.Ma2@amd.com>
>> ---
>> drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 10 +++++++++-
>> 1 file changed, 9 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> index 4b694696930e..e7aedb4bd66e 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
>> @@ -1417,6 +1417,12 @@ void amdgpu_device_wb_free(struct amdgpu_device *adev, u32 wb)
>> __clear_bit(wb, adev->wb.used);
>> }
>>
>> +static inline void amdgpu_find_rb_register(struct amdgpu_device *adev)
>> +{
>> + if (!pci_find_ext_capability(adev->pdev, PCI_EXT_CAP_ID_REBAR))
>> + DRM_WARN("System can't access the resize bar register,please check!!\n");
>> +}
>> +
>> /**
>> * amdgpu_device_resize_fb_bar - try to resize FB BAR
>> *
>> @@ -1444,8 +1450,10 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
>>
>> /* skip if the bios has already enabled large BAR */
>> if (adev->gmc.real_vram_size &&
>> - (pci_resource_len(adev->pdev, 0) >= adev->gmc.real_vram_size))
>> + (pci_resource_len(adev->pdev, 0) >= adev->gmc.real_vram_size)) {
>> + amdgpu_find_rb_register(adev);
>> return 0;
>> + }
>>
>> /* Check if the root BUS has 64bit memory resources */
>> root = adev->pdev->bus;
>
next prev parent reply other threads:[~2023-12-21 1:58 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-19 5:58 [PATCH] drm/amdgpu: Check resize bar register when system uses large bar Ma Jun
2023-12-20 14:10 ` Christian König
2023-12-21 1:58 ` Ma, Jun [this message]
2023-12-30 2:22 ` Mario Limonciello
2024-01-05 13:39 ` Christian König
2024-01-05 16:11 ` Alex Deucher
2024-01-08 9:25 ` Ma, Jun
2024-01-08 9:24 ` Ma, Jun
2024-01-08 16:24 ` Christian König
2024-01-09 9:44 ` Ma, Jun
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8fd5d4dc-e781-475e-b90f-b43001ab224b@amd.com \
--to=majun@amd.com \
--cc=Alexander.Deucher@amd.com \
--cc=Jun.Ma2@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=mario.limonciello@amd.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox