From nobody Mon Dec 15 13:00:14 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0996BC07E9D for ; Mon, 26 Sep 2022 11:45:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238430AbiIZLpq (ORCPT ); Mon, 26 Sep 2022 07:45:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238248AbiIZLml (ORCPT ); Mon, 26 Sep 2022 07:42:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B62BD726B8; Mon, 26 Sep 2022 03:46:06 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id EBE95B80924; Mon, 26 Sep 2022 10:33:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2F901C433D7; Mon, 26 Sep 2022 10:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1664188388; bh=zm91d3VKnzAezy3Obx9BDlw9gyCWzfFCaOa9sB9Etog=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U67hgP7TT2Rq5B3oaQ1TGMDl07Sl+NPe14WIK3+lesABQ+ZMz8ZweftD7dbtYX6vd brjvZuY6KJYlw5rRMvVULbsmzexd0UWluFi0sugLPtnKj6v6V0HUogu839uuZTs7J8 H4o0NI20gX/K7nPPJj2KGDoLORKB9PgiTllVhMWo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= , Oleksij Rempel , Wolfram Sang , Sasha Levin Subject: [PATCH 5.10 134/141] i2c: imx: If pm_runtime_get_sync() returned 1 device access is possible Date: Mon, 26 Sep 2022 12:12:40 +0200 Message-Id: <20220926100759.306970082@linuxfoundation.org> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926100754.639112000@linuxfoundation.org> References: <20220926100754.639112000@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Uwe Kleine-K=C3=B6nig [ Upstream commit 085aacaa73163f4b8a89dec24ecb32cfacd34017 ] pm_runtime_get_sync() returning 1 also means the device is powered. So resetting the chip registers in .remove() is possible and should be done. Reported-by: Dan Carpenter Fixes: d98bdd3a5b50 ("i2c: imx: Make sure to unregister adapter on remove()= ") Signed-off-by: Uwe Kleine-K=C3=B6nig Acked-by: Oleksij Rempel Signed-off-by: Wolfram Sang Signed-off-by: Sasha Levin --- drivers/i2c/busses/i2c-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index d3719df1c40d..be4ad516293b 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1289,7 +1289,7 @@ static int i2c_imx_remove(struct platform_device *pde= v) if (i2c_imx->dma) i2c_imx_dma_free(i2c_imx); =20 - if (ret =3D=3D 0) { + if (ret >=3D 0) { /* setup chip registers to defaults */ imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IADR); imx_i2c_write_reg(0, i2c_imx, IMX_I2C_IFDR); --=20 2.35.1