mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Maíra Canal" <mcanal@igalia.com>
To: Jose Maria Casanova Crespo <jmcasanova@igalia.com>,
	Melissa Wen <mwen@igalia.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@gmail.com>, Simona Vetter <simona@ffwll.ch>,
	Paul Kocialkowski <paul.kocialkowski@bootlin.com>,
	Emma Anholt <emma@anholt.net>
Cc: dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] drm/v3d: fix client obtained from axi_ids on V3D 4.1
Date: Thu, 10 Apr 2025 09:31:08 -0300	[thread overview]
Message-ID: <ee5cbc11-b909-4754-ab62-de9581d9785e@igalia.com> (raw)
In-Reply-To: <20250409155504.1093400-2-jmcasanova@igalia.com>

Hi Chema,

On 09/04/25 12:55, Jose Maria Casanova Crespo wrote:
> The client that causes an MMU error is expected to be reported.
> But in the case of MMU TFU errors, a non existing client

"In the case of MMU errors caused by the TFU unit, [...]"

> was being reported. This happened because  because the client

There are two "because" in the sentence. Could you add an example of the
a MMU error with a non-existing client in the commit message?

> calculation was taking into account more than the bits 0-7
> from the axi_id that were representing the client.
> 
> This patch masks the proper bits to do the calculation and
> limits the returned clients to the expected axi_id ranges that
> V3D 4.1 and 4.2 use.
> 
> Fixes: 38c2c7917adc ("drm/v3d: Fix and extend MMU error handling.")
> Signed-off-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
> ---
>   drivers/gpu/drm/v3d/v3d_irq.c | 33 +++++++++++++++++++++------------
>   1 file changed, 21 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/gpu/drm/v3d/v3d_irq.c b/drivers/gpu/drm/v3d/v3d_irq.c
> index 29f63f572d35..1810743ea7b8 100644
> --- a/drivers/gpu/drm/v3d/v3d_irq.c
> +++ b/drivers/gpu/drm/v3d/v3d_irq.c
> @@ -186,24 +186,33 @@ v3d_hub_irq(int irq, void *arg)
>   		u32 axi_id = V3D_READ(V3D_MMU_VIO_ID);
>   		u64 vio_addr = ((u64)V3D_READ(V3D_MMU_VIO_ADDR) <<
>   				(v3d->va_width - 32));
> -		static const char *const v3d41_axi_ids[] = {
> -			"L2T",
> -			"PTB",
> -			"PSE",
> -			"TLB",
> -			"CLE",
> -			"TFU",
> -			"MMU",
> -			"GMP",
> +		static const struct {
> +			u32 begin;
> +			u32 end;
> +			const char *client;
> +		} v3d41_axi_ids[] = {
> +			{0x00, 0x20, "L2T"},
> +			{0x20, 0x21, "PTB"},
> +			{0x40, 0x41, "PSE"},
> +			{0x60, 0x80, "TLB"},
> +			{0x80, 0x88, "CLE"},
> +			{0xA0, 0xA1, "TFU"},
> +			{0xC0, 0xE0, "MMU"},
> +			{0xE0, 0xE1, "GMP"},
>   		};
>   		const char *client = "?";
>   
>   		V3D_WRITE(V3D_MMU_CTL, V3D_READ(V3D_MMU_CTL));
>   
>   		if (v3d->ver >= V3D_GEN_41) {
> -			axi_id = axi_id >> 5;
> -			if (axi_id < ARRAY_SIZE(v3d41_axi_ids))
> -				client = v3d41_axi_ids[axi_id];
> +			axi_id = axi_id & 0xFF;
> +			for (size_t i = 0; i < ARRAY_SIZE(v3d41_axi_ids); i++) {
> +				if (axi_id >= v3d41_axi_ids[i].begin &&
> +				    axi_id < v3d41_axi_ids[i].end) {
> +					client = v3d41_axi_ids[i].client;
> +					break;
> +				}
> +			}
>   		}
>   
>   		dev_err(v3d->drm.dev, "MMU error from client %s (%d) at 0x%llx%s%s%s\n",

As we are declaring `begin` and `end` as hexadecimal numbers in the
code, could we display AXI ID as a hexadecimal as well? Just to ease
future debugging. You would need to change "(%d)".

Please, don't forget to mention this change in the commit message of v2.

Thanks for your patch!

Best Regards,
- Maíra


  parent reply	other threads:[~2025-04-10 12:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-09 15:55 Jose Maria Casanova Crespo
2025-04-09 15:55 ` [PATCH 2/2] drm/v3d: client ranges from axi_ids are different with V3D 7.1 Jose Maria Casanova Crespo
2025-04-10 12:40   ` Maíra Canal
2025-04-25 12:40     ` Chema Casanova
2025-04-10 12:31 ` Maíra Canal [this message]
2025-04-25 12:34   ` [PATCH 1/2] drm/v3d: fix client obtained from axi_ids on V3D 4.1 Chema Casanova

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=ee5cbc11-b909-4754-ab62-de9581d9785e@igalia.com \
    --to=mcanal@igalia.com \
    --cc=airlied@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=emma@anholt.net \
    --cc=jmcasanova@igalia.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=mwen@igalia.com \
    --cc=paul.kocialkowski@bootlin.com \
    --cc=simona@ffwll.ch \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®