Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4907302pxu; Tue, 13 Oct 2020 09:51:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZ+P/Fp0t5rpNaPcch26tczhWJ4AniniOp6YLZKX7KtU+g261s5/FrcNpNC0d7VULa5hBr X-Received: by 2002:a17:906:52c6:: with SMTP id w6mr632449ejn.199.1602607882486; Tue, 13 Oct 2020 09:51:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602607882; cv=none; d=google.com; s=arc-20160816; b=bpP/mdEL2f89mD2grmdqoqmSghcREf5AE3Vw2AOyKYasrdxhyovcf3sst7kGtGKF4A hO8jr3afAL1BQRVcNEwGnuaULoO9qkDCwUGvfw7Bj1oqAoflLVIMpSk1WdqHCD/GEpYN pOa3eSKw4F7I4y8ptebReerAynADpdmDijlehK5MHwbFJ/biPh4DTBZs+yutkTXGQGF3 OQgrxg+YwEvIZbsTYf7r1QdnXNwHJQUwi7D5Ixo4hsT20q7QbIehYqDVwdZJSMUJvJqo wJCjqUPIFBwo9n1mhOghd/YKhknkB3D/L/+Pv6fZ5uReeNG/TVnDJlO0EuYdHBE7M0QH yCSw== 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=hjbUEfx1NuvySd28lU9UGjY9JvW4fzN6udCrfbIoq1c=; b=BOTrcdnP9D0U1On7PNT85eVOfp7TQ03pG/hVDV07Y8aTQvWOQmlApE2t6XbcBxYUxK D+E+vxb5PCVflGMhcCQLJjXhFuxlPvjprmyY2mPhtrW4M4+dAGQaFDaTYvn47w1GVufj pqeeQ/Ys92TMjQ7PQaghF8+G4XofKSq0FNUliT3rAUSDX9gmOi0qQomTJ4o+VDdK+CFY oqROtHmLorUxalIT1Kf6wU6sL8wO9XjYZ90TC16CC+QOaUyicQyYW7Adeo8B5fyLkaPq ZzbrIZ2Roz1waj1cw26HBzvfoi6il9NmL8CrIcWHbNm7DpZXWFC9dw2UCjWmaHg+8ffm /PqQ== 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 d2si189074ejm.262.2020.10.13.09.50.59; Tue, 13 Oct 2020 09:51:22 -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 S2388527AbgJMOOY (ORCPT + 99 others); Tue, 13 Oct 2020 10:14:24 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:33820 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388488AbgJMOOX (ORCPT ); Tue, 13 Oct 2020 10:14:23 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id EE30A1C0B77; Tue, 13 Oct 2020 16:14:21 +0200 (CEST) Date: Tue, 13 Oct 2020 16:14:21 +0200 From: Pavel Machek To: Marek Szyprowski Cc: Pavel Machek , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Yu Kuai , Joerg Roedel , Sasha Levin Subject: Re: [PATCH 4.19 27/38] iommu/exynos: add missing put_device() call in exynos_iommu_of_xlate() Message-ID: <20201013141421.GA22886@duo.ucw.cz> References: <20201005142108.650363140@linuxfoundation.org> <20201005142109.977461657@linuxfoundation.org> <20201007094737.GA12593@duo.ucw.cz> <5b869c86-8d35-e834-4fec-6b63a942e484@samsung.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9jxsPFA5p3P2qPhR" Content-Disposition: inline In-Reply-To: <5b869c86-8d35-e834-4fec-6b63a942e484@samsung.com> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --9jxsPFA5p3P2qPhR Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! > >> From: Yu Kuai > >> > >> [ Upstream commit 1a26044954a6d1f4d375d5e62392446af663be7a ] > >> > >> if of_find_device_by_node() succeed, exynos_iommu_of_xlate() doesn't h= ave > >> a corresponding put_device(). Thus add put_device() to fix the excepti= on > >> handling for this function implementation. > > Okay, this looks reasonable, but... > > > > Do we miss put_device() in normal path, too? I'd expect another > > put_device at end of exynos_iommu_of_xlate() or perhaps in release > > path somewhere... >=20 > Frankly, there is no release path, so there is no need for put_device.=20 > Once initialized, Exynos IOMMU stays in the system forever. There is no= =20 > point to remove IOMMU nor the API for that. Keeping increased refcount=20 > for its device just matches this behavior. >=20 > If the missing put_device() is really a problem, then we can move it=20 > from the error path just after data =3D platform_get_drvdata(sysmmu)=20 > assignment. Feel free to send a patch if you think this is a more=20 > appropriate approach. exynos_iommu_detach_device() looks like a place where resources could be freed? But if there's no release path, we don't really need to do anythi= ng.=20 Sorry about the noise. Best regards, Pavel --=20 DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany --9jxsPFA5p3P2qPhR Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iF0EABECAB0WIQRPfPO7r0eAhk010v0w5/Bqldv68gUCX4W2PQAKCRAw5/Bqldv6 8m7vAJ4iXq02bm6+RavPQxrGMERfz/4fsQCfQdFAYbgb57aGCx7w0yA3EfNXz4Y= =CDgo -----END PGP SIGNATURE----- --9jxsPFA5p3P2qPhR--