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]
Date:   Mon, 19 Aug 2019 11:36:20 +0200
From:   "Rafael J. Wysocki" <rjw@...ysocki.net>
To:     Stephen Boyd <swboyd@...omium.org>
Cc:     Tri Vo <trong@...roid.com>, LKML <linux-kernel@...r.kernel.org>,
        Linux PM <linux-pm@...r.kernel.org>, Qian Cai <cai@....pw>
Subject: Re: [PATCH] PM / wakeup: Register wakeup class kobj after device is added

On Friday, August 16, 2019 11:46:19 PM CEST Stephen Boyd wrote:
> Quoting Tri Vo (2019-08-16 14:27:35)
> > On Fri, Aug 16, 2019 at 7:56 AM Stephen Boyd <swboyd@...omium.org> wrote:
> > > diff --git a/drivers/base/power/sysfs.c b/drivers/base/power/sysfs.c
> > > index 1b9c281cbe41..27ee00f50bd7 100644
> > > --- a/drivers/base/power/sysfs.c
> > > +++ b/drivers/base/power/sysfs.c
> > > @@ -5,6 +5,7 @@
> > >  #include <linux/export.h>
> > >  #include <linux/pm_qos.h>
> > >  #include <linux/pm_runtime.h>
> > > +#include <linux/pm_wakeup.h>
> > >  #include <linux/atomic.h>
> > >  #include <linux/jiffies.h>
> > >  #include "power.h"
> > > @@ -661,14 +662,21 @@ int dpm_sysfs_add(struct device *dev)
> > >                 if (rc)
> > >                         goto err_runtime;
> > >         }
> > > +       if (dev->power.wakeup) {
> > 
> > This conditional checks for the situation when wakeup source
> > registration have been previously attempted, but failed at
> > wakeup_source_sysfs_add(). My concern is that it's not easy to
> > understand what this check does without knowing exactly what
> > device_wakeup_enable() does to dev->power.wakeup before we reach this
> > point.
> 
> Oh, actually this is wrong. It should be a check for
> dev->power.wakeup->dev being non-NULL. That's the variable that's set by
> wakeup_source_sysfs_add() upon success. So I should make it:
> 
> 	if (dev->power.wakeup && !dev->power.wakeup->dev)
> 
> And there's the problem that CONFIG_PM_SLEEP could be unset. Let me fix
> it up with a new inline function like device_has_wakeup_dev().

OK, fix that and resend the patch.  I'll restore the series then.



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ