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=-9.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 5C421C4363A for ; Tue, 27 Oct 2020 09:26:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1033D2225C for ; Tue, 27 Oct 2020 09:26:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2509900AbgJ0J0s (ORCPT ); Tue, 27 Oct 2020 05:26:48 -0400 Received: from relay2-d.mail.gandi.net ([217.70.183.194]:51855 "EHLO relay2-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2509895AbgJ0J0s (ORCPT ); Tue, 27 Oct 2020 05:26:48 -0400 X-Originating-IP: 93.29.109.196 Received: from aptenodytes (196.109.29.93.rev.sfr.net [93.29.109.196]) (Authenticated sender: paul.kocialkowski@bootlin.com) by relay2-d.mail.gandi.net (Postfix) with ESMTPSA id DD2A340015; Tue, 27 Oct 2020 09:26:38 +0000 (UTC) Date: Tue, 27 Oct 2020 10:26:38 +0100 From: Paul Kocialkowski To: Maxime Ripard Cc: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devel@driverdev.osuosl.org, linux-sunxi@googlegroups.com, Mauro Carvalho Chehab , Rob Herring , Chen-Yu Tsai , Yong Deng , Kishon Vijay Abraham I , Vinod Koul , Helen Koike , Greg Kroah-Hartman , Philipp Zabel , Hans Verkuil , Sakari Ailus , Thomas Petazzoni , Hans Verkuil , kevin.lhopital@hotmail.com Subject: Re: [PATCH 03/14] media: sun6i-csi: Support an optional dedicated memory pool Message-ID: <20201027092638.GC168350@aptenodytes> References: <20201023174546.504028-1-paul.kocialkowski@bootlin.com> <20201023174546.504028-4-paul.kocialkowski@bootlin.com> <20201026154104.v32up7uh6oryqxaf@gilmour.lan> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="69pVuxX8awAiJ7fD" Content-Disposition: inline In-Reply-To: <20201026154104.v32up7uh6oryqxaf@gilmour.lan> Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org --69pVuxX8awAiJ7fD Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon 26 Oct 20, 16:41, Maxime Ripard wrote: > On Fri, Oct 23, 2020 at 07:45:35PM +0200, Paul Kocialkowski wrote: > > This allows selecting a dedicated CMA memory pool (specified via > > device-tree) instead of the default one. > >=20 > > Signed-off-by: Paul Kocialkowski >=20 > Why would that be needed? Sorry for the confusion, this is indeed unrelated to the current series and it is not needed for MIPI CSI-2 support. However, I think it's a worthwhile addition to the driver. I will take it out of the series and re-submit it separately then. > > --- > > drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c | 8 ++++++++ > > 1 file changed, 8 insertions(+) > >=20 > > diff --git a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c b/drive= rs/media/platform/sunxi/sun6i-csi/sun6i_csi.c > > index 28e89340fed9..5d2389a5cd17 100644 > > --- a/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c > > +++ b/drivers/media/platform/sunxi/sun6i-csi/sun6i_csi.c > > @@ -16,6 +16,7 @@ > > #include > > #include > > #include > > +#include > > #include > > #include > > #include > > @@ -849,6 +850,12 @@ static int sun6i_csi_resource_request(struct sun6i= _csi_dev *sdev, > > return PTR_ERR(sdev->regmap); > > } > > =20 > > + ret =3D of_reserved_mem_device_init(&pdev->dev); > > + if (ret && ret !=3D -ENODEV) { > > + dev_err(&pdev->dev, "Unable to init reserved memory\n"); > > + return ret; > > + } > > + > > sdev->clk_mod =3D devm_clk_get(&pdev->dev, "mod"); >=20 > If that clk_get or any subsequent function fail you'll end up leaking > whatever the initialization of the reserved memory has allocated Right, there's a missing of_reserved_mem_device_release in the error path h= ere. Thanks! Paul --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --69pVuxX8awAiJ7fD Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAl+X584ACgkQ3cLmz3+f v9FxYAf/Ub94G9WZnyvpvke4BYJGrlHPAnZqKjmkgjeXotEjAs6FwGm6O6I+M6Yp JxGnG/1WIaU4lCJQXscCtQJNUMb9oiFPd+agJyZCh6xfgK907/s4GJzMjGpWLeaa /f0JtK1jsl+rkglVn0wdEPM5/EiZGhVD1sTS183WgQ2TdkeIHxACvf9/h/1Z5H6e ZJPJAVBOKnDxkoEh7dWkwAjPch6Arjk+OuYhRk4OcK86IVcqzLj3M/ACzADFa4Tw +VomSUxExN5nmJaCyRNrMJlv940nICwaXwCgLJYvC4yyJgJgXtnAi8cBeuA+oZi4 KKp3bDm6HR5bz9k++lP/3+phx+m74w== =Hl5g -----END PGP SIGNATURE----- --69pVuxX8awAiJ7fD--