From patchwork Tue Nov 13 05:49:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 150901 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4004594ljp; Mon, 12 Nov 2018 21:50:02 -0800 (PST) X-Google-Smtp-Source: AJdET5eezex7dV3x5HMccNHTd2qlrlhVngKKk6O3q0lCRCvl36yB/z/FE7Bk5ookDxCajHtsjrgn X-Received: by 2002:a62:2095:: with SMTP id m21-v6mr828780pfj.32.1542088202338; Mon, 12 Nov 2018 21:50:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542088202; cv=none; d=google.com; s=arc-20160816; b=fxNR4XXU680tLHK5XvnRQSKvR1ox4EQ53HgU3YN8br+ai/sRVtYB3M8G2ExRLt0gLz d/cGvIYBg6Y5vGD4+jvXlu96wp2Z1GuZPsablU8NjIyDDp4Z+YCZO7hLULm24QYvRpg0 CZSHsT/H8HNl9HKKjBZ0MBH6ZjB7tBODHTZtZMkWkyE6d4MWeiLhGKViNcawZC50gPe/ C/MjwdjVj8R1g4z5X5tL7ld+l6sEWr1PxpYepSwXtGcqEreiS0PuzHBMRCKIAHuJV8bw 0XHRxYMdFQzNDfrI3sABzamBddf7CtaXKNiZjev4qQGOBdDBdr0Zdk/10oKJkXx5jNeb O/Yg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=0Ivny22atPKP7r09S6eOWAUUxpSyDbfuH38df4pm6AE=; b=acr6YsgI/CwAbKVr2A/Z/byQcXqUaJqAC7qRdOXfXoLGYSkj5g1i6lc7sNxiHgenMc v5rRcHEeCoROKG3jbYC6OYvLOznDdNM51zD1b0lNcmGyvQPGgyW2jk5eDf7wVCQ9kAYy KPZ7w23xJgDAqANfdxuGFkBeAt6+12XOTMYdH25Qrqtu77d2qhOXOtGSFiK88/wEiQrp bEdYd31CM32jF8GS9kA46Dc2DdVubotEbZFRAJaFqxKcUrCWIWfzuO/DxQOpEeuNbWTK tWdg7NNit5WTlRPEeDg4JCDWkT4UGvR/5z9smz+UAzkiiyypVFElZcmLMI4j+zQERjvj EGKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="vwZ9/Xvo"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q8-v6si19695336pgc.347.2018.11.12.21.50.02; Mon, 12 Nov 2018 21:50:02 -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="vwZ9/Xvo"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730884AbeKMPqV (ORCPT + 32 others); Tue, 13 Nov 2018 10:46:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:59886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727475AbeKMPqU (ORCPT ); Tue, 13 Nov 2018 10:46:20 -0500 Received: from sasha-vm.mshome.net (unknown [64.114.255.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1E28C2250F; Tue, 13 Nov 2018 05:49:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542088193; bh=r2uAgtl/FPWvBkzUCbhQ0Wz2OgqudjzPYkzWiYxK12c=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vwZ9/XvohsNUjq4dDLkpWVaAdwxR/qZkoUeO7j8vSU0TerV3QvgvxVjj2Z2I1046p ytOhzwYD2YRRM/61UOi68pDUyhAUiEsJrnit9DsyMI+FtaNpVwoKTP/8LRURcvsNAr ZYH9lDlVOrcVoY0ikFUG6Osmklr447XiBD+/itpQ= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Anders Roxell , Catalin Marinas , Sasha Levin Subject: [PATCH AUTOSEL 4.19 04/44] arm64: kprobe: make page to RO mode when allocate it Date: Tue, 13 Nov 2018 00:49:10 -0500 Message-Id: <20181113054950.77898-4-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181113054950.77898-1-sashal@kernel.org> References: <20181113054950.77898-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anders Roxell [ Upstream commit 966866892cf89d606544bca22d584ba2ef9ec208 ] Commit 1404d6f13e47 ("arm64: dump: Add checking for writable and exectuable pages") has successfully identified code that leaves a page with W+X permissions. [ 3.245140] arm64/mm: Found insecure W+X mapping at address (____ptrval____)/0xffff000000d90000 [ 3.245771] WARNING: CPU: 0 PID: 1 at ../arch/arm64/mm/dump.c:232 note_page+0x410/0x420 [ 3.246141] Modules linked in: [ 3.246653] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.19.0-rc5-next-20180928-00001-ge70ae259b853-dirty #62 [ 3.247008] Hardware name: linux,dummy-virt (DT) [ 3.247347] pstate: 80000005 (Nzcv daif -PAN -UAO) [ 3.247623] pc : note_page+0x410/0x420 [ 3.247898] lr : note_page+0x410/0x420 [ 3.248071] sp : ffff00000804bcd0 [ 3.248254] x29: ffff00000804bcd0 x28: ffff000009274000 [ 3.248578] x27: ffff00000921a000 x26: ffff80007dfff000 [ 3.248845] x25: ffff0000093f5000 x24: ffff000009526f6a [ 3.249109] x23: 0000000000000004 x22: ffff000000d91000 [ 3.249396] x21: ffff000000d90000 x20: 0000000000000000 [ 3.249661] x19: ffff00000804bde8 x18: 0000000000000400 [ 3.249924] x17: 0000000000000000 x16: 0000000000000000 [ 3.250271] x15: ffffffffffffffff x14: 295f5f5f5f6c6176 [ 3.250594] x13: 7274705f5f5f5f28 x12: 2073736572646461 [ 3.250941] x11: 20746120676e6970 x10: 70616d20582b5720 [ 3.251252] x9 : 6572756365736e69 x8 : 3039643030303030 [ 3.251519] x7 : 306666666678302f x6 : ffff0000095467b2 [ 3.251802] x5 : 0000000000000000 x4 : 0000000000000000 [ 3.252060] x3 : 0000000000000000 x2 : ffffffffffffffff [ 3.252323] x1 : 4d151327adc50b00 x0 : 0000000000000000 [ 3.252664] Call trace: [ 3.252953] note_page+0x410/0x420 [ 3.253186] walk_pgd+0x12c/0x238 [ 3.253417] ptdump_check_wx+0x68/0xf8 [ 3.253637] mark_rodata_ro+0x68/0x98 [ 3.253847] kernel_init+0x38/0x160 [ 3.254103] ret_from_fork+0x10/0x18 kprobes allocates a writable executable page with module_alloc() in order to store executable code. Reworked to that when allocate a page it sets mode RO. Inspired by commit 63fef14fc98a ("kprobes/x86: Make insn buffer always ROX and use text_poke()"). Suggested-by: Arnd Bergmann Suggested-by: Ard Biesheuvel Acked-by: Will Deacon Acked-by: Masami Hiramatsu Reviewed-by: Laura Abbott Signed-off-by: Anders Roxell [catalin.marinas@arm.com: removed unnecessary casts] Signed-off-by: Catalin Marinas Signed-off-by: Sasha Levin --- arch/arm64/kernel/probes/kprobes.c | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) -- 2.17.1 diff --git a/arch/arm64/kernel/probes/kprobes.c b/arch/arm64/kernel/probes/kprobes.c index e78c3ef04d95..b5a367d4bba6 100644 --- a/arch/arm64/kernel/probes/kprobes.c +++ b/arch/arm64/kernel/probes/kprobes.c @@ -23,7 +23,9 @@ #include #include #include +#include #include +#include #include #include #include @@ -42,10 +44,21 @@ DEFINE_PER_CPU(struct kprobe_ctlblk, kprobe_ctlblk); static void __kprobes post_kprobe_handler(struct kprobe_ctlblk *, struct pt_regs *); +static int __kprobes patch_text(kprobe_opcode_t *addr, u32 opcode) +{ + void *addrs[1]; + u32 insns[1]; + + addrs[0] = addr; + insns[0] = opcode; + + return aarch64_insn_patch_text(addrs, insns, 1); +} + static void __kprobes arch_prepare_ss_slot(struct kprobe *p) { /* prepare insn slot */ - p->ainsn.api.insn[0] = cpu_to_le32(p->opcode); + patch_text(p->ainsn.api.insn, p->opcode); flush_icache_range((uintptr_t) (p->ainsn.api.insn), (uintptr_t) (p->ainsn.api.insn) + @@ -118,15 +131,15 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p) return 0; } -static int __kprobes patch_text(kprobe_opcode_t *addr, u32 opcode) +void *alloc_insn_page(void) { - void *addrs[1]; - u32 insns[1]; + void *page; - addrs[0] = (void *)addr; - insns[0] = (u32)opcode; + page = vmalloc_exec(PAGE_SIZE); + if (page) + set_memory_ro((unsigned long)page, 1); - return aarch64_insn_patch_text(addrs, insns, 1); + return page; } /* arm kprobe: install breakpoint in text */ From patchwork Tue Nov 13 05:49:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 150925 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4016181ljp; Mon, 12 Nov 2018 22:04:19 -0800 (PST) X-Google-Smtp-Source: AJdET5f/3Wx/TzJ47ORL+KSWSHTzcmwcPEI9Jy2uukM3x5I676MAEr5qdw15Do26DAWrX8xL0ztV X-Received: by 2002:a63:fc22:: with SMTP id j34-v6mr3611805pgi.434.1542089059494; Mon, 12 Nov 2018 22:04:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542089059; cv=none; d=google.com; s=arc-20160816; b=pIeYR4ofblF+PP/B2aEVVQREghXmpIH9D7q8rlWMY+uZQ/Ss3ia5bjP5Szb0ROMwyX xa5uf9GLMA9+t5EQjE4DgmTYkc73q49Mkx9X+yu4SKzUgHF9ZIfSdmP3yhm5aLiniVfs MWttHsW6+XsfZatpfL9BU2hlUsh2SYmW4GMjK+MnondmVByWIeGxk5pduidq/e4SV1LM KV4zm40QWFzsjtdA8LGDzG7/XF/l3R+CwReCFjFiDttrAVz8Si/FbrQasX3zMRj6taZG eKVrdfE6bX99aq81PbZghWuAG7NkkucXCbQxTwQqit+/O5Z+GGZaLX58PmDdfjNkkkmV EQcw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=8Rt6vU85V7RumWVE6qGuUrEbdnKr7pp2AQAKScVTZCI=; b=fiPgTSObg7WQA55U7Oi97JdKaVZQzRWxNoVytKfAMj/VNj8/w0jKAweHYpIZAFSq8R dCyESNwl1p9L74llJ1lOg8Rl9AcvifyWN1kF3FWGcK8OzjeUR9ueGlJE3l7cnJ/Vz1zd e84YYlCwkUPo1Dmo/A8mUjig3tMTz5+lNOQiJWfU/IEgVTwuFsS9NuNY9zhGdcXSmb1N EqaX4NOYCPre7mNa2bW+nr/deiZa/Mc8ihMlFDTIjxlujdPBS36sSfHLNMUql4fqP6bz QOEdoZ8GpPJ5KiDhWv+z5U+NEPqC/PlkeaVpU0A5iT/Ggsh/o4TvahwYS2bK3RpnIG0d 1k1w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EBTUi9UW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r81-v6si2422036pfc.253.2018.11.12.22.04.19; Mon, 12 Nov 2018 22:04:19 -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=EBTUi9UW; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731411AbeKMPq7 (ORCPT + 32 others); Tue, 13 Nov 2018 10:46:59 -0500 Received: from mail.kernel.org ([198.145.29.99]:60724 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731253AbeKMPq6 (ORCPT ); Tue, 13 Nov 2018 10:46:58 -0500 Received: from sasha-vm.mshome.net (unknown [64.114.255.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0D0BC2251F; Tue, 13 Nov 2018 05:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542088231; bh=rEW7FOhsjb5KfIVyFm4ZAPHnT612BU0DenklrHKMRwA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EBTUi9UWIRVES5aHT+t5KE74d7xVStv9uFJxEiuC58x49cbeW+Yp1fzuYa2DSQRF3 TrKqHYR4Z4E3QyJmA23bYeXUPLHoEA26tWUuTMRGtL01+3AWANqMpQIt0ROvjYB8ZA bm/JD90ngXF3a68oxB9Zo/mQIN7g9nM5pzlfJUTs= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Sylwester Nawrocki , Sasha Levin , linux-clk@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 27/44] clk: samsung: exynos5420: Enable PERIS clocks for suspend Date: Tue, 13 Nov 2018 00:49:33 -0500 Message-Id: <20181113054950.77898-27-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181113054950.77898-1-sashal@kernel.org> References: <20181113054950.77898-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski [ Upstream commit b33228029d842269e17bba591609e83ed422005d ] Ensure that clocks for core SoC modules (including TZPC0..9 modules) are enabled for suspend/resume cycle. This fixes suspend/resume support on Exynos5422-based Odroid XU3/XU4 boards. Suggested-by: Joonyoung Shim Signed-off-by: Marek Szyprowski Signed-off-by: Sylwester Nawrocki Signed-off-by: Sasha Levin --- drivers/clk/samsung/clk-exynos5420.c | 1 + 1 file changed, 1 insertion(+) -- 2.17.1 diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c index 95e1bf69449b..d4f77c4eb277 100644 --- a/drivers/clk/samsung/clk-exynos5420.c +++ b/drivers/clk/samsung/clk-exynos5420.c @@ -281,6 +281,7 @@ static const struct samsung_clk_reg_dump exynos5420_set_clksrc[] = { { .offset = GATE_BUS_TOP, .value = 0xffffffff, }, { .offset = GATE_BUS_DISP1, .value = 0xffffffff, }, { .offset = GATE_IP_PERIC, .value = 0xffffffff, }, + { .offset = GATE_IP_PERIS, .value = 0xffffffff, }, }; static int exynos5420_clk_suspend(void) From patchwork Tue Nov 13 05:49:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 150902 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp4005075ljp; Mon, 12 Nov 2018 21:50:41 -0800 (PST) X-Google-Smtp-Source: AJdET5fJKyJBlpYKP6lnI/Y8x9MhWnVipLwQ8p9hq86felRVNMpCego5406CPzVgf1R4OJp7zeW4 X-Received: by 2002:a62:cac4:: with SMTP id y65-v6mr3778971pfk.27.1542088241682; Mon, 12 Nov 2018 21:50:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542088241; cv=none; d=google.com; s=arc-20160816; b=VMutwbJxir3YJcRSMMAn0wP7aIikMmvFFjSpvWE4iAX9Z9/LyUXJhAYRuJuptPCgM3 w7wzrM49Y+sd5KX/ilkOG0Kg3fFL+0RKW16PcbKGga/V+vagqzbXZ+VxOpz6U3XEur3Q zgi9JefOsakjgSTW3WrNV+ADBu9yKDieOxaExPv0lF2EEw04TPlcjeiPSMbq79lJwOAE jRNhoWLf0gFX70l2JjiFvnsd9uQ9MdPlpBBhwufFRgyM9o72VGgYkq3HLtufhppp08OO 1lRcvJlx+QhlSlE0cUFpMWTCKQ6OhSxfpbdcc+W2QApbCMFQUrIsytNRVigj4K3mJ7bk VQ0A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=mnESPIrI+Nme8yiUR4aZMlQ1FRmPd/MmZkLwqjaGrPQ=; b=XN34R5SOmHYkb2biU6JpZWmxYZoNX9IvbtKjS6crypaBdVo3JBKxDcGFEfduRr6vDX it+4TqI43PFhiEOx4pSdMSxaPFyCvHwOqcASdMUrdVTBMRGH9yUxG3SV0WKSxJYeuYcy N0cJN5/Gs1wwyIp15Uzqb7iXBQQjpefaj5t9/XNV/qXr6OD5Ha6VSKEafLqSgsERCAgZ 06q5vPrIa1FyGwI7DbfdFIgwbOHSMRxHC0QlD/42X/UCHxNs0902euyaYUu+Xe608PIU TS3AcPAghfRBKhMawUMXJjYGtEG4MQKqKBBfc//D/rTN3gZ9JrKVeOxEym+b2UXw1DLC 4acg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=LhcsHpxX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 62-v6si21410242pfu.2.2018.11.12.21.50.41; Mon, 12 Nov 2018 21:50:41 -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=LhcsHpxX; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731641AbeKMPrG (ORCPT + 32 others); Tue, 13 Nov 2018 10:47:06 -0500 Received: from mail.kernel.org ([198.145.29.99]:60844 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731477AbeKMPrE (ORCPT ); Tue, 13 Nov 2018 10:47:04 -0500 Received: from sasha-vm.mshome.net (unknown [64.114.255.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4916B2250F; Tue, 13 Nov 2018 05:50:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1542088236; bh=0TPpHlUsaHzJegStfDXj8ImOiNKPRTMI/2oEu/QolJU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LhcsHpxX8SGxf8wMKE0Yto9OFioi9HUpVor8zpNzj52FRFXpS4IFU5wHwD8+EnsIU gWKSKpsI2nyMki31IirzSuq4qvFpFoYz1PtW/U4GnOBfRRTWxpHR4T4ojx7fz9fcSf u05c5hOcYbr8dUU51oYsJAjbY0QfbRlqnQtrzTgk= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jerome Brunet , Sasha Levin , linux-amlogic@lists.infradead.org, linux-clk@vger.kernel.org Subject: [PATCH AUTOSEL 4.19 33/44] clk: meson: clk-pll: drop CLK_GET_RATE_NOCACHE where unnecessary Date: Tue, 13 Nov 2018 00:49:39 -0500 Message-Id: <20181113054950.77898-33-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181113054950.77898-1-sashal@kernel.org> References: <20181113054950.77898-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jerome Brunet [ Upstream commit 2303a9ca693e585a558497ad737728fec97e2b8a ] CLK_GET_RATE_NOCACHE should only be necessary when the registers controlling the rate of clock may change outside of CCF. On Amlogic, it should only be the case for the hdmi pll which is directly controlled by the display driver (WIP to fix this). The other plls should not require this flag. Reviewed-by: Martin Blumenstingl Tested-by: Martin Blumenstingl Signed-off-by: Jerome Brunet Signed-off-by: Sasha Levin --- drivers/clk/meson/axg.c | 1 - drivers/clk/meson/gxbb.c | 12 ++++++++---- drivers/clk/meson/meson8b.c | 3 --- 3 files changed, 8 insertions(+), 8 deletions(-) -- 2.17.1 diff --git a/drivers/clk/meson/axg.c b/drivers/clk/meson/axg.c index a95152071087..f24d38c12e09 100644 --- a/drivers/clk/meson/axg.c +++ b/drivers/clk/meson/axg.c @@ -96,7 +96,6 @@ static struct clk_regmap axg_sys_pll = { .ops = &meson_clk_pll_ro_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, - .flags = CLK_GET_RATE_NOCACHE, }, }; diff --git a/drivers/clk/meson/gxbb.c b/drivers/clk/meson/gxbb.c index 86d3ae58e84c..58e4b66bfc55 100644 --- a/drivers/clk/meson/gxbb.c +++ b/drivers/clk/meson/gxbb.c @@ -213,7 +213,6 @@ static struct clk_regmap gxbb_fixed_pll = { .ops = &meson_clk_pll_ro_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, - .flags = CLK_GET_RATE_NOCACHE, }, }; @@ -276,6 +275,10 @@ static struct clk_regmap gxbb_hdmi_pll = { .ops = &meson_clk_pll_ro_ops, .parent_names = (const char *[]){ "hdmi_pll_pre_mult" }, .num_parents = 1, + /* + * Display directly handle hdmi pll registers ATM, we need + * NOCACHE to keep our view of the clock as accurate as possible + */ .flags = CLK_GET_RATE_NOCACHE, }, }; @@ -334,6 +337,10 @@ static struct clk_regmap gxl_hdmi_pll = { .ops = &meson_clk_pll_ro_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, + /* + * Display directly handle hdmi pll registers ATM, we need + * NOCACHE to keep our view of the clock as accurate as possible + */ .flags = CLK_GET_RATE_NOCACHE, }, }; @@ -371,7 +378,6 @@ static struct clk_regmap gxbb_sys_pll = { .ops = &meson_clk_pll_ro_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, - .flags = CLK_GET_RATE_NOCACHE, }, }; @@ -418,7 +424,6 @@ static struct clk_regmap gxbb_gp0_pll = { .ops = &meson_clk_pll_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, - .flags = CLK_GET_RATE_NOCACHE, }, }; @@ -472,7 +477,6 @@ static struct clk_regmap gxl_gp0_pll = { .ops = &meson_clk_pll_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, - .flags = CLK_GET_RATE_NOCACHE, }, }; diff --git a/drivers/clk/meson/meson8b.c b/drivers/clk/meson/meson8b.c index 7447d96a265f..74697e145dde 100644 --- a/drivers/clk/meson/meson8b.c +++ b/drivers/clk/meson/meson8b.c @@ -132,7 +132,6 @@ static struct clk_regmap meson8b_fixed_pll = { .ops = &meson_clk_pll_ro_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, - .flags = CLK_GET_RATE_NOCACHE, }, }; @@ -169,7 +168,6 @@ static struct clk_regmap meson8b_vid_pll = { .ops = &meson_clk_pll_ro_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, - .flags = CLK_GET_RATE_NOCACHE, }, }; @@ -207,7 +205,6 @@ static struct clk_regmap meson8b_sys_pll = { .ops = &meson_clk_pll_ro_ops, .parent_names = (const char *[]){ "xtal" }, .num_parents = 1, - .flags = CLK_GET_RATE_NOCACHE, }, };