From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tero Kristo Subject: [PATCH 22/30] ARM: AM33xx: fix module_wait_ready without clkctrl register Date: Mon, 11 Apr 2016 11:19:13 +0300 Message-ID: <1460362761-4842-23-git-send-email-t-kristo@ti.com> References: <1460362761-4842-1-git-send-email-t-kristo@ti.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: In-Reply-To: <1460362761-4842-1-git-send-email-t-kristo@ti.com> Sender: linux-clk-owner@vger.kernel.org To: linux-omap@vger.kernel.org, tony@atomide.com, paul@pwsan.com, mturquette@baylibre.com, sboyd@codeaurora.org Cc: linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-clk@vger.kernel.org List-Id: devicetree@vger.kernel.org If the module has no clkctrl register defined, module_wait_ready should not try to access this. This can potentially cause an illegal register access, and result in bad idle reporting also. Signed-off-by: Tero Kristo --- arch/arm/mach-omap2/cm33xx.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm/mach-omap2/cm33xx.c b/arch/arm/mach-omap2/cm33xx.c index 7b181f9..c073fb5 100644 --- a/arch/arm/mach-omap2/cm33xx.c +++ b/arch/arm/mach-omap2/cm33xx.c @@ -220,6 +220,9 @@ static int am33xx_cm_wait_module_ready(u8 part, s16 inst, u16 clkctrl_offs, { int i = 0; + if (!clkctrl_offs) + return 0; + omap_test_timeout(_is_module_ready(inst, clkctrl_offs), MAX_MODULE_READY_TIME, i); -- 1.7.9.5