Re: [PATCH 4/4] s390/pci: Use lock guard for pci_rescan_remove_lock
From: Niklas Schnelle
Date: Mon Mar 09 2026 - 11:52:16 EST
On Mon, 2026-03-09 at 11:54 +0100, Benjamin Block wrote:
> On Mon, Mar 09, 2026 at 09:38:45AM +0200, Ilpo Järvinen wrote:
> > On Fri, 6 Mar 2026, Benjamin Block wrote:
> > > - pci_lock_rescan_remove();
> > > - zpci_device_reserved(zdev);
> > > - pci_unlock_rescan_remove();
> > > + scoped_guard(pci_rescan_remove)
> > > + zpci_device_reserved(zdev);
> >
> > Order in this series is weird. Why not introduce *guard() support before
> > the fix (reorder patches 2 and 3) and then use guard direct here so you
> > don't have to immediately change the code again to "convert" it to use
> > *guard() in patch 4?
>
> The main intention here was to make it easier on me (and others) to retrofit
> this in stable and/or distribution Kernels. I know this isn't a main concern
> for the upstream master, but it would make my life a bit easier :)
>
> Although, ofc., it isn't required, so in doubt, I can change it. Given that
> the Maintainers are actually OK with the use of guards, in any case.
I do like the guards but thinking about it, I also do have a slight
preference for adding the guard support first and using it directly.
I'm not entirely convinced this makes it harder to backport either.
>From a quick check it looks like all relevant distros have the macro
and we do try to keep the code close to upstream so would just end up
backporting the lock guard conversion too maybe immediately maybe
later.
Thanks,
Niklas