From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 90510C433ED for ; Tue, 6 Apr 2021 19:14:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 572EA6044F for ; Tue, 6 Apr 2021 19:14:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240347AbhDFTPG (ORCPT ); Tue, 6 Apr 2021 15:15:06 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:51904 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231701AbhDFTPE (ORCPT ); Tue, 6 Apr 2021 15:15:04 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id D2BE21C0BC5; Tue, 6 Apr 2021 21:14:53 +0200 (CEST) Date: Tue, 6 Apr 2021 21:14:53 +0200 From: Pavel Machek To: Thierry Reding Cc: Pavel Machek , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Jonathan Hunter Subject: Re: [PATCH 5.10 079/126] drm/tegra: sor: Grab runtime PM reference across reset Message-ID: <20210406191452.GA25862@amd> References: <20210405085031.040238881@linuxfoundation.org> <20210405085033.686284735@linuxfoundation.org> <20210405154221.GB305@amd> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="d6Gm4EdcadzBjdND" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --d6Gm4EdcadzBjdND Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > > > However, these functions alone don't provide any guarantees at the > > > system level. Drivers need to ensure that the only a single consumer = has > > > access to the reset at the same time. In order for the SOR to be able= to > > > exclusively access its reset, it must therefore ensure that the SOR > > > power domain is not powered off by holding on to a runtime PM referen= ce > > > to that power domain across the reset assert/deassert operation. > >=20 > > Yeah, but it should not leak the PM reference in the error handling. >=20 > True. However the only reason why the code could realistically fail > between pm_runtime_resume_and_get() and pm_runtime_put() is if we did > not take the runtime PM reference (which would cause the call to > reset_control_acquire() to fail). >=20 > So the chances of this actually leaking are practically zero, so I > didn't want to bloat this bugfix with what's essentially dead code. I > can queue up your fix below for v5.14, though, since it's obviously > more correct from a theoretical point of view. Yes, that sounds like good solution, thanks! Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --d6Gm4EdcadzBjdND Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmBssywACgkQMOfwapXb+vIt3ACcD7swSealTFQpOV3oi6VRfvXd YEgAoIionJkH4CL8eN9W/fqhYk0MySi1 =o404 -----END PGP SIGNATURE----- --d6Gm4EdcadzBjdND--