All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandre Courbot <gnurou@gmail.com>
To: Diego Viola <diego.viola@gmail.com>
Cc: Ben Skeggs <bskeggs@redhat.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	dri-devel@lists.freedesktop.org, nouveau@spliet.org
Subject: Re: [PATCH v2] drm/nouveau/pmu: fix timeout on GP108
Date: Wed, 17 Feb 2021 12:30:30 +0900	[thread overview]
Message-ID: <CAAVeFuLLw+pb-vvxPbbgDGGLo4Vi-ReJAh_YH-3xUZEDyhDb-Q@mail.gmail.com> (raw)
In-Reply-To: <20210216161924.1687-1-diego.viola@gmail.com>

On Wed, Feb 17, 2021 at 1:20 AM Diego Viola <diego.viola@gmail.com> wrote:
>
> This code times out on GP108, probably because the BIOS puts it into a
> bad state.
>
> Since we reset the PMU on driver load anyway, we are at no risk from
> missing a response from it since we are not waiting for one to begin
> with.

This looks safe to me, provided indeed that the PMU's reset is not
called outside of initialization (which for GP108 is shouldn't be
IIRC?).

>
> Signed-off-by: Diego Viola <diego.viola@gmail.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
> index a0fe607c9c07..5c802f2d00cb 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
> @@ -102,12 +102,8 @@ nvkm_pmu_reset(struct nvkm_pmu *pmu)
>         if (!pmu->func->enabled(pmu))
>                 return 0;
>
> -       /* Inhibit interrupts, and wait for idle. */
> +       /* Inhibit interrupts. */
>         nvkm_wr32(device, 0x10a014, 0x0000ffff);
> -       nvkm_msec(device, 2000,
> -               if (!nvkm_rd32(device, 0x10a04c))
> -                       break;
> -       );
>
>         /* Reset. */
>         if (pmu->func->reset)
> --
> 2.30.1
>

WARNING: multiple messages have this Message-ID (diff)
From: Alexandre Courbot <gnurou@gmail.com>
To: Diego Viola <diego.viola@gmail.com>
Cc: nouveau@spliet.org, Ben Skeggs <bskeggs@redhat.com>,
	dri-devel@lists.freedesktop.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] drm/nouveau/pmu: fix timeout on GP108
Date: Wed, 17 Feb 2021 12:30:30 +0900	[thread overview]
Message-ID: <CAAVeFuLLw+pb-vvxPbbgDGGLo4Vi-ReJAh_YH-3xUZEDyhDb-Q@mail.gmail.com> (raw)
In-Reply-To: <20210216161924.1687-1-diego.viola@gmail.com>

On Wed, Feb 17, 2021 at 1:20 AM Diego Viola <diego.viola@gmail.com> wrote:
>
> This code times out on GP108, probably because the BIOS puts it into a
> bad state.
>
> Since we reset the PMU on driver load anyway, we are at no risk from
> missing a response from it since we are not waiting for one to begin
> with.

This looks safe to me, provided indeed that the PMU's reset is not
called outside of initialization (which for GP108 is shouldn't be
IIRC?).

>
> Signed-off-by: Diego Viola <diego.viola@gmail.com>
> ---
>  drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c | 6 +-----
>  1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
> index a0fe607c9c07..5c802f2d00cb 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/pmu/base.c
> @@ -102,12 +102,8 @@ nvkm_pmu_reset(struct nvkm_pmu *pmu)
>         if (!pmu->func->enabled(pmu))
>                 return 0;
>
> -       /* Inhibit interrupts, and wait for idle. */
> +       /* Inhibit interrupts. */
>         nvkm_wr32(device, 0x10a014, 0x0000ffff);
> -       nvkm_msec(device, 2000,
> -               if (!nvkm_rd32(device, 0x10a04c))
> -                       break;
> -       );
>
>         /* Reset. */
>         if (pmu->func->reset)
> --
> 2.30.1
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2021-02-17  3:31 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-16 16:19 [PATCH v2] drm/nouveau/pmu: fix timeout on GP108 Diego Viola
2021-02-16 16:19 ` Diego Viola
2021-02-17  3:30 ` Alexandre Courbot [this message]
2021-02-17  3:30   ` Alexandre Courbot
2021-02-24  9:50   ` Ben Skeggs
2021-02-24  9:50     ` Ben Skeggs
2021-02-25  4:04     ` Diego Viola
2021-02-25  4:04       ` Diego Viola
2021-02-25  5:22     ` Diego Viola
2021-02-25  5:22       ` Diego Viola
2021-02-25  5:37       ` Diego Viola
2021-02-25  5:37         ` Diego Viola

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=CAAVeFuLLw+pb-vvxPbbgDGGLo4Vi-ReJAh_YH-3xUZEDyhDb-Q@mail.gmail.com \
    --to=gnurou@gmail.com \
    --cc=bskeggs@redhat.com \
    --cc=diego.viola@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nouveau@spliet.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 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.