AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: Ma Jun <Jun.Ma2@amd.com>,
	amd-gfx@lists.freedesktop.org, Alexander.Deucher@amd.com
Subject: Re: [PATCH v3] drm/amdgpu: Check extended configuration space register when system uses large bar
Date: Wed, 10 Jan 2024 11:20:29 +0100	[thread overview]
Message-ID: <2ca4c71c-04fd-45e7-86c3-5fd91a42a00f@amd.com> (raw)
In-Reply-To: <20240110101319.695169-1-Jun.Ma2@amd.com>

Am 10.01.24 um 11:13 schrieb Ma Jun:
> 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.
>
> 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.
>
> Therefor print a warnning message if the system can't access the
> extended configuration space register when using large bar.
>
> Signed-off-by: Ma Jun <Jun.Ma2@amd.com>

Reviewed-by: Christian König <christian.koenig@amd.com>

> ---
> v2:
> - Check the register at 0x100 but not resize bar register
> - Modify the commit message
> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index 4b694696930e..629de7f2908c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -1442,6 +1442,10 @@ int amdgpu_device_resize_fb_bar(struct amdgpu_device *adev)
>   	if (amdgpu_sriov_vf(adev))
>   		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");
> +
>   	/* 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))


      reply	other threads:[~2024-01-10 10:20 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-10 10:13 [PATCH v3] drm/amdgpu: Check extended configuration space register when system uses large bar Ma Jun
2024-01-10 10:20 ` Christian König [this message]

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=2ca4c71c-04fd-45e7-86c3-5fd91a42a00f@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Jun.Ma2@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    /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