From patchwork Mon Aug 12 19:40:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 819252 Received: from 9.mo575.mail-out.ovh.net (9.mo575.mail-out.ovh.net [46.105.78.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D092915C143 for ; Mon, 12 Aug 2024 20:18:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=46.105.78.111 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723493926; cv=none; b=Xt+3ti6MYwnGzNQ3aJu6/y8F8k6K+FydYeSMfVYypqNM7WbxhWSpBifD3FWAl2TK0LYa79kBYrSaCsIYeScRR1dpAmwJZ/mFdteCls0RuAP/ZcgHhNnGDdTqLmiCoAxqBpKyFLjwjfgE5OS+lXbZzMHbCuXOITf15nSnUIiUBtk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723493926; c=relaxed/simple; bh=OwaYBx/xSKuijtieDU7h0nqtEahyb7C8n+PL7wBUgJA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=VDYHcvYL2aIoHxsmSi/xV/bpQnORwHER7+Y0r+x5DsBPJhgQHztVMFHev2o6vNjVoUt0Ftvo5Y8Er6YfqkBndEsOWxfHhBeST7jtC7An/naQDn1m9MMd9QLe0OB2iosn+Z1+sHV3zPaLkfsbxBxjot9XM7sJ7hH4FzqduVsN+M0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=etezian.org; arc=none smtp.client-ip=46.105.78.111 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=etezian.org Received: from director1.ghost.mail-out.ovh.net (unknown [10.108.2.211]) by mo575.mail-out.ovh.net (Postfix) with ESMTP id 4WjPz44J09z1K6t for ; Mon, 12 Aug 2024 19:41:36 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-plhlz (unknown [10.110.118.244]) by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 283651FE44; Mon, 12 Aug 2024 19:41:34 +0000 (UTC) Received: from etezian.org ([37.59.142.101]) by ghost-submission-6684bf9d7b-plhlz with ESMTPSA id ymM3Km5lumZkMCAAii7AHw (envelope-from ); Mon, 12 Aug 2024 19:41:34 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-101G00454ab9ec0-df5c-45fa-b21e-fd2114598578, 664DA16141902EE5CF70331F943976485F5C157F) smtp.auth=andi@etezian.org X-OVh-ClientIp: 188.155.229.193 From: Andi Shyti To: linux-i2c Cc: Andi Shyti , Gaosheng Cui , stable@vger.kernel.org, Bjorn Andersson , Konrad Dybcio , Vladimir Zapolskiy Subject: [PATCH 1/2] i2c: qcom-geni: Add missing geni_icc_disable in geni_i2c_runtime_resume Date: Mon, 12 Aug 2024 21:40:28 +0200 Message-ID: <20240812194029.2222697-2-andi.shyti@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240812194029.2222697-1-andi.shyti@kernel.org> References: <20240812194029.2222697-1-andi.shyti@kernel.org> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Ovh-Tracer-Id: 7309342197315013237 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddruddttddgudegtdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetnhguihcuufhhhihtihcuoegrnhguihdrshhhhihtiheskhgvrhhnvghlrdhorhhgqeenucggtffrrghtthgvrhhnpefgudevjeetgeetlefhteeuteehgeefhefhkedtvdelheethfehveekudelueeuveenucfkphepuddvjedrtddrtddruddpudekkedrudehhedrvddvledrudelfedpfeejrdehledrudegvddruddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomheprghnughisegvthgviihirghnrdhorhhgpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqihdvtgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheejhedpmhhouggvpehsmhhtphhouhht Add the missing geni_icc_disable() call before returning in the geni_i2c_runtime_resume() function. Commit 9ba48db9f77c ("i2c: qcom-geni: Add missing geni_icc_disable in geni_i2c_runtime_resume") by Gaosheng missed disabling the interconnect in one case. Fixes: bf225ed357c6 ("i2c: i2c-qcom-geni: Add interconnect support") Signed-off-by: Andi Shyti Cc: Gaosheng Cui Cc: # v5.9+ --- Cc: Bjorn Andersson Cc: Konrad Dybcio Cc: Vladimir Zapolskiy drivers/i2c/busses/i2c-qcom-geni.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index 365e37bba0f33..06e836e3e8773 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -986,8 +986,10 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev) return ret; ret = clk_prepare_enable(gi2c->core_clk); - if (ret) + if (ret) { + geni_icc_disable(&gi2c->se); return ret; + } ret = geni_se_resources_on(&gi2c->se); if (ret) { From patchwork Mon Aug 12 19:40:29 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andi Shyti X-Patchwork-Id: 818692 Received: from 10.mo550.mail-out.ovh.net (10.mo550.mail-out.ovh.net [178.32.96.102]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D90441607B9 for ; Mon, 12 Aug 2024 22:11:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.32.96.102 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723500667; cv=none; b=DaiqWzoqiDb8GnMtcxoeJbZdUS37mqUiHTADcwVDIH+po0njzxy02ZN5kK3uHlmO+dHE+YytGa9jNcmAg70V/xRz5HXUP3e5iRwXUNfn3dLxxGlp8DKTrL0ZCzS/e6bQX1p5yS11lgMJ13Ca8wKE65DE+nddUt3zXvV1/vKXPMM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723500667; c=relaxed/simple; bh=Vny6rVwCTckTsxlHsRJUyiuClvSveUMZim97hZB4hHI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=NT/KZ8DECxpxQxBJZDCRHE/W2ZB3ho9bbumtkFVR9DscCtSJ1tUOwNA2FhaLHhJr3SzN9bTH6Gu/G89neJUae5cTSh8DsfmzP+Ha6WJ0FUfO+z0oqDDLP66GA0Dmb0kFv36se0+zUCEeTWfl/jC/lgfeAEIMyUL0jB0yZA7WnGw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=pass smtp.mailfrom=etezian.org; arc=none smtp.client-ip=178.32.96.102 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=etezian.org Received: from director1.ghost.mail-out.ovh.net (unknown [10.108.25.63]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 4WjPz53wN1z1K92 for ; Mon, 12 Aug 2024 19:41:37 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-bv82q (unknown [10.110.168.204]) by director1.ghost.mail-out.ovh.net (Postfix) with ESMTPS id 208E91FE44; Mon, 12 Aug 2024 19:41:37 +0000 (UTC) Received: from etezian.org ([37.59.142.107]) by ghost-submission-6684bf9d7b-bv82q with ESMTPSA id PQHzBXFlumYxwwUAnZV3Uw (envelope-from ); Mon, 12 Aug 2024 19:41:37 +0000 Authentication-Results: garm.ovh; auth=pass (GARM-107S0013ee0e8b8-6fb8-4627-9d96-24fc406607d9, 664DA16141902EE5CF70331F943976485F5C157F) smtp.auth=andi@etezian.org X-OVh-ClientIp: 188.155.229.193 From: Andi Shyti To: linux-i2c Cc: Andi Shyti , Bjorn Andersson , Gaosheng Cui , Konrad Dybcio , Vladimir Zapolskiy Subject: [PATCH 2/2] i2c: qcom-geni: Use goto for clearer exit path Date: Mon, 12 Aug 2024 21:40:29 +0200 Message-ID: <20240812194029.2222697-3-andi.shyti@kernel.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240812194029.2222697-1-andi.shyti@kernel.org> References: <20240812194029.2222697-1-andi.shyti@kernel.org> Precedence: bulk X-Mailing-List: linux-i2c@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Ovh-Tracer-Id: 7309623672837769845 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeeftddruddttddgudeflecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfqggfjpdevjffgvefmvefgnecuuegrihhlohhuthemucehtddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeetnhguihcuufhhhihtihcuoegrnhguihdrshhhhihtiheskhgvrhhnvghlrdhorhhgqeenucggtffrrghtthgvrhhnpefgudevjeetgeetlefhteeuteehgeefhefhkedtvdelheethfehveekudelueeuveenucfkphepuddvjedrtddrtddruddpudekkedrudehhedrvddvledrudelfedpfeejrdehledrudegvddruddtjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomheprghnughisegvthgviihirghnrdhorhhgpdhnsggprhgtphhtthhopedupdhrtghpthhtoheplhhinhhugidqihdvtgesvhhgvghrrdhkvghrnhgvlhdrohhrghdpoffvtefjohhsthepmhhoheehtddpmhhouggvpehsmhhtphhouhht Refactor the code by using goto statements to reduce duplication and make the exit path clearer. Signed-off-by: Andi Shyti --- Cc: Bjorn Andersson Cc: Gaosheng Cui Cc: Konrad Dybcio Cc: Vladimir Zapolskiy drivers/i2c/busses/i2c-qcom-geni.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/drivers/i2c/busses/i2c-qcom-geni.c b/drivers/i2c/busses/i2c-qcom-geni.c index 06e836e3e8773..ebb5900fd3227 100644 --- a/drivers/i2c/busses/i2c-qcom-geni.c +++ b/drivers/i2c/busses/i2c-qcom-geni.c @@ -986,21 +986,24 @@ static int __maybe_unused geni_i2c_runtime_resume(struct device *dev) return ret; ret = clk_prepare_enable(gi2c->core_clk); - if (ret) { - geni_icc_disable(&gi2c->se); - return ret; - } + if (ret) + goto out_icc_disable; ret = geni_se_resources_on(&gi2c->se); - if (ret) { - clk_disable_unprepare(gi2c->core_clk); - geni_icc_disable(&gi2c->se); - return ret; - } + if (ret) + goto out_clk_disable; enable_irq(gi2c->irq); gi2c->suspended = 0; + return 0; + +out_clk_disable: + clk_disable_unprepare(gi2c->core_clk); +out_icc_disable: + geni_icc_disable(&gi2c->se); + + return ret; } static int __maybe_unused geni_i2c_suspend_noirq(struct device *dev)