All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <david.vrabel@csr.com>
To: Ohad Ben-Cohen <ohad@wizery.com>
Cc: Alan Stern <stern@rowland.harvard.edu>,
	"Rafael J. Wysocki" <rjw@sisk.pl>,
	Linux-pm mailing list <linux-pm@lists.linux-foundation.org>,
	linux-mmc@vger.kernel.org, Ido Yariv <ido@wizery.com>
Subject: Re: [linux-pm] subtle pm_runtime_put_sync race and sdio functions
Date: Sat, 18 Dec 2010 14:16:30 +0000	[thread overview]
Message-ID: <4D0CC23E.6000509@csr.com> (raw)
In-Reply-To: <AANLkTi=32bqipN5U00La-B7JSgTC1bHgMev=xUSF6kRN@mail.gmail.com>

On 18/12/2010 13:29, Ohad Ben-Cohen wrote:
> 
> During system suspend, our driver is asked (by mac80211's suspend
> handler) to power off its device. When this happens, the driver has no
> idea that the system is suspending - regular driver code (responsible
> to remove the wlan interface and stop the device) is being called.
> Obviously pm_runtime_put_sync() won't power off the device at this
> point, but later during suspend, when the SDIO core will suspend, the
> device will be powered off and things would work as expected.
> 
> That breaks when the suspend transition is cancelled (e.g. due to an
> error) before SDIO core gets the chance to power off the device: the
> driver will be asked (by mac80211's resume handler) to power up the
> device and reinitialize it, but since the device was never powered
> off, the driver will fail doing so because the device is quiescent (a
> power cycle should have put him into a communicable state, but that
> never happened in this scenario).
> 
> At that resume point the device is always on - whether the system
> suspended successfully or not - and the driver can't tell whether the
> device was indeed powered off beforehand or not. In addition, the
> driver code that is going to fail is not a resume handler - it's just
> regular driver code responsible for powering on the device and
> reinitializing it (which is being called by mac80211's resume
> handler).

It's not clear where the problem is exactly.  It may be useful if you
describe the wi-fi chip's operational or power states and the valid
transitions between them.

Is the problem:

1. The suspend handler puts the wi-fi chip into a state that cannot be
recovered from without a power cycle?  The obvious solution would be to
not put the chip into such a state.

or

2. The resume handler fails because it cannot distinguish between a
wi-fi chip that needs reinitializing from power-on and one that is
already operational?  There is probably a chip register you can query to
determine if the chip was powered down or reset.  In the absense of any
suitable chip-specific register a CCCR register such as I/O Enable might
be usable.

David

  reply	other threads:[~2010-12-18 14:39 UTC|newest]

Thread overview: 179+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-09 23:37 subtle pm_runtime_put_sync race and sdio functions Ohad Ben-Cohen
2010-12-10  0:00 ` Rafael J. Wysocki
2010-12-10  0:00 ` [linux-pm] " Rafael J. Wysocki
2010-12-10 17:24   ` Alan Stern
2010-12-10 17:24   ` [linux-pm] " Alan Stern
2010-12-10 22:01     ` Rafael J. Wysocki
2010-12-10 22:01     ` [linux-pm] " Rafael J. Wysocki
2010-12-10 23:02       ` Ohad Ben-Cohen
2010-12-10 23:02       ` [linux-pm] " Ohad Ben-Cohen
2010-12-10 22:59     ` Ohad Ben-Cohen
2010-12-10 22:59     ` [linux-pm] " Ohad Ben-Cohen
2010-12-11  1:17       ` Ohad Ben-Cohen
2010-12-11 14:53         ` Alan Stern
2010-12-11  1:17       ` Ohad Ben-Cohen
2010-12-11 14:50       ` Alan Stern
2010-12-18 13:29         ` Ohad Ben-Cohen
2010-12-18 13:29         ` [linux-pm] " Ohad Ben-Cohen
2010-12-18 14:16           ` David Vrabel [this message]
2010-12-18 15:12             ` Ohad Ben-Cohen
2010-12-18 15:12             ` [linux-pm] " Ohad Ben-Cohen
2010-12-18 14:16           ` David Vrabel
2010-12-18 15:07           ` [linux-pm] " Rafael J. Wysocki
2010-12-18 16:00             ` Ohad Ben-Cohen
2010-12-18 16:40               ` Johannes Berg
2010-12-18 16:40               ` [linux-pm] " Johannes Berg
2010-12-18 19:08                 ` Ohad Ben-Cohen
     [not found]                 ` <1292690407.3653.2.camel-8upI4CBIZJIJvtFkdXX2HixXY32XiHfO@public.gmane.org>
2010-12-18 19:08                   ` [linux-pm] " Ohad Ben-Cohen
2010-12-18 19:08                     ` Ohad Ben-Cohen
2010-12-18 21:30                     ` Alan Stern
2010-12-18 21:30                     ` [linux-pm] " Alan Stern
2010-12-18 21:30                       ` Alan Stern
2010-12-18 22:57                       ` Rafael J. Wysocki
2010-12-18 22:57                       ` Rafael J. Wysocki
2010-12-18 22:52                     ` Rafael J. Wysocki
2010-12-18 22:52                     ` [linux-pm] " Rafael J. Wysocki
2010-12-18 21:29                 ` Alan Stern
2010-12-18 21:29                   ` Alan Stern
2010-12-18 21:29                 ` Alan Stern
2010-12-18 22:50                 ` [linux-pm] " Rafael J. Wysocki
2010-12-18 22:50                 ` Rafael J. Wysocki
2010-12-18 22:47               ` Rafael J. Wysocki
     [not found]               ` <AANLkTin23vbbA7+UDzh=v060HbkLMrJjB38cs+AWScPJ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-18 22:47                 ` [linux-pm] " Rafael J. Wysocki
2010-12-18 22:47                   ` Rafael J. Wysocki
2010-12-19  7:48                   ` Ohad Ben-Cohen
     [not found]                   ` <201012182347.08635.rjw-KKrjLPT3xs0@public.gmane.org>
2010-12-19  7:48                     ` [linux-pm] " Ohad Ben-Cohen
2010-12-19  7:48                       ` Ohad Ben-Cohen
2010-12-19 10:22                   ` Rafael J. Wysocki
2010-12-19 10:22                   ` [linux-pm] " Rafael J. Wysocki
2010-12-20  3:37                     ` Alan Stern
2010-12-20  3:37                     ` [linux-pm] " Alan Stern
2010-12-20  3:37                       ` Alan Stern
2010-12-20 21:17                       ` Rafael J. Wysocki
2010-12-20 21:17                       ` [linux-pm] " Rafael J. Wysocki
     [not found]                         ` <201012202217.09374.rjw-KKrjLPT3xs0@public.gmane.org>
2010-12-21  0:57                           ` Alan Stern
2010-12-21  0:57                             ` Alan Stern
2010-12-21 21:31                             ` Rafael J. Wysocki
2010-12-22  1:42                               ` Alan Stern
     [not found]                               ` <201012212231.57420.rjw-KKrjLPT3xs0@public.gmane.org>
2010-12-22  1:42                                 ` [linux-pm] " Alan Stern
2010-12-22  1:42                                   ` Alan Stern
     [not found]                                   ` <Pine.LNX.4.44L0.1012212032590.11252-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-22 12:29                                     ` Rafael J. Wysocki
2010-12-22 12:29                                       ` Rafael J. Wysocki
2011-01-26 23:28                                       ` Kevin Hilman
2011-01-26 23:28                                         ` [linux-pm] " Kevin Hilman
2011-01-27 18:13                                         ` Alan Stern
2011-01-27 18:13                                           ` Alan Stern
     [not found]                                           ` <Pine.LNX.4.44L0.1101271158530.2090-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2011-01-27 19:22                                             ` Kevin Hilman
2011-01-27 19:22                                               ` Kevin Hilman
2011-01-27 19:49                                               ` Alan Stern
2011-01-27 19:49                                                 ` Alan Stern
2011-01-27 20:15                                                 ` Kevin Hilman
     [not found]                                                 ` <Pine.LNX.4.44L0.1101271439020.2090-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2011-01-27 20:15                                                   ` [linux-pm] " Kevin Hilman
2011-01-27 20:15                                                     ` Kevin Hilman
     [not found]                                                     ` <87tyguje7j.fsf-l0cyMroinI0@public.gmane.org>
2011-01-27 22:18                                                       ` Vitaly Wool
2011-01-27 22:18                                                         ` Vitaly Wool
2011-01-27 22:18                                                     ` Vitaly Wool
2011-01-27 23:21                                                     ` Rafael J. Wysocki
2011-01-27 23:21                                                     ` [linux-pm] " Rafael J. Wysocki
2011-01-27 23:49                                                       ` Kevin Hilman
2011-01-27 23:49                                                       ` Kevin Hilman
2011-01-27 19:49                                               ` Alan Stern
2011-01-27 19:22                                           ` Kevin Hilman
2011-01-27 23:11                                           ` Rafael J. Wysocki
2011-01-27 23:11                                           ` [linux-pm] " Rafael J. Wysocki
2011-01-27 18:13                                         ` Alan Stern
2011-01-27 18:20                                         ` Vitaly Wool
     [not found]                                         ` <87k4hrtfcb.fsf-l0cyMroinI0@public.gmane.org>
2011-01-27 18:20                                           ` [linux-pm] " Vitaly Wool
2011-01-27 18:20                                             ` Vitaly Wool
2011-01-27 18:54                                             ` Kevin Hilman
2011-01-27 18:54                                             ` Kevin Hilman
2010-12-22 12:29                                   ` Rafael J. Wysocki
2010-12-21 21:31                             ` Rafael J. Wysocki
2010-12-21  0:57                         ` Alan Stern
2010-12-21 22:23                     ` Kevin Hilman
2010-12-21 22:23                     ` [linux-pm] " Kevin Hilman
2010-12-22  1:48                       ` Alan Stern
2010-12-22  1:48                         ` Alan Stern
2010-12-22  1:48                       ` Alan Stern
2010-12-23  7:51                     ` [linux-pm] " Ohad Ben-Cohen
2010-12-23 16:03                       ` Alan Stern
2010-12-23 16:03                       ` [linux-pm] " Alan Stern
2010-12-23 16:03                         ` Alan Stern
     [not found]                         ` <Pine.LNX.4.44L0.1012231055440.5617-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-25  7:34                           ` Ohad Ben-Cohen
2010-12-25  7:34                             ` Ohad Ben-Cohen
     [not found]                             ` <AANLkTi=aHU57xDq+-DWrN2sJsAwx_9bZ_ofy1rOmp0VH-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-25 16:21                               ` Alan Stern
2010-12-25 16:21                                 ` Alan Stern
     [not found]                                 ` <Pine.LNX.4.44L0.1012251046060.5079-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-25 20:58                                   ` Ohad Ben-Cohen
2010-12-25 20:58                                     ` Ohad Ben-Cohen
2010-12-25 21:50                                     ` Vitaly Wool
2010-12-25 21:50                                     ` [linux-pm] " Vitaly Wool
2010-12-26  5:27                                       ` Ohad Ben-Cohen
2010-12-26  5:27                                       ` Ohad Ben-Cohen
2010-12-25 21:54                                     ` Vitaly Wool
     [not found]                                     ` <AANLkTimj0E3Rz_8WQrU4wGg3ONyXzkUT9+U3Xqz7Cq0X-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-25 21:54                                       ` [linux-pm] " Vitaly Wool
2010-12-25 21:54                                         ` Vitaly Wool
2010-12-26  2:48                                     ` Alan Stern
2010-12-26  2:48                                     ` [linux-pm] " Alan Stern
2010-12-26  2:48                                       ` Alan Stern
2010-12-26  5:55                                       ` Ohad Ben-Cohen
     [not found]                                       ` <Pine.LNX.4.44L0.1012252041260.10725-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-26  5:55                                         ` [linux-pm] " Ohad Ben-Cohen
2010-12-26  5:55                                           ` Ohad Ben-Cohen
2010-12-26 11:45                                           ` Rafael J. Wysocki
2010-12-26 11:45                                           ` [linux-pm] " Rafael J. Wysocki
     [not found]                                             ` <201012261245.29680.rjw-KKrjLPT3xs0@public.gmane.org>
2010-12-26 12:43                                               ` Ohad Ben-Cohen
2010-12-26 12:43                                                 ` Ohad Ben-Cohen
2010-12-26 18:35                                                 ` Rafael J. Wysocki
2010-12-28 19:11                                                   ` Ohad Ben-Cohen
2010-12-28 19:21                                                     ` Rafael J. Wysocki
     [not found]                                                     ` <AANLkTimHHN+GesyhR6Jjnm771XLhn=inn=vrSk=mT6Mh-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-28 19:21                                                       ` [linux-pm] " Rafael J. Wysocki
2010-12-28 19:21                                                         ` Rafael J. Wysocki
2010-12-28 19:34                                                         ` Ohad Ben-Cohen
2010-12-28 19:34                                                         ` [linux-pm] " Ohad Ben-Cohen
2010-12-28 20:36                                                           ` Rafael J. Wysocki
2010-12-28 20:36                                                           ` [linux-pm] " Rafael J. Wysocki
2010-12-28 19:11                                                   ` Ohad Ben-Cohen
2010-12-26 18:35                                                 ` Rafael J. Wysocki
2010-12-26 12:43                                             ` Ohad Ben-Cohen
2010-12-26 14:53                                             ` [linux-pm] " Ohad Ben-Cohen
2010-12-26 18:37                                               ` Rafael J. Wysocki
2010-12-28 19:15                                                 ` Ohad Ben-Cohen
2010-12-28 19:15                                                 ` [linux-pm] " Ohad Ben-Cohen
     [not found]                                                   ` <AANLkTinewad6YxXvn5gnJQ+HJn41Sg96319GQn9KRKWj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-28 20:04                                                     ` Rafael J. Wysocki
2010-12-28 20:04                                                       ` Rafael J. Wysocki
     [not found]                                                       ` <201012282104.06232.rjw-KKrjLPT3xs0@public.gmane.org>
2010-12-28 20:41                                                         ` Ohad Ben-Cohen
2010-12-28 20:41                                                           ` Ohad Ben-Cohen
2010-12-28 20:41                                                       ` Ohad Ben-Cohen
2010-12-28 20:04                                                   ` Rafael J. Wysocki
2010-12-26 18:37                                               ` Rafael J. Wysocki
2010-12-26 14:53                                             ` Ohad Ben-Cohen
     [not found]                                           ` <AANLkTinyKfwcZLD5D4rdF6OpQqr79F==GRjAMBjjbupW-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-26 17:00                                             ` [linux-pm] " Alan Stern
2010-12-26 17:00                                               ` Alan Stern
2010-12-28 19:04                                               ` Ohad Ben-Cohen
     [not found]                                               ` <Pine.LNX.4.44L0.1012261050050.18773-100000-pYrvlCTfrz9XsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-12-28 19:04                                                 ` [linux-pm] " Ohad Ben-Cohen
2010-12-28 19:04                                                   ` Ohad Ben-Cohen
2010-12-28 21:46                                                   ` Alan Stern
2010-12-28 21:46                                                     ` Alan Stern
2010-12-29  6:34                                                     ` Ohad Ben-Cohen
2010-12-29  6:34                                                     ` [linux-pm] " Ohad Ben-Cohen
2010-12-30  4:25                                                       ` Alan Stern
2010-12-30  4:25                                                         ` Alan Stern
2010-12-30  4:25                                                       ` Alan Stern
2010-12-29  8:01                                                     ` [linux-pm] " Ohad Ben-Cohen
     [not found]                                                       ` <AANLkTi=QT1thWxy94=imJhbbcXQ1CD36=PnkAyaaA6Hj-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-12-30  4:30                                                         ` Alan Stern
2010-12-30  4:30                                                           ` Alan Stern
2010-12-30  4:30                                                       ` Alan Stern
2010-12-29  8:01                                                     ` Ohad Ben-Cohen
2010-12-28 21:46                                                   ` Alan Stern
2010-12-26 17:00                                           ` Alan Stern
2010-12-25 20:58                                 ` Ohad Ben-Cohen
2010-12-25 16:21                             ` Alan Stern
2010-12-25  7:34                         ` Ohad Ben-Cohen
2010-12-23  7:51                     ` Ohad Ben-Cohen
2010-12-18 16:00             ` Ohad Ben-Cohen
2010-12-18 15:07           ` Rafael J. Wysocki
2010-12-18 21:20           ` Alan Stern
2010-12-18 21:20           ` [linux-pm] " Alan Stern
2010-12-18 23:03             ` Rafael J. Wysocki
2010-12-18 23:03             ` [linux-pm] " Rafael J. Wysocki
2010-12-19 10:00             ` Ohad Ben-Cohen
2010-12-19 10:00             ` [linux-pm] " Ohad Ben-Cohen

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=4D0CC23E.6000509@csr.com \
    --to=david.vrabel@csr.com \
    --cc=ido@wizery.com \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux-pm@lists.linux-foundation.org \
    --cc=ohad@wizery.com \
    --cc=rjw@sisk.pl \
    --cc=stern@rowland.harvard.edu \
    /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.