Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4584222pxj; Tue, 8 Jun 2021 18:47:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPJNJMoePBB4TR8ivdtATL3q7i/5x8tAVliwn30kpgWFiDjdCX1Lf4H7hrWcsvSRfRi2YL X-Received: by 2002:a17:906:240b:: with SMTP id z11mr25942638eja.545.1623203253511; Tue, 08 Jun 2021 18:47:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623203253; cv=none; d=google.com; s=arc-20160816; b=FxVjrtFbrF73Z2tcR5Y1SdNEbt02xeiXL2Mr2XGRXtTYzl1hgyfag+kOmn+JbMt5iD v/stmbLPHKDXm12QZeDF8abXgbyqeKaD6xxZooHXmujOSjiq45l2vsxNGSveGHswzaSE y87ZZC46LrkPAUCGisbsYsWE8jxmoAz+sPPkEajdyaxXeqy1r5SrHyBANM3RxNx1YG/X KIIvz/+korEOBwjoU0FqBTINdb9/u1JB3bB5osP3xac1YJg6ELKWmfeh5P1UretsiaeV o0paPhmCHYaj5/FVAyMLfMsMNz/1RWnwOGu35r2f/yx3g34Y5eSW4/QUBYUToJhl0kbw XTlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=vFOK9jP+sVZ69YVXYVOXv71Mf62sDq8ik7sunZCsEp0=; b=em5oMLaMHfHkrmhOTz+bU+DY3pKShEP12vYggIDPCNFEc2BJO4ZzNqdyPVI/osO+9+ lYPfFxA6lbjpWU9c/bq2fWtmzBB/fwkCM1PrMNqn82XC8z5U/zA1aEsFSQ5NE/dH2ETL KKJn/PdfR7Y5GXUax+9oa1KH3Ng1/Oo6SqnmkWTgopLPHV8ce2/9/Ny/0sLfjyn4Nl3V bEdPlkcDxoeO9Jhft4d8G7KFUT410B/b4nVgcqzHjDnJDsSAwkbDZA/9RsDXAXPk4Yff zESA7FI266cR4FaG3hXb/1OM8+R0tUg2Hvdo/TFk7qWVK9jVpPnYTt2JIgHkAaxv03NG GlAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j16si1230047edw.43.2021.06.08.18.47.10; Tue, 08 Jun 2021 18:47:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233300AbhFHO0w (ORCPT + 99 others); Tue, 8 Jun 2021 10:26:52 -0400 Received: from netrider.rowland.org ([192.131.102.5]:47261 "HELO netrider.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S233326AbhFHO0w (ORCPT ); Tue, 8 Jun 2021 10:26:52 -0400 Received: (qmail 1805405 invoked by uid 1000); 8 Jun 2021 10:24:58 -0400 Date: Tue, 8 Jun 2021 10:24:58 -0400 From: Alan Stern To: Ulf Hansson Cc: "Rafael J . Wysocki" , linux-pm@vger.kernel.org, Saravana Kannan , Adrian Hunter , Tony Lindgren , Kevin Hilman , Geert Uytterhoeven , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/3] PM: runtime: Update behaviour for no callbacks Message-ID: <20210608142458.GD1804083@rowland.harvard.edu> References: <20210608090250.85256-1-ulf.hansson@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210608090250.85256-1-ulf.hansson@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jun 08, 2021 at 11:02:47AM +0200, Ulf Hansson wrote: > While reviewing a patch on the mmc-list, I ended up inspecting the behaviour of > how we deal with the no callback case for runtime PM. > > A couple of observations: > > *) When pm_runtime_no_callbacks() have been called, it allows the PM core to > takes a quicker path, but at the same time, consumer/supplier device links are > being skipped in rpm_resume|suspend(). > > **) Calling pm_runtime_no_callbacks() to avoid boiler plate code (assigning > empty functions to ->runtime_suspend|resume()), doesn't work if there could be > consumer/supplier device link being used or a platform dependent PM domain that > could get attached to the device. > > Therefore, this series suggests to change the behaviour in the PM core, to > allow the ->runtime_suspend|resume() callbacks to be unassigned. This is already > supported for ->runtime_idle() callbacks, so it would also move things into a > more consistent behaviour. > > I have looked at various error paths, in the kernel of callers of > pm_runtime_get_sync(). I couldn't find anyone that made sense, that looked for > the special error code, -ENOSYS, which is the error code getting returned when a > callback is missing. Whether that is sufficient proof that these changes are > 100% safe, I can't guarantee, but I think it would be worth a try as the > benefits of avoiding boilerplate code and the corresponding additional code > paths are quite nice, if you ask me. In principle I have no objection to these changes. It's likely that if any problems do crop up, we'll be able to fix them pretty easily. For patches 1 and 2: Acked-by: Alan Stern Alan Stern