From patchwork Wed Oct 17 13:41:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 149066 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp674103lji; Wed, 17 Oct 2018 06:42:21 -0700 (PDT) X-Google-Smtp-Source: ACcGV611nsoHfe6P+LJUBQ/1IyBot9MxNnLRP6BjeOXTz7Z7J/FeXd9n9qJuOTMKQhS0LQ8eWM2l X-Received: by 2002:a17:902:8342:: with SMTP id z2-v6mr25650413pln.147.1539783740907; Wed, 17 Oct 2018 06:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539783740; cv=none; d=google.com; s=arc-20160816; b=lCSgdhsK8K3MxNU2Z2AbSrxHJjwsbejgxVtg6PvpE5eR9qgmmn/ETshNrQNeHDZzFW Uabk2qnWRQIAO9NlZF9b51YlwtKI80T9Ck6goS4DvgdFj+4PZ0MsuUHrAufGCbl3ZvJt 36qQgXM6uLCtq7dqfbyvshe8fdVdbISwXDMhnnNc3ynoUpBc3erZlMG9Rr+CIbT5xSJ5 vK2hX50cZA2XjWPbLqsLyr9tTo6WmXyZ7yiZ6WlLLeIdWNgD1zE0lW1qGFcytMnQauDn SH3Ra22DoONDbM434ggOEFrq+fevDJUjAhC916RbOFVeOlYpP5yQVH8xKjyoGB4eZQzF EAXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=zJetpoNhW01GT4Xt0gk6SKTpHAA/tdY/kH9zyQ9f4Ok=; b=c1ZCNps9GhOFZcHGKJq3xj1VHRvNnQ0mC7KvULeoVWX8K8AYmiRmrXTQctf0AZYoMW 8rU8pHq06kmPP5B4lU6f6FZ+noP6SpF8OqlxGBjUiy1ja09RCxVlevN7kfSSatMxbjMw U23zKu5+EpQefg4ilCnNM/Lg1rKYi21zbUqDRUUaAv/W/ytrPluNnJZS7QZTq4SiXEQp Vyf5NiPchYL5T0DM+KiMYyMYB/PHGeocQluSekkXQI5aSWxUFiKDq3Q4yC+k0i3msnXB 79alrLhGl4GwjvvVci3AjAmOoZJtUcO7rLXVJsixBXmLZmYfqVbotd2rqwS/8TQE9Hr3 pDpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kv7DMbMY; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si7296708plb.292.2018.10.17.06.42.15; Wed, 17 Oct 2018 06:42:20 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b=kv7DMbMY; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727481AbeJQVhy (ORCPT + 32 others); Wed, 17 Oct 2018 17:37:54 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57622 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727028AbeJQVhx (ORCPT ); Wed, 17 Oct 2018 17:37:53 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181017134206euoutp01167c8c6b6e96d4baf23f708a1bb54915~eaSQ5C5kt1251312513euoutp01C; Wed, 17 Oct 2018 13:42:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181017134206euoutp01167c8c6b6e96d4baf23f708a1bb54915~eaSQ5C5kt1251312513euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539783726; bh=zJetpoNhW01GT4Xt0gk6SKTpHAA/tdY/kH9zyQ9f4Ok=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=kv7DMbMYq4g6qZ9MUmdKcg/NrURhwwp8toEcAWkscYtZspY6jpOEeUAhjTGGzB2CH tgVekNF3XGr5BTmFW3PVoyygd87K/kiGYNn1BvkIJgaMIB9Z2wiNnAcXFg46k5c5/k fsByNleCuE3ZNpAUdYWFgg3o5dztGdgoUn17+ABQ= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181017134206eucas1p16493289394fa81fe801c0001e7b1cf6d~eaSQWvqic1588515885eucas1p1R; Wed, 17 Oct 2018 13:42:06 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 04.AD.04806.D2C37CB5; Wed, 17 Oct 2018 14:42:05 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181017134205eucas1p148faab76ac153e9afbb8a519e6d8d1e2~eaSPnTYDM1901519015eucas1p1I; Wed, 17 Oct 2018 13:42:05 +0000 (GMT) X-AuditID: cbfec7f5-34dff700000012c6-d7-5bc73c2d9acf Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 68.22.04284.D2C37CB5; Wed, 17 Oct 2018 14:42:05 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGQ001A0WQ1IZ80@eusync4.samsung.com>; Wed, 17 Oct 2018 14:42:05 +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 Subject: [PATCH v3 1/6] clocksource: exynos_mct: Remove dead code Date: Wed, 17 Oct 2018 15:41:54 +0200 Message-id: <20181017134159.9656-2-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181017134159.9656-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrDIsWRmVeSWpSXmKPExsWy7djPc7q6NsejDX5vsrbYOGM9q8X7ZT2M Fte/PGe1mPdZ1mLS/QksFufPb2C32PT4GqvF5V1z2CxmnN/HZLH2yF12i793/rFZbN40ldni 5ccTLA68HmvmrWH02LSqk83jzrU9bB7vzp1j99i8pN6jb8sqRo/Pm+QC2KO4bFJSczLLUov0 7RK4Mnatsi2YzFexp7GBrYHxIXcXIweHhICJxMc/nF2MXBxCAisYJdbfn8MM4XxmlPjwczuQ wwlW9LB7JztEYhmjxKumFYwQTgOTxL2FS1lBqtgEDCW63naxgdgiAtkSnY8fMILYzAKLmCUO HBMGsYUFHCUmv30KFmcRUJW4dXAPWD2vgI3EkstXWCG2yUus3nCAGeQ8TgFbibX9VSC7JAT2 sEns/PSdFeJsF4nvG7QgyoUlXh3fwg5hy0h0dhxkgqhvZpRonzGLHcLpYZTYOmcHG0SVtcTh 4xdZIY7jk5i0bTozxFBeiY42IYgSD4l/j/6A3SkkMIFR4vlh7QmMkgsYGVYxiqeWFuempxYb 56WW6xUn5haX5qXrJefnbmIExvHpf8e/7mDc9yfpEKMAB6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FfPgIAAA== X-CMS-MailID: 20181017134205eucas1p148faab76ac153e9afbb8a519e6d8d1e2 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181017134205eucas1p148faab76ac153e9afbb8a519e6d8d1e2 References: <20181017134159.9656-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.17.1 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 Wed Oct 17 13:41:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 149071 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp674706lji; Wed, 17 Oct 2018 06:42:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV63V16nDhVMOl4Ryk8q3eOoYjer6xuDlRxr6SNxI/wZld1Dsi72onuafyCSwqXa89qcdAPgs X-Received: by 2002:a63:91c9:: with SMTP id l192-v6mr24899448pge.433.1539783776118; Wed, 17 Oct 2018 06:42:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539783776; cv=none; d=google.com; s=arc-20160816; b=svmLALh9+N/ymqdkutHpaYHuFjqS+gY11jtms4Km7xo580HnTDHAMwSgkRkxma+N07 XUS2+0/e3pOUWoS0s6yj6ne/HvBflQHgFviBd7Brnx4TbnQhpjyqAdxU8CW6uq9g5Fpa 9YNXH7yZbH4OyTFhvDvuT5926/T4mdZbDQ5B2AjLtg0GMAa/QPcwLYONFoP3boP1tjJ+ +fs9kcQNM/+vSw7Q1aNQqe1bQPKGqztKC67cmhugg0REiL5jxTBzvCKopZ4RySWg6jbz HcXa5zxiIU/IyLmT6e44uTrjLH/4uFnhO+7ntswlXYzyWgX4IMaVnQPR1j12keL42sOr IznQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=23R/J6B8yoCfPOWlxldxP5D7mXL7n7ZMaMuWjzEhIWQ=; b=U42YitYR+SEEkzrResbxWy1thmwGC6zms/tpbX9ZueoJ9/tW4f+/r4HTYSujHghFq9 BDZOohjJPK9hmwNpwskgjka/RTMF6FtuorpWdHUluej4zGd1nSEZzEoLXDhjMOinMzTo EZYU1q3BMpOgGQ2JrtJ9X4x5Uhvak/0A+ExxCCim8k0tki6tQwa2uC7tu2Rr+TTFYO7U c5iQrL9i9XxTpWem0gCtmeTFr5yQb+cpM6UCb49kWISAVGvrac6M8oqbbx3ujgZv994b aZA6DoLA5GpThv0Eqfs9BVDHQyC5aXrG2jr147IkpAttmOczRxvsx35Gcer2qIYk9uFV udOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=vK4GJoe0; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si7296708plb.292.2018.10.17.06.42.49; Wed, 17 Oct 2018 06:42:56 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b=vK4GJoe0; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727591AbeJQViW (ORCPT + 32 others); Wed, 17 Oct 2018 17:38:22 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57629 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727040AbeJQVhy (ORCPT ); Wed, 17 Oct 2018 17:37:54 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181017134207euoutp0129c077156823e2c56f9087c500c86609~eaSRa75CD1247812478euoutp01C; Wed, 17 Oct 2018 13:42:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181017134207euoutp0129c077156823e2c56f9087c500c86609~eaSRa75CD1247812478euoutp01C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539783727; bh=23R/J6B8yoCfPOWlxldxP5D7mXL7n7ZMaMuWjzEhIWQ=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=vK4GJoe0lqjIm5ziF9DFt545bus3f0k0FiWc9s8fZmceiC/LW1OUsEfvcnVQ5wbeG u0KJjuUuDPtStaxCSylPMvAOFlO1vslhgpLrpTP0I3sO5UUKjYw9e9JARhjaDVVnei 9qQiclf/0/BZumD7TMlfpwyYi4bFAuwWcs9cNwd8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181017134206eucas1p225968760428d7ad78a8ca89943294b73~eaSQ2Fg2T1242212422eucas1p23; Wed, 17 Oct 2018 13:42:06 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id CC.4E.04441.E2C37CB5; Wed, 17 Oct 2018 14:42:06 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181017134206eucas1p1caf7cdec20ec620a5bf52fb9e060a7de~eaSQFvfjE1608716087eucas1p1Y; Wed, 17 Oct 2018 13:42:06 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-90-5bc73c2e1115 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3D.12.04128.D2C37CB5; Wed, 17 Oct 2018 14:42:06 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGQ001A0WQ1IZ80@eusync4.samsung.com>; Wed, 17 Oct 2018 14:42:05 +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 Subject: [PATCH v3 2/6] clocksource: exynos_mct: Fix error path in timer resources initialization Date: Wed, 17 Oct 2018 15:41:55 +0200 Message-id: <20181017134159.9656-3-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181017134159.9656-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRmVeSWpSXmKPExsWy7djP87p6NsejDV7fUrLYOGM9q8X7ZT2M Fte/PGe1mPdZ1mLS/QksFufPb2C32PT4GqvF5V1z2CxmnN/HZLH2yF12i793/rFZbN40ldni 5ccTLA68HmvmrWH02LSqk83jzrU9bB7vzp1j99i8pN6jb8sqRo/Pm+QC2KO4bFJSczLLUov0 7RK4Mn5uuMhe8JWr4u6JXUwNjHM5uxg5OSQETCTm3mtm7WLk4hASWMEocWXabSjnM6PE7afv mGGqHm86wQiRWMYo0dl1lwnCaWCSuLdwKStIFZuAoUTX2y42EFtEIFui8/EDRhCbWWARs8SB Y8IgtrBAskTH//9gU1kEVCX6Tj9iAbF5BWwk3k5azgSxTV5i9YYDQDUcHJwCthJr+6tAdkkI 7GGTuLZ+OjtEjYvEzB8nWCBsYYlXx7dAxWUkLk/uZoFoaGaUaJ8xix3C6WGU2DpnBxtElbXE 4eMXWSGu45OYtG062DYJAV6JjjYhiBIPiTlzm6G+nMAo8a5zJeMERskFjAyrGMVTS4tz01OL DfNSy/WKE3OLS/PS9ZLzczcxAuP59L/jn3Ywfr2UdIhRgINRiYd3h9ixaCHWxLLiytxDjBI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: 20181017134206eucas1p1caf7cdec20ec620a5bf52fb9e060a7de X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181017134206eucas1p1caf7cdec20ec620a5bf52fb9e060a7de References: <20181017134159.9656-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.17.1 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 Wed Oct 17 13:41:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 149069 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp674437lji; Wed, 17 Oct 2018 06:42:42 -0700 (PDT) X-Google-Smtp-Source: ACcGV63p7G399sn8UsEeu1uneAW4nPGSnD3jXtwUAMoiCwhs3Dx3wCalq4vLWqxY9HUKbTdhvSAZ X-Received: by 2002:a63:f501:: with SMTP id w1-v6mr23370372pgh.336.1539783762812; Wed, 17 Oct 2018 06:42:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539783762; cv=none; d=google.com; s=arc-20160816; b=KKolPasicWvwy5D7ej0kHCRrxACugCRYOUpngWyoukrnMqhb+0daHB9degfnI4U/L8 tYG7nTBPbuG/qk4MGAKcNw0ro6SwVgqiU/0skXejZs+/TVznQ+mH1m0qdCGOqYREYxh2 2hYbv9JWhTv8foyIKuchCOdadfXQCytnFTCL2R20phs4K3LL4FMH/NCAhP8N/970oQZ4 SfsBcapI3JGHgEwtltIWay3fwrDsouujWumWSrMbV6O9p6cYVXXiXeY3h7j4HMBD4C9/ q0XPIdI4pHyji43BMLytM9pEW23S4m5USdwwaeZsFo4XDAsz4ToWEB+sc5BxLdfhs5BL xCFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=oel99Mp9meQQ4+STkZabHx/+KTVTtlGBaiezJPYNJsY=; b=uC/BVQY1Y7lWeQcwyi/wL+O4MLA27D8cqdHUEcLQafslsh1txbBXByYE0Pp55U5A86 DieNccUjxbKNjMw8mL7gML3vf/m2MzgNtSrHJrjg0VKfQkRCaeLfwli6P16hRkRQnx5m nhbNbAGqg/S0KFN0FC5uLQWsiRuXdllFPSQWbtbXFXDlLYtFzuGZrsmzGacTHwG1bx3z IKsZVdu3vt4Edzq/tEZVugJcPXeN5/BdpTGFe/jsOzZZvvX+KHIsxIQlmc+5wsx9sF40 07wKKMMtUe3n00Wq15D+ZWAaQLD2aVrmEF9NLhR+d0JSHTDkFVJDjQf16xtQDS7QNeu+ /oZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=kQqw06VZ; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si7296708plb.292.2018.10.17.06.42.35; Wed, 17 Oct 2018 06:42:42 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b=kQqw06VZ; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727579AbeJQViI (ORCPT + 32 others); Wed, 17 Oct 2018 17:38:08 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:37386 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726727AbeJQVhy (ORCPT ); Wed, 17 Oct 2018 17:37:54 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181017134208euoutp02d4a410fdf8256252a1865accb1ba45c9~eaSR9I68r1192811928euoutp02o; Wed, 17 Oct 2018 13:42:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181017134208euoutp02d4a410fdf8256252a1865accb1ba45c9~eaSR9I68r1192811928euoutp02o DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539783728; bh=oel99Mp9meQQ4+STkZabHx/+KTVTtlGBaiezJPYNJsY=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=kQqw06VZBtPPZCP663Qs5jxm9kqRAeG0pi26bcNe061EGneUTsgli8NT50+hX2xSt N/GIpnz0/7sajk6KlQwSgtp6uvySPZ2WEVxyAFV/DYD5h6OHllKt8IRG5/TE8o5Jke 6vHk/456+GM9m8iEdgBere9FLXIszAKqeJYfl7pw= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181017134207eucas1p105a6fc6c211349ed1f213f0ac74092c1~eaSRZ34r21606816068eucas1p1b; Wed, 17 Oct 2018 13:42:07 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 6E.4E.04441.F2C37CB5; Wed, 17 Oct 2018 14:42:07 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181017134206eucas1p1ebc76569f706675d41f2d2183349f1f3~eaSQn7isL1609216092eucas1p1A; Wed, 17 Oct 2018 13:42:06 +0000 (GMT) X-AuditID: cbfec7f2-a1ae89c000001159-96-5bc73c2f86cb Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id AE.12.04128.E2C37CB5; Wed, 17 Oct 2018 14:42:06 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGQ001A0WQ1IZ80@eusync4.samsung.com>; Wed, 17 Oct 2018 14:42:06 +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 Subject: [PATCH v3 3/6] clocksource: exynos_mct: Refactor resources allocation Date: Wed, 17 Oct 2018 15:41:56 +0200 Message-id: <20181017134159.9656-4-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181017134159.9656-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAAzWRb0gTcRjH/e1ud7fV4tgsf2kWDgoqnBlFl5oYBB2BaL1IbC905eG/bcrO WfqmhaltaZk1Hf6ZGmbhf885h4qahjMENQVtMLFYEQoluqyEtJyn7z4Pz+fh+/A8BCKdRgOJ dG0Oo9Oq1HJMjNrHNiZDw6KcyjOeWhHVZekQUitNJYCa//lNSFm9wVT5YhlKTU114hTnmRNS s301GGWZGhRQbe8WcGrTvYVR3ZwZoZZWx9EYCd1qbQU012zEaPfcAEb/mJzE6e7G+/QTWzOg vdzRePyWOCqFUafnMrqw6GRx2p+VDiy7FN57OF0lMIB5mQmICEiegzMFy7gJiAkp+QZAS+8a 4AsvgP3GNnTPWiqeQPhGE4AVQy92LYMAjj7bxH0WRoZD03cT5mN/MhMaPZ+AjxHyJQKHx3by ZGQ87GlvR3yMkseh4YFtx5GQUfCL3Szg047Bls7hbYcgROQl2PY035cFyQEM1s0U7250BZps rwDPMrjstOE8H4Gzzx+j/EABgMWWKpwvSgDsqXFgvBUJR50fhPx2B2C5vXInDZIS+KhIyis0 dLsNu4cpA9Db4hKWgcP1wK8ZBDB6VpPKsOFa5q6CVWlYvTZVcSdLw4HtP09sOdccYH3m9ggg CSDfL3EcGlNKhapcNk8zAiCByP0l+SFOpVSSosrLZ3RZSTq9mmFHQBCBygMkTdYupZRMVeUw mQyTzej2ugJCFGgAjTfro8nYzx8zBvHr/aGxlHuw8pc5A9movigraGl37Yv42xBx1c//vc16 4qSlPuhgokuBLMw6GsSrOcnGosK4a63uxLh1k+eGi7NVvw4JLE8u1L4F58cV/5J6YtI9CaFc 6ZClYlRtDr7wW3+5q84e2Xe6t/us+WstsShNGEblKJumCj+F6FjVf3G8cCzjAgAA X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrDLMWRmVeSWpSXmKPExsVy+t/xa7p6NsejDToalCw2zljPavF+WQ+j xfUvz1kt5n2WtZh0fwKLxfnzG9gtNj2+xmpxedccNosZ5/cxWaw9cpfd4u+df2wWmzdNZbZ4 +fEEiwOvx5p5axg9Nq3qZPO4c20Pm8e7c+fYPTYvqffo27KK0ePzJrkA9igum5TUnMyy1CJ9 uwSujB/v17MV9EpUtFyYxdTAeF24i5GTQ0LAROJl+2nmLkYuDiGBJYwS6w83s0M4TUwSUyY+ YASpYhMwlOh628UGYosIZEvM39vNDmIzCyxhlrh53wHEFhbwk5hx8xBYnEVAVaKhcQtYL6+A jcSTbVOZILbJS6zecABoGwcHp4CtxNr+KpCwEFDJy89zmSYw8ixgZFjFKJJaWpybnltspFec mFtcmpeul5yfu4kRGIbbjv3csoOx613wIUYBDkYlHt4dYseihVgTy4orcw8xSnAwK4nwVike jxbiTUmsrEotyo8vKs1JLT7EKM3BoiTOe96gMkpIID2xJDU7NbUgtQgmy8TBKdXAyCrz44Dq 3ESDm8+fW6xbGey3LkVkd+y7Ap/NKRLaTB+OT9tWGJahM2f3LraSzUlvwxbMPhN4qjHZ9uKc +i3+DUkSG8NO/oq3+hEXeuQ6s0rerOxcgxvMt1nzD5j5qMap8riFveOYKW3Ts5T38/nL9at2 2WpEF3v6J71OmKD7p8L12M2Zd4RVlFiKMxINtZiLihMBsgbrDD8CAAA= X-CMS-MailID: 20181017134206eucas1p1ebc76569f706675d41f2d2183349f1f3 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181017134206eucas1p1ebc76569f706675d41f2d2183349f1f3 References: <20181017134159.9656-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/clocksource/exynos_mct.c | 49 +++++++++++++++++++------------- 1 file changed, 30 insertions(+), 19 deletions(-) -- 2.17.1 Reviewed-by: Chanwoo Choi Tested-by: Chanwoo Choi diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 49413900b24c..02ad55db390b 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 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,14 @@ 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); + ret = exynos4_timer_resources(np); + if (ret) + return ret; - /* - * 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, of_iomap(np, 0)); + ret = exynos4_timer_interrupts(np, int_type); if (ret) return ret; From patchwork Wed Oct 17 13:41:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 149067 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp674178lji; Wed, 17 Oct 2018 06:42:27 -0700 (PDT) X-Google-Smtp-Source: ACcGV60SVyG3ZfKxuYJpK7KDzaFaW0MKkU560MizUgyNVCFX341saSO3VxKFO9YmKub/+jDr3JWP X-Received: by 2002:a17:902:bc42:: with SMTP id t2-v6mr19084632plz.168.1539783747001; Wed, 17 Oct 2018 06:42:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539783746; cv=none; d=google.com; s=arc-20160816; b=ZW1HKl2rwX/1k8i4/20Wit+jY7UxUrc3LpIMUGjlxvXKQxyMZJ6l805qDbqeAO4d/5 lmjyGozWTRlkL6GVsv9+pNwybsqDEjsb+GsJgwKrCXJkrtNszHk1igmH4cp6gjXx25Hq nfgLtXfFOYQIK0f026GWYwmzo8wWdTgKyZlGIIzYmwQjcyxoIOMdc6RO/bOlHEfHKeug qrqLvOWafNLwBrytTFH/cxpNgPxBBPiXTG+La5h7wEDm1gUvG1OOSkcSkcpBiOCbUwHo yse7mPZ9OKBttXNgqsAIdA93qD+D05ArMoNuD8OynEYcmhYUAUfOgEvCobnOgmtqa15k NVQg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=5+5MtfY6OsS9nIIyl7W+JZvvkhN7JVG2GisE3EjsluE=; b=mB7XsRJ+InZvCUfiBiMhoF6sxH5GnyVQ0ArkxuUACMByO8SPJcS/Ae+cBP/qwccYA5 Rq9RsGjENnUkUp4pepYBlET1Wj1am+dbYO38+b3tdKJupY1QW+d2L29w9wQdNHjl0Z9R Zi/4GOkQpk+vk2g9Mg7W8ATmgqgoQN6VgJlZM1kDfP2z2DOzcHYDtxHZCcTM5AU5xrVy OJlBrPoMiAKoORIERDMK8ZRtkyDndlk1Lp/efrS+AsUOCRViZFVfEYU7u+Bov2U0KPXn UX8Uyu8k61tz8fwMS533iHy2pIqsqjzQJsA1rHZxK6n28FjsEsm+EubyXAYFYI7AStqD Gq0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=ifijoEIS; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si7296708plb.292.2018.10.17.06.42.21; Wed, 17 Oct 2018 06:42:26 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b=ifijoEIS; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727506AbeJQVh4 (ORCPT + 32 others); Wed, 17 Oct 2018 17:37:56 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57640 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727476AbeJQVhz (ORCPT ); Wed, 17 Oct 2018 17:37:55 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181017134208euoutp01ceba8569d860510361e51091384e9e6b~eaSSgAW3Q1251312513euoutp01D; Wed, 17 Oct 2018 13:42:08 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181017134208euoutp01ceba8569d860510361e51091384e9e6b~eaSSgAW3Q1251312513euoutp01D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539783728; bh=5+5MtfY6OsS9nIIyl7W+JZvvkhN7JVG2GisE3EjsluE=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=ifijoEISTcKrYxWpDkG7RbifMCK91rCLHBbTLbTNR6ZILwgrhMuCvuWmlvgnhJVAK GzlEW/qa2Sw8XOz6Uhj0cj/+piNGTDLwaYiAbAS4emPFU47omnxySO9skL6RAlIbWm orSnwH0UZxoGoeDb76Z7IzNtiAt9BgDebyNoadpg= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181017134207eucas1p2ddd72a7f9c9f8a6cfa44305722f2ad76~eaSR3wbLZ1291812918eucas1p24; Wed, 17 Oct 2018 13:42:07 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 4F.4E.04441.F2C37CB5; Wed, 17 Oct 2018 14:42:07 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181017134207eucas1p1b938eefe31fc47baaf538c9ebafc1a7e~eaSRGtc5e1609116091eucas1p1p; Wed, 17 Oct 2018 13:42:07 +0000 (GMT) X-AuditID: cbfec7f2-5c9ff70000001159-97-5bc73c2f66a6 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 69.22.04284.F2C37CB5; Wed, 17 Oct 2018 14:42:07 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGQ001A0WQ1IZ80@eusync4.samsung.com>; Wed, 17 Oct 2018 14:42:07 +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 Subject: [PATCH v3 4/6] clocksource: exynos_mct: Add arch_timer cooperation mode for ARM64 Date: Wed, 17 Oct 2018 15:41:57 +0200 Message-id: <20181017134159.9656-5-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181017134159.9656-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsWy7djP87r6NsejDWbOUbHYOGM9q8X7ZT2M Fte/PGe1mPdZ1mLS/QksFufPb2C32PT4GqvF5V1z2CxmnN/HZLH2yF12i793/rFZbN40ldni 5ccTLA68HmvmrWH02LSqk83jzrU9bB7vzp1j99i8pN6jb8sqRo/Pm+QC2KO4bFJSczLLUov0 7RK4Mubf0S5YxVWxYOJipgbGgxxdjJwcEgImEqubnzB3MXJxCAmsYJTYcG0HC4TzmVFizbyn LDBV0xY8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pXnpesn5uZsYgUG47djPzTsYL20MPsQowMGoxMO7Q+xYtBBrYllxZe4hRgkOZiUR3irF 49FCvCmJlVWpRfnxRaU5qcWHGKU5WJTEec8bVEYJCaQnlqRmp6YWpBbBZJk4OKUaGLt9a83L t2Qs6vrD/Nw8+GnnZlfZ/q267hftF5ic+FJ8sdlO66q1XKfw1xeapXXiMswyHQdMX2rMOhc6 y5g94GOu+8WDCxNYNL//2iHO8sxiltnWiM8LyifV1R2s2ffhwh+Z2mlps46dO2z1Q1mYZ7Xb JDM3id/GGbypvb27TCfwyxv1XxX7rsRSnJFoqMVcVJwIAFVxb4w+AgAA X-CMS-MailID: 20181017134207eucas1p1b938eefe31fc47baaf538c9ebafc1a7e X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181017134207eucas1p1b938eefe31fc47baaf538c9ebafc1a7e References: <20181017134159.9656-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/clocksource/exynos_mct.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- 2.17.1 diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 02ad55db390b..1b19a4f03929 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -606,6 +606,15 @@ 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) From patchwork Wed Oct 17 13:41:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marek Szyprowski X-Patchwork-Id: 149068 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp674294lji; Wed, 17 Oct 2018 06:42:35 -0700 (PDT) X-Google-Smtp-Source: ACcGV62B85sY01AsfiUyJMEmSpSrF59UTczpBUq3/2xBPRxi72l9vO39IxdGyDDM90MTxnWq1rA7 X-Received: by 2002:a17:902:8502:: with SMTP id bj2-v6mr25665558plb.295.1539783755149; Wed, 17 Oct 2018 06:42:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539783755; cv=none; d=google.com; s=arc-20160816; b=DyKy9zXkMl7UqzfQwV6WXNbhAilYea4TiacPvlPzxY0LvHWzpVQX5IX0M+XXxoB7yg wnPgHyUz+LCyXRAwZq5vFfJxuo5e64OfoT0bffj+0rQ4pkADmsED2N1SkT2zsRYCbzTF hnW3gZ1OPGIo8/ldJxV9FNpX1J6uklB+coDcMXgAUTIeZSRsTcDJSuFPizsQHI1ytajS QAZjZzPrDNVeZxdaUxcOGimviHDkaU/eh2ZATGmVsyfXol7fIcOzr3F1p9tCeph0H5Gp y/K4RXdZLyaYAWbln/eFROvJn+VX5+lI2bZ8PhPByO4lHWgRTQyDk9IiZsXUAwytxjPz DBUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=JbawqqnuJmBPjDcr8q+jVFNwx8wHm3+63GETfeiWmM0=; b=XCi+3D0ZkvPuj+Eeew9TvmwneRZ5NRy/eM7NvZyQ+Zc6i6Msqhro5UyKMM4d+AJlkN 47BNI974gU1/hCId78Jg8D4/L3FYdkGE+DUSLWWKSE+InQQq1i0qcWsEnxf2IvcvBesm s5wlt+cTaF6Uk1mhtwBZZ13SfDEXJ7gEr0GlmGB3hjyDrpTfx+fCmCT450vXYhX888Q+ I9Pz3Xq/aJCD/OVmCCCNFer5B7ixQKNwCj1wnxv74mFuF9aPTayu7Oe4H9XGTMyP0pm/ sK7JcJnnvNKTbGgPpZP0sBRjkdv1BOqrN0LBgOXp/fLtoecoiVfX38oGp63bnt2wZs3w 9nvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Cslwrbih; 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=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q1-v6si7296708plb.292.2018.10.17.06.42.27; Wed, 17 Oct 2018 06:42:35 -0700 (PDT) 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=@samsung.com header.s=mail20170921 header.b=Cslwrbih; 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=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727525AbeJQVh6 (ORCPT + 32 others); Wed, 17 Oct 2018 17:37:58 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:57662 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727482AbeJQVh4 (ORCPT ); Wed, 17 Oct 2018 17:37:56 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181017134209euoutp011e723b5f25dca56b42f2fb63d5895412~eaSTasaTQ1247812478euoutp01F; Wed, 17 Oct 2018 13:42:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181017134209euoutp011e723b5f25dca56b42f2fb63d5895412~eaSTasaTQ1247812478euoutp01F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539783729; bh=JbawqqnuJmBPjDcr8q+jVFNwx8wHm3+63GETfeiWmM0=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=Cslwrbihf4Qh9yWmfIn0qVLkbBZj5DaqlO60KNjnvsAyRlDZ4zoH89EraP7uZs4r4 C28IdAJpP9vqQUh3wPg1rGlWhqnks6PKm+b2IXvgLtkus5GEjpdwGPS0BDsldHKmF0 gORccETx6aVxNG4FFpsTLvEYVOQsORBJ+aqjFXAs= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181017134209eucas1p2d71dfa82326b8459cab3baa065f0d34f~eaSS_S21_1254712547eucas1p2t; Wed, 17 Oct 2018 13:42:09 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 40.5E.04441.03C37CB5; Wed, 17 Oct 2018 14:42:08 +0100 (BST) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181017134208eucas1p19c81d1ce9050be1b78e386d8a349f441~eaSSInvIn0909309093eucas1p1l; Wed, 17 Oct 2018 13:42:08 +0000 (GMT) X-AuditID: cbfec7f2-5e3ff70000001159-9a-5bc73c30cd54 Received: from eusync4.samsung.com ( [203.254.199.214]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 8B.22.04284.03C37CB5; Wed, 17 Oct 2018 14:42:08 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync4.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGQ001A0WQ1IZ80@eusync4.samsung.com>; Wed, 17 Oct 2018 14:42:08 +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 Subject: [PATCH v3 6/6] arm64: platform: Add enable Exynos Multi-Core Timer driver Date: Wed, 17 Oct 2018 15:41:59 +0200 Message-id: <20181017134159.9656-7-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181017134159.9656-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrPIsWRmVeSWpSXmKPExsWy7djPc7oGNsejDa5O1bLYOGM9q8X7ZT2M Fte/PGe1mPdZ1mLS/QksFufPb2C32PT4GqvF5V1z2CxmnN/HZLH2yF12i793/rFZbN40ldni 5ccTLA68HmvmrWH02LSqk83jzrU9bB7vzp1j99i8pN6jb8sqRo/Pm+QC2KO4bFJSczLLUov0 7RK4Mg5tucVWMIe94s//r0wNjJPYuhg5OSQETCRmnJ4LZHNxCAmsYJTo/XCHGcL5zCixbkIz E0zV3P6H7BCJZYwSW9cugWppYJK4sHAuO0gVm4ChRNfbLrC5IgLZEp2PHzCC2MwCi5glDhwT BrGFBUIkFjzbxAxiswioSry42gBWwytgI7Hy0hF2iG3yEqs3HACq4eDgFLCVWNtfBbJLQmAP m8ThldcYIWpcJI6sPAr1g7DEq+NboHplJDo7DjJBNDQzSrTPmMUO4fQAnT1nB1SHtcTh4xdZ Ia7jk5i0bTrYNgkBXomONiGIEg+J1Y8OgZUICUxglGha7TuBUXIBI8MqRvHU0u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794e9StPbnDk HyrN3VVaJasQoL/tzhWTsI7oHXeUWIozEg21mIuKEwHmOmvZPwIAAA== X-CMS-MailID: 20181017134208eucas1p19c81d1ce9050be1b78e386d8a349f441 X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181017134208eucas1p19c81d1ce9050be1b78e386d8a349f441 References: <20181017134159.9656-1-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(+) -- 2.17.1 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