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 51BAEC25B08 for ; Sat, 20 Aug 2022 06:49:19 +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=cmJRm9Onpy4doabhUuGl3lUTrKCZsyC2MmFvrU9vWZE=; b=jQw6J/z/EHUbZ2/SvBN8xoQk+d YzQSw2PDZcZEKzJZpAg0NNnuBzMPAdRDVmr5fJhciZQzg8EzDqO479hWmUc52zpovg4SVqmXT1dcg m7W51uBP5q9sPvCdDRPXIW4cfzyNaN3Z3pt4zQPI3LYGaOgkBMn88/1Fh82vzAMky5Jp9nOGri0AZ 8px2RGWRX0VhLnS5G5nUyvXOOz2njKNZFbR9j6N8kiomNNZoY/K3vJJOKaVgD3roFcgL1BXlImki2 BmSDAJ2hg2Hl+r+75kcG63HLct/C4/wQXhYqirElAP4wiI7H98mNgLqLSsWc69YW1ytFXAXBbSKiX DmRYFHvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPIGc-003rDi-00; Sat, 20 Aug 2022 06:47:34 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oPIGZ-003rCu-H0 for linux-arm-kernel@lists.infradead.org; Sat, 20 Aug 2022 06:47:32 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id BF5B460ED2; Sat, 20 Aug 2022 06:47:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 72DC3C433D6; Sat, 20 Aug 2022 06:47:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1660978049; bh=QVjaJSiWu7HTI9i+Z9zlE7GtVPtDRnl/W7Gxfvld2HI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=BAmKw19vajsD70tQ4Kg/FxlmZ9Z1Lc0YfiQD6EmMfumIKg6R0iS/FBBML/0YZv3qG zhHBlEilZ0rmVkvw6FAghuW0AI4m2/RYG4cOpjogLNg+v0tBaYTrHnkzUbnLkiPT29 z5l5OYZ+HZQLlreyb6oeINtoiHumVKAb3I15J/CNxno/g8SrKQaTyKjSWlrtQ/mCEI 4DBV2xJVJcE9C/LF+W9V/Q3nIPfvYP50D12zm6p2riIerY9XOg1c1649/wCsp+NBIm zyLRVOgk7bl+4IsUiURfsmVCyQyueyuCjfAnSaqXAHpwgfV4xs3+pvu0zzijwHMt2E OHtZFDuZrpoaQ== Date: Sat, 20 Aug 2022 08:47:25 +0200 From: Wolfram Sang To: Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= Cc: Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH] i2c: imx: Make sure to unregister adapter on remove() Message-ID: Mail-Followup-To: Wolfram Sang , Uwe =?utf-8?Q?Kleine-K=C3=B6nig?= , Oleksij Rempel , Pengutronix Kernel Team , Shawn Guo , Sascha Hauer , Fabio Estevam , NXP Linux Team , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org References: <20220720150933.239956-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 In-Reply-To: <20220720150933.239956-1-u.kleine-koenig@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220819_234731_651064_575FDAE0 X-CRM114-Status: GOOD ( 14.30 ) 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="===============7859182770292839768==" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org --===============7859182770292839768== Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="YTQp0O8vMuWUe3XW" Content-Disposition: inline --YTQp0O8vMuWUe3XW Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Jul 20, 2022 at 05:09:33PM +0200, Uwe Kleine-K=C3=B6nig wrote: > If for whatever reasons pm_runtime_resume_and_get() fails and .remove() is > exited early, the i2c adapter stays around and the irq still calls its > handler, while the driver data and the register mapping go away. So if > later the i2c adapter is accessed or the irq triggers this results in > havoc accessing freed memory and unmapped registers. >=20 > So unregister the software resources even if resume failed, and only skip > the hardware access in that case. >=20 > Signed-off-by: Uwe Kleine-K=C3=B6nig Applied to for-current, thanks! --YTQp0O8vMuWUe3XW Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEOZGx6rniZ1Gk92RdFA3kzBSgKbYFAmMAg30ACgkQFA3kzBSg Kba8Iw//SDM2LoesWrSCg6VaZxcT23FX1ot7PTkFoW7/qdoWaISFfP6bn9il7ey8 M38MCjvmn27EHJ8KdR/AYsa3V/49UlaqR4DQ0UCbP5q0/4QgEjeqreix7sErzSPZ w6zAVUcBJcSMSWKS4bkryze/udl1nwEltkb4Qd+7kUoF6ItpDPLAqEqyHnHoAhlL lM8QnkrZFdrCGXEMAvShulGtpb8DU9drPn05W6BCgqOfB5tjNvU50JTluv/oGz8y n4czh1G3208LLcKmUyYB63ZqYhFLQu3MWLlPfgw1EI2qRYGx//In0DIVpoqzcc3a Uc4jukvAlS0qrmcVRaOxLyRCnD+SN22OVL6HDqKrK9E9FSQmHf0znxCGuJj7GqZD 4eb2cu1YyNp3x4EuMim4wWZYLvbHXCmj61Nq+ZfjoHdwxdzh3JG/Ovy61JOuup0+ mHLIU9bhy9MeQiWHuJ0FJXzKi/69S5snwF/BdYdlWwzhtk6ZU8sZrLa3v6ik6Fpe 70EjS6r4WbB1+mmFjkXCcLerXyt/ukpWsPN4WxBmRrXgabnOyvclnV/j1/5UUmAz eERgbDv13GattC/jFcceB1h6VNYkOcbqhjIg2Bx7Gp39tUeii94VJ7OtADk8Mez2 I3WZbyjY1BMxUzWI4JE2gyu4cGR5jaomnkAkQUoGRYJQb2oCPH4= =q5mn -----END PGP SIGNATURE----- --YTQp0O8vMuWUe3XW-- --===============7859182770292839768== 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 --===============7859182770292839768==--