From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ulf Hansson Subject: Re: [PATCH] spi/pl022: Activate resourses before deactivate them in suspend Date: Sun, 28 Oct 2012 21:28:44 +0100 Message-ID: References: <1349423012-18048-1-git-send-email-ulf.hansson@stericsson.com> <20121027214642.GH4564@opensource.wolfsonmicro.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Vipul Kumar Samar , Russell King , Viresh Kumar , Mark Brown , "Rafael J. Wysocki" , Alan Stern , spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org, Ulf Hansson , linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Linus Walleij Return-path: In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On 28 October 2012 20:52, Linus Walleij wrote: > On Sat, Oct 27, 2012 at 11:46 PM, Mark Brown > wrote: >> On Fri, Oct 05, 2012 at 09:43:32AM +0200, Ulf Hansson wrote: >> >>> To be able to deactivate resourses in suspend, the resourses must >>> first be surely active. This is done with a pm_runtime_get_sync. >>> Once the resourses are restored to active state again in resume, >>> the runtime pm usage count can be decreased with a pm_runtime_put. >> >> The PM core will ensure devices are runtime resumed before we enter >> suspend precisely due to this sort of issue. > > I asked the very same question to Ulf (in speech, sorry > so you couldn't see it...) > > So I guess we are talking about drivers/base/main.c > > in device_prepare() > pm_runtime_get_noresume() is called This will increase the "usage_counter" for the device. It will not "runtime_resume" the device, though it will prevent it from being "runtime_suspended". > and in device_complete() > pm_runtime_put_sync() is called. > > Both put into current for in > commit 88d26136a256576e444db312179e17af6dd0ea87 > on sep 19th. > > Yes it seems like it will do the job. > > Ulf can you comment on this... > > Yours, > Linus Walleij Kind regards Ulf Hansson ------------------------------------------------------------------------------ WINDOWS 8 is here. Millions of people. Your app in 30 days. Visit The Windows 8 Center at Sourceforge for all your go to resources. http://windows8center.sourceforge.net/ join-generation-app-and-make-money-coding-fast/