From patchwork Sat Feb 23 13:06:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 159116 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp33397jad; Sat, 23 Feb 2019 05:08:16 -0800 (PST) X-Google-Smtp-Source: AHgI3IYXAB0W0BsVphLxJQvlU2WjmLqUpaGSXQTPdOPD46ipAhLF3w3ASEnluFMi1lFlGyZRZNt+ X-Received: by 2002:a17:902:9b90:: with SMTP id y16mr9507761plp.0.1550927296802; Sat, 23 Feb 2019 05:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550927296; cv=none; d=google.com; s=arc-20160816; b=g/ivGvLcf97sAM/uVXnUcuelgQAqIGfTCsLEF41Bz++lFjihDoq/hpvG/9JvZhqG5k nhxcWpQ7/j9oVreyQ09UTP33BUR2moKCZVdLBuVVayhBdAnrwrOmuG686ogZqQgDKDss BNdSDp/Ey+NTF5GJOPZ5jPIPed2uNfFxhe2CsT/Lg9GkJ1W0xZuB5fhYJ9Ump95BQCNw RrLdFamyMCmxnJkzs7KZOFEOBluT8xg6lkrwtI/rnnUesNvkP7mY+CTt5YxvDmAd3EcZ sSgXRSS1pr+AsfSKN3iJvfBt3yzQFLF9D+HZZCeW5PmgTfOlTaG9+EkMZW/YqFpeN/gv CEZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=HqlZ9y60+g61RglAPoiE/a+Pic8KuxjtCcTeAXdOW8w=; b=w2vZfbC47hfhspBB8OhmyH7OESH/TDegrWscERabRSvHUs5iCNpli0MGQ+0gA8UdFd jLMgbha6UP6pHZD6zHCOiWFPiBgebRRasezXcROAAIX4zB7FOr4InFVpr9QCgkRrTji6 yl7JifWHgroziNZ7RGHKb6SxkEomr/TRjOVB89MVoCkvH+ofcR7EDawluOJUBGFHNqc+ IOv1L1fAHD7JmKfswzUyPvsNAhyxovo3QPyQ7A4/C7QcktxYK5DM52zbehuJSYQBFn9m tKsMOo8DFSY9aBlepBh+clfYl4YsUTD5XG493bfSW6jS8oayFOscTlzVirZn2bEG5TOy EW2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UDySiRAE; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cm10si3952995plb.295.2019.02.23.05.08.16; Sat, 23 Feb 2019 05:08:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UDySiRAE; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727966AbfBWNIP (ORCPT + 32 others); Sat, 23 Feb 2019 08:08:15 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35681 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727923AbfBWNIK (ORCPT ); Sat, 23 Feb 2019 08:08:10 -0500 Received: by mail-wm1-f67.google.com with SMTP id y15so4279798wma.0 for ; Sat, 23 Feb 2019 05:08:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=HqlZ9y60+g61RglAPoiE/a+Pic8KuxjtCcTeAXdOW8w=; b=UDySiRAEDlj+2/nVLaWr1kRMDEterDlOGCjGMrfb5Qcyxd3BCAjB9t+XzXvOc70r3G hElqqI6om74Ug3hEio91Ol9EbkkFnJh2QrbqlI8cYMgnmPq0FzrF+EzGPU/HkOk5LeoQ jAQfXM2AF4+g3cZ/2w0YDGcpBJ0D1pLuZ8DWVLzmc/V/cFVS+7td9moAOrKf0WPbUW3d iF/+XVkeqPq8o5/wskCbGn7u2XlxHuISEU3/imhDFYLwjNvihWjcT4Q3IAWMKbit+t3N DmTgqKugwVilOQIhbZ4Ma4I57VG1bBKd6WiDIxAQgzjGmOr3Fs6ht00liZAW+d4iraDk QJHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=HqlZ9y60+g61RglAPoiE/a+Pic8KuxjtCcTeAXdOW8w=; b=BxPfmr2alQToMQdTzOXIBaakrLX8q1oyYC5+f3mUDCdmKNM3/hEiWoxCUHwA8ml4MD 2yAqHc9AKLzTxSCDz72PmtsaBOj5TyfIqHysr75LJMNjmz5S7OL/Nru3qfhtQEbvD+q+ UBFNFXMhjRvyzVvgfN6QJMScf9rJC3P1tzMwpGnUwSq/hdhG5Qq0A2nBD9geqUV3kkNS TCnP4N0Gb21BdCv8XAxPy/MjL1NAvkAAUP6CBv1/yStKRoALBBn/diB3hR/ruiIl57oy 3SsCtN0hix4sCrcnUisw+eHGNOhWUzlJ6TkIgMQzETTl6A04ShaTnmb3wNqwFrZSeIOz Py4g== X-Gm-Message-State: AHQUAuZsAH70dyX6tyzQtvHGfiO2uH92wGVEh6ijFjtSAfJ9T27F0aG0 pmuyi8etZ07o9M5TPUE1elbkEg== X-Received: by 2002:a05:600c:219a:: with SMTP id e26mr5676166wme.93.1550927288008; Sat, 23 Feb 2019 05:08:08 -0800 (PST) Received: from clegane.local (189.126.130.77.rev.sfr.net. [77.130.126.189]) by smtp.gmail.com with ESMTPSA id i12sm7830746wrq.21.2019.02.23.05.08.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 23 Feb 2019 05:08:07 -0800 (PST) From: Daniel Lezcano To: tglx@linutronix.de Cc: linux-kernel@vger.kernel.org, Marek Szyprowski , Krzysztof Kozlowski , Kukjin Kim , linux-arm-kernel@lists.infradead.org (moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES), linux-samsung-soc@vger.kernel.org (moderated list:ARM/SAMSUNG EXYNOS ARM ARCHITECTURES) Subject: [PATCH 09/18] clocksource/drivers/exynos_mct: Fix error path in timer resources initialization Date: Sat, 23 Feb 2019 14:06:57 +0100 Message-Id: <20190223130707.16704-9-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190223130707.16704-1-daniel.lezcano@linaro.org> References: <20190223130707.16704-1-daniel.lezcano@linaro.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Marek Szyprowski 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 Signed-off-by: Daniel Lezcano --- 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 647ea9fc752f..33e90c080877 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; }