All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Skeggs <skeggsb@gmail.com>
To: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Cc: David Airlie <airlied@redhat.com>,
	nouveau@lists.freedesktop.org,  regressions@lists.linux.dev,
	dri-devel@lists.freedesktop.org,  bskeggs@redhat.com,
	kwizart@gmail.com, kherbst@redhat.com
Subject: Re: [REGRESSION] GM20B probe fails after commit 2541626cfb79
Date: Fri, 27 Jan 2023 16:00:59 +1000	[thread overview]
Message-ID: <CACAvsv4_XJLSwnA-s0BXLVbBCESDfnK7kx5-WUPd2+vdJuMojg@mail.gmail.com> (raw)
In-Reply-To: <20230120113443.wgwhwp7tm6rnc6je@wslaptop>

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

On Fri, 20 Jan 2023 at 21:37, Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt> wrote:
>
> On Wed, Jan 18, 2023 at 11:28:49AM +1000, Ben Skeggs wrote:
> > On Mon, 16 Jan 2023 at 22:27, Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt> wrote:
> > > On Mon, Jan 16, 2023 at 07:45:05AM +1000, David Airlie wrote:
> > > > As a quick check can you try changing
> > > >
> > > > drivers/gpu/drm/nouveau/nvkm/core/firmware.c:nvkm_firmware_mem_target
> > > > from NVKM_MEM_TARGET_HOST to NVKM_MEM_TARGET_NCOH ?
>
> > In addition to Dave's change, can you try changing the
> > nvkm_falcon_load_dmem() call in gm20b_pmu_init() to:
> >
> > nvkm_falcon_pio_wr(falcon, (u8 *)&args, 0, 0, DMEM, addr_args,
> > sizeof(args), 0, false);
>
> Hello!
>
> Chiming in just to say that with this change I see the same as Nicolas
> except that the init message size is 255 instead of 0:
>
> [    2.196934] nouveau 57000000.gpu: pmu: unexpected init message size 255 vs 42
I've attached an entirely untested patch (to go on top of the other
hacks/fixes so far), that will hopefully get us a little further.

Would be great if you guys could test it out for me.

Thanks,
Ben.

[-- Attachment #2: gm20b.diff --]
[-- Type: text/x-patch, Size: 1030 bytes --]

diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c b/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
index 393ade9f7e6c..b7da3ab44c27 100644
--- a/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
+++ b/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
@@ -48,6 +48,16 @@ gm200_flcn_pio_dmem_rd(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l
 		img += 4;
 		len -= 4;
 	}
+
+	/* Sigh.  Tegra PMU FW's init message... */
+	if (len) {
+		u32 data = nvkm_falcon_rd32(falcon, 0x1c4 + (port * 8));
+
+		while (len--) {
+			*(u8 *)img++ = data & 0xff;
+			data >>= 8;
+		}
+	}
 }
 
 static void
@@ -64,6 +74,8 @@ gm200_flcn_pio_dmem_wr(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l
 		img += 4;
 		len -= 4;
 	}
+
+	WARN_ON(len);
 }
 
 static void
@@ -74,7 +86,7 @@ gm200_flcn_pio_dmem_wr_init(struct nvkm_falcon *falcon, u8 port, bool sec, u32 d
 
 const struct nvkm_falcon_func_pio
 gm200_flcn_dmem_pio = {
-	.min = 4,
+	.min = 1,
 	.max = 0x100,
 	.wr_init = gm200_flcn_pio_dmem_wr_init,
 	.wr = gm200_flcn_pio_dmem_wr,

WARNING: multiple messages have this Message-ID (diff)
From: Ben Skeggs <skeggsb@gmail.com>
To: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Cc: regressions@lists.linux.dev, nouveau@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, bskeggs@redhat.com,
	David Airlie <airlied@redhat.com>
Subject: Re: [Nouveau] [REGRESSION] GM20B probe fails after commit 2541626cfb79
Date: Fri, 27 Jan 2023 16:00:59 +1000	[thread overview]
Message-ID: <CACAvsv4_XJLSwnA-s0BXLVbBCESDfnK7kx5-WUPd2+vdJuMojg@mail.gmail.com> (raw)
In-Reply-To: <20230120113443.wgwhwp7tm6rnc6je@wslaptop>

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

On Fri, 20 Jan 2023 at 21:37, Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt> wrote:
>
> On Wed, Jan 18, 2023 at 11:28:49AM +1000, Ben Skeggs wrote:
> > On Mon, 16 Jan 2023 at 22:27, Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt> wrote:
> > > On Mon, Jan 16, 2023 at 07:45:05AM +1000, David Airlie wrote:
> > > > As a quick check can you try changing
> > > >
> > > > drivers/gpu/drm/nouveau/nvkm/core/firmware.c:nvkm_firmware_mem_target
> > > > from NVKM_MEM_TARGET_HOST to NVKM_MEM_TARGET_NCOH ?
>
> > In addition to Dave's change, can you try changing the
> > nvkm_falcon_load_dmem() call in gm20b_pmu_init() to:
> >
> > nvkm_falcon_pio_wr(falcon, (u8 *)&args, 0, 0, DMEM, addr_args,
> > sizeof(args), 0, false);
>
> Hello!
>
> Chiming in just to say that with this change I see the same as Nicolas
> except that the init message size is 255 instead of 0:
>
> [    2.196934] nouveau 57000000.gpu: pmu: unexpected init message size 255 vs 42
I've attached an entirely untested patch (to go on top of the other
hacks/fixes so far), that will hopefully get us a little further.

Would be great if you guys could test it out for me.

Thanks,
Ben.

[-- Attachment #2: gm20b.diff --]
[-- Type: text/x-patch, Size: 1030 bytes --]

diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c b/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
index 393ade9f7e6c..b7da3ab44c27 100644
--- a/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
+++ b/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
@@ -48,6 +48,16 @@ gm200_flcn_pio_dmem_rd(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l
 		img += 4;
 		len -= 4;
 	}
+
+	/* Sigh.  Tegra PMU FW's init message... */
+	if (len) {
+		u32 data = nvkm_falcon_rd32(falcon, 0x1c4 + (port * 8));
+
+		while (len--) {
+			*(u8 *)img++ = data & 0xff;
+			data >>= 8;
+		}
+	}
 }
 
 static void
@@ -64,6 +74,8 @@ gm200_flcn_pio_dmem_wr(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l
 		img += 4;
 		len -= 4;
 	}
+
+	WARN_ON(len);
 }
 
 static void
@@ -74,7 +86,7 @@ gm200_flcn_pio_dmem_wr_init(struct nvkm_falcon *falcon, u8 port, bool sec, u32 d
 
 const struct nvkm_falcon_func_pio
 gm200_flcn_dmem_pio = {
-	.min = 4,
+	.min = 1,
 	.max = 0x100,
 	.wr_init = gm200_flcn_pio_dmem_wr_init,
 	.wr = gm200_flcn_pio_dmem_wr,

WARNING: multiple messages have this Message-ID (diff)
From: Ben Skeggs <skeggsb@gmail.com>
To: Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt>
Cc: regressions@lists.linux.dev, kherbst@redhat.com,
	kwizart@gmail.com, nouveau@lists.freedesktop.org,
	dri-devel@lists.freedesktop.org, bskeggs@redhat.com,
	David Airlie <airlied@redhat.com>
Subject: Re: [REGRESSION] GM20B probe fails after commit 2541626cfb79
Date: Fri, 27 Jan 2023 16:00:59 +1000	[thread overview]
Message-ID: <CACAvsv4_XJLSwnA-s0BXLVbBCESDfnK7kx5-WUPd2+vdJuMojg@mail.gmail.com> (raw)
In-Reply-To: <20230120113443.wgwhwp7tm6rnc6je@wslaptop>

[-- Attachment #1: Type: text/plain, Size: 1132 bytes --]

On Fri, 20 Jan 2023 at 21:37, Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt> wrote:
>
> On Wed, Jan 18, 2023 at 11:28:49AM +1000, Ben Skeggs wrote:
> > On Mon, 16 Jan 2023 at 22:27, Diogo Ivo <diogo.ivo@tecnico.ulisboa.pt> wrote:
> > > On Mon, Jan 16, 2023 at 07:45:05AM +1000, David Airlie wrote:
> > > > As a quick check can you try changing
> > > >
> > > > drivers/gpu/drm/nouveau/nvkm/core/firmware.c:nvkm_firmware_mem_target
> > > > from NVKM_MEM_TARGET_HOST to NVKM_MEM_TARGET_NCOH ?
>
> > In addition to Dave's change, can you try changing the
> > nvkm_falcon_load_dmem() call in gm20b_pmu_init() to:
> >
> > nvkm_falcon_pio_wr(falcon, (u8 *)&args, 0, 0, DMEM, addr_args,
> > sizeof(args), 0, false);
>
> Hello!
>
> Chiming in just to say that with this change I see the same as Nicolas
> except that the init message size is 255 instead of 0:
>
> [    2.196934] nouveau 57000000.gpu: pmu: unexpected init message size 255 vs 42
I've attached an entirely untested patch (to go on top of the other
hacks/fixes so far), that will hopefully get us a little further.

Would be great if you guys could test it out for me.

Thanks,
Ben.

[-- Attachment #2: gm20b.diff --]
[-- Type: text/x-patch, Size: 1030 bytes --]

diff --git a/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c b/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
index 393ade9f7e6c..b7da3ab44c27 100644
--- a/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
+++ b/drivers/gpu/drm/nouveau/nvkm/falcon/gm200.c
@@ -48,6 +48,16 @@ gm200_flcn_pio_dmem_rd(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l
 		img += 4;
 		len -= 4;
 	}
+
+	/* Sigh.  Tegra PMU FW's init message... */
+	if (len) {
+		u32 data = nvkm_falcon_rd32(falcon, 0x1c4 + (port * 8));
+
+		while (len--) {
+			*(u8 *)img++ = data & 0xff;
+			data >>= 8;
+		}
+	}
 }
 
 static void
@@ -64,6 +74,8 @@ gm200_flcn_pio_dmem_wr(struct nvkm_falcon *falcon, u8 port, const u8 *img, int l
 		img += 4;
 		len -= 4;
 	}
+
+	WARN_ON(len);
 }
 
 static void
@@ -74,7 +86,7 @@ gm200_flcn_pio_dmem_wr_init(struct nvkm_falcon *falcon, u8 port, bool sec, u32 d
 
 const struct nvkm_falcon_func_pio
 gm200_flcn_dmem_pio = {
-	.min = 4,
+	.min = 1,
 	.max = 0x100,
 	.wr_init = gm200_flcn_pio_dmem_wr_init,
 	.wr = gm200_flcn_pio_dmem_wr,

  reply	other threads:[~2023-01-27  6:01 UTC|newest]

Thread overview: 60+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-28 14:49 [REGRESSION] GM20B probe fails after commit 2541626cfb79 Diogo Ivo
2022-12-28 14:49 ` [Nouveau] " Diogo Ivo
2022-12-28 14:49 ` Diogo Ivo
2023-01-05 12:28 ` Thorsten Leemhuis
2023-01-05 12:28   ` [Nouveau] " Thorsten Leemhuis
2023-01-05 12:28   ` Thorsten Leemhuis
2023-01-13 13:19   ` Linux kernel regression tracking (Thorsten Leemhuis)
2023-01-13 13:19     ` Linux kernel regression tracking (Thorsten Leemhuis)
2023-01-13 13:19     ` [Nouveau] " Linux kernel regression tracking (Thorsten Leemhuis)
2023-01-14  3:27     ` Karol Herbst
2023-01-14  3:27       ` Karol Herbst
2023-01-14  3:27       ` Karol Herbst
2023-01-14 16:03       ` Diogo Ivo
2023-01-14 16:03         ` [Nouveau] " Diogo Ivo
2023-01-14 16:03         ` Diogo Ivo
2023-01-14 18:56         ` Karol Herbst
2023-01-14 18:56           ` Karol Herbst
2023-01-14 18:56           ` [Nouveau] " Karol Herbst
2023-01-14 15:58     ` Diogo Ivo
2023-01-14 15:58       ` [Nouveau] " Diogo Ivo
2023-01-14 15:58       ` Diogo Ivo
2023-02-03  9:13   ` Linux kernel regression tracking (#update)
2023-02-03  9:13     ` Linux kernel regression tracking (#update)
2023-02-03  9:13     ` [Nouveau] " Linux kernel regression tracking (#update)
2023-01-15 21:45 ` David Airlie
2023-01-15 21:45   ` David Airlie
2023-01-15 21:45   ` [Nouveau] " David Airlie
2023-01-16 12:24   ` Diogo Ivo
2023-01-16 12:24     ` [Nouveau] " Diogo Ivo
2023-01-16 12:24     ` Diogo Ivo
2023-01-18  1:28     ` [Nouveau] " Ben Skeggs
2023-01-18  1:28       ` Ben Skeggs
2023-01-18  1:28       ` Ben Skeggs
2023-01-18  8:42       ` [Nouveau] " Nicolas Chauvet
2023-01-18  8:42         ` Nicolas Chauvet
2023-01-20 11:34       ` Diogo Ivo
2023-01-20 11:34         ` [Nouveau] " Diogo Ivo
2023-01-20 11:34         ` Diogo Ivo
2023-01-27  6:00         ` Ben Skeggs [this message]
2023-01-27  6:00           ` Ben Skeggs
2023-01-27  6:00           ` [Nouveau] " Ben Skeggs
2023-01-27  9:03           ` Nicolas Chauvet
2023-01-27  9:03             ` Nicolas Chauvet
2023-01-27  9:03             ` [Nouveau] " Nicolas Chauvet
2023-01-27 10:48             ` Diogo Ivo
2023-01-27 10:48               ` [Nouveau] " Diogo Ivo
2023-01-27 10:39           ` Diogo Ivo
2023-01-27 10:39             ` [Nouveau] " Diogo Ivo
2023-01-27 10:39             ` Diogo Ivo
2023-01-29 22:36             ` Ben Skeggs
2023-01-29 22:36               ` Ben Skeggs
2023-01-29 22:36               ` [Nouveau] " Ben Skeggs
2023-01-30 13:54               ` Diogo Ivo
2023-01-30 13:54                 ` [Nouveau] " Diogo Ivo
2023-01-30 13:54                 ` Diogo Ivo
2023-01-30 16:05               ` Nicolas Chauvet
2023-01-30 16:05                 ` Nicolas Chauvet
2023-01-30 16:05                 ` [Nouveau] " Nicolas Chauvet
2023-01-17 15:55   ` Nicolas Chauvet
2023-01-17 15:55     ` Nicolas Chauvet

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=CACAvsv4_XJLSwnA-s0BXLVbBCESDfnK7kx5-WUPd2+vdJuMojg@mail.gmail.com \
    --to=skeggsb@gmail.com \
    --cc=airlied@redhat.com \
    --cc=bskeggs@redhat.com \
    --cc=diogo.ivo@tecnico.ulisboa.pt \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kherbst@redhat.com \
    --cc=kwizart@gmail.com \
    --cc=nouveau@lists.freedesktop.org \
    --cc=regressions@lists.linux.dev \
    /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.