Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1242716

Re: [PATCH 2/2] PM / sleep: prohibit devices probing during suspend/hibernation

From "Rafael J. Wysocki" <rjw@rjwysocki.net>
Newsgroups linux.kernel
Subject Re: [PATCH 2/2] PM / sleep: prohibit devices probing during suspend/hibernation
Date 2015-10-08 22:20 +0200
Message-ID <qhpPr-5yd-9@gated-at.bofh.it> (permalink)
References <qhp34-4ok-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thursday, October 08, 2015 03:20:08 PM Alan Stern wrote:
> On Thu, 8 Oct 2015, Grygorii Strashko wrote:
> 
> > >>   /**
> > >> + * device_defer_all_probes() - Enable/disable probing of devices
> > >> + * @enable:  Enable/disable probing of devices
> > >> + *
> > >> + * if @enable = true
> > >> + *	It will disable probing of devices and defer their probes.
> > >> + * otherwise
> > >> + *	It will restore normal behavior and trigger re-probing of deferred
> > >> + *	devices.
> > >> + */
> > >> +void device_defer_all_probes(bool enable)
> > >> +{
> > >> +	defer_all_probes = enable;
> > >> +	if (enable)
> > >> +		/* sync with probes to avoid any races. */
> > >> +		wait_for_device_probe();
> > 
> > ^ pls, pay attention on above code line
> > 
> > >> +	else
> > >> +		driver_deferred_probe_trigger();
> > >> +}
> > > 
> > > Some people might prefer to see two separate functions, an enable
> > > routine and a disable routine.  I don't much care.
> > 
> > May be. Should I change it?
> 
> It would then be more in line with functions like 
> pm_runtime_set_{active|suspended} or pm_runtime_[dont_]use_autosuspend.

Also it would be cleaner code without conditionals:

enable:
	defer_all_probes = true;
	wait_for_device_probe();

disable:
	defer_all_probes = false;
	driver_deferred_probe_trigger();

Cleaner, no?

Thanks,
Rafael

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

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 2/2] PM / sleep: prohibit devices probing during suspend/hibernation Grygorii Strashko <grygorii.strashko@ti.com> - 2015-10-08 19:00 +0200
  Re: [PATCH 2/2] PM / sleep: prohibit devices probing during  suspend/hibernation Alan Stern <stern@rowland.harvard.edu> - 2015-10-08 19:30 +0200
    Re: [PATCH 2/2] PM / sleep: prohibit devices probing during  suspend/hibernation Grygorii Strashko <grygorii.strashko@ti.com> - 2015-10-08 21:00 +0200
      Re: [PATCH 2/2] PM / sleep: prohibit devices probing during  suspend/hibernation Alan Stern <stern@rowland.harvard.edu> - 2015-10-08 21:30 +0200
        Re: [PATCH 2/2] PM / sleep: prohibit devices probing during  suspend/hibernation Grygorii Strashko <grygorii.strashko@ti.com> - 2015-10-08 21:50 +0200
          Re: [PATCH 2/2] PM / sleep: prohibit devices probing during  suspend/hibernation Alan Stern <stern@rowland.harvard.edu> - 2015-10-08 22:10 +0200
        Re: [PATCH 2/2] PM / sleep: prohibit devices probing during suspend/hibernation "Rafael J. Wysocki" <rjw@rjwysocki.net> - 2015-10-08 22:20 +0200
          Re: [PATCH 2/2] PM / sleep: prohibit devices probing during  suspend/hibernation Grygorii Strashko <grygorii.strashko@ti.com> - 2015-10-09 16:40 +0200

csiph-web