[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <19bdf152a97.5ffa0a07806790.470935296772844852@linux.beauty>
Date: Wed, 21 Jan 2026 13:44:24 +0800
From: Li Chen <me@...ux.beauty>
To: "David Airlie" <airlied@...il.com>
Cc: "Lyude Paul" <lyude@...hat.com>,
"Maarten Lankhorst" <maarten.lankhorst@...ux.intel.com>,
"Maxime Ripard" <mripard@...nel.org>,
"Thomas Zimmermann" <tzimmermann@...e.de>,
"Simona Vetter" <simona@...ll.ch>,
"dri-devel" <dri-devel@...ts.freedesktop.org>,
"nouveau" <nouveau@...ts.freedesktop.org>,
"linux-kernel" <linux-kernel@...r.kernel.org>,
"Daniel Palmer" <daniel@...f.com>
Subject: Re: [PATCH] nouveau: pci: quiesce GPU on shutdown
Hi Dave,
> Hi Danilo
>
> > On Wed Jan 21, 2026 at 1:50 AM CET, Li Chen wrote:
> > > > > + usleep_range(200, 400);\
> > > >
> > > > Why is this needed? it at least needs a comment.
> > >
> > > This patch is needed for kexec/KHO/LUO reboot: firmware reset is skipped, so the GPU may remain in an active/DMA
> > > state and the next kernel can fail to re-init nouveau. We can’t call the full DRM/TTM teardown from ->shutdown() because
> > > userspace may still hold DRM fds during shutdown, which triggers WARNs.
> > >
> > > So the shutdown hook reuses the suspend/quiesce path (safe with open fds) and then powers down the PCI function (D3hot)
> > > to leave the device in a consistent state for the next kernel.
> >
> > I think the question was about the usleep_range() specifically. :)
> >
>
> Thanks for the hint.
>
> That usleep_range(200, 400) is just to give the PCI power transition time to settle before an immediate kexec jump.
>
> It’s mirroring the existing nouveau_pmops_suspend() behavior, which already does udelay(200) right after pci_set_power_state(..., PCI_D3hot). In ->shutdown() we’re allowed to
> sleep, so I used usleep_range() instead of a busy-wait udelay().
Dave, if this is ok, I would add it as comment in the next version.
Regards,
Li
Powered by blists - more mailing lists