Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp8609881rwr; Thu, 11 May 2023 03:59:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5inje1QICS1T7z6VXY+/qn/SV+wyuyHwEZQMxlQBN+PkNAPzrENkYMiiBjvVtif86goFI/ X-Received: by 2002:a05:6a00:1d14:b0:643:90ee:56f with SMTP id a20-20020a056a001d1400b0064390ee056fmr27154475pfx.1.1683802748500; Thu, 11 May 2023 03:59:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683802748; cv=none; d=google.com; s=arc-20160816; b=SDwbfuPnJxMec8bE61QQvS9cHIZNY/CdjenYNuRuNCgrsWAFm9bq5rOeB6bs7CePAK BfBncbb9YLkCRZ9rpH3Hovcg2BLOpU75iLlNiq5VbWNhWwiEDLUI7zzH/POui3KWvC7c zrwhUklICrtAau79mJ2Bxhsc5UVspI3M8ofgAgXvThEZpuMQeDYWEdrKrXDJheNAtQ6N W3GVzl2coo0/s9FqQQNC3xM8DqjaymTEXH1ikkniYC1jzXcKg7ANY1Jl1rn61oldH87v sUmHWme9/Uo6ZBDyUPlgV1UjyeXytpaBfbNsDtJsnSz0q7GsJpXCLLSdeyoy7ycc+X40 /z5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=V8/pdl3kkCzJJ2xX+2FoCGV5Lgvbow4SCzx3xoUBnIQ=; b=S3fCpRU5VIESMQz9q0yd+/oC7Fmk7PGTqKjmMWbfF7mu2gq85SLXDAsAP0GR09D3Cf PcexfwQo53OKdcAYo8x9hD2aWe7Yj/wugw5k7IHcytC/z65yEnVJeyksn060JDkK/iBp VlhB8xW+X2RxqkZXs9diQIIz3mVh+lowwSfOiFs8HBwhv+ynKIWeonREV0Z2fAsG/Egp TDbsECZ/m/gXVEjRHelbI9hRUIDiZLaHu/Nnk3/oeQTxj8j7TKMNnCnb9SJeW/BbHBf9 wF0cOU38bi1g8mSyUNs8RH+saf3ul97YTDMl1lqKQJ/CLEHDQjA/pU8xjaerCBsnlXvM +tMA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i6-20020a056a00004600b00643bac6f81esi7397362pfk.16.2023.05.11.03.58.54; Thu, 11 May 2023 03:59:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237831AbjEKKjd (ORCPT + 99 others); Thu, 11 May 2023 06:39:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229548AbjEKKja (ORCPT ); Thu, 11 May 2023 06:39:30 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0FAD1FDA for ; Thu, 11 May 2023 03:39:28 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1px3hk-0007Op-PQ; Thu, 11 May 2023 12:39:24 +0200 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1px3hj-002hiF-Ty; Thu, 11 May 2023 12:39:23 +0200 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1px3hj-003NcI-8D; Thu, 11 May 2023 12:39:23 +0200 Date: Thu, 11 May 2023 12:39:23 +0200 From: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= To: "Rafael J. Wysocki" Cc: Greg Kroah-Hartman , linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH] driver core: Call pm_runtime_put_sync() only after device_remove() Message-ID: <20230511103923.hvibdyo5ges4bab2@pengutronix.de> References: <20230511073428.10264-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="7m2fk3b3fmff72si" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --7m2fk3b3fmff72si Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, May 11, 2023 at 12:18:09PM +0200, Rafael J. Wysocki wrote: > On Thu, May 11, 2023 at 9:34=E2=80=AFAM Uwe Kleine-K=C3=B6nig > wrote: > > > > Many drivers that use runtime PM call pm_runtime_get_sync() or one of > > its variants in their remove callback. So calling pm_runtime_put_sync() > > directly before calling the remove callback results (under some > > conditions) in the driver's suspend routine being called just to resume > > it again afterwards. > > > > So delay the pm_runtime_put_sync() call until after device_remove(). > > > > Confirmed on a stm32mp157a that doing > > > > echo 4400e000.can > /sys/bus/platform/drivers/m_can_platform/un= bind > > > > (starting with a runtime-pm suspended 4400e000.can) results in one call > > less of m_can_runtime_resume() and m_can_runtime_suspend() each after > > this change was applied. > > > > Signed-off-by: Uwe Kleine-K=C3=B6nig >=20 > I'm not against this change, although I kind of expect it to trigger > some fallout that will need to be addressed. So caveat emtor. >=20 > Anyway >=20 > Reviewed-by: Rafael J. Wysocki Thanks for your review tag. I wondered if there will be some fallout, and don't know what to expect yet. Sounds like getting it into next soon is a good idea?! Best regards Uwe --=20 Pengutronix e.K. | Uwe Kleine-K=C3=B6nig = | Industrial Linux Solutions | https://www.pengutronix.de/ | --7m2fk3b3fmff72si Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEP4GsaTp6HlmJrf7Tj4D7WH0S/k4FAmRcxdkACgkQj4D7WH0S /k7jXAgAqiN5Sx0I4QVbgbmz3wNVPRVsHVwlqohYzZRSi/SoXrO5XouqiedZTlxb N+rfTwegroja2y5jUYhZ6t/g6G6a76fXzwgYV8Mit/bcspRd7oxAlvgGVOzzi8DC qUEWRVzDXgTTnZO++4TIxv55SVV0+fYGi87LzObnh/Iq7URXNjlnCpLNgUZGgdoI fUPjs6NTmEOFVh6BbC60/7ArxaLwJJLjo4gHzfjt+BaCr8GjwtUoxjgmst3kfV4x v8Cjx6JANS4QLSPv5oZ7HGjzAZLEX5bBnvGwmEvufFPyEt04F6ypOe2k7Df9/0r0 DIZm1vX5Ce1vQEI72CJWBZPRUL0/Mw== =Sp3J -----END PGP SIGNATURE----- --7m2fk3b3fmff72si--