From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Rafael J. Wysocki" Subject: Re: subtle pm_runtime_put_sync race and sdio functions Date: Sun, 26 Dec 2010 19:37:21 +0100 Message-ID: <201012261937.21256.rjw__24322.5661143244$1293388715$gmane$org@sisk.pl> References: <201012261245.29680.rjw@sisk.pl> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: linux-pm-bounces@lists.linux-foundation.org Errors-To: linux-pm-bounces@lists.linux-foundation.org To: Ohad Ben-Cohen Cc: linux-wireless@vger.kernel.org, linux-mmc@vger.kernel.org, Ido Yariv , linux-pm@lists.linux-foundation.org, Johannes Berg List-Id: linux-pm@vger.kernel.org On Sunday, December 26, 2010, Ohad Ben-Cohen wrote: > On Sun, Dec 26, 2010 at 1:45 PM, Rafael J. Wysocki wrote: > > (It still is not a race, though.) > > Thread 1 > ======= > > suspend_handler_of_a_random_device() > { > return failure; > } > > Thread 2 > ======= > > suspend_handler_of_our_mmc_host_controller() > { > invoke our sdio suspend handler and power down the card (directly); > return success; > } > > If thread 2 wins => everything is cool > If thread 1 wins => our driver will not be able to resume > > The race begins after mac80211 invokes our driver's power off handler, > which is using pm_runtime_put_sync(). So, it only happens during asynchronous suspend? In other words, if suspend is synchronous, everything should be fine, right? Rafael