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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE4A6C32772 for ; Tue, 23 Aug 2022 12:29:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: In-Reply-To:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Reply-To:Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date :Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=L9rrpUPOa0EAqAXiNxbbALt8GcEUVSi0gugnJewjZi4=; b=hBWfBP+vCzpPJ4+JwN9O5WbGrN KmWZeTTV0Theuec4cIhKk0Q2LILHdNE9YK4mcBClVV7KS5qPn0nQMFjQUfcRu/6VGOpjuILwGEU3W 5pgR4GlINUCUx2tQiVF0K8ZbhU2AcPgoXrNVC7pM5LzhxSoSjP3eGnHmi8AVX/6+nO49Ajxj2VeAc 7RyeJCePhnZq5IlP9YW56BsihDA0mKbJ7GRUrqyUGZhErvQd6w99UMOjXZ1r16dDxDKKU3+gQegsj /4Wvod+IhcF3ppEA2MzotvVX0HrWnKwCtJ44y2B7UZWyb4blRoEhV0b5jkgOGJy7GCP68fpBGFUZG YRa3pFeA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQT0u-005rl1-Hs; Tue, 23 Aug 2022 12:28:13 +0000 Received: from relay12.mail.gandi.net ([2001:4b98:dc4:8::232]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQSvo-005pCA-Dh for linux-arm-kernel@lists.infradead.org; Tue, 23 Aug 2022 12:22:58 +0000 Received: (Authenticated sender: paul.kocialkowski@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id B6140200004; Tue, 23 Aug 2022 12:22:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1661257371; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=mH/IsYL2UPBaCXvhJbSLyyoriNuaQXpxdb7a7Mfls2k=; b=DAzEwz0Yj5FE2S/Gf2B5PDjuh2A9BbgMkrwUgaEn6TEf+aSR3AWc5hjukvQOyOUIX2tjnT VqHvjbLQRHRi83kxjT8K4c88QHMOcDAeSxydZnwV/NPnW4a7B5cx4tytI0vZMGagEYlGT8 Wq9aDliGZjnH+ItFFvPkeblGaypN0er1s0CmnRvpvfPU1uONta8FqtcbSoCU+5A7wM3R3g HdM2rf13SnCK0/ta9Tn4S/AVqUE9mhik4oQhhEYpANOwI6HHZIDL8f7gR+IJ8MFa0ATeWa Gro75d/mDXIQ/4nkvme6/rwYAwas01UqUck8kxNFPfDGk/xTj+J0V38F/WC5ww== Date: Tue, 23 Aug 2022 14:22:44 +0200 From: Paul Kocialkowski To: Samuel Holland Cc: Jernej =?utf-8?Q?=C5=A0krabec?= , linux-media@vger.kernel.org, Maxime Ripard , Mauro Carvalho Chehab , Greg Kroah-Hartman , Chen-Yu Tsai , Nicolas Dufresne , kernel@collabora.com, Dmitry Osipenko , stable@vger.kernel.org, linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 2/3] media: cedrus: Set the platform driver data earlier Message-ID: References: <20220818203308.439043-1-nicolas.dufresne@collabora.com> <4418189.LvFx2qVVIh@jernej-laptop> <47ce07adc73887b5afaf9815a78b793d0e9a6b54.camel@collabora.com> <4733096.GXAFRqVoOG@jernej-laptop> <0aab3720-7211-9414-0005-6a419b5f04c8@sholland.org> MIME-Version: 1.0 In-Reply-To: <0aab3720-7211-9414-0005-6a419b5f04c8@sholland.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220823_052256_929460_9200C3DE X-CRM114-Status: GOOD ( 24.95 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============7626823588418767164==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7626823588418767164== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="VACStzkiwKlyW1sA" Content-Disposition: inline --VACStzkiwKlyW1sA Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon 22 Aug 22, 22:57, Samuel Holland wrote: > On 8/20/22 3:25 AM, Jernej =C5=A0krabec wrote: > > Dne petek, 19. avgust 2022 ob 17:37:20 CEST je Nicolas Dufresne napisal= (a): > >> Le vendredi 19 ao=C3=BBt 2022 =C3=A0 06:17 +0200, Jernej =C5=A0krabec = a =C3=A9crit : > >>> Dne =C4=8Detrtek, 18. avgust 2022 ob 22:33:07 CEST je Nicolas Dufresn= e=20 > > napisal(a): > >>>> From: Dmitry Osipenko > >>>> > >>>> The cedrus_hw_resume() crashes with NULL deference on driver probe if > >>>> runtime PM is disabled because it uses platform data that hasn't been > >>>> set up yet. Fix this by setting the platform data earlier during pro= be. > >>> > >>> Does it even work without PM? Maybe it would be better if Cedrus would > >>> select PM in Kconfig. > >> > >> I cannot comment myself on this, but it does not seem to invalidate th= is > >> Dmitry's fix. > >=20 > > If NULL pointer dereference happens only when PM is disabled, then it d= oes. I=20 > > have PM always enabled and I never experienced above issue. >=20 > There's still a bug even with PM enabled: the v4l2 device is exposed to > userspace, and therefore userspace could trigger a PM resume, before > platform_set_drvdata() is called. Absolutely agreed! > >>>> Cc: stable@vger.kernel.org > >>>> Signed-off-by: Dmitry Osipenko > >>>> Signed-off-by: Nicolas Dufresne >=20 > Please add a Fixes tag. With that: >=20 > Reviewed-by: Samuel Holland Same here: Acked-by: Paul Kocialkowski Thanks! Paul > >>>> --- > >>>> > >>>> drivers/staging/media/sunxi/cedrus/cedrus.c | 4 ++-- > >>>> 1 file changed, 2 insertions(+), 2 deletions(-) > >>>> > >>>> diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c > >>>> b/drivers/staging/media/sunxi/cedrus/cedrus.c index > >>>> 960a0130cd620..55c54dfdc585c 100644 > >>>> --- a/drivers/staging/media/sunxi/cedrus/cedrus.c > >>>> +++ b/drivers/staging/media/sunxi/cedrus/cedrus.c > >>>> @@ -448,6 +448,8 @@ static int cedrus_probe(struct platform_device > >>>> *pdev) > >>>> > >>>> if (!dev) > >>>> return -ENOMEM; > >>>> > >>>> + platform_set_drvdata(pdev, dev); > >>>> + > >>>> dev->vfd =3D cedrus_video_device; > >>>> dev->dev =3D &pdev->dev; > >>>> dev->pdev =3D pdev; > >>>> > >>>> @@ -521,8 +523,6 @@ static int cedrus_probe(struct platform_device > >>>> *pdev) > >>>> > >>>> goto err_m2m_mc; > >>>> } > >>>> > >>>> - platform_set_drvdata(pdev, dev); > >>>> - > >>>> return 0; > >>>> =20 > >>>> err_m2m_mc: --=20 Paul Kocialkowski, Bootlin Embedded Linux and kernel engineering https://bootlin.com --VACStzkiwKlyW1sA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAmMExpQACgkQ3cLmz3+f v9Hphgf/RHIkNtIHgUBj1wEt+9CgUUYKzkUCP8Iwi0xIbXLJz4GeHQwIrL8VNnrT 1xZCbn9LrUxPEx48WPdyxs2DMCk3JgIw0M4xGltx8VBPsmRo2GzslC8nWGYt9HyX r3sVL/Vx8GC0Do/yTaTA22LfBQOBOMebdEWZx2M05z/UL5aYC5QLHeaRo88fXqlE RLUhSbWZg3CIRQK4K8aIIa20mW/BpPGvp4af+NqFMezJiY9XsvAmv23dNhnYxZk9 vrkXYKOK5L9WppdzVxqkBGl2jjeKqf5DHAwpIiQaf1iq7DJmdUTPZ193Vs3T9pHC c9btoDAjNoaJGV5Vir/sRaOTUBxmrg== =Aw5f -----END PGP SIGNATURE----- --VACStzkiwKlyW1sA-- --===============7626823588418767164== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel --===============7626823588418767164==--