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] [day] [month] [year] [list]
Message-ID: <2611471.DTHhsJrc8q@vostro.rjw.lan>
Date:	Fri, 02 Oct 2015 00:23:16 +0200
From:	"Rafael J. Wysocki" <rjw@...ysocki.net>
To:	Ulf Hansson <ulf.hansson@...aro.org>
Cc:	Tomeu Vizoso <tomeu.vizoso@...labora.com>,
	"linux-pm@...r.kernel.org" <linux-pm@...r.kernel.org>,
	Alan Stern <stern@...land.harvard.edu>,
	martyn.welch@...labora.co.uk,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Len Brown <len.brown@...el.com>,
	Kevin Hilman <khilman@...nel.org>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Pavel Machek <pavel@....cz>
Subject: Re: [PATCH v7 1/2] PM / sleep: Go direct_complete if driver has no callbacks

On Thursday, October 01, 2015 11:04:17 AM Ulf Hansson wrote:
> On 30 September 2015 at 23:17, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
> > On Wednesday, September 30, 2015 03:59:48 PM Tomeu Vizoso wrote:
> >> On 30 September 2015 at 15:05, Rafael J. Wysocki <rjw@...ysocki.net> wrote:
> >> > On Wednesday, September 30, 2015 01:33:29 PM Ulf Hansson wrote:
> >> >> On 30 September 2015 at 11:58, Tomeu Vizoso <tomeu.vizoso@...labora.com> wrote:
> >> >> > @@ -1369,6 +1372,8 @@ int pm_genpd_remove_device(struct generic_pm_domain *genpd,
> >> >> >
> >> >> >         genpd_free_dev_data(dev, gpd_data);
> >> >> >
> >> >> > +       device_check_pm_callbacks(dev);
> >> >> > +
> >> >> >         return 0;
> >> >>
> >> >> I can't tell whether this is an interesting feature to use for devices
> >> >> that gets attached to the ACPI PM domain. Although, you currently
> >> >> doesn't deal with that case, and too me I think this looks a bit
> >> >> weird/unsymmetrical.
> >> >
> >> > Good point.
> >> >
> >> > It needs to be done in every situation where a PM domain is or can be used.
> >> >
> >> > I guess we might require all PM domains to be attached to devices after
> >> > a successful probe at the latest (no PM domains should be attached/detached
> >> > after probe succeeds IOW), in which case it should be sufficient to do the
> >> > device_check_pm_callbacks() thing each time after probe successds.
> >> >
> >> > Thoughts?
> >>
> >> Sound good to me. How were you thinking of doing that? Manually
> >> checking that that's currently the case and adding a WARN() if a
> >> pm_domain is attached to a device that has been probed already?
> >
> > I guess we need a function for setting/clearing the pm_domain pointer that
> > will check whether or not the device has been probed and WARN() in that case.
> >
> > Then, convert all users of PM domains to use that function instead of
> > manipulating the pointer directly.
> 
> Why would ever a device be fully probed without first having its PM
> domain pointer assigned?
> 
> To me that wouldn't even work, as the device would rather depend on
> that the PM domain is power up to succeed being probed (at least in
> general case), and unless the PM domain pointer is set we can't
> control that.

That generally is the case, but then I can imagine a situation in which setting
the pm_domain pointer after probe may work for somebody and my point is that
we should enforce things that we are going to rely on for correctness rather
then hope that everybody will do them just because they make sense.

Thanks,
Rafael

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ