All of lore.kernel.org
 help / color / mirror / Atom feed
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
	Thierry Reding <thierry.reding@gmail.com>
Subject: Re: [PATCH 2/2] PM / sleep: prohibit devices probing during suspend/hibernation
Date: Fri, 9 Oct 2015 09:31:24 -0500	[thread overview]
Message-ID: <5617CFBC.1090409@ti.com> (raw)
In-Reply-To: <15556679.oJAEDkJbZ7@vostro.rjw.lan>

On 10/08/2015 03:46 PM, Rafael J. Wysocki wrote:
> 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?
>

NP. Will do.

-- 
regards,
-grygorii

WARNING: multiple messages have this Message-ID (diff)
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: "Rafael J. Wysocki" <rjw@rjwysocki.net>,
	Alan Stern <stern@rowland.harvard.edu>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Pavel Machek <pavel@ucw.cz>, Len Brown <len.brown@intel.com>,
	<linux-kernel@vger.kernel.org>, <linux-pm@vger.kernel.org>,
	Thierry Reding <thierry.reding@gmail.com>
Subject: Re: [PATCH 2/2] PM / sleep: prohibit devices probing during suspend/hibernation
Date: Fri, 9 Oct 2015 09:31:24 -0500	[thread overview]
Message-ID: <5617CFBC.1090409@ti.com> (raw)
In-Reply-To: <15556679.oJAEDkJbZ7@vostro.rjw.lan>

On 10/08/2015 03:46 PM, Rafael J. Wysocki wrote:
> 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?
>

NP. Will do.

-- 
regards,
-grygorii

  reply	other threads:[~2015-10-09 14:31 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08 16:57 [PATCH 0/2] PM / sleep: prohibit devices probing during suspend/hibernation Grygorii Strashko
2015-10-08 16:57 ` Grygorii Strashko
2015-10-08 16:57 ` [PATCH 1/2] PM / sleep: ensure deferred probe workqueue is finished in wait_for_device_probe Grygorii Strashko
2015-10-08 16:57   ` Grygorii Strashko
2015-10-08 20:50   ` Rafael J. Wysocki
2015-10-08 20:53     ` Alan Stern
2015-10-08 20:53       ` Alan Stern
2015-10-09 14:38       ` Grygorii Strashko
2015-10-09 14:38         ` Grygorii Strashko
2015-10-09 21:16         ` Rafael J. Wysocki
2015-10-13 18:25           ` Grygorii Strashko
2015-10-13 18:25             ` Grygorii Strashko
2015-10-08 16:57 ` [PATCH 2/2] PM / sleep: prohibit devices probing during suspend/hibernation Grygorii Strashko
2015-10-08 16:57   ` Grygorii Strashko
2015-10-08 17:24   ` Alan Stern
2015-10-08 17:24     ` Alan Stern
2015-10-08 18:54     ` Grygorii Strashko
2015-10-08 18:54       ` Grygorii Strashko
2015-10-08 19:20       ` Alan Stern
2015-10-08 19:20         ` Alan Stern
2015-10-08 19:48         ` Grygorii Strashko
2015-10-08 19:48           ` Grygorii Strashko
2015-10-08 20:05           ` Alan Stern
2015-10-08 20:05             ` Alan Stern
2015-10-08 20:46         ` Rafael J. Wysocki
2015-10-09 14:31           ` Grygorii Strashko [this message]
2015-10-09 14:31             ` Grygorii Strashko

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=5617CFBC.1090409@ti.com \
    --to=grygorii.strashko@ti.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=len.brown@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=rjw@rjwysocki.net \
    --cc=stern@rowland.harvard.edu \
    --cc=thierry.reding@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.