All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: "Timur Kristóf" <timur.kristof@gmail.com>,
	amd-gfx@lists.freedesktop.org, Alexander.Deucher@amd.com,
	"Natalie Vock" <natalie.vock@gmx.de>,
	"Amir Shetaia" <Amir.Shetaia@amd.com>,
	"Marek Olšák" <maraeo@gmail.com>,
	"Mario Limonciello" <mario.limonciello@amd.com>,
	"Tvrtko Ursulin" <tursulin@ursulin.net>,
	"Felix Kuehling" <Felix.Kuehling@amd.com>,
	"Lijo Lazar" <lijo.lazar@amd.com>, "Siwei He" <siwei.he@amd.com>,
	"Philip Yang" <philip.yang@amd.com>,
	"Mukul Joshi" <mukul.joshi@amd.com>
Subject: Re: [PATCH 04/14] drm/amdgpu/ih: Add retry_cam_ack IH function pointer
Date: Thu, 2 Jul 2026 10:12:25 +0200	[thread overview]
Message-ID: <030a0e49-e2b5-4659-9252-02ce57b1a660@amd.com> (raw)
In-Reply-To: <20260701161721.85681-5-timur.kristof@gmail.com>

On 7/1/26 18:17, Timur Kristóf wrote:
> No functional changes.
> 
> This is a refactor to allow different filter CAM implementation
> in subsequent commits. The actual new implementations are
> going to be in subsequent commits.
> 
> Instead of writing the doorbell in amdgpu_gmc_handle_retry_fault()
> directly, add an IH function pointer which can be defined in
> a different way for different IH versions.
> 
> Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>

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

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c | 7 ++++++-
>  drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h  | 1 +
>  drivers/gpu/drm/amd/amdgpu/ih_v7_0.c    | 6 ++++++
>  drivers/gpu/drm/amd/amdgpu/vega20_ih.c  | 8 +++++++-
>  4 files changed, 20 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> index 3f0b1b7a557b..bb278a61dc9e 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c
> @@ -552,6 +552,11 @@ int amdgpu_gmc_handle_retry_fault(struct amdgpu_device *adev,
>  	int ret;
>  
>  	if (adev->irq.retry_cam_enabled) {
> +		if (!adev->irq.ih_funcs->retry_cam_ack) {
> +			dev_warn(adev->dev, "retry CAM is enabled, but retry_cam_ack is NULL\n");
> +			return -EOPNOTSUPP;
> +		}
> +
>  		/* Delegate it to a different ring if the hardware hasn't
>  		 * already done it.
>  		 */
> @@ -562,7 +567,7 @@ int amdgpu_gmc_handle_retry_fault(struct amdgpu_device *adev,
>  
>  		ret = amdgpu_vm_handle_fault(adev, entry->pasid, entry->vmid, node_id,
>  					     addr, entry->timestamp, write_fault);
> -		WDOORBELL32(adev->irq.retry_cam_doorbell_index, cam_index);
> +		adev->irq.ih_funcs->retry_cam_ack(adev, cam_index);
>  		if (ret)
>  			return 1;
>  	} else {
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h
> index 444437c30088..e6e34f6e86f4 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ih.h
> @@ -97,6 +97,7 @@ struct amdgpu_ih_funcs {
>  	const char *(*node_id_to_die_name)(struct amdgpu_device *adev,
>  					   unsigned int node_id,
>  					   char *buf, size_t size);
> +	void (*retry_cam_ack)(struct amdgpu_device *adev, u32 cam_index);
>  };
>  
>  #define amdgpu_ih_get_wptr(adev, ih) (adev)->irq.ih_funcs->get_wptr((adev), (ih))
> diff --git a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
> index bd332e8cc5bf..24be9d726428 100644
> --- a/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/ih_v7_0.c
> @@ -289,6 +289,11 @@ static uint32_t ih_v7_0_setup_retry_doorbell(u32 doorbell_index)
>  	return val;
>  }
>  
> +static void ih_v7_0_retry_cam_ack(struct amdgpu_device *adev, u32 cam_index)
> +{
> +	WDOORBELL32(adev->irq.retry_cam_doorbell_index, cam_index);
> +}
> +
>  #define regIH_RING1_CLIENT_CFG_INDEX_V7_1             0x122
>  #define regIH_RING1_CLIENT_CFG_INDEX_V7_1_BASE_IDX    0
>  #define regIH_RING1_CLIENT_CFG_DATA_V7_1              0x123
> @@ -865,6 +870,7 @@ static const struct amdgpu_ih_funcs ih_v7_0_funcs = {
>  	.decode_iv_ts = amdgpu_ih_decode_iv_ts_helper,
>  	.set_rptr = ih_v7_0_set_rptr,
>  	.node_id_to_die_name = ih_v7_0_node_id_to_die_name,
> +	.retry_cam_ack = ih_v7_0_retry_cam_ack,
>  };
>  
>  static void ih_v7_0_set_interrupt_funcs(struct amdgpu_device *adev)
> diff --git a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
> index 85846fd08ce4..30a82fff3ff7 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vega20_ih.c
> @@ -293,6 +293,11 @@ static uint32_t vega20_setup_retry_doorbell(u32 doorbell_index)
>  	return val;
>  }
>  
> +static void vega20_retry_cam_ack(struct amdgpu_device *adev, u32 cam_index)
> +{
> +	WDOORBELL32(adev->irq.retry_cam_doorbell_index, cam_index);
> +}
> +
>  /**
>   * vega20_ih_irq_init - init and enable the interrupt ring
>   *
> @@ -738,7 +743,8 @@ static const struct amdgpu_ih_funcs vega20_ih_funcs = {
>  	.get_wptr = vega20_ih_get_wptr,
>  	.decode_iv = amdgpu_ih_decode_iv_helper,
>  	.decode_iv_ts = amdgpu_ih_decode_iv_ts_helper,
> -	.set_rptr = vega20_ih_set_rptr
> +	.set_rptr = vega20_ih_set_rptr,
> +	.retry_cam_ack = vega20_retry_cam_ack,
>  };
>  
>  static void vega20_ih_set_interrupt_funcs(struct amdgpu_device *adev)


  reply	other threads:[~2026-07-02  8:12 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-01 16:17 [PATCH 00/14] drm/amdgpu: Improve retry fault handling (v3) Timur Kristóf
2026-07-01 16:17 ` [PATCH 01/14] drm/amdgpu: Respect noretry flag for retry faults on GFX12.1 Timur Kristóf
2026-07-02  7:58   ` Christian König
2026-07-01 16:17 ` [PATCH 02/14] drm/amdgpu/gfxhub: Enable retry fault interrupts when needed Timur Kristóf
2026-07-02  8:10   ` Christian König
2026-07-02  9:14     ` Timur Kristóf
2026-07-02 12:02       ` Christian König
2026-07-01 16:17 ` [PATCH 03/14] drm/amdgpu/ih: Don't perturb HW registers when accessing soft IH ring Timur Kristóf
2026-07-02  8:10   ` Christian König
2026-07-01 16:17 ` [PATCH 04/14] drm/amdgpu/ih: Add retry_cam_ack IH function pointer Timur Kristóf
2026-07-02  8:12   ` Christian König [this message]
2026-07-01 16:17 ` [PATCH 05/14] drm/amdgpu/ih6.1: Use IH_SW_RING_SIZE for soft IH ring instead of PAGE_SIZE Timur Kristóf
2026-07-02  8:13   ` Christian König
2026-07-01 16:17 ` [PATCH 06/14] drm/amdgpu/ih7.0: " Timur Kristóf
2026-07-02 10:15   ` Christian König
2026-07-01 16:17 ` [PATCH 07/14] drm/amdgpu/gmc11: Pass cam_index to retry fault handler Timur Kristóf
2026-07-02 10:17   ` Christian König
2026-07-01 16:17 ` [PATCH 08/14] drm/amdgpu/gmc12: " Timur Kristóf
2026-07-02 10:18   ` Christian König
2026-07-01 16:17 ` [PATCH 09/14] drm/amdgpu/gmc12: Use AMDGPU_PTE_IS_PTE flag for init_pte_flags on GFX12.0 Timur Kristóf
2026-07-02 10:19   ` Christian König
2026-07-01 16:17 ` [PATCH 10/14] drm/amdgpu/vm: Use init PTE flags and NOALLOC in amdgpu_vm_handle_fault() Timur Kristóf
2026-07-02 10:22   ` Christian König
2026-07-02 11:28     ` Timur Kristóf
2026-07-02 12:18       ` Christian König
2026-07-02 12:58         ` Timur Kristóf
2026-07-01 16:17 ` [PATCH 11/14] drm/amdgpu/ih6.0: Use MMIO ACK for retry CAM on IH 6.0 Timur Kristóf
2026-07-02 10:23   ` Christian König
2026-07-02 11:52     ` Timur Kristóf
2026-07-03 18:11     ` Joshi, Mukul
2026-07-03 18:50       ` Timur Kristóf
2026-07-03 18:45     ` Kuehling, Felix
2026-07-03 17:46   ` Joshi, Mukul
2026-07-03 18:46     ` Timur Kristóf
2026-07-06 15:28       ` Alex Deucher
2026-07-06 18:04       ` Joshi, Mukul
2026-07-06 21:27         ` Mukul Joshi
2026-07-01 16:17 ` [PATCH 12/14] drm/amdgpu/ih7.0: Use MMIO ACK instead of doorbell for retry CAM on IH 7.0 Timur Kristóf
2026-07-02 10:24   ` Christian König
2026-07-03 16:31   ` Joshi, Mukul
2026-07-03 18:41     ` Timur Kristóf
2026-07-06 17:48       ` Joshi, Mukul
2026-07-06 19:03         ` Mukul Joshi
2026-07-01 16:17 ` [PATCH 13/14] drm/amdgpu/ih6.0: Enable retry CAM on Navi 3 dGPUs Timur Kristóf
2026-07-02 10:35   ` Christian König
2026-07-01 16:17 ` [PATCH 14/14] drm/amdgpu/ih7.0: Enable retry CAM on Navi 4 dGPUs Timur Kristóf
2026-07-02 10:38   ` Christian König
2026-07-02 11:53     ` Timur Kristóf
2026-07-02 12:30       ` Christian König
2026-07-02 12:47         ` Timur Kristóf
2026-07-02 13:26         ` Alex Deucher

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=030a0e49-e2b5-4659-9252-02ce57b1a660@amd.com \
    --to=christian.koenig@amd.com \
    --cc=Alexander.Deucher@amd.com \
    --cc=Amir.Shetaia@amd.com \
    --cc=Felix.Kuehling@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=lijo.lazar@amd.com \
    --cc=maraeo@gmail.com \
    --cc=mario.limonciello@amd.com \
    --cc=mukul.joshi@amd.com \
    --cc=natalie.vock@gmx.de \
    --cc=philip.yang@amd.com \
    --cc=siwei.he@amd.com \
    --cc=timur.kristof@gmail.com \
    --cc=tursulin@ursulin.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.