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 9A42AC43334 for ; Thu, 16 Jun 2022 07:56:13 +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=3wP3hWV53SmVr1w0B296GCUDYpRvOkmo7XMbNfBU4Ww=; b=m3XBE8rdeHfhXvXuEa+FDpGd5J 8ADdS+ZNgA9bYAChxHgiHxWbd2nrD5StsrGlmRcRrRWvhVXTPhjZ1y1Mrz8QITpmr5VHRKbN003PJ uVqkzasobHe6ebZ/HwKMNVtH9q0ux+Vtdts8fYBWy4ouABfhIMBNZR8T0ms/sOWw278VJcFzZO2dV YGx8z0LV+p+pvvN1kKFxG2+iEAw8xG7LmyQe7Y6B+NgClnCUx1gu/ngLZGo3bb0Q+T9oEZxg9ZV1r vrXkodr7iZoC020xGn83i5w/hRhYmk8mhNq8EGjZb3lXr8uRcwQ/d9X16A7NUC8zFrJwUSAeK92j4 Rkhs0gmA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1kL2-001DGH-4I; Thu, 16 Jun 2022 07:54:49 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o1kHQ-001Bj7-9l for linux-arm-kernel@lists.infradead.org; Thu, 16 Jun 2022 07:51:05 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 890245C04A4; Thu, 16 Jun 2022 03:51:03 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 16 Jun 2022 03:51:03 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h=cc :cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; t=1655365863; x=1655452263; bh=avkRFOQri+ DCIUeMYAcXgoXa03VDvIj7+Mqpc1dZorE=; b=tPTiDQZgOpOTBNkWPIEeZ1cVHU rEBZIs9kB54QbLOHfdkbmXpHgb5tCHVKkq+L0SFsg6Rv0yKI0y+3PAbC0Vb/fPMJ F/RuZ/sx27XTAS3vhno2ZjGMC62OUcI3JRIzE/vAQILFsE4W/3bGiGet0nOdpZ1F inyflp5AjmQ5LyaxJ0vIXsxJ3qE0OrAx8GwdkIoGopzpxRzu+4Uk4D4uTMjPPqeG EpvB6fMFevTJu+RFOUaRsqwvvd58R/4W9xhVgvOGHln0e6PkQskebfXxGsMrG4S1 h8aRbJztk/H++1oq607cQTeJegMgPt3a72uA/tTj4uIj1+nPkuuzfYGz9fAg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:date:date:feedback-id :feedback-id:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:sender:subject:subject:to:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; t=1655365863; x=1655452263; bh=avkRFOQri+DCIUeMYAcXgoXa03VD vIj7+Mqpc1dZorE=; b=psRljeytIRyTl+ScjZLU8kIJ9pQfdTmnCb5I1dHxqdMu NeiD9HWw0xK3XCyYtXufIATqua3uZXwAhhQ3FLzn1iioUsoFk+P+ZgJ7J7A1PiyN nTW60PU/Fs2xvMERANtD+bbcdZexftiAoR9i1jj9M5dAcSZvTmtQQ5/ufLLnuHs6 PZqn3nL08qP4cFzFmaL4yRDslLWbXwIG0rxN7PXyKLVPJtfqvQHaqaKAAoo60WnP i4FWoKByAuqz8u2b7w2QmN5qmVGkT3tayPMzkq106FmGpa16e8Zpux7tLmig4fYw 2kny5qdSOYehInMKxAYpqtWLVFwh+Gff5ZrultoDXQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvfedruddvvddguddvvdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddvnecuhfhrohhmpeforgig ihhmvgcutfhiphgrrhguuceomhgrgihimhgvsegtvghrnhhordhtvggthheqnecuggftrf grthhtvghrnhepteefffefgfektdefgfeludfgtdejfeejvddttdekteeiffejvdfgheeh fffhvedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomh epmhgrgihimhgvsegtvghrnhhordhtvggthh X-ME-Proxy: Feedback-ID: i8771445c:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 16 Jun 2022 03:51:02 -0400 (EDT) Date: Thu, 16 Jun 2022 09:51:01 +0200 From: Maxime Ripard To: Samuel Holland Cc: Chen-Yu Tsai , Jernej Skrabec , Daniel Vetter , David Airlie , Ondrej Jirman , dri-devel@lists.freedesktop.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@lists.linux.dev Subject: Re: [PATCH] drm/sun4i: Fix crash during suspend after component bind failure Message-ID: <20220616075101.gjm4dctnyjxcmjur@houat> References: <20220615054254.16352-1-samuel@sholland.org> MIME-Version: 1.0 In-Reply-To: <20220615054254.16352-1-samuel@sholland.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220616_005104_448046_E0B20F9A X-CRM114-Status: GOOD ( 16.79 ) 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="===============2687886305298105323==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============2687886305298105323== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="qbgetibzjtgdqpsj" Content-Disposition: inline --qbgetibzjtgdqpsj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Wed, Jun 15, 2022 at 12:42:53AM -0500, Samuel Holland wrote: > If the component driver fails to bind, or is unbound, the driver data > for the top-level platform device points to a freed drm_device. If the > system is then suspended, the driver passes this dangling pointer to > drm_mode_config_helper_suspend(), which crashes. >=20 > Fix this by only setting the driver data while the platform driver holds > a reference to the drm_device. >=20 > Fixes: 624b4b48d9d8 ("drm: sun4i: Add support for suspending the display = driver") > Signed-off-by: Samuel Holland Yeah, it's far from the only issue regarding structure lifetimes in the driver. We should convert as much as possible to the DRM-managed functions to fix those. Maxime --qbgetibzjtgdqpsj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCYqrg5QAKCRDj7w1vZxhR xVj+AP9Lpx3pI6RrBywPXKcmxvCkRZ4QHOy5xsKfXkKI6tLETgEAkGiZ3sBXGsYY KLIz4RgXLbFTU7/u7uLaZcvDfMWHigU= =4NA8 -----END PGP SIGNATURE----- --qbgetibzjtgdqpsj-- --===============2687886305298105323== 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 --===============2687886305298105323==--