Message ID | 20250227170012.124768-7-marex@denx.de (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | arm64: dts: imx95: Add support for Mali G310 GPU | expand |
On Thu, 27 Feb 2025 17:58:06 +0100 Marek Vasut <marex@denx.de> wrote: > This seems necessary on Freescale i.MX95 Mali G310 to reliably resume > from runtime PM suspend. Without this, if only the L2 is powered down > on RPM entry, the GPU gets stuck and does not indicate the firmware is > booted after RPM resume. > > Signed-off-by: Marek Vasut <marex@denx.de> > --- > Cc: Boris Brezillon <boris.brezillon@collabora.com> > Cc: Conor Dooley <conor+dt@kernel.org> > Cc: David Airlie <airlied@gmail.com> > Cc: Fabio Estevam <festevam@gmail.com> > Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> > Cc: Liviu Dudau <liviu.dudau@arm.com> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > Cc: Maxime Ripard <mripard@kernel.org> > Cc: Pengutronix Kernel Team <kernel@pengutronix.de> > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: Rob Herring <robh@kernel.org> > Cc: Sascha Hauer <s.hauer@pengutronix.de> > Cc: Sebastian Reichel <sre@kernel.org> > Cc: Shawn Guo <shawnguo@kernel.org> > Cc: Simona Vetter <simona@ffwll.ch> > Cc: Steven Price <steven.price@arm.com> > Cc: Thomas Zimmermann <tzimmermann@suse.de> > Cc: devicetree@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org > Cc: imx@lists.linux.dev > Cc: linux-arm-kernel@lists.infradead.org > --- > drivers/gpu/drm/panthor/panthor_gpu.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c > index 671049020afaa..0f07ef7d9aea7 100644 > --- a/drivers/gpu/drm/panthor/panthor_gpu.c > +++ b/drivers/gpu/drm/panthor/panthor_gpu.c > @@ -470,11 +470,12 @@ int panthor_gpu_soft_reset(struct panthor_device *ptdev) > */ > void panthor_gpu_suspend(struct panthor_device *ptdev) > { > - /* On a fast reset, simply power down the L2. */ > - if (!ptdev->reset.fast) > - panthor_gpu_soft_reset(ptdev); > - else > - panthor_gpu_power_off(ptdev, L2, 1, 20000); > + /* > + * Power off the L2 and soft reset the GPU, that makes > + * iMX95 Mali G310 resume without firmware boot timeout. > + */ > + panthor_gpu_power_off(ptdev, L2, 1, 20000); > + panthor_gpu_soft_reset(ptdev); Unfortunately, if you do that unconditionally we no longer have a fast-reset. Would be good to figure out why the fast-reset doesn't work on this platform.
On 2/27/25 6:17 PM, Boris Brezillon wrote: [...] >> diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c >> index 671049020afaa..0f07ef7d9aea7 100644 >> --- a/drivers/gpu/drm/panthor/panthor_gpu.c >> +++ b/drivers/gpu/drm/panthor/panthor_gpu.c >> @@ -470,11 +470,12 @@ int panthor_gpu_soft_reset(struct panthor_device *ptdev) >> */ >> void panthor_gpu_suspend(struct panthor_device *ptdev) >> { >> - /* On a fast reset, simply power down the L2. */ >> - if (!ptdev->reset.fast) >> - panthor_gpu_soft_reset(ptdev); >> - else >> - panthor_gpu_power_off(ptdev, L2, 1, 20000); >> + /* >> + * Power off the L2 and soft reset the GPU, that makes >> + * iMX95 Mali G310 resume without firmware boot timeout. >> + */ >> + panthor_gpu_power_off(ptdev, L2, 1, 20000); >> + panthor_gpu_soft_reset(ptdev); > > Unfortunately, if you do that unconditionally we no longer have a > fast-reset. Would be good to figure out why the fast-reset doesn't work > on this platform. I was hoping to get some hint on this one, I spent quite a while trying to narrow this down, finally got it down to this particular bit. The NXP downstream vendor kernel vendor Mali driver does not seem to have anything interesting regarding the L2 power handling, but I might have missed it, the code is difficult to read. Have you ever seen anything problematic in this specific L2 department ? Do you have any hints how I can debug this further ?
Hi Marek, On Thu, Feb 27, 2025 at 05:58:06PM +0100, Marek Vasut wrote: > This seems necessary on Freescale i.MX95 Mali G310 to reliably resume > from runtime PM suspend. Without this, if only the L2 is powered down > on RPM entry, the GPU gets stuck and does not indicate the firmware is > booted after RPM resume. That doesn't sound right. Can you tell me what GPU firmware are you running (we are now printing the git sha of the image at boot time). Best regards, Liviu > > Signed-off-by: Marek Vasut <marex@denx.de> > --- > Cc: Boris Brezillon <boris.brezillon@collabora.com> > Cc: Conor Dooley <conor+dt@kernel.org> > Cc: David Airlie <airlied@gmail.com> > Cc: Fabio Estevam <festevam@gmail.com> > Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> > Cc: Liviu Dudau <liviu.dudau@arm.com> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> > Cc: Maxime Ripard <mripard@kernel.org> > Cc: Pengutronix Kernel Team <kernel@pengutronix.de> > Cc: Philipp Zabel <p.zabel@pengutronix.de> > Cc: Rob Herring <robh@kernel.org> > Cc: Sascha Hauer <s.hauer@pengutronix.de> > Cc: Sebastian Reichel <sre@kernel.org> > Cc: Shawn Guo <shawnguo@kernel.org> > Cc: Simona Vetter <simona@ffwll.ch> > Cc: Steven Price <steven.price@arm.com> > Cc: Thomas Zimmermann <tzimmermann@suse.de> > Cc: devicetree@vger.kernel.org > Cc: dri-devel@lists.freedesktop.org > Cc: imx@lists.linux.dev > Cc: linux-arm-kernel@lists.infradead.org > --- > drivers/gpu/drm/panthor/panthor_gpu.c | 11 ++++++----- > 1 file changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c > index 671049020afaa..0f07ef7d9aea7 100644 > --- a/drivers/gpu/drm/panthor/panthor_gpu.c > +++ b/drivers/gpu/drm/panthor/panthor_gpu.c > @@ -470,11 +470,12 @@ int panthor_gpu_soft_reset(struct panthor_device *ptdev) > */ > void panthor_gpu_suspend(struct panthor_device *ptdev) > { > - /* On a fast reset, simply power down the L2. */ > - if (!ptdev->reset.fast) > - panthor_gpu_soft_reset(ptdev); > - else > - panthor_gpu_power_off(ptdev, L2, 1, 20000); > + /* > + * Power off the L2 and soft reset the GPU, that makes > + * iMX95 Mali G310 resume without firmware boot timeout. > + */ > + panthor_gpu_power_off(ptdev, L2, 1, 20000); > + panthor_gpu_soft_reset(ptdev); > > panthor_gpu_irq_suspend(&ptdev->gpu->irq); > } > -- > 2.47.2 >
On 2/28/25 12:06 PM, Liviu Dudau wrote: > Hi Marek, Hi, > On Thu, Feb 27, 2025 at 05:58:06PM +0100, Marek Vasut wrote: >> This seems necessary on Freescale i.MX95 Mali G310 to reliably resume >> from runtime PM suspend. Without this, if only the L2 is powered down >> on RPM entry, the GPU gets stuck and does not indicate the firmware is >> booted after RPM resume. > > That doesn't sound right. Can you tell me what GPU firmware are you running > (we are now printing the git sha of the image at boot time). Please see below. It could be some sort of NXP firmware fork ? It comes from the NXP firmware repo , mali-imx-r50.2-710cfb6 . panthor 4d900000.gpu: [drm] clock rate = 1000000000 panthor 4d900000.gpu: EM: created perf domain panthor 4d900000.gpu: [drm] mali-unknown id 0xac74 major 0x0 minor 0x0 status 0x1 panthor 4d900000.gpu: [drm] Features: L2:0x7110306 Tiler:0x809 Mem:0x1 MMU:0x2830 AS:0xff panthor 4d900000.gpu: [drm] shader_present=0x1 l2_present=0x1 tiler_present=0x1 panthor 4d900000.gpu: [drm] Firmware protected mode entry not be supported, ignoring panthor 4d900000.gpu: [drm] Firmware git sha: 8e5cfcfec20cc8aff8509d37e72babc935d34a3b panthor 4d900000.gpu: [drm] CSF FW using interface v1.1.0, Features 0x0 Instrumentation features 0x71 [drm] Initialized panthor 1.3.0 for 4d900000.gpu on minor 0 $ sha256sum mali_csffw.bin befd23b9279b26010ebf35c835cc3aa7d0f50758930c7306ff4f5abbe5218624 mali_csffw.bin [...]
On Fri, Feb 28, 2025 at 06:05:36PM +0100, Marek Vasut wrote: > On 2/28/25 12:06 PM, Liviu Dudau wrote: > > Hi Marek, > > Hi, > > > On Thu, Feb 27, 2025 at 05:58:06PM +0100, Marek Vasut wrote: > > > This seems necessary on Freescale i.MX95 Mali G310 to reliably resume > > > from runtime PM suspend. Without this, if only the L2 is powered down > > > on RPM entry, the GPU gets stuck and does not indicate the firmware is > > > booted after RPM resume. > > > > That doesn't sound right. Can you tell me what GPU firmware are you running > > (we are now printing the git sha of the image at boot time). > Please see below. It could be some sort of NXP firmware fork ? > > It comes from the NXP firmware repo , mali-imx-r50.2-710cfb6 . > > panthor 4d900000.gpu: [drm] clock rate = 1000000000 > panthor 4d900000.gpu: EM: created perf domain > panthor 4d900000.gpu: [drm] mali-unknown id 0xac74 major 0x0 minor 0x0 > status 0x1 > panthor 4d900000.gpu: [drm] Features: L2:0x7110306 Tiler:0x809 Mem:0x1 > MMU:0x2830 AS:0xff > panthor 4d900000.gpu: [drm] shader_present=0x1 l2_present=0x1 > tiler_present=0x1 > panthor 4d900000.gpu: [drm] Firmware protected mode entry not be supported, > ignoring > panthor 4d900000.gpu: [drm] Firmware git sha: > 8e5cfcfec20cc8aff8509d37e72babc935d34a3b This looks like it has been part of a R50 release of the DDK, which is recent enough to consider it up-to-date. The issues you're seeing with fast resume are probably due to some integration issues or other quirks. Boris has the most recent experience with playing with fast resume, maybe he can share some tips on where to add messages in Panthor to try to debug your problem. Best regards, Liviu > panthor 4d900000.gpu: [drm] CSF FW using interface v1.1.0, Features 0x0 > Instrumentation features 0x71 > [drm] Initialized panthor 1.3.0 for 4d900000.gpu on minor 0 > > $ sha256sum mali_csffw.bin > befd23b9279b26010ebf35c835cc3aa7d0f50758930c7306ff4f5abbe5218624 > mali_csffw.bin > > [...]
On Mon, 3 Mar 2025 12:08:51 +0000 Liviu Dudau <liviu.dudau@arm.com> wrote: > On Fri, Feb 28, 2025 at 06:05:36PM +0100, Marek Vasut wrote: > > On 2/28/25 12:06 PM, Liviu Dudau wrote: > > > Hi Marek, > > > > Hi, > > > > > On Thu, Feb 27, 2025 at 05:58:06PM +0100, Marek Vasut wrote: > > > > This seems necessary on Freescale i.MX95 Mali G310 to reliably resume > > > > from runtime PM suspend. Without this, if only the L2 is powered down > > > > on RPM entry, the GPU gets stuck and does not indicate the firmware is > > > > booted after RPM resume. > > > > > > That doesn't sound right. Can you tell me what GPU firmware are you running > > > (we are now printing the git sha of the image at boot time). > > Please see below. It could be some sort of NXP firmware fork ? > > > > It comes from the NXP firmware repo , mali-imx-r50.2-710cfb6 . > > > > panthor 4d900000.gpu: [drm] clock rate = 1000000000 > > panthor 4d900000.gpu: EM: created perf domain > > panthor 4d900000.gpu: [drm] mali-unknown id 0xac74 major 0x0 minor 0x0 > > status 0x1 > > panthor 4d900000.gpu: [drm] Features: L2:0x7110306 Tiler:0x809 Mem:0x1 > > MMU:0x2830 AS:0xff > > panthor 4d900000.gpu: [drm] shader_present=0x1 l2_present=0x1 > > tiler_present=0x1 > > panthor 4d900000.gpu: [drm] Firmware protected mode entry not be supported, > > ignoring > > panthor 4d900000.gpu: [drm] Firmware git sha: > > 8e5cfcfec20cc8aff8509d37e72babc935d34a3b > > This looks like it has been part of a R50 release of the DDK, which is recent > enough to consider it up-to-date. The issues you're seeing with fast resume are > probably due to some integration issues or other quirks. > > Boris has the most recent experience with playing with fast resume, maybe > he can share some tips on where to add messages in Panthor to try to debug > your problem. If you end up with fast_reset=true, that means the FW claims it entered a suspend state from which is can resume quickly (fast-reset), and in that case, we're only supposed to power on the L2 block at resume time AFAIK. If there's a component that can tell us more, it's probably the FW, unfortunately, it doesn't tell us much through the FW interface, especially if it's not booting properly. Do you hit this error [1] without this patch, and if you do, what's the status reported there? [1]https://elixir.bootlin.com/linux/v6.14-rc4/source/drivers/gpu/drm/panthor/panthor_fw.c#L1051
On Mon, 3 Mar 2025 13:35:23 +0100 Boris Brezillon <boris.brezillon@collabora.com> wrote: > On Mon, 3 Mar 2025 12:08:51 +0000 > Liviu Dudau <liviu.dudau@arm.com> wrote: > > > On Fri, Feb 28, 2025 at 06:05:36PM +0100, Marek Vasut wrote: > > > On 2/28/25 12:06 PM, Liviu Dudau wrote: > > > > Hi Marek, > > > > > > Hi, > > > > > > > On Thu, Feb 27, 2025 at 05:58:06PM +0100, Marek Vasut wrote: > > > > > This seems necessary on Freescale i.MX95 Mali G310 to reliably resume > > > > > from runtime PM suspend. Without this, if only the L2 is powered down > > > > > on RPM entry, the GPU gets stuck and does not indicate the firmware is > > > > > booted after RPM resume. > > > > > > > > That doesn't sound right. Can you tell me what GPU firmware are you running > > > > (we are now printing the git sha of the image at boot time). > > > Please see below. It could be some sort of NXP firmware fork ? > > > > > > It comes from the NXP firmware repo , mali-imx-r50.2-710cfb6 . > > > > > > panthor 4d900000.gpu: [drm] clock rate = 1000000000 > > > panthor 4d900000.gpu: EM: created perf domain > > > panthor 4d900000.gpu: [drm] mali-unknown id 0xac74 major 0x0 minor 0x0 > > > status 0x1 > > > panthor 4d900000.gpu: [drm] Features: L2:0x7110306 Tiler:0x809 Mem:0x1 > > > MMU:0x2830 AS:0xff > > > panthor 4d900000.gpu: [drm] shader_present=0x1 l2_present=0x1 > > > tiler_present=0x1 > > > panthor 4d900000.gpu: [drm] Firmware protected mode entry not be supported, > > > ignoring > > > panthor 4d900000.gpu: [drm] Firmware git sha: > > > 8e5cfcfec20cc8aff8509d37e72babc935d34a3b > > > > This looks like it has been part of a R50 release of the DDK, which is recent > > enough to consider it up-to-date. The issues you're seeing with fast resume are > > probably due to some integration issues or other quirks. > > > > Boris has the most recent experience with playing with fast resume, maybe > > he can share some tips on where to add messages in Panthor to try to debug > > your problem. > > If you end up with fast_reset=true, that means the FW claims it entered > a suspend state from which is can resume quickly (fast-reset), and in > that case, we're only supposed to power on the L2 block at resume time > AFAIK. Can you try deasserting the reset lines at probe time and keeping them deasserted until the device is removed instead of re-asserting at suspend time? If that doesn't work, try doing the same with power domains. > If there's a component that can tell us more, it's probably the > FW, unfortunately, it doesn't tell us much through the FW interface, > especially if it's not booting properly. Do you hit this error [1] > without this patch, and if you do, what's the status reported there? > > [1]https://elixir.bootlin.com/linux/v6.14-rc4/source/drivers/gpu/drm/panthor/panthor_fw.c#L1051
diff --git a/drivers/gpu/drm/panthor/panthor_gpu.c b/drivers/gpu/drm/panthor/panthor_gpu.c index 671049020afaa..0f07ef7d9aea7 100644 --- a/drivers/gpu/drm/panthor/panthor_gpu.c +++ b/drivers/gpu/drm/panthor/panthor_gpu.c @@ -470,11 +470,12 @@ int panthor_gpu_soft_reset(struct panthor_device *ptdev) */ void panthor_gpu_suspend(struct panthor_device *ptdev) { - /* On a fast reset, simply power down the L2. */ - if (!ptdev->reset.fast) - panthor_gpu_soft_reset(ptdev); - else - panthor_gpu_power_off(ptdev, L2, 1, 20000); + /* + * Power off the L2 and soft reset the GPU, that makes + * iMX95 Mali G310 resume without firmware boot timeout. + */ + panthor_gpu_power_off(ptdev, L2, 1, 20000); + panthor_gpu_soft_reset(ptdev); panthor_gpu_irq_suspend(&ptdev->gpu->irq); }
This seems necessary on Freescale i.MX95 Mali G310 to reliably resume from runtime PM suspend. Without this, if only the L2 is powered down on RPM entry, the GPU gets stuck and does not indicate the firmware is booted after RPM resume. Signed-off-by: Marek Vasut <marex@denx.de> --- Cc: Boris Brezillon <boris.brezillon@collabora.com> Cc: Conor Dooley <conor+dt@kernel.org> Cc: David Airlie <airlied@gmail.com> Cc: Fabio Estevam <festevam@gmail.com> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> Cc: Liviu Dudau <liviu.dudau@arm.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <mripard@kernel.org> Cc: Pengutronix Kernel Team <kernel@pengutronix.de> Cc: Philipp Zabel <p.zabel@pengutronix.de> Cc: Rob Herring <robh@kernel.org> Cc: Sascha Hauer <s.hauer@pengutronix.de> Cc: Sebastian Reichel <sre@kernel.org> Cc: Shawn Guo <shawnguo@kernel.org> Cc: Simona Vetter <simona@ffwll.ch> Cc: Steven Price <steven.price@arm.com> Cc: Thomas Zimmermann <tzimmermann@suse.de> Cc: devicetree@vger.kernel.org Cc: dri-devel@lists.freedesktop.org Cc: imx@lists.linux.dev Cc: linux-arm-kernel@lists.infradead.org --- drivers/gpu/drm/panthor/panthor_gpu.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)