From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752565AbcF3Wsl (ORCPT ); Thu, 30 Jun 2016 18:48:41 -0400 Received: from mail-pf0-f181.google.com ([209.85.192.181]:36490 "EHLO mail-pf0-f181.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751569AbcF3Wsj (ORCPT ); Thu, 30 Jun 2016 18:48:39 -0400 From: Kevin Hilman To: "Rafael J. Wysocki" Cc: Linux PM list , Arjan van de Ven , Linux Kernel Mailing List , Alan Stern , Ulf Hansson Subject: Re: [PATCH] PM / runtime: Asynchronous "idle" in pm_runtime_allow() Organization: BayLibre References: <2236951.5ps16Zk8OD@vostro.rjw.lan> Date: Thu, 30 Jun 2016 15:48:37 -0700 In-Reply-To: <2236951.5ps16Zk8OD@vostro.rjw.lan> (Rafael J. Wysocki's message of "Wed, 29 Jun 2016 02:53:48 +0200") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (darwin) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org "Rafael J. Wysocki" writes: > From: Rafael J. Wysocki > > Arjan reports that it takes a relatively long time to enable runtime > PM for multiple devices at system startup, because all writes to the > "control" attribute in sysfs are handled synchronously and if the > device is suspended as a result of the write, it will block until > that operation is complete. > > That may be avoided by passing the RPM_ASYNC flag to rpm_idle() > in pm_runtime_allow() which will make it execute the device's > "idle" callback asynchronously, so writes to "control" changing > it from "on" to "auto" will return without waiting. > > Reported-by: Arjan van de Ven > Signed-off-by: Rafael J. Wysocki Reviewed-by: Kevin Hilman