From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755357Ab1IMQEm (ORCPT ); Tue, 13 Sep 2011 12:04:42 -0400 Received: from ogre.sisk.pl ([217.79.144.158]:60384 "EHLO ogre.sisk.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755283Ab1IMQEg (ORCPT ); Tue, 13 Sep 2011 12:04:36 -0400 From: "Rafael J. Wysocki" To: Ming Lei Subject: Re: [PATCH 2/5] PM / Runtime: Do not run callbacks under lock for power.irq_safe set Date: Tue, 13 Sep 2011 18:06:38 +0200 User-Agent: KMail/1.13.6 (Linux/3.1.0-rc4+; KDE/4.6.0; x86_64; ; ) Cc: Linux PM mailing list , LKML , "Linux-sh list" , Magnus Damm , Kevin Hilman , jean.pihet@newoldbits.com References: <201108310017.03103.rjw@sisk.pl> <201109122344.02386.rjw@sisk.pl> In-Reply-To: MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201109131806.39050.rjw@sisk.pl> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tuesday, September 13, 2011, Ming Lei wrote: > Hi, > > On Tue, Sep 13, 2011 at 5:44 AM, Rafael J. Wysocki wrote: > > Hi, > > > > On Monday, September 12, 2011, Ming Lei wrote: > > > >> Hi, > > > >> > > > >> On Wed, Aug 31, 2011 at 6:20 AM, Rafael J. Wysocki wrote: > > > >> > From: Rafael J. Wysocki > > > >> > > > > >> > The rpm_suspend() and rpm_resume() routines execute subsystem or PM > > > >> > domain callbacks under power.lock if power.irq_safe is set for the > > > >> > given device. This is inconsistent with that rpm_idle() does after > > > >> > commit 02b2677 (PM / Runtime: Allow _put_sync() from > > > >> > interrupts-disabled context) and is problematic for subsystems and PM > > > >> > domains wanting to use power.lock for synchronization in their > > > >> > runtime PM callbacks. For this reason, make runtime PM core functions > > > >> > always release power.lock before invoking subsystem or PM domain > > > >> > > > >> If power.lock is released, the transition states(resuming or suspending) > > > >> may be observed in rpm_suspend or rpm_resume, then tasks schedule > > > >> will be produced in these two functions, > > > > I don't think so, because the interrupts are still off. > > Yes, the interrupts are still off on local CPU, but the release of spin lock may > cause another CPUs to run into rpm_suspend or rpm_resume and produce > task schedule inside the two functions. Not for the same device, though. Also, I'm not quite sure what scenario exactly are you referring to. Could you please give an example? Thanks, Rafael