Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1937171rwd; Wed, 17 May 2023 03:36:51 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5dpLkND7J0IpdI9O1q6Jaqji8hI6Fdh3Evg25iU3kJsZ6MQV3UHZzcEaOHBdpsdvnci/z7 X-Received: by 2002:a17:902:a417:b0:19e:e001:6a75 with SMTP id p23-20020a170902a41700b0019ee0016a75mr17154648plq.6.1684319811356; Wed, 17 May 2023 03:36:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684319811; cv=none; d=google.com; s=arc-20160816; b=aOifTldvGg9Iq3oKmAqZ72VpSchOWSc3X7TilUvqpLCuvwtP0A9wxjQxDhQIkyUs1s utSSYzg7F8x92PHvt41sExcfuAlb0fgHaC9xqeAceYzFkZGe0/Lq9/BRoo3UwspSEiqg EAv41TQveJDQXwHzwuYXKzPT8AiAOd7p1sCDRlIlV+YdwLy1/BGX31HINU9e8390XTcI gJDRwD4MFsZEF1Eca/Vb/77+QiVRSOhtu99YQMW1nWYsii+vr2IieB13iZ1UJlo4Eqkz 9WSzeWYhrJyb50eH7l3MJUuw3GZe4y45S4dJ0kfXpDNqJCPT3lHa76UXyiHjgQjp/HWm QCUQ== 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=ElxSiogDU2Od5grJzGJ8xMnCSk8PXok1ewMhMAK6ke0=; b=sWS8bWwsPfrA5if8Oum2sU3dmB9lBulApqHcsSM8CqHFw5NUZqwwjhUPKnEdMuJ6MW Ym2PL7rGpzqDKNpXBulrYV9f8pUY0THzMHmHHDbPwxEWlRnUHtHnwHKOv/QCw92DEla6 /HTHwxp0hkBp54MZgVLvLUpEv+fLXNAZJBWNsQdt3EcXqjNen04SOPPrlrEHkpKgW2lj jiCchOWfqNXHLmuVSeDL+D+aLrzxgBKg04JZk0Tr5F88ATA7R8nHIVy8IVBeV4WWaWgH IvOGu9EpcbWLFmqrOEhomRbSybV6mVcqe5wtcH1iSFhP2r26vI5CPwF2Zgl1EcjY2v7l LP/Q== 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 m5-20020a170902db0500b001a99ace3e76si22923189plx.554.2023.05.17.03.36.36; Wed, 17 May 2023 03:36:51 -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 S229947AbjEQJzh (ORCPT + 99 others); Wed, 17 May 2023 05:55:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229775AbjEQJzf (ORCPT ); Wed, 17 May 2023 05:55:35 -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 98100A6 for ; Wed, 17 May 2023 02:55:34 -0700 (PDT) Received: from moin.white.stw.pengutronix.de ([2a0a:edc0:0:b01:1d::7b] helo=bjornoya.blackshift.org) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pzDsW-0005cr-K3; Wed, 17 May 2023 11:55:28 +0200 Received: from pengutronix.de (unknown [172.20.34.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: mkl-all@blackshift.org) by smtp.blackshift.org (Postfix) with ESMTPSA id DC2AA1C6F22; Wed, 17 May 2023 09:55:27 +0000 (UTC) Date: Wed, 17 May 2023 11:55:27 +0200 From: Marc Kleine-Budde To: Johan Hovold Cc: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, kernel@pengutronix.de, "Rafael J. Wysocki" Subject: Re: [PATCH] driver core: Call pm_runtime_put_sync() only after device_remove() Message-ID: <20230517-amigo-depth-00436cd21520-mkl@pengutronix.de> References: <20230511073428.10264-1-u.kleine-koenig@pengutronix.de> <20230511103923.hvibdyo5ges4bab2@pengutronix.de> <20230512184925.d7w3j4r7oajtpsxi@pengutronix.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3wt7jlt2pkr75bmw" Content-Disposition: inline In-Reply-To: X-SA-Exim-Connect-IP: 2a0a:edc0:0:b01:1d::7b X-SA-Exim-Mail-From: mkl@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,URIBL_BLOCKED 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 --3wt7jlt2pkr75bmw Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 17.05.2023 10:28:01, Johan Hovold wrote: > Right, but we do have drivers that have CONFIG_PM as an explicit > dependency. >=20 > > In the end something like 72362dcdf654 ("can: mcp251xfd: > > mcp251xfd_unregister(): simplify runtime PM handling") might be an > > approach. But IMHO it's more complicated than it should be and honestly > > I'm not sure if it's safe and correct this way. >=20 > Yeah, unfortunately runtime PM is fairly underspecified so we end up > with this multitude of implementations, many of which are broken in > various ways. A smaller API with documented best-practices may have > helped, but that's not where we are right now. >=20 > Looks like 72362dcdf654 ("can: mcp251xfd: mcp251xfd_unregister(): > simplify runtime PM handling") introduces yet another way to do things, > and which will break if anyone enables (or tries to use this pattern in > another driver with) autosuspend... ACK - I think in that driver it works, as the runtime PM is resumed during interface up and suspended in interface down. IMHO autosuspend would not bring any benefits here... regards, Marc --=20 Pengutronix e.K. | Marc Kleine-Budde | Embedded Linux | https://www.pengutronix.de | Vertretung N=C3=BCrnberg | Phone: +49-5121-206917-129 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 | --3wt7jlt2pkr75bmw Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAABCgAdFiEEDs2BvajyNKlf9TJQvlAcSiqKBOgFAmRkpIwACgkQvlAcSiqK BOhzbAf8DWsOJ0mjyWBBY0Q+gWS12dT8Rvj/nRDr0prMJppQqSwDt5fMVojtTcPO tn520MDhPhYdS00ufsnJj7hHfjBHEs/UAtJcqOqNGvAaY9KSG0f3T4SfBEfwDUF3 YEAjr7fSYfl1MFfx815+m3kGse1nd4VMclqa0fsucc5z+0bO7MnhAszj22cXKPHZ JztBSMB3MFa+YlhCU5uXTumqemLK8oUjyI9HOuyc+uO6QM7rKcnkKeNnz+4xS1Gc HrgBZcpBqFie8qOO2K9FQbyXU00iJxRc12iteaX77Prsau9kXfbIdpEr3Plo/KXU X+mLuXKrYuC1GAlHX6RPtP2xyU/LiQ== =J+hB -----END PGP SIGNATURE----- --3wt7jlt2pkr75bmw--