lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251113112610.000071df@huawei.com>
Date: Thu, 13 Nov 2025 11:26:10 +0000
From: Jonathan Cameron <jonathan.cameron@...wei.com>
To: "Rafael J. Wysocki" <rafael@...nel.org>
CC: <dan.j.williams@...el.com>, Dhruva Gole <d-gole@...com>, Frank Li
	<Frank.Li@....com>, Linux PM <linux-pm@...r.kernel.org>, Linux ACPI
	<linux-acpi@...r.kernel.org>, Takashi Iwai <tiwai@...e.de>, LKML
	<linux-kernel@...r.kernel.org>, Zhang Qilong <zhangqilong3@...wei.com>, Linux
 PCI <linux-pci@...r.kernel.org>, Bjorn Helgaas <helgaas@...nel.org>, Alex
 Williamson <alex.williamson@...hat.com>
Subject: Re: [PATCH v1 0/3] PM: runtime: Wrapper macros for usage counter
 guards

On Wed, 12 Nov 2025 22:38:14 +0100
"Rafael J. Wysocki" <rafael@...nel.org> wrote:

> On Wed, Nov 12, 2025 at 10:27 PM <dan.j.williams@...el.com> wrote:
> >
> > Rafael J. Wysocki wrote:  
> > > On Wednesday, November 12, 2025 7:39:41 AM CET Dhruva Gole wrote:  
> > > > On Nov 07, 2025 at 19:35:09 +0100, Rafael J. Wysocki wrote:  
> > > > > Hi All,
> > > > >
> > > > > The runtime PM usage counter guards introduced recently:
> > > > >
> > > > > https://lore.kernel.org/linux-pm/6196611.lOV4Wx5bFT@rafael.j.wysocki/
> > > > >
> > > > > and then fixed:
> > > > >
> > > > > https://lore.kernel.org/linux-pm/5943878.DvuYhMxLoT@rafael.j.wysocki/
> > > > >
> > > > > should generally work, but using them feels sort of arcane and cryptic
> > > > > even though the underlying concept is relatively straightforward.
> > > > >
> > > > > For this reason, runtime PM wrapper macros around ACQUIRE() and
> > > > > ACQUIRE_ERR() involving the new guards are introduced in this series
> > > > > (patch [1/3]) and then used in the code already using the guards (patches
> > > > > [2/3] and [3/3]) to make it look more straightforward.  
> > > >
> > > > The patches look okay to me,
> > > > Reviewed-by: Dhruva Gole <d-gole@...com>  
> > >
> > > Thank you and Jonathan for the tags, but since Frank is not convinced, let me
> > > bounce one more idea off all of you.
> > >
> > > Namely, I think that Frank has a point when he wonders if PM_RUNTIME_ACQUIRE_ERR
> > > hides too much information and I agree with Jonathan that may be misunderstood,
> > > so what about defining the wrapper macros so they don't hide the guard variable
> > > name, like in the patch below?  
> >
> > I had been reluctant about offering an enthusiastic tag on this series
> > given that information hiding, but with this change:
> >
> > Reviewed-by: Dan Williams <dan.j.williams@...el.com>  
> 
> Thanks!
> 
> > However, I prefer that the scope variable declaration vs usage
> > (reference) cases should maintain visual separation with an operator,
> > i.e.:
> >
> >         PM_RUNTIME_ACQUIRE(dev, pm);
> >         if (PM_RUNTIME_ACQUIRE_ERR(&pm))
> >                 return -ENXIO;
> >
> > Otherwise we have a case of different flavors of *_ACQUIRE_ERR
> > implementing various styles. I initially looked at hiding the '&':
> >
> > http://lore.kernel.org/681ea7d5ea04b_2a2bb100cf@dwillia2-mobl4.notmuch
> >
> > ...but it grew on me precisely because it provides a clue about how this
> > magic operates.  
> 
> Fair enough.
> 
> I'll resend the series with this change then.
This new option is much nicer and not too verbose.

> 
> Thank you!
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ