From nobody Mon Sep 28 19:24:50 2026 Received: from out203-205-221-190.mail.qq.com (out203-205-221-190.mail.qq.com [203.205.221.190]) (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 7DA7C471D1D for ; Tue, 18 Aug 2026 12:41:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=203.205.221.190 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787056888; cv=none; b=aoLqrZpjZw28hxE5RKwBY2BL7Bot38X0SkTk4yCxVBpJQmp9WGndQG2ZrIg2JYCqooyNFPqhuhB19FzlCcvGdoCFjNNxxuieo43yDZpG/wo05dcpVyy4i/bs8xtCLFQoWREjx58+rj13jRVA2+AYaRQctZBB8ayxltSSFp9gXcU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787056888; c=relaxed/simple; bh=9VwD3aaBSgjDzeDiLDWpmP9Xf9UgqI+xC9lJkY6Obog=; h=Message-ID:From:To:Cc:Subject:Date:MIME-Version; b=Giusevbvf4nTbrodP3r+ELJOwX4jjfEqCNs9Iwp5VtWea/w0DrnHt8SyXYHzSpwkSdhCtoWw/ThTi0hqu3t/21qmC6l9Us7tXZ4W3qTtuxGdmzUfs/zlhlJf7rQRc9d6b7xiYiu6wIng3LT4iBhclW71tgLTwglhO5sdGCTUaow= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com; spf=pass smtp.mailfrom=qq.com; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b=A4bpKgEJ; arc=none smtp.client-ip=203.205.221.190 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=qq.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=qq.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=qq.com header.i=@qq.com header.b="A4bpKgEJ" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qq.com; s=s201512; t=1787056881; bh=xNroi3DbpDldx3k8AfLJXonfuC90VLgrEQxpmBbtKdM=; h=From:To:Cc:Subject:Date; b=A4bpKgEJL2lAUL1ZX251vzyooKKUmDyvbdN0Q/auSlp5j1PLlIL3548yiuAJk/Ail y7+qi54vFzHuowfqAZB6Onfs3Zn4bHBs2GQC3O2urfsq1kYhUk6PlacEA6MrBujF0V sxyXGZiT/pnjxV31tBOExXzRF4MbKVSHaJ8fBKhU= Received: from ws006419.mbzu.ae ([5.195.0.150]) by newxmesmtplogicsvrszc56-0.qq.com (NewEsmtp) with SMTP id A53A5840; Tue, 18 Aug 2026 20:41:19 +0800 X-QQ-mid: xmsmtpt1787056879t3q5naxmz Message-ID: X-QQ-XMAILINFO: NmxDRtNfo6mLlW/KwPinoFD2y8S5OdBgYfv/evnL3mPS/QjGhNT0DW7HwKxjVy Axo62b6zKWoCQacc+Xd5/09SWWTpX4NLNVEqPGhhUioHPeve6JIrmugQOLD03WjC7H5/p2FtQSIA 7/DKvkKOUosiwro/zLyYXVngUGdmHstj/9+An8NY7J2DUHTcsD5WRWrQU9e1Ml2imJfwxOUQ0QLp w2ZzcFOSJAeR8XwPsYyXEn1eDjxAOcEWEIge5D54WiyvKdk21T5YIaQznyEYmADY64m2LDHdoQeg twH+SRyI8HnOly8nwh9fnFw6qPtNsc2fUrFiEj9PQ0X/dMaIHpIz9QQkTuuKTRTsxpFtZfqX9rYm 0YJeU2IH1q3UqKf6agCITdmu/ROlo8QjOBVyczNd9LXYVaqDusM5BInA+5+CKq1DmEaRv3g8DHEE 40f5r0xpQhmRnKsdHUTO10ckbZ6e7xx8qfckjZ4YQDRHzlqxrYyqs4FA87hJr21ak4by0HmRf3wg nV+/MACRcEzDUrh6kONVfU6kJOoKe3Jostxed6Csd0AtmzvnV8ckvHz7jTeFCi9Vr5+zxKmHfev8 ZtpOLNlDh7hYnx81IRvpEHOE7OlC8UDdhMJuJbB+pnEVa3Vps7jRFn3pWW1Zy80ZE7OWFfXX/1Kp EENWXe58xPkpo2GwZTqPP8GV+GyNTKmuFUDg2pmTtZf/Yi+KlvMeASK0RVSVENtDv7jyZ04HCNRc gQTFYJBksXP0zFkumCRoJjhTcYNlC2/K4OaXeIVlqYTYvG3F99Dr3/8d5eNfGd2ALBJyrWnGgrwm fsQF6KMrAWq/3EVwvjP/1xODdMiV80IMEHfX2/EafV7ikKY4bMvQgTabpuqIAIqjJLW5TZPu+GcK JQCSaVC18V60x+2cjUa0jS8zKm4s+JeT7pHBR95qeRW8uk/Ykzr0/uRXMgQAwJySdUsBkJlusHOA 8I05OYe/lZBG08mBJXH+QbkZaHOFLmeCt1Jn/D8jXnJhhmzqRhJKW6pzgQ4b5zm+wkq8yB0bGJoZ XB2EBh2XmKwNAq1zeNPvc4Lg2fsKcRo5w/HHWdWj0dxTlGRm/AS3L4WbN5BrlyBn06QSd43YF3FH 6A4JEkZ8DuN9vHOCo= X-QQ-XMRINFO: NyFYKkN4Ny6FuXrnB5Ye7Aabb3ujjtK+gg== From: Jiawen Liu <1298662399@qq.com> To: linux-kernel@vger.kernel.org Cc: jiawen <1298662399@qq.com> Subject: [PATCH] rtc: rtc-cadence: fix clock cleanup ordering Date: Tue, 18 Aug 2026 16:41:19 +0400 X-OQ-MSGID: <20260818124119.246926-1-1298662399@qq.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: jiawen <1298662399@qq.com> The probe function enables the peripheral clock (pclk) before the reference clock (ref_clk), and its error path disables ref_clk before pclk. However, the remove function disables pclk before ref_clk, which is the reverse order. This asymmetric teardown can leave the clock framework in an inconsistent state and violates the expected lifecycle balance. Fix the remove function to disable ref_clk first, then pclk, matching the probe enable order and the error path cleanup order. Signed-off-by: jiawen <1298662399@qq.com> --- diff --git a/drivers/rtc/rtc-cadence.c b/drivers/rtc/rtc-cadence.c --- a/drivers/rtc/rtc-cadence.c +++ b/drivers/rtc/rtc-cadence.c @@ -361,8 +361,8 @@ cdns_rtc_alarm_irq_enable(&pdev->dev, 0); device_init_wakeup(&pdev->dev, false); =20 + clk_disable_unprepare(crtc->ref_clk); clk_disable_unprepare(crtc->pclk); - clk_disable_unprepare(crtc->ref_clk); } =20 #ifdef CONFIG_PM_SLEEP