From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751701AbdKOHXC (ORCPT ); Wed, 15 Nov 2017 02:23:02 -0500 Received: from mail-io0-f173.google.com ([209.85.223.173]:38981 "EHLO mail-io0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750882AbdKOHW4 (ORCPT ); Wed, 15 Nov 2017 02:22:56 -0500 X-Google-Smtp-Source: AGs4zMZ1Ja1y0CcxIi9q7E5DpJtYJO/CG+NH6fUfo+xVEVJkYd4rTPHoH4x1jGwD8j+OOgM6cFgee6O8P2RWKYV4PIg= MIME-Version: 1.0 In-Reply-To: <5072995.lhOZmqyh0S@aspire.rjw.lan> References: <1713438.irjm9MTSvo@aspire.rjw.lan> <5072995.lhOZmqyh0S@aspire.rjw.lan> From: Ulf Hansson Date: Wed, 15 Nov 2017 08:22:54 +0100 Message-ID: Subject: Re: [PATCH] PM / runtime: Drop children check from __pm_runtime_set_status() To: "Rafael J. Wysocki" Cc: Linux PM , LKML , Greg Kroah-Hartman , Alan Stern , Linus Walleij Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [...] >> >> When pm_runtime_set_suspended(dev) is called, dev's child device may >> still be runtime PM enabled and active. >> I was suggesting to add a check for this scenario, to see if dev's >> child device is runtime PM is enabled, as and additional constraint >> before deciding to return an error code. > > Well, that's sort of difficult to do, however, because the code would need to > walk all of the children of the device and the child power lock cannot be > acquired under the one of the parent, so it would be fragile and ugly. Yeah, you have a point. > >> The idea was to get a consistent behavior, from the >> pm_runtime_set_active|suspended() APIs point of view, and not from the >> runtime PM core point of view. > > Yes, but the cost is high and the benefit is shallow. > > The enable-time WARN() should cover the really broken cases without that > much complexity. Fair enough! Feel free to add: Reviewed-by: Ulf Hansson Kind regards Uffe