AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <ckoenig.leichtzumerken@gmail.com>
To: Alex Deucher <alexander.deucher@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Adjust logic in amdgpu_device_partner_bandwidth()
Date: Fri, 24 May 2024 10:04:45 +0200	[thread overview]
Message-ID: <53db4de8-4fb9-4061-a191-0f5a0451f84e@gmail.com> (raw)
In-Reply-To: <20240516150512.2260787-1-alexander.deucher@amd.com>

Am 16.05.24 um 17:05 schrieb Alex Deucher:
> Use current speed/width on devices which don't support
> dynamic PCIe switching.
>
> Closes: https://gitlab.freedesktop.org/drm/amd/-/issues/3289
> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

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

> ---
>   drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 19 ++++++++++++-------
>   1 file changed, 12 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> index e72e774d17e6a..f0011dac589d2 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
> @@ -5946,13 +5946,18 @@ static void amdgpu_device_partner_bandwidth(struct amdgpu_device *adev,
>   	*speed = PCI_SPEED_UNKNOWN;
>   	*width = PCIE_LNK_WIDTH_UNKNOWN;
>   
> -	while ((parent = pci_upstream_bridge(parent))) {
> -		/* skip upstream/downstream switches internal to dGPU*/
> -		if (parent->vendor == PCI_VENDOR_ID_ATI)
> -			continue;
> -		*speed = pcie_get_speed_cap(parent);
> -		*width = pcie_get_width_cap(parent);
> -		break;
> +	if (amdgpu_device_pcie_dynamic_switching_supported(adev)) {
> +		while ((parent = pci_upstream_bridge(parent))) {
> +			/* skip upstream/downstream switches internal to dGPU*/
> +			if (parent->vendor == PCI_VENDOR_ID_ATI)
> +				continue;
> +			*speed = pcie_get_speed_cap(parent);
> +			*width = pcie_get_width_cap(parent);
> +			break;
> +		}
> +	} else {
> +		/* use the current speeds rather than max if switching is not supported */
> +		pcie_bandwidth_available(adev->pdev, NULL, speed, width);
>   	}
>   }
>   


      parent reply	other threads:[~2024-05-24  8:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-16 15:05 [PATCH] drm/amdgpu: Adjust logic in amdgpu_device_partner_bandwidth() Alex Deucher
2024-05-23 18:44 ` Alex Deucher
2024-05-24  8:04 ` 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=53db4de8-4fb9-4061-a191-0f5a0451f84e@gmail.com \
    --to=ckoenig.leichtzumerken@gmail.com \
    --cc=alexander.deucher@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