Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752391AbeABLVp (ORCPT + 1 other); Tue, 2 Jan 2018 06:21:45 -0500 Received: from mail-oi0-f50.google.com ([209.85.218.50]:45446 "EHLO mail-oi0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751357AbeABLVo (ORCPT ); Tue, 2 Jan 2018 06:21:44 -0500 X-Google-Smtp-Source: ACJfBosxAsneCNmqnkOxgTlYOdO8IP6LAP95cPk1pNwWr0j2IyxHnEo6CoFELLHVzwwoVRgZJxym+Z4o/EP/ZL+n1II= MIME-Version: 1.0 In-Reply-To: References: <4069324.Q7yJt6I4hJ@aspire.rjw.lan> <20180102105105.GA15376@wunner.de> From: "Rafael J. Wysocki" Date: Tue, 2 Jan 2018 12:21:43 +0100 X-Google-Sender-Auth: q96f2043RhNikcB5mRmj_5FXueg Message-ID: Subject: Re: [PATCH] PM / runtime: Rework pm_runtime_force_suspend/resume() To: Lukas Wunner Cc: Linux PM , Kevin Hilman , LKML , Ulf Hansson , Geert Uytterhoeven Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 2, 2018 at 12:02 PM, Rafael J. Wysocki wrote: > On Tue, Jan 2, 2018 at 11:51 AM, Lukas Wunner wrote: >> On Tue, Jan 02, 2018 at 01:56:28AM +0100, Rafael J. Wysocki wrote: [cut] > >> One addition that would be really helpful: pm_runtime_force_suspend() >> should also force-suspend all children and consumers of the given >> device. Likewise, those should be resumed on pm_runtime_force_resume(). >> Then I could just add a device link from the audio PCI device on the GPU >> to the graphics PCI device and just call pm_runtime_force_*() on the >> graphics device (supplier) to magically power them both off and on. > > Actually, the assumption is that pm_runtime_force_suspend() must be > called for the children before it is called for the parent even > without my patch, so it is just not going to work this way. Moreover, what if those devices have nonzero usage counters? There may be other reasons for that than just dependencies, like for example user space might have written "on" to their "control" files in sysfs. What you are looking for doesn't seem to match the runtime PM framework's assumptions, I'm afraid. Thanks, Rafael