From patchwork Thu Oct 18 09:57:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10646935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C9BCB17D4 for ; Thu, 18 Oct 2018 09:57:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ADDC328830 for ; Thu, 18 Oct 2018 09:57:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1A98288C9; Thu, 18 Oct 2018 09:57:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3DBB928830 for ; Thu, 18 Oct 2018 09:57:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727423AbeJRR5e (ORCPT ); Thu, 18 Oct 2018 13:57:34 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:53116 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727845AbeJRR5d (ORCPT ); Thu, 18 Oct 2018 13:57:33 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181018095717euoutp0111210dd8069639dc7b4488c71f5a1527~eq3QTbLOQ0107701077euoutp01Z; Thu, 18 Oct 2018 09:57:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181018095717euoutp0111210dd8069639dc7b4488c71f5a1527~eq3QTbLOQ0107701077euoutp01Z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539856637; bh=zJetpoNhW01GT4Xt0gk6SKTpHAA/tdY/kH9zyQ9f4Ok=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=aTgk1rfPeEW8tqfWTdwSg4TZQyK0mLQm3GVknpbI4DBOGG3NTEGMKLpylEnTksvV/ CVhXhn0S/KQgn+iD8KChOBSjDnCd2GxjMJsqmDUT2rw7p7sAlXfQaXUOtN3aEjB0ZI QTeXf7NYERUX/YClBqN1+KjwT+ZVGdSHIM636Wfw= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181018095717eucas1p2f656677dcc7d03550eb6c8ca5f12f8a5~eq3PyTstY2351323513eucas1p2E; Thu, 18 Oct 2018 09:57:17 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 9D.D1.04294.CF858CB5; Thu, 18 Oct 2018 10:57:16 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181018095716eucas1p192004241424d1cf581f715558b2e67a4~eq3O6tUM92351723517eucas1p1G; Thu, 18 Oct 2018 09:57:16 +0000 (GMT) X-AuditID: cbfec7f4-835ff700000010c6-fb-5bc858fcf29a Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id AB.D2.04284.CF858CB5; Thu, 18 Oct 2018 10:57:16 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGS00GLZGZA2H50@eusync3.samsung.com>; Thu, 18 Oct 2018 10:57:16 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Will Deacon , Catalin Marinas , Marc Zyngier , Thomas Gleixner , Daniel Lezcano , Krzysztof Kozlowski , Chanwoo Choi , Bartlomiej Zolnierkiewicz , Inki Dae , Mark Rutland Subject: [PATCH v4 1/6] clocksource: exynos_mct: Remove dead code Date: Thu, 18 Oct 2018 11:57:03 +0200 Message-id: <20181018095708.1527-2-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181018095708.1527-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrCIsWRmVeSWpSXmKPExsWy7djP87p/Ik5EG/xeYWCxccZ6Vov3y3oY La5/ec5qMe+zrMWk+xNYLM6f38BusenxNVaLy7vmsFnMOL+PyWLtkbvsFn/v/GOzWHr9IpPF 5k1TmS1efjzB4sDnsWbeGkaPTas62TzuXNvD5vHu3Dl2j81L6j36tqxi9Pi8SS6APYrLJiU1 J7MstUjfLoErY9cq24LJfBV7GhvYGhgfcncxcnJICJhINK84xg5iCwmsYJRoWiLbxcgFZH9m lJjy9y4jTNGKZ9uZIYqWMUr8+JYAUdTAJPF3wwk2kASbgKFE19suMFtEIFui8/EDRpAiZoGT zBL/bm4CWyEs4Cjx5PZbFhCbRUBV4tnZFrA4r4CNxLGZb5ggtslLrN5wAGwbp4CtxJn571hA BkkIHGGTuPehhQWiyEVi+s3NzBC2sMSr41vYIWwZic6Og0wQDc2MEu0zZrFDOD2MElvn7GCD qLKWOHz8IiuIzSzAJzFp23SgSRxAcV6JjjYhiBIPicUf1zBD/DmBUeLR2uOsExglFzAyrGIU Ty0tzk1PLTbKSy3XK07MLS7NS9dLzs/dxAiM69P/jn/ZwbjrT9IhRgEORiUe3gepx6OFWBPL iitzDzFKcDArifBWm52IFuJNSaysSi3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1p192004241424d1cf581f715558b2e67a4 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181018095716eucas1p192004241424d1cf581f715558b2e67a4 References: <20181018095708.1527-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Exynos Multi-Core Timer driver is used only on device-tree based systems, so remove non-dt related code. In case of !CONFIG_OF the code is anyway equal because of_irq_count() has a stub returning 0. Device node pointer is always provided when driver has been probed from device tree. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi --- drivers/clocksource/exynos_mct.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 7a244b681876..ef18bbf8d20c 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -507,13 +507,12 @@ static int __init exynos4_timer_resources(struct device_node *np, void __iomem * int err, cpu; struct clk *mct_clk, *tick_clk; - tick_clk = np ? of_clk_get_by_name(np, "fin_pll") : - clk_get(NULL, "fin_pll"); + tick_clk = of_clk_get_by_name(np, "fin_pll"); if (IS_ERR(tick_clk)) panic("%s: unable to determine tick clock rate\n", __func__); clk_rate = clk_get_rate(tick_clk); - mct_clk = np ? of_clk_get_by_name(np, "mct") : clk_get(NULL, "mct"); + mct_clk = of_clk_get_by_name(np, "mct"); if (IS_ERR(mct_clk)) panic("%s: unable to retrieve mct clock instance\n", __func__); clk_prepare_enable(mct_clk); @@ -581,11 +580,7 @@ static int __init mct_init_dt(struct device_node *np, unsigned int int_type) * timer irqs are specified after the four global timer * irqs are specified. */ -#ifdef CONFIG_OF nr_irqs = of_irq_count(np); -#else - nr_irqs = 0; -#endif for (i = MCT_L0_IRQ; i < nr_irqs; i++) mct_irqs[i] = irq_of_parse_and_map(np, i); From patchwork Thu Oct 18 09:57:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10646939 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD49C17DE for ; Thu, 18 Oct 2018 09:57:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92FCE28830 for ; Thu, 18 Oct 2018 09:57:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86EC1288C9; Thu, 18 Oct 2018 09:57:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3056B28830 for ; Thu, 18 Oct 2018 09:57:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727885AbeJRR5e (ORCPT ); Thu, 18 Oct 2018 13:57:34 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:58937 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727423AbeJRR5d (ORCPT ); Thu, 18 Oct 2018 13:57:33 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181018095717euoutp0244b3117ec04057e0f96e184197362be3~eq3QpAt2j3210732107euoutp02q; Thu, 18 Oct 2018 09:57:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181018095717euoutp0244b3117ec04057e0f96e184197362be3~eq3QpAt2j3210732107euoutp02q DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539856638; bh=23R/J6B8yoCfPOWlxldxP5D7mXL7n7ZMaMuWjzEhIWQ=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=dBrHmwsUvh/Emgqaf1MT1jV5kIXzQO2P6ajX08nU9XWBCn7i/oLIvaOFBmfKIs+8z XnmkVvViXf2k0RVF2f94zd2fUKIL1c+fK+PrxaJy0kkSicn/CWdco5Y3UpAeob0iJl 3Th9Mx2gj+GRBruGfl7aGxD7IWkutIzZA1VfcOno= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181018095717eucas1p1d3672ab28cff9ac1551d45b80ea4a18a~eq3QKIJ891223412234eucas1p10; Thu, 18 Oct 2018 09:57:17 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 8E.D1.04294.DF858CB5; Thu, 18 Oct 2018 10:57:17 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181018095716eucas1p103fb0d1a19c6122e885b15526c176967~eq3Pc6OL01224112241eucas1p1j; Thu, 18 Oct 2018 09:57:16 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-fc-5bc858fd08bb Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id FC.D2.04284.CF858CB5; Thu, 18 Oct 2018 10:57:16 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGS00GLZGZA2H50@eusync3.samsung.com>; Thu, 18 Oct 2018 10:57:16 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Will Deacon , Catalin Marinas , Marc Zyngier , Thomas Gleixner , Daniel Lezcano , Krzysztof Kozlowski , Chanwoo Choi , Bartlomiej Zolnierkiewicz , Inki Dae , Mark Rutland Subject: [PATCH v4 2/6] clocksource: exynos_mct: Fix error path in timer resources initialization Date: Thu, 18 Oct 2018 11:57:04 +0200 Message-id: <20181018095708.1527-3-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181018095708.1527-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGIsWRmVeSWpSXmKPExsWy7djPc7p/I05EG2yawW2xccZ6Vov3y3oY La5/ec5qMe+zrMWk+xNYLM6f38BusenxNVaLy7vmsFnMOL+PyWLtkbvsFn/v/GOzWHr9IpPF 5k1TmS1efjzB4sDnsWbeGkaPTas62TzuXNvD5vHu3Dl2j81L6j36tqxi9Pi8SS6APYrLJiU1 J7MstUjfLoEr4+eGi+wFX7kq7p7YxdTAOJezi5GTQ0LARGLCq71sILaQwApGidP9Fl2MXED2 Z0aJPS8/McMU3Tzdxw6RWMYocev/YRYIp4FJ4u+GE2DtbAKGEl1vu8BsEYFsic7HDxhBipgF TjJL/Lu5iR0kISyQLHHr3l1WEJtFQFVi84LnTCA2r4CNxO01Vxkh1slLrN5wAGw1p4CtxJn5 78C2SQgcYZP4fPYoG0SRi8SV/jPsELawxKvjW6BsGYnOjoNMEA3NjBLtM2axQzg9jBJb5+yA 6raWOHz8ItgZzAJ8EpO2TQdaxwEU55XoaBOCKPGQmDbvDRvEnxMYJa5sW8w+gVFyASPDKkbx 1NLi3PTUYqO81HK94sTc4tK8dL3k/NxNjMDYPv3v+JcdjLv+JB1iFOBgVOLhfZB6PFqINbGs uDL3EKMEB7OSCG+12YloId6UxMqq1KL8+KLS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1p103fb0d1a19c6122e885b15526c176967 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181018095716eucas1p103fb0d1a19c6122e885b15526c176967 References: <20181018095708.1527-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP While freeing interrupt handlers in error path, don't assume that all requested interrupts are per-processor interrupts and properly release standard interrupts too. Reported-by: Krzysztof Kozlowski Fixes: 56a94f13919c ("clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier") Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi --- drivers/clocksource/exynos_mct.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index ef18bbf8d20c..49413900b24c 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -561,7 +561,19 @@ static int __init exynos4_timer_resources(struct device_node *np, void __iomem * return 0; out_irq: - free_percpu_irq(mct_irqs[MCT_L0_IRQ], &percpu_mct_tick); + if (mct_int_type == MCT_INT_PPI) { + free_percpu_irq(mct_irqs[MCT_L0_IRQ], &percpu_mct_tick); + } else { + for_each_possible_cpu(cpu) { + struct mct_clock_event_device *pcpu_mevt = + per_cpu_ptr(&percpu_mct_tick, cpu); + + if (pcpu_mevt->evt.irq != -1) { + free_irq(pcpu_mevt->evt.irq, pcpu_mevt); + pcpu_mevt->evt.irq = -1; + } + } + } return err; } From patchwork Thu Oct 18 09:57:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10646941 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4218717D4 for ; Thu, 18 Oct 2018 09:57:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 275AD28830 for ; Thu, 18 Oct 2018 09:57:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1BACA288C7; Thu, 18 Oct 2018 09:57:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1D52288D7 for ; Thu, 18 Oct 2018 09:57:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727455AbeJRR6M (ORCPT ); Thu, 18 Oct 2018 13:58:12 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:53131 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727853AbeJRR5e (ORCPT ); Thu, 18 Oct 2018 13:57:34 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181018095718euoutp016bd5895d743845253d7ac83a534641e4~eq3RMLqty0160201602euoutp01e; Thu, 18 Oct 2018 09:57:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181018095718euoutp016bd5895d743845253d7ac83a534641e4~eq3RMLqty0160201602euoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539856638; bh=h+DAgBMdXW66D9M3iwDYly4siSxPNHVl5qlT4WELpzU=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=V5zlImZNTBoF+5jKjEMp5FDCDd6LAvSutQu31bA9QQZGzNEJGBwReABn2gqZgK1TH d1pAltluS1FUVCgqmTJW78et/NyL0iJrsLFHmoiUGJkyCnx8XmAc0Nwnx9AwDolk4a n1+DbKkZ3JuoxeGa27MCVSeKbRt1wc21JPw3LBB0= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181018095718eucas1p2b97a0fec37fbcae0686cce9e833d94d3~eq3QxUv492884828848eucas1p2X; Thu, 18 Oct 2018 09:57:18 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id DB.63.04441.DF858CB5; Thu, 18 Oct 2018 10:57:17 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181018095717eucas1p2c89f6e71642e6db62676e1af5514529f~eq3QCyEdV0201302013eucas1p2p; Thu, 18 Oct 2018 09:57:17 +0000 (GMT) X-AuditID: cbfec7f2-a1ae89c000001159-6a-5bc858fdcc2f Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CB.C2.04128.DF858CB5; Thu, 18 Oct 2018 10:57:17 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGS00GLZGZA2H50@eusync3.samsung.com>; Thu, 18 Oct 2018 10:57:17 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Will Deacon , Catalin Marinas , Marc Zyngier , Thomas Gleixner , Daniel Lezcano , Krzysztof Kozlowski , Chanwoo Choi , Bartlomiej Zolnierkiewicz , Inki Dae , Mark Rutland Subject: [PATCH v4 3/6] clocksource: exynos_mct: Refactor resources allocation Date: Thu, 18 Oct 2018 11:57:05 +0200 Message-id: <20181018095708.1527-4-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181018095708.1527-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrGIsWRmVeSWpSXmKPExsWy7djP87p/I05EG2y+ZWKxccZ6Vov3y3oY La5/ec5qMe+zrMWk+xNYLM6f38BusenxNVaLy7vmsFnMOL+PyWLtkbvsFn/v/GOzWHr9IpPF 5k1TmS1efjzB4sDnsWbeGkaPTas62TzuXNvD5vHu3Dl2j81L6j36tqxi9Pi8SS6APYrLJiU1 J7MstUjfLoEr49zZbvaCXxIVz24+Z29g3CXSxcjJISFgIrHs4DbmLkYuDiGBFYwSj378Zodw PjNK7L4ykQWmatuLpywQiWWMEne+z2KDcBqYJHa2PgarYhMwlOh628UGYosIZEt0Pn7ACFLE LHCSWeLfzU3sIAlhgQCJ67s/g9ksAqoSx1umMoPYvAI2Ev3rj7BCrJOXWL3hAFicU8BW4sz8 d1BnHGGT+PWCA8J2kZi7axczhC0s8er4FnYIW0bi8uRusFMlBJoZJdpnzGKHcHoYJbbO2cEG UWUtcfj4RbBtzAJ8EpO2TQeaxAEU55XoaBOCKPGQ2HxiKSvEmxMYJZY//s8+gVFyASPDKkbx 1NLi3PTUYsO81HK94sTc4tK8dL3k/NxNjMDYPv3v+KcdjF8vJR1iFOBgVOLhfZB6PFqINbGs uDL3EKMEB7OSCG+12YloId6UxMqq1KL8+KLSnNTiQ4zSHCxK4rzL5m2MFhJITyxJzU5NLUgt gskycXBKNTAuefTU8mbtN0UZO6GQg7u4eMId62/2S22PZjz98nhsalrTOUGb+IPa6w1amWS7 pmuUzlJc8qrlUXrm0+2nIx5NLH2oaZnzxD/Ms365Xno+1w7zXTWaxi4LKkULr6cKKV/cr/Xx Bn9R5BYtLbONSTf/lm7ZKF8isSZ2a9PunGVuFms5lm5+8UeJpTgj0VCLuag4EQBIeDDL6QIA AA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrMLMWRmVeSWpSXmKPExsVy+t/xq7p/I05EG/w8KGixccZ6Vov3y3oY La5/ec5qMe+zrMWk+xNYLM6f38BusenxNVaLy7vmsFnMOL+PyWLtkbvsFn/v/GOzWHr9IpPF 5k1TmS1efjzB4sDnsWbeGkaPTas62TzuXNvD5vHu3Dl2j81L6j36tqxi9Pi8SS6APYrLJiU1 J7MstUjfLoEr49zZbvaCXxIVz24+Z29g3CXSxcjJISFgIrHtxVOWLkYuDiGBJYwSh3a/Z4Vw mpgkrrxZyw5SxSZgKNH1tosNxBYRyJaYv7ebHaSIWeAks8Slx+9YQBLCAn4Sp65A2CwCqhLH W6Yyg9i8AjYS/euPsEKsk5dYveEAWJxTwFbizHyIeiGgmu4/69knMPIsYGRYxSiSWlqcm55b bKRXnJhbXJqXrpecn7uJERiU24793LKDsetd8CFGAQ5GJR7eB6nHo4VYE8uKK3MPMUpwMCuJ 8FabnYgW4k1JrKxKLcqPLyrNSS0+xCjNwaIkznveoDJKSCA9sSQ1OzW1ILUIJsvEwSnVwJia z3lCdseNX5/3P6o8f+KKX1fzjXutZxP0rTfPj1u0+0PGiwnn1Ti/f2Lu/hSic+5bfNSSXqY9 IYVlMXmHJwp4pn2yEWm+6rByaWXalu6b6u/uv1RabbSKUbifJSL6y7W985ctPvWkTfRLQfhK h2q2yozbihIP16wQswkudVOU33zKNSH3WpYSS3FGoqEWc1FxIgA8uj/eRgIAAA== X-CMS-MailID: 20181018095717eucas1p2c89f6e71642e6db62676e1af5514529f X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181018095717eucas1p2c89f6e71642e6db62676e1af5514529f References: <20181018095708.1527-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move interrupts allocation from exynos4_timer_resources() into separate function together with the interrupt number parsing code from mct_init_dt(), so the code for managing interrupts is kept together. While touching exynos4_timer_resources() function, move of_iomap() to it. No functional changes. Signed-off-by: Marek Szyprowski Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- drivers/clocksource/exynos_mct.c | 50 +++++++++++++++++++------------- 1 file changed, 30 insertions(+), 20 deletions(-) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 49413900b24c..4c886ff2941a 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -502,11 +502,14 @@ static int exynos4_mct_dying_cpu(unsigned int cpu) return 0; } -static int __init exynos4_timer_resources(struct device_node *np, void __iomem *base) +static int __init exynos4_timer_resources(struct device_node *np) { - int err, cpu; struct clk *mct_clk, *tick_clk; + reg_base = of_iomap(np, 0); + if (!reg_base) + panic("%s: unable to ioremap mct address space\n", __func__); + tick_clk = of_clk_get_by_name(np, "fin_pll"); if (IS_ERR(tick_clk)) panic("%s: unable to determine tick clock rate\n", __func__); @@ -517,9 +520,27 @@ static int __init exynos4_timer_resources(struct device_node *np, void __iomem * panic("%s: unable to retrieve mct clock instance\n", __func__); clk_prepare_enable(mct_clk); - reg_base = base; - if (!reg_base) - panic("%s: unable to ioremap mct address space\n", __func__); + return 0; +} + +static int __init exynos4_timer_interrupts(struct device_node *np, + unsigned int int_type) +{ + int nr_irqs, i, err, cpu; + + mct_int_type = int_type; + + /* This driver uses only one global timer interrupt */ + mct_irqs[MCT_G0_IRQ] = irq_of_parse_and_map(np, MCT_G0_IRQ); + + /* + * Find out the number of local irqs specified. The local + * timer irqs are specified after the four global timer + * irqs are specified. + */ + nr_irqs = of_irq_count(np); + for (i = MCT_L0_IRQ; i < nr_irqs; i++) + mct_irqs[i] = irq_of_parse_and_map(np, i); if (mct_int_type == MCT_INT_PPI) { @@ -579,24 +600,13 @@ static int __init exynos4_timer_resources(struct device_node *np, void __iomem * static int __init mct_init_dt(struct device_node *np, unsigned int int_type) { - u32 nr_irqs, i; int ret; - mct_int_type = int_type; - - /* This driver uses only one global timer interrupt */ - mct_irqs[MCT_G0_IRQ] = irq_of_parse_and_map(np, MCT_G0_IRQ); - - /* - * Find out the number of local irqs specified. The local - * timer irqs are specified after the four global timer - * irqs are specified. - */ - nr_irqs = of_irq_count(np); - for (i = MCT_L0_IRQ; i < nr_irqs; i++) - mct_irqs[i] = irq_of_parse_and_map(np, i); + ret = exynos4_timer_resources(np); + if (ret) + return ret; - ret = exynos4_timer_resources(np, of_iomap(np, 0)); + ret = exynos4_timer_interrupts(np, int_type); if (ret) return ret; From patchwork Thu Oct 18 09:57:06 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10646937 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B00B017DE for ; Thu, 18 Oct 2018 09:57:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9479D28830 for ; Thu, 18 Oct 2018 09:57:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8522D288C9; Thu, 18 Oct 2018 09:57:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2603828830 for ; Thu, 18 Oct 2018 09:57:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728071AbeJRR6B (ORCPT ); Thu, 18 Oct 2018 13:58:01 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:53145 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727877AbeJRR5e (ORCPT ); Thu, 18 Oct 2018 13:57:34 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181018095719euoutp011b840002f9645bdc3babcb8f38f7bdc4~eq3R1SW150108101081euoutp01U; Thu, 18 Oct 2018 09:57:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181018095719euoutp011b840002f9645bdc3babcb8f38f7bdc4~eq3R1SW150108101081euoutp01U DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539856639; bh=7RzFxofNGfgWBQtiHbTFe9TEVqpCi1g2karnmb1X59I=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=krfirxAzO7Qq5s/ssVN+WwSU3qIg0R/JW2QqcVPuuVdbjb6OZgXY+JXsg/etwYgza spT2ReJCudf3/zRXmgQNZCwri4td8ZebkrQIx0Au62PDD5jkGVu8LLuph2IggccQlW VjMWdDmrMWh0V8+B8+BeD3DoXHRuPBgadnre/9GU= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181018095718eucas1p195d0397d91b2620e70fb24d070d38f04~eq3RR8IuI2351723517eucas1p1L; Thu, 18 Oct 2018 09:57:18 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id A3.B1.04806.EF858CB5; Thu, 18 Oct 2018 10:57:18 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181018095717eucas1p20a7d2d2b1b18ae60a4893a8e3d8c19f9~eq3Qh5W422119521195eucas1p2U; Thu, 18 Oct 2018 09:57:17 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-b4-5bc858fe9a3d Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id EC.C2.04128.DF858CB5; Thu, 18 Oct 2018 10:57:17 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGS00GLZGZA2H50@eusync3.samsung.com>; Thu, 18 Oct 2018 10:57:17 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Will Deacon , Catalin Marinas , Marc Zyngier , Thomas Gleixner , Daniel Lezcano , Krzysztof Kozlowski , Chanwoo Choi , Bartlomiej Zolnierkiewicz , Inki Dae , Mark Rutland Subject: [PATCH v4 4/6] clocksource: exynos_mct: Add arch_timer cooperation mode for ARM64 Date: Thu, 18 Oct 2018 11:57:06 +0200 Message-id: <20181018095708.1527-5-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181018095708.1527-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMIsWRmVeSWpSXmKPExsWy7djPc7r/Ik5EG9w6IGaxccZ6Vov3y3oY La5/ec5qMe+zrMWk+xNYLM6f38BusenxNVaLy7vmsFnMOL+PyWLtkbvsFn/v/GOzWHr9IpPF 5k1TmS1efjzB4sDnsWbeGkaPTas62TzuXNvD5vHu3Dl2j81L6j36tqxi9Pi8SS6APYrLJiU1 J7MstUjfLoEro3lVcMFC7opt1/cxNjCu5Oxi5OCQEDCR2LU/v4uRi0NIYAWjxJ9nB1ggnM+M Er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ZSHT/Wc8+gZFnASPDKkaR1NLi 3PTcYiO94sTc4tK8dL3k/NxNjMBw3Hbs55YdjF3vgg8xCnAwKvHwPkg9Hi3EmlhWXJl7iFGC g1lJhLfa7ES0EG9KYmVValF+fFFpTmrxIUZpDhYlcd7zBpVRQgLpiSWp2ampBalFMFkmDk6p Bkb3bVcfTa+Zu+WtUOMefcEJOj9uTDpg6nNZXTs+4jj7wcP/9qS926Dk7P5E9Puchh72m5es +H7u8OqUkGj7Wa/Ump90s7riQMirQ1VPGUubHXe5mN4+/O5idjvjl6OZihEVUyWO2517V2l5 rObTAtmyNXW+qTpfa+0C9vXN2eHT/3DFg2sNub5KLMUZiYZazEXFiQC2MYxoQwIAAA== X-CMS-MailID: 20181018095717eucas1p20a7d2d2b1b18ae60a4893a8e3d8c19f9 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181018095717eucas1p20a7d2d2b1b18ae60a4893a8e3d8c19f9 References: <20181018095708.1527-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP To get ARM Architected Timers working on Samsung Exynos SoCs, one has to first configure and enable Exynos Multi-Core Timer, because they both share some common hardware blocks (global system counter). This patch adds a mode of cooperation with arch_timer driver, so kernel can use CP15 based timer interface via arch_timer driver, which is mandatory on ARM64. In such mode MCT driver only enables its clocks and starts global timer. Everything else will be handled by arch_timer driver. Signed-off-by: Marek Szyprowski Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi Reviewed-by: Krzysztof Kozlowski --- drivers/clocksource/exynos_mct.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 4c886ff2941a..1f5249fb25fd 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -606,6 +606,16 @@ static int __init mct_init_dt(struct device_node *np, unsigned int int_type) if (ret) return ret; + if (IS_ENABLED(CONFIG_ARM64) && IS_ENABLED(CONFIG_ARM_ARCH_TIMER)) { + struct device_node *np = of_find_compatible_node(NULL, NULL, + "arm,armv8-timer"); + if (np) { + of_node_put(np); + exynos4_mct_frc_start(); + return 0; + } + } + ret = exynos4_timer_interrupts(np, int_type); if (ret) return ret; From patchwork Thu Oct 18 09:57:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10646933 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 731B417D4 for ; Thu, 18 Oct 2018 09:57:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57B2928830 for ; Thu, 18 Oct 2018 09:57:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4B729288C9; Thu, 18 Oct 2018 09:57:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EA6D528830 for ; Thu, 18 Oct 2018 09:57:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728032AbeJRR5f (ORCPT ); Thu, 18 Oct 2018 13:57:35 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:53153 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727946AbeJRR5f (ORCPT ); Thu, 18 Oct 2018 13:57:35 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181018095719euoutp01d2838277dbccbd78b006fbc20c19f301~eq3SUf2Um0160201602euoutp01f; Thu, 18 Oct 2018 09:57:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181018095719euoutp01d2838277dbccbd78b006fbc20c19f301~eq3SUf2Um0160201602euoutp01f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539856639; bh=Flm64HIKyGpGJJ++WR5bD05/fn6GV6v+Pg40dM+Jxdg=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=NN7YGIRJweT4UFtrUkfKqB5tJlwsnweWLCiT3wX8uX25NLZEp+vq4Mwab1+oTfadf UG+y6ozmaSBSNsz2eV2aJb+ftj2w6y/5bEPrilkRFVC0snUVpavFKHCXC/7LzMo3Yu JbIDFn6fNfXjUCJJ5EOPk/mB8+w3OAIXix4LvYvc= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181018095719eucas1p2b2edc39c08bc260229864241c6467a29~eq3R4Et2y0201302013eucas1p2u; Thu, 18 Oct 2018 09:57:19 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id 30.E1.04294.EF858CB5; Thu, 18 Oct 2018 10:57:19 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181018095718eucas1p17799dfba088b0ea412687dd5f1dad78f~eq3RFN3X91872818728eucas1p15; Thu, 18 Oct 2018 09:57:18 +0000 (GMT) X-AuditID: cbfec7f4-84fff700000010c6-02-5bc858fe7559 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 20.E2.04284.EF858CB5; Thu, 18 Oct 2018 10:57:18 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGS00GLZGZA2H50@eusync3.samsung.com>; Thu, 18 Oct 2018 10:57:18 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Will Deacon , Catalin Marinas , Marc Zyngier , Thomas Gleixner , Daniel Lezcano , Krzysztof Kozlowski , Chanwoo Choi , Bartlomiej Zolnierkiewicz , Inki Dae , Mark Rutland Subject: [PATCH v4 5/6] arm64: dts: exynos: Move arch-timer node to right place Date: Thu, 18 Oct 2018 11:57:07 +0200 Message-id: <20181018095708.1527-6-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181018095708.1527-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzVRa0hTYRju2zk757haHTbDz1uXQReCLEXiQy0N+nFAyKR+ZAty5Wma7kx2 3MoiXFama5YZMgnTChWdhrqZqZjUGk1LHWIqoqZh0MUbNvsxqVXz6L/neZ/neS+8FCb7iIdQ GVwOq+NUWQpCgre987r3/z3dozzY3y5CLeVNYrRYawZodPmrGFV6wlHpVAmO3O5mEtlmRsRo qLOCQOXubhF67pwk0Z8JH4FqRgdFyG4rw9D3pR48YTPTWNkIGJu1iGAmRroIZmFggGTs1XnM vVYrYDy2bSfIM5K4NDYrw8DqDhxJlaT3DhWA7DrpFW+Z2ggWJSYQQEE6Gr5/bCRNQELJ6DoA 68dr1ogHwA7HJ7DuMltWcEGoBdB7/5lYIEYRHB6ZXHURdCQ0zZsIPw6kM2HRzDTwmzC6F4O+ MRvpF+R0Mnx42yEyAYrC6V3wi1HuL0vpOPhqrp8Qpm2HD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1H3R4sFzTrUd8WcoFRh3/6U5+3ooM//eyqwuvzovg6O2e +i1z/vq0ePMPavJeGzyKNObazSiYn/qF858w97w7Oduzd92+u2K9eb/pgpgZli9a98blTytY 8uSJwoHHuU+CZd5ePrdQ6722leMrwWeVM/6+VWIpzkg01GIuKk4EANyZ4zZEAgAA X-CMS-MailID: 20181018095718eucas1p17799dfba088b0ea412687dd5f1dad78f X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181018095718eucas1p17799dfba088b0ea412687dd5f1dad78f References: <20181018095708.1527-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move ARM architected timer device-tree node to the beginning of 'soc' node, to group it together with other ARM CPU core devices (like PMU). Signed-off-by: Marek Szyprowski Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi --- arch/arm64/boot/dts/exynos/exynos5433.dtsi | 23 +++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/arch/arm64/boot/dts/exynos/exynos5433.dtsi b/arch/arm64/boot/dts/exynos/exynos5433.dtsi index 2131f12364cb..fa20eb3495b3 100644 --- a/arch/arm64/boot/dts/exynos/exynos5433.dtsi +++ b/arch/arm64/boot/dts/exynos/exynos5433.dtsi @@ -255,6 +255,18 @@ interrupt-affinity = <&cpu4>, <&cpu5>, <&cpu6>, <&cpu7>; }; + timer: timer { + compatible = "arm,armv8-timer"; + interrupts = , + , + , + ; + }; + chipid@10000000 { compatible = "samsung,exynos4210-chipid"; reg = <0x10000000 0x100>; @@ -1750,17 +1762,6 @@ }; }; - timer: timer { - compatible = "arm,armv8-timer"; - interrupts = , - , - , - ; - }; }; #include "exynos5433-bus.dtsi" From patchwork Thu Oct 18 09:57:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 10646931 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABC6717DE for ; Thu, 18 Oct 2018 09:57:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9052928830 for ; Thu, 18 Oct 2018 09:57:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8497D288C9; Thu, 18 Oct 2018 09:57:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 23E1228830 for ; Thu, 18 Oct 2018 09:57:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727946AbeJRR5f (ORCPT ); Thu, 18 Oct 2018 13:57:35 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:58967 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727997AbeJRR5f (ORCPT ); Thu, 18 Oct 2018 13:57:35 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181018095720euoutp022f9f0a605126b1e654091eaf692e6b50~eq3Sz2mcQ3210532105euoutp02z; Thu, 18 Oct 2018 09:57:20 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181018095720euoutp022f9f0a605126b1e654091eaf692e6b50~eq3Sz2mcQ3210532105euoutp02z DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539856640; bh=JbawqqnuJmBPjDcr8q+jVFNwx8wHm3+63GETfeiWmM0=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Q9uYZdYFUvMcis5O22jtqppTl7hl/4CPrsdlGYPX0URfloFk26eZCwnEJw5lmb+78 8nLVFA3PtHRvCUkYYj4ns3Yy5LKQw4Z30eUoSGUYQnmozeBOH8L7d8MjPVA6N2m8k4 mQkST35PGi229BZYqUpFFtdGTd3oUNxAF9D1wT44= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181018095719eucas1p14a5ba239fba9a472368332262f9acb53~eq3SYkGck1223012230eucas1p1s; Thu, 18 Oct 2018 09:57:19 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id BF.63.04441.FF858CB5; Thu, 18 Oct 2018 10:57:19 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181018095719eucas1p27732208abef3397d28640c4e519d5bca~eq3RuB4RF2701327013eucas1p2o; Thu, 18 Oct 2018 09:57:19 +0000 (GMT) X-AuditID: cbfec7f2-a1ae89c000001159-75-5bc858ffa2b4 Received: from eusync3.samsung.com ( [203.254.199.213]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id FE.C2.04128.FF858CB5; Thu, 18 Oct 2018 10:57:19 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync3.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGS00GLZGZA2H50@eusync3.samsung.com>; Thu, 18 Oct 2018 10:57:19 +0100 (BST) From: Marek Szyprowski To: linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Marek Szyprowski , Will Deacon , Catalin Marinas , Marc Zyngier , Thomas Gleixner , Daniel Lezcano , Krzysztof Kozlowski , Chanwoo Choi , Bartlomiej Zolnierkiewicz , Inki Dae , Mark Rutland Subject: [PATCH v4 6/6] arm64: platform: Add enable Exynos Multi-Core Timer driver Date: Thu, 18 Oct 2018 11:57:08 +0200 Message-id: <20181018095708.1527-7-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181018095708.1527-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrMIsWRmVeSWpSXmKPExsWy7djPc7r/I05EG/x+rmyxccZ6Vov3y3oY La5/ec5qMe+zrMWk+xNYLM6f38BusenxNVaLy7vmsFnMOL+PyWLtkbvsFn/v/GOzWHr9IpPF 5k1TmS1efjzB4sDnsWbeGkaPTas62TzuXNvD5vHu3Dl2j81L6j36tqxi9Pi8SS6APYrLJiU1 J7MstUjfLoEr49CWW2wFc9gr/vz/ytTAOImti5GTQ0LARGLuk3MsXYxcHEICKxglunpvskI4 nxklrqy/zQJT1fDzHRNEYhmjxOEFrVBVDUwSz38cA6tiEzCU6HrbBTZXRCBbovPxA0aQImaB k8wS/25uYu9i5OAQFgiRuPGnBsRkEVCVmH5OG6ScV8BGouXzFqiT5CVWbzjADGJzCthKnJn/ Duw8CYEjbBJrb2+CushF4sDsh0wQtrDEq+Nb2CFsGYnLk7uhGpoZJdpnzGKHcHoYJbbO2QG1 wlri8PGLrCA2swCfxKRt05lBLpIQ4JXoaBOCMD0kLn6sA6kQEpjAKLFhds4ERskFjAyrGMVT S4tz01OLDfNSy/WKE3OLS/PS9ZLzczcxAqP69L/jn3Ywfr2UdIhRgINRiYf3QerxaCHWxLLi ytxDjBIczEoivNVmJ6KFeFMSK6tSi/Lji0pzUosPMUpzsCiJ8y6btzFaSCA9sSQ1OzW1ILUI JsvEwSnVwMh+TObeAZNv5ac3qXzUfcH7fvp5y8uClbPdCo5WbBYWld20ZdKOeWfnmpzZmnGx 5v2Dk6+mbQzZIGhvfyHZUkdtr3pG5P0J0U0uS/yr3t3zthM84byhseSr9HEtA+Vkr4wgNbnC 0wFqbXt/7Z15rbrPIGCzVEud04/lnvmmH58tylm+67DxnW4lluKMREMt5qLiRADwoTuc5gIA AA== X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrILMWRmVeSWpSXmKPExsVy+t/xq7r/I05EG+yZwmKxccZ6Vov3y3oY La5/ec5qMe+zrMWk+xNYLM6f38BusenxNVaLy7vmsFnMOL+PyWLtkbvsFn/v/GOzWHr9IpPF 5k1TmS1efjzB4sDnsWbeGkaPTas62TzuXNvD5vHu3Dl2j81L6j36tqxi9Pi8SS6APYrLJiU1 J7MstUjfLoEr49CWW2wFc9gr/vz/ytTAOImti5GTQ0LARKLh5zumLkYuDiGBJYwSM1r+skM4 TUwSrbeuMoFUsQkYSnS97QLrEBHIlpi/txusiFngJLPEpcfvWLoYOTiEBUIkbvypATFZBFQl pp/TBinnFbCRaPm8BWqZvMTqDQeYQWxOAVuJM/NBOjmBdtlIdP9Zzz6BkWcBI8MqRpHU0uLc 9NxiI73ixNzi0rx0veT83E2MwIDcduznlh2MXe+CDzEKcDAq8fA+SD0eLcSaWFZcmXuIUYKD WUmEt9rsRLQQb0piZVVqUX58UWlOavEhRmkOFiVx3vMGlVFCAumJJanZqakFqUUwWSYOTqkG RnPuqkuXVWfXr+m2enPt4Ou3U4/fTvzWLJ7qvUqgukS5olRw2u9qk+pl7yy1i2Nm7I6sFHhz TvArZ8UGyVutJ288CYzr3bDmxnVftT6P6cYi3NG6O5LPr+heWqZ20C565lq13F31Sye4ZdWU s33XkVr8sGiqYZjRmd9vympOdDxSm6KulPHMU4mlOCPRUIu5qDgRAN3coEBEAgAA X-CMS-MailID: 20181018095719eucas1p27732208abef3397d28640c4e519d5bca X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181018095719eucas1p27732208abef3397d28640c4e519d5bca References: <20181018095708.1527-1-m.szyprowski@samsung.com> Sender: linux-samsung-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Exynos SoCs enabling MCT driver is required even if ARM Architected Timer driver is used to for managing timer hardware and clock source events. Signed-off-by: Marek Szyprowski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi --- arch/arm64/Kconfig.platforms | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/Kconfig.platforms b/arch/arm64/Kconfig.platforms index 51bc479334a4..7cc687580fad 100644 --- a/arch/arm64/Kconfig.platforms +++ b/arch/arm64/Kconfig.platforms @@ -62,6 +62,7 @@ config ARCH_BRCMSTB config ARCH_EXYNOS bool "ARMv8 based Samsung Exynos SoC family" select COMMON_CLK_SAMSUNG + select CLKSRC_EXYNOS_MCT select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS select EXYNOS_PMU select HAVE_S3C2410_WATCHDOG if WATCHDOG