Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751961AbaKCKFM (ORCPT ); Mon, 3 Nov 2014 05:05:12 -0500 Received: from gw-1.arm.linux.org.uk ([78.32.30.217]:53761 "EHLO pandora.arm.linux.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751710AbaKCKFK (ORCPT ); Mon, 3 Nov 2014 05:05:10 -0500 Date: Mon, 3 Nov 2014 10:04:42 +0000 From: Russell King - ARM Linux To: Krzysztof Kozlowski Cc: "Rafael J. Wysocki" , Len Brown , Pavel Machek , Jonathan Corbet , Dan Williams , Vinod Koul , Ulf Hansson , Alan Stern , linux-pm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Lars-Peter Clausen , Michal Simek , Kyungmin Park , Marek Szyprowski , Bartlomiej Zolnierkiewicz Subject: Re: [PATCH v8 3/5] amba: Don't unprepare the clocks if device driver wants IRQ safe runtime PM Message-ID: <20141103100442.GB4042@n2100.arm.linux.org.uk> References: <1413795888-18559-1-git-send-email-k.kozlowski@samsung.com> <1413795888-18559-4-git-send-email-k.kozlowski@samsung.com> <1479283.dvHduzBoyf@vostro.rjw.lan> <20141101005514.GY27405@n2100.arm.linux.org.uk> <20141101010113.GA3831@n2100.arm.linux.org.uk> <1415003805.4241.6.camel@AMDC1943> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1415003805.4241.6.camel@AMDC1943> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 03, 2014 at 09:36:45AM +0100, Krzysztof Kozlowski wrote: > On sob, 2014-11-01 at 01:01 +0000, Russell King - ARM Linux wrote: > > Would another possible solution be to remember the irq-safeness in the > > suspend handler, and use that in the resume handler? Resume should > > /always/ undo what the suspend handler previously did wrt clk API stuff. > > I think the second solution could be more readable. The WARN_ON wouldn't > be needed. However this won't solve the two dual nature of runtime > callbacks. > > I wondered also about removing runtime PM callbacks from amba/bus.c > completely and moving this to child drivers. This way runtime PM would > be obvious in each driver case. That makes it pretty horrid from the point of view of having bus management code, because we now have the management of the bus clock split between the bus layer and the device driver. This is /really/ a problem for runtime PM. Runtime PM permits there to be a bus layer involved - and runtime PM can also be coupled up to PM domains as well. For all this stuff, the context which the callbacks are called in depends on whether the driver itself has marked the device as having IRQ-safe callbacks. That's fine, but the bus and PM domain level code then /really/ needs to know what context they're being called in, so they know whether they can sleep or not, or they must to be written to always use non-sleeping functions so they work in both contexts. If we assume the former, then that implies that the irq-safe flag must never change state between a suspend and a resume. -- FTTC broadband for 0.8mile line: currently at 9.5Mbps down 400kbps up according to speedtest.net. -- 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/