Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4821253ybl; Wed, 22 Jan 2020 05:23:36 -0800 (PST) X-Google-Smtp-Source: APXvYqyY6rfdoFlSwze/TAfaU4LRySxf8ws0FLBFTyXqYtr0iEBSDUe6ec8S6b2fRxj+gfTRNOYZ X-Received: by 2002:a9d:674f:: with SMTP id w15mr7493237otm.243.1579699416843; Wed, 22 Jan 2020 05:23:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579699416; cv=none; d=google.com; s=arc-20160816; b=H9gn9qJ1z7V+0oI05jG4zJFP23DLk/LL7/f+RdQaXsv9Mv2w7FfV9DhHQNVlSK7ylW DC/L9bHTwVQiWOIU21S/dufeZ3K39pQlkHAsjeaTo/7O7uOADpe67l3LIQzJi1dMsv5v 2RJiSGYrZFNTp2kIe8KviMahhG8qEjI280ycwL47M5VLLVra7jrCHpZ0+CjDVmSaBpRE 0CkBgVN9cNGKn9EEl0nBfiSCBSnAezwJRJtPA9gGJ1x+uqcmCvnxqcU8JRHdH3Cu4f1A OgoR9U/RieVYzEesDxejX2CZYZ1wUb4FW8Pbg5J46fGec3ZGUCiMIkyOmaJScjOgZGRW etKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=vRdND8aYTKTU4u7t9ShzwoKqmqE/XdNElJa3jl0pCfc=; b=l7PTzPmfVKFXs1wfdXXMH3G3XdJbU7fVMV6cNW0BgCQJnQ2aQTEzqLMMUYg6tq4SCL FuzUdHXyfB4rbk2QGNi4ByooEUyuPSBjKfUHrqxhClXe9vYdz20wAW/M259K+eVlBM4b EimSl7TqwCpGwpZZMfcPA5du8wGR+ZO8ZaWE62d9GGvF/fY3f4vA8HAwt71FT7Q2q5qH DpS3+RpKY04yW5je2fpUO1EigUfRl+zMsldAtjnpwyLixNKOreaUSOn/rdF/a4Z1P9H7 X8GytI2aEoroIvzFctkHSV7qX30uPEHskRU0voJgdmdsGCYiA08eBbWEGZZRSFQLtrsY 8Q6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CNT6PYFk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 12si20181378oiz.131.2020.01.22.05.23.25; Wed, 22 Jan 2020 05:23:36 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=CNT6PYFk; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730415AbgAVNWI (ORCPT + 99 others); Wed, 22 Jan 2020 08:22:08 -0500 Received: from mail.kernel.org ([198.145.29.99]:39532 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728797AbgAVNWH (ORCPT ); Wed, 22 Jan 2020 08:22:07 -0500 Received: from localhost (unknown [84.241.205.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C6A632468F; Wed, 22 Jan 2020 13:22:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579699326; bh=TIZmAdVjHSTjlNlJIi5CrdgHyPu2IsR1hqWI2t3lnOQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CNT6PYFkIi0+kvJAHsVGNpK6SoJOKq9rPz4Sy4Kcvg2AEv7/tWTti6jW0sQLmzPz8 EnT3fmE2g/XWkfrmCDt37IyChFbtPClRj7s5SqsHMJNwsS3n/TmSa6GWBUvmO2w6qA yYQUdpsE0MkqMAEGtbe85aJtSA4gALMPkX0nJVjk= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Marek Szyprowski , Krzysztof Kozlowski , Chanwoo Choi , Sylwester Nawrocki , Stephen Boyd Subject: [PATCH 5.4 074/222] clk: samsung: exynos5420: Keep top G3D clocks enabled Date: Wed, 22 Jan 2020 10:27:40 +0100 Message-Id: <20200122092839.017829447@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200122092833.339495161@linuxfoundation.org> References: <20200122092833.339495161@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski commit 67f96ff7c8f073648696eab50fd23ded23441067 upstream. In Exynos542x/5800 SoCs, the G3D leaf clocks are located in the G3D power domain. This is similar to the other hardware modules and their power domains. However there is one thing specific to G3D clocks hierarchy. Unlike other hardware modules, the G3D clocks hierarchy doesn't have any gate clock between the TOP part of the hierarchy and the part located in the power domain and some SoC internal busses are sourced directly from the TOP muxes. The consequence of this design if the fact that the TOP part of the hierarchy has to be enabled permanently to ensure proper operation of the SoC power related components (G3D power domain and Exynos Power Management Unit for system suspend/resume). This patch adds an explicit call to clk_prepare_enable() on the last MUX in the TOP part of G3D clock hierarchy to keep it enabled permanently to ensure that the internal busses get their clock regardless of the main G3D clock enablement status. This fixes following imprecise abort issue observed on Odroid XU3/XU4 after enabling Panfrost driver by commit 1a5a85c56402 "ARM: dts: exynos: Add Mali/GPU node on Exynos5420 and enable it on Odroid XU3/4"): panfrost 11800000.gpu: clock rate = 400000000 panfrost 11800000.gpu: failed to get regulator: -517 panfrost 11800000.gpu: regulator init failed -517 Power domain G3D disable failed ... panfrost 11800000.gpu: clock rate = 400000000 8<--- cut here --- Unhandled fault: imprecise external abort (0x1406) at 0x00000000 pgd = (ptrval) [00000000] *pgd=00000000 Internal error: : 1406 [#1] PREEMPT SMP ARM Modules linked in: CPU: 7 PID: 53 Comm: kworker/7:1 Not tainted 5.4.0-rc8-next-20191119-00032-g56f1001191a6 #6923 Hardware name: SAMSUNG EXYNOS (Flattened Device Tree) Workqueue: events deferred_probe_work_func PC is at panfrost_gpu_soft_reset+0x94/0x110 LR is at ___might_sleep+0x128/0x2dc ... [] (panfrost_gpu_soft_reset) from [] (panfrost_gpu_init+0x10/0x67c) [] (panfrost_gpu_init) from [] (panfrost_device_init+0x158/0x2cc) [] (panfrost_device_init) from [] (panfrost_probe+0x80/0x178) [] (panfrost_probe) from [] (platform_drv_probe+0x48/0x9c) [] (platform_drv_probe) from [] (really_probe+0x1c4/0x474) [] (really_probe) from [] (driver_probe_device+0x78/0x1bc) [] (driver_probe_device) from [] (bus_for_each_drv+0x74/0xb8) [] (bus_for_each_drv) from [] (__device_attach+0xd4/0x16c) [] (__device_attach) from [] (bus_probe_device+0x88/0x90) [] (bus_probe_device) from [] (deferred_probe_work_func+0x4c/0xd0) [] (deferred_probe_work_func) from [] (process_one_work+0x300/0x864) [] (process_one_work) from [] (worker_thread+0x58/0x5a0) [] (worker_thread) from [] (kthread+0x12c/0x160) [] (kthread) from [] (ret_from_fork+0x14/0x20) Exception stack(0xee03dfb0 to 0xee03dff8) ... Code: e594300c e5933020 e3130c01 1a00000f (ebefff50). ---[ end trace badde2b74a65a540 ]--- In the above case, the Panfrost driver disables G3D clocks after failure of getting the needed regulator and return with -EPROVE_DEFER code. This causes G3D power domain disable failure and then, during second probe an imprecise abort is triggered due to undefined power domain state. Fixes: 45f10dabb56b ("clk: samsung: exynos5420: Add SET_RATE_PARENT flag to clocks on G3D path") Fixes: c9f7567aff31 ("clk: samsung: exynos542x: Move G3D subsystem clocks to its sub-CMU") Signed-off-by: Marek Szyprowski Link: https://lkml.kernel.org/r/20191216131407.17225-1-m.szyprowski@samsung.com Acked-by: Krzysztof Kozlowski Acked-by: Chanwoo Choi Acked-by: Sylwester Nawrocki Signed-off-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- drivers/clk/samsung/clk-exynos5420.c | 8 ++++++++ 1 file changed, 8 insertions(+) --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -12,6 +12,7 @@ #include #include #include +#include #include "clk.h" #include "clk-cpu.h" @@ -1630,6 +1631,13 @@ static void __init exynos5x_clk_init(str exynos5x_subcmus); } + /* + * Keep top part of G3D clock path enabled permanently to ensure + * that the internal busses get their clock regardless of the + * main G3D clock enablement status. + */ + clk_prepare_enable(__clk_lookup("mout_sw_aclk_g3d")); + samsung_clk_of_add_provider(np, ctx); }