All of lore.kernel.org
 help / color / mirror / Atom feed
From: Steven Price <steven.price@arm.com>
To: Boris Brezillon <boris.brezillon@collabora.com>,
	Rob Herring <robh+dt@kernel.org>,
	Tomeu Vizoso <tomeu@tomeuvizoso.net>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Robin Murphy <robin.murphy@arm.com>
Cc: dri-devel@lists.freedesktop.org, stable@vger.kernel.org
Subject: Re: [PATCH 1/3] drm/panfrost: Clear MMU irqs before handling the fault
Date: Mon, 1 Feb 2021 12:13:36 +0000	[thread overview]
Message-ID: <8cb47743-5d1b-f4bb-3914-022dd02c2b91@arm.com> (raw)
In-Reply-To: <20210201082116.267208-2-boris.brezillon@collabora.com>

On 01/02/2021 08:21, Boris Brezillon wrote:
> When a fault is handled it will unblock the GPU which will continue
> executing its shader and might fault almost immediately on a different
> page. If we clear interrupts after handling the fault we might miss new
> faults, so clear them before.
> 
> Cc: <stable@vger.kernel.org>
> Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Good catch (although this oddly rings a bell - so perhaps it was me you 
discussed it with before)

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>   drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> index 7c1b3481b785..904d63450862 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> @@ -593,6 +593,8 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data)
>   		access_type = (fault_status >> 8) & 0x3;
>   		source_id = (fault_status >> 16);
>   
> +		mmu_write(pfdev, MMU_INT_CLEAR, mask);
> +
>   		/* Page fault only */
>   		ret = -1;
>   		if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0)
> @@ -616,8 +618,6 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data)
>   				access_type, access_type_name(pfdev, fault_status),
>   				source_id);
>   
> -		mmu_write(pfdev, MMU_INT_CLEAR, mask);
> -
>   		status &= ~mask;
>   	}
>   
> 


WARNING: multiple messages have this Message-ID (diff)
From: Steven Price <steven.price@arm.com>
To: Boris Brezillon <boris.brezillon@collabora.com>,
	Rob Herring <robh+dt@kernel.org>,
	Tomeu Vizoso <tomeu@tomeuvizoso.net>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Robin Murphy <robin.murphy@arm.com>
Cc: stable@vger.kernel.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 1/3] drm/panfrost: Clear MMU irqs before handling the fault
Date: Mon, 1 Feb 2021 12:13:36 +0000	[thread overview]
Message-ID: <8cb47743-5d1b-f4bb-3914-022dd02c2b91@arm.com> (raw)
In-Reply-To: <20210201082116.267208-2-boris.brezillon@collabora.com>

On 01/02/2021 08:21, Boris Brezillon wrote:
> When a fault is handled it will unblock the GPU which will continue
> executing its shader and might fault almost immediately on a different
> page. If we clear interrupts after handling the fault we might miss new
> faults, so clear them before.
> 
> Cc: <stable@vger.kernel.org>
> Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations")
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>

Good catch (although this oddly rings a bell - so perhaps it was me you 
discussed it with before)

Reviewed-by: Steven Price <steven.price@arm.com>

> ---
>   drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> index 7c1b3481b785..904d63450862 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> @@ -593,6 +593,8 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data)
>   		access_type = (fault_status >> 8) & 0x3;
>   		source_id = (fault_status >> 16);
>   
> +		mmu_write(pfdev, MMU_INT_CLEAR, mask);
> +
>   		/* Page fault only */
>   		ret = -1;
>   		if ((status & mask) == BIT(i) && (exception_type & 0xF8) == 0xC0)
> @@ -616,8 +618,6 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data)
>   				access_type, access_type_name(pfdev, fault_status),
>   				source_id);
>   
> -		mmu_write(pfdev, MMU_INT_CLEAR, mask);
> -
>   		status &= ~mask;
>   	}
>   
> 

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-02-01 12:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-01  8:21 [PATCH 0/3] drm/panfrost: MMU fixes Boris Brezillon
2021-02-01  8:21 ` [PATCH 1/3] drm/panfrost: Clear MMU irqs before handling the fault Boris Brezillon
2021-02-01  8:21   ` Boris Brezillon
2021-02-01 12:13   ` Steven Price [this message]
2021-02-01 12:13     ` Steven Price
2021-02-01  8:21 ` [PATCH 2/3] drm/panfrost: Don't try to map pages that are already mapped Boris Brezillon
2021-02-01  8:21   ` Boris Brezillon
2021-02-01 12:13   ` Steven Price
2021-02-01 12:13     ` Steven Price
2021-02-01  8:21 ` [PATCH 3/3] drm/panfrost: Stay in the threaded MMU IRQ handler until we've handled all IRQs Boris Brezillon
2021-02-01 12:13   ` Steven Price
2021-02-01 12:59     ` Boris Brezillon
2021-02-01 13:24       ` Steven Price
2021-02-01 13:47         ` Boris Brezillon
2021-02-03 14:45   ` Rob Herring
2021-02-03 15:43     ` Steven Price

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=8cb47743-5d1b-f4bb-3914-022dd02c2b91@arm.com \
    --to=steven.price@arm.com \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robh+dt@kernel.org \
    --cc=robin.murphy@arm.com \
    --cc=stable@vger.kernel.org \
    --cc=tomeu@tomeuvizoso.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.