From patchwork Mon Oct 15 12:31: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: 148823 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp3736820lji; Mon, 15 Oct 2018 05:31:41 -0700 (PDT) X-Google-Smtp-Source: ACcGV61Fyj3STNU2VLhg8CjLsCJCVfhhhPjoQlqZRh3uGrZgo5CT9aXF6Cl+4NBf0GazZc2cnno3 X-Received: by 2002:a17:902:6a4:: with SMTP id 33-v6mr16650780plh.11.1539606700910; Mon, 15 Oct 2018 05:31:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539606700; cv=none; d=google.com; s=arc-20160816; b=H+WT0YC+9ADGevOBjPZvjoBbBqio7ncjuKv8MUnzBz5aVWqMSqDLEH/dnQLlhLvnu9 JvBnnyDrE05dHXBluvu+lgh+5PZKyJIqh804rSsdvORWMT83XTK+0eW45onjSG5vIR+V z9TVwGuzRT/+Qygjbn1UowHEg6120f9i44GknsrnyaFx7pCG3he4uhy5ne5N5KKcypNd xKjbdNvuY/Jv8RsDKret359pJNqIIJig7M4qNt7pXY05crxXY3Nxepuhp41DZZ56voND l7OF4Xa3wwkw0/PT2h2CrK/UDW7w5nAM7PlGk5eTdLDquYFXyUhDJho2ui7IcpSSYRGd UInw== 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=cse+VOAcgPmNGKk2EiPdVIoBwnoLUK7Ug9Nh0R0rQ0I=; b=dU/kgD5D41qzOO4dNnF7EdHvrkmCZW3/LrwrjunjGI/RM9b7/HMUPZfoHhh0q4onS5 rKBbvC+/eJfk5sig9Atuq1UnPU/sKFbA6GvJz0NiqqFjjlj3kVHKP+4YfveXuN0zrW5x bvY0hPqSqHGifrwhznoLeYTNhbvx8qgE+vAJ+Pdcp1ZpAko19gQQ0Q1R7ROu2CC3zxcS qUdBPF45aUvaepv9NC4+vYHAc0FDrU4RZ2CNygqiJJcW1XjW91Qi6cOZSJfa5vIIBcHI YHPM26+Rn3u2YfHu9zNsZPgQH36WHVE+y8VCiX7gtOd3yDWT+axY3oGYwu0p1nPvGxz8 lLGw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=hzieEwHK; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 e21-v6si10454373pgk.311.2018.10.15.05.31.40; Mon, 15 Oct 2018 05:31:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-samsung-soc-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=hzieEwHK; spf=pass (google.com: best guess record for domain of linux-samsung-soc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-samsung-soc-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 S1726698AbeJOUQo (ORCPT + 3 others); Mon, 15 Oct 2018 16:16:44 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:51540 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726528AbeJOUQm (ORCPT ); Mon, 15 Oct 2018 16:16:42 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20181015123136euoutp01f8f16327ec9e5fcc6111a2bd66984e0b~dyCIhAdf20681706817euoutp01i; Mon, 15 Oct 2018 12:31:36 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20181015123136euoutp01f8f16327ec9e5fcc6111a2bd66984e0b~dyCIhAdf20681706817euoutp01i DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539606696; bh=cse+VOAcgPmNGKk2EiPdVIoBwnoLUK7Ug9Nh0R0rQ0I=; h=From:To:Cc:Subject:Date:In-reply-to:References:From; b=hzieEwHKdRa1jnW2qU+jETDgRm8gMH4DoyIeC76q2U5TE4YRGS5pVRBEpz20q8Mdp 8ePV+nAfQcqIBHUclhr5jxg6fbOLJ4QcRgoT/G7pyMmVv79w93J7lFScO4o6ZBtj93 Ua8Jl+YGefuIzjhpSh8j1bNx0S6XeM7MAngh8MlE= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181015123136eucas1p23e5fa00af4b528e2e093ab9b12a19347~dyCIFpbMe2085720857eucas1p2f; Mon, 15 Oct 2018 12:31:36 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 6C.6F.04806.7A884CB5; Mon, 15 Oct 2018 13:31:35 +0100 (BST) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20181015123135eucas1p18df135504c9476cead8da6463226cdec~dyCHW-NcF1986619866eucas1p1v; Mon, 15 Oct 2018 12:31:35 +0000 (GMT) X-AuditID: cbfec7f5-367ff700000012c6-91-5bc488a7f632 Received: from eusync1.samsung.com ( [203.254.199.211]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 17.DE.04128.7A884CB5; Mon, 15 Oct 2018 13:31:35 +0100 (BST) Received: from AMDC2765.digital.local ([106.116.147.25]) by eusync1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0PGN00GZC4490K70@eusync1.samsung.com>; Mon, 15 Oct 2018 13:31:35 +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 v2 2/6] clocksource: exynos_mct: Fix error path in timer resources initialization Date: Mon, 15 Oct 2018 14:31:08 +0200 Message-id: <20181015123112.9379-3-m.szyprowski@samsung.com> X-Mailer: git-send-email 2.17.1 In-reply-to: <20181015123112.9379-1-m.szyprowski@samsung.com> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrAIsWRmVeSWpSXmKPExsWy7djP87rLO45EG5xsMrLYOGM9q8X7ZT2M Fte/PGe1mPdZ1mLS/QksFufPb2C32PT4GqvF5V1z2CxmnN/HZLH2yF12i793/rFZbN40ldni 5ccTLA68HmvmrWH02LSqk83jzrU9bB7vzp1j99i8pN6jb8sqRo/Pm+QC2KO4bFJSczLLUov0 7RK4Mg4umcdY0M9VcWL2dvYGxoMcXYycHBICJhKz7k1i6mLk4hASWMEosXjuPmYI5zOjxKTJ 79lhqk7vXwaVWMYosXDaChYIp4FJYtvJ46wgVWwChhJdb7vYQGwRgWyJzscPGEFsZoFFzBIH jgmD2MICyRL3r68HinNwsAioSnzfB3YGr4CNxJ8v+1gglslLrN5wgBnE5hSwlTj8fxXYLgmB A2wSGyctYoMocpHYdqATyhaWeHV8C9SlMhKXJ3dDNTQzSrTPmMUO4fQwSmydswOqw1ri8PGL rBDX8UlM2jadGeQiCQFeiY42IYgSD4kJqxdCvTyBUeLJii+sExglFzAyrGIUTy0tzk1PLTbO Sy3XK07MLS7NS9dLzs/dxAiM59P/jn/dwbjvT9IhRgEOR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huSz8CAAA= X-CMS-MailID: 20181015123135eucas1p18df135504c9476cead8da6463226cdec X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181015123135eucas1p18df135504c9476cead8da6463226cdec References: <20181015123112.9379-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 While freeing interrupt handlers in error path, don't assume that all requested interrupts are per-processor interrupts and properly release standard interrupts too. Suggested-by: Krzysztof Kozlowski Fixes: 56a94f13919c ("clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier") Signed-off-by: Marek Szyprowski --- drivers/clocksource/exynos_mct.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) -- 2.17.1 Reported-by: Krzysztof Kozlowski Reviewed-by: Krzysztof Kozlowski Reviewed-by: Chanwoo Choi diff --git a/drivers/clocksource/exynos_mct.c b/drivers/clocksource/exynos_mct.c index 43b335ff4a96..a379f11fad2d 100644 --- a/drivers/clocksource/exynos_mct.c +++ b/drivers/clocksource/exynos_mct.c @@ -562,7 +562,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; }