AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Lazar, Lijo" <lijo.lazar@amd.com>
To: Felix Kuehling <Felix.Kuehling@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/1] drm/amdkfd: make needs_pcie_atomics FW-version dependent
Date: Wed, 1 Sep 2021 16:34:42 +0530	[thread overview]
Message-ID: <239a99fd-835f-cbbc-152f-afae6861bf60@amd.com> (raw)
In-Reply-To: <20210831215632.195506-1-Felix.Kuehling@amd.com>



On 9/1/2021 3:26 AM, Felix Kuehling wrote:
> On some GPUs the PCIe atomic requirement for KFD depends on the MEC
> firmware version. Add a firmware version check for this. The minimum
> firmware version that works without atomics can be updated in the
> device_info structure for each GPU type.
> 
> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
> ---
>   drivers/gpu/drm/amd/amdkfd/kfd_device.c | 9 +++++++--
>   drivers/gpu/drm/amd/amdkfd/kfd_priv.h   | 1 +
>   2 files changed, 8 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device.c b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> index 16a57b70cc1a..655ee5733229 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_device.c
> @@ -688,6 +688,7 @@ struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd,
>   	struct kfd_dev *kfd;
>   	const struct kfd_device_info *device_info;
>   	const struct kfd2kgd_calls *f2g;
> +	uint32_t fw_version;
>   
>   	if (asic_type >= sizeof(kfd_supported_devices) / (sizeof(void *) * 2)
>   		|| asic_type >= sizeof(kfd2kgd_funcs) / sizeof(void *)) {
> @@ -713,8 +714,12 @@ struct kfd_dev *kgd2kfd_probe(struct kgd_dev *kgd,
>   	 * supported.
>   	 */
>   	kfd->pci_atomic_requested = amdgpu_amdkfd_have_atomics_support(kgd);

Should the check be grouped inside amdgpu_amdkfd_have_atomics_support?

This flag is used for setting some link properties. If there is HW 
support but comes with incompatible firmware, should the link be still 
marked as atomic?

Thanks,
Lijo

> -	if (device_info->needs_pci_atomics &&
> -	    !kfd->pci_atomic_requested) {
> +	fw_version = amdgpu_amdkfd_get_fw_version(kgd, KGD_ENGINE_MEC1);
> +	if (!kfd->pci_atomic_requested &&
> +	    device_info->needs_pci_atomics &&
> +	    (!device_info->no_atomic_fw_version ||
> +	      amdgpu_amdkfd_get_fw_version(kgd, KGD_ENGINE_MEC1) <
> +			device_info->no_atomic_fw_version)) {
>   		dev_info(kfd_device,
>   			 "skipped device %x:%x, PCI rejects atomics\n",
>   			 pdev->vendor, pdev->device);
> diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> index ab83b0de6b22..6d8f9bb2d905 100644
> --- a/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> +++ b/drivers/gpu/drm/amd/amdkfd/kfd_priv.h
> @@ -207,6 +207,7 @@ struct kfd_device_info {
>   	bool supports_cwsr;
>   	bool needs_iommu_device;
>   	bool needs_pci_atomics;
> +	uint32_t no_atomic_fw_version;
>   	unsigned int num_sdma_engines;
>   	unsigned int num_xgmi_sdma_engines;
>   	unsigned int num_sdma_queues_per_engine;
> 

  parent reply	other threads:[~2021-09-01 11:04 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-31 21:56 [PATCH 1/1] drm/amdkfd: make needs_pcie_atomics FW-version dependent Felix Kuehling
2021-08-31 22:09 ` Zeng, Oak
2021-08-31 22:22   ` Felix Kuehling
2021-09-01 11:04 ` Lazar, Lijo [this message]
2021-09-01 14:54   ` Felix Kuehling
2021-09-01 16:30     ` Lazar, Lijo
2021-09-01 16:37       ` Alex Deucher
2021-09-01 16:47       ` Felix Kuehling
2021-09-02  3:54         ` Lazar, Lijo

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=239a99fd-835f-cbbc-152f-afae6861bf60@amd.com \
    --to=lijo.lazar@amd.com \
    --cc=Felix.Kuehling@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