Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756175AbYBXUK4 (ORCPT ); Sun, 24 Feb 2008 15:10:56 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752548AbYBXUKs (ORCPT ); Sun, 24 Feb 2008 15:10:48 -0500 Received: from gprs189-60.eurotel.cz ([160.218.189.60]:55163 "EHLO amd.ucw.cz" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752525AbYBXUKr (ORCPT ); Sun, 24 Feb 2008 15:10:47 -0500 Date: Sun, 24 Feb 2008 21:11:05 +0100 From: Pavel Machek To: Alan Stern Cc: "Rafael J. Wysocki" , Pierre Ossman , Zdenek Kabelac , Kernel development list , pm list Subject: Re: [Bug 10030] Suspend doesn't work when SD card is inserted Message-ID: <20080224201105.GC18908@elf.ucw.cz> References: <20080224182120.GB3886@ucw.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Warning: Reading this can be dangerous to your mental health. User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1358 Lines: 38 Hi! > > > @@ -25,6 +25,7 @@ > > > #include > > > #include > > > #include > > > +#include > > > > > > #include "../base.h" > > > #include "power.h" > > > @@ -59,6 +60,13 @@ static DECLARE_RWSEM(pm_sleep_rwsem); > > > > > > int (*platform_enable_wakeup)(struct device *dev, int is_on); > > > > > > +static struct task_struct *suspending_task; > > > > What locking protects this variable? What happens when suspending_task > > exits? (Hmm, that would probably be bug, anyway?) > > It's protected by whatever existing locking scheme allows only one > task to start a system sleep at a time. For example, the suspending > task has to get a write lock on pm_sleep_rwsem. And readers of suspending_task are protected by? At the very least, you'd need rmb() before reading it and wmb() after writing to it, but I'm not sure if that's enough on every obscure architecture out there. Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html -- 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/