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: 10641771 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 390DF112B for ; Mon, 15 Oct 2018 12:34:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2623029666 for ; Mon, 15 Oct 2018 12:34:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A6ED297A9; Mon, 15 Oct 2018 12:34:33 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 9B93829666 for ; Mon, 15 Oct 2018 12:34:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-reply-to:Message-id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=v1qHP2IA0gNE5vQMs0di8Wl39jlbi1muf7kAwB1CL9U=; b=oSTzKxFq07wjWn48zcuS3i5bGN 9o6tNZ+hndoJ+CJDDbNWfmap8orPkAaoZhrcaS7eQWDMkwip4HdMJ/v/kEzmoLVqBzlHZ1SN1LSmS Cv90gMK3wHyTtcnyA1xSA9ExxaWanhspOdIzv+FNcTLHLagncW797gCPKLWMN/QaFMQgmkrXe5KC6 LvrfnEmu5CAE5e3/c40Ef+7OoliAmDEYRKB+VINHJaTQkbEUJs5pPFPtrKfetsso1YJllZxnCYYUv N6eu2fijJWaVDpfMsPE8WfCt+0jKgPgKogt4CROvdoxNXkVQqkSqj6jMoVjRw6DYf5R0r2f2mYwN8 u9L4raOg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gC24e-0001cH-Sc; Mon, 15 Oct 2018 12:34:16 +0000 Received: from mailout1.w1.samsung.com ([210.118.77.11]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gC22G-0000V7-7D for linux-arm-kernel@lists.infradead.org; Mon, 15 Oct 2018 12:31:53 +0000 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 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 F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cMo+xoJ+r4sTs7ewNjAc5uhg5OSQETCRO71/G3MXIxSEksIRR4smfW2wQThOTxOnr VxhBqtgEDCW63naxgdgiAtkS8/d2s4PYzAJLmCVu3ncAsYUFkiXuX18PVM/BwSKgKvF9H9gC XgEbiT9f9rFALJOXWL3hADOIzSlgK3H4/yqwuBBQzYVjfxknMPIsYGRYxSiSWlqcm55bbKRX nJhbXJqXrpecn7uJERiG24793LKDsetd8CFGAQ5GJR5eAZ4j0UKsiWXFlbmHGCU4mJVEeCVC DkUL8aYkVlalFuXHF5XmpBYfYpTmYFES5z1vUBklJJCeWJKanZpakFoEk2Xi4JRqYJxf3PB0 obOzjvIEf+8NS5eJrpundEyD5WHSpKuqU55+vZUtarC7zu+CzPED1pNXeJxZN3VTaErCxtj/ Dbnyobs9KjYtmTupR0SuuFTx8IP5uoLFr17+rX7RXax368eUq6XL9l8V3dX2nTv75o3GgvLi eAPj2M9Gn6Zk72f69uv4gX2cijySF74qsRRnJBpqMRcVJwIAH7huSz8CAAA= X-CMS-MailID: 20181015123135eucas1p18df135504c9476cead8da6463226cdec X-Msg-Generator: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181015123135eucas1p18df135504c9476cead8da6463226cdec References: <20181015123112.9379-1-m.szyprowski@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181015_053148_409963_42285ACA X-CRM114-Status: GOOD ( 16.51 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bartlomiej Zolnierkiewicz , Marc Zyngier , Catalin Marinas , Daniel Lezcano , Will Deacon , Krzysztof Kozlowski , Inki Dae , Chanwoo Choi , Thomas Gleixner , Marek Szyprowski MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.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. Suggested-by: Krzysztof Kozlowski Fixes: 56a94f13919c ("clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier") Signed-off-by: Marek Szyprowski Reported-by: Krzysztof Kozlowski 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 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; }