Linux Power Management development
 help / color / mirror / Atom feed
From: Chen Yu <yu.c.chen@intel.com>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Len Brown <len.brown@intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Linux PM <linux-pm@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH][v2] PM / sysfs: Expose suspend resume driver flags in sysfs
Date: Fri, 23 Oct 2020 02:53:20 +0800	[thread overview]
Message-ID: <20201022185320.GA8811@chenyu-office.sh.intel.com> (raw)
In-Reply-To: <CAHp75Vf52m78FNKgTQ8c_y6UNaR91ANZh296tg6nz+reEv0DEg@mail.gmail.com>

Hi Andy,
On Thu, Oct 22, 2020 at 04:36:25PM +0300, Andy Shevchenko wrote:
> On Thu, Oct 22, 2020 at 12:24 PM Chen Yu <yu.c.chen@intel.com> wrote:
> >
> > Currently there are 4 driver flags to control system suspend/resume
> > behavior: DPM_FLAG_NO_DIRECT_COMPLETE, DPM_FLAG_SMART_PREPARE,
> > DPM_FLAG_SMART_SUSPEND and DPM_FLAG_MAY_SKIP_RESUME. Make these flags
> > visible in sysfs as read-only to get a brief understanding of the
> > expected behavior of each device during suspend/resume, so as to
> > facilitate suspend/resume debugging/tuning.
> >
> > For example:
> > /sys/devices/pci0000:00/0000:00:15.1/power/driver_flags:4
> > (DPM_FLAG_SMART_SUSPEND)
> >
> > /sys/devices/pci0000:00/0000:00:07.3/power/driver_flags:5
> > (DPM_FLAG_NO_DIRECT_COMPLETE | DPM_FLAG_SMART_SUSPEND)
> 
> ...
> 
> > +What:          /sys/devices/.../power/driver_flags
> > +Date:          October 2020
> > +Contact:       Chen Yu <yu.c.chen@intel.com>
> > +Description:
> > +               The /sys/devices/.../driver_flags attribute contains the driver
> > +               flags to control system suspend/resume. The flag is a combination
> > +               of DPM_FLAG_NO_DIRECT_COMPLETE, DPM_FLAG_SMART_PREPARE,
> > +               DPM_FLAG_SMART_SUSPEND and DPM_FLAG_MAY_SKIP_RESUME, or 0 if the
> > +               driver has not set any flag.
> 
> > This attribute is read-only. If
> > +               CONFIG_PM_ADVANCED_DEBUG is not set this attribute is empty.
> 
> Which makes me wonder why we even expose this if the above is not set.
> 
> ...
> 
It will not be exposed if the config is disabled. 'empty' means
'not present' I think.
> > +static struct attribute *pm_driver_flags_attrs[] = {
> > +#ifdef CONFIG_PM_ADVANCED_DEBUG
> > +#ifdef CONFIG_PM_SLEEP
> > +       &dev_attr_driver_flags.attr,
> > +#endif
> > +#endif
> 
> > +       NULL,
> 
> No comma here, please. I think I commented on this internally.
> 
Sorry I misunderstood your point previously, I can change in next
version. But might need to wait for Greg to decide if this item
should be exposed or not first.

Thanks,
Chenyu
> > +};
> 
> -- 
> With Best Regards,
> Andy Shevchenko

      reply	other threads:[~2020-10-22 18:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22  8:52 [PATCH][v2] PM / sysfs: Expose suspend resume driver flags in sysfs Chen Yu
2020-10-22  9:17 ` Greg Kroah-Hartman
2020-10-22 18:43   ` Chen Yu
2020-10-22 13:36 ` Andy Shevchenko
2020-10-22 18:53   ` Chen Yu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201022185320.GA8811@chenyu-office.sh.intel.com \
    --to=yu.c.chen@intel.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox