All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rob Herring <robh+dt@kernel.org>
To: Boris Brezillon <boris.brezillon@collabora.com>
Cc: dri-devel <dri-devel@lists.freedesktop.org>,
	Robin Murphy <robin.murphy@arm.com>,
	Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>,
	Steven Price <steven.price@arm.com>
Subject: Re: [PATCH 3/3] drm/panfrost: Stay in the threaded MMU IRQ handler until we've handled all IRQs
Date: Wed, 3 Feb 2021 08:45:22 -0600	[thread overview]
Message-ID: <CAL_JsqLGfjbu1AmuqHtSCqFpkWFdZ7qPb4BWAr3d5eHzq55+0g@mail.gmail.com> (raw)
In-Reply-To: <20210201082116.267208-4-boris.brezillon@collabora.com>

On Mon, Feb 1, 2021 at 2:21 AM Boris Brezillon
<boris.brezillon@collabora.com> wrote:
>
> Doing a hw-irq -> threaded-irq round-trip is counter-productive, stay
> in the threaded irq handler as long as we can.
>
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
> ---
>  drivers/gpu/drm/panfrost/panfrost_mmu.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> index 21e552d1ac71..65bc20628c4e 100644
> --- a/drivers/gpu/drm/panfrost/panfrost_mmu.c
> +++ b/drivers/gpu/drm/panfrost/panfrost_mmu.c
> @@ -580,6 +580,8 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data)
>         u32 status = mmu_read(pfdev, MMU_INT_RAWSTAT);
>         int i, ret;
>
> +again:
> +
>         for (i = 0; status; i++) {
>                 u32 mask = BIT(i) | BIT(i + 16);
>                 u64 addr;
> @@ -628,6 +630,11 @@ static irqreturn_t panfrost_mmu_irq_handler_thread(int irq, void *data)
>                 status &= ~mask;
>         }
>
> +       /* If we received new MMU interrupts, process them before returning. */
> +       status = mmu_read(pfdev, MMU_INT_RAWSTAT);
> +       if (status)
> +               goto again;
> +

Can't we avoid the goto? Change the for loop like this:

i = 0;
while (status = mmu_read(pfdev, MMU_INT_RAWSTAT)) {
    ...

    i++;
    if (i == 16)
        i = 0;
}

>         mmu_write(pfdev, MMU_INT_MASK, ~0);
>         return IRQ_HANDLED;
>  };
> --
> 2.26.2
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2021-02-03 14:45 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
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 [this message]
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=CAL_JsqLGfjbu1AmuqHtSCqFpkWFdZ7qPb4BWAr3d5eHzq55+0g@mail.gmail.com \
    --to=robh+dt@kernel.org \
    --cc=alyssa.rosenzweig@collabora.com \
    --cc=boris.brezillon@collabora.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=robin.murphy@arm.com \
    --cc=steven.price@arm.com \
    /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.