Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1698394imm; Thu, 18 Oct 2018 02:40:53 -0700 (PDT) X-Google-Smtp-Source: ACcGV62fakhkglZaqCv7aJxEeiQ1cVfQ23Kkx4i5zcMT0qxkVQMSGwOOy/ICziG7xRb4M85uEhBY X-Received: by 2002:a17:902:5597:: with SMTP id g23-v6mr1213779pli.46.1539855653667; Thu, 18 Oct 2018 02:40:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539855653; cv=none; d=google.com; s=arc-20160816; b=pKTvC1yEWAVpob91yp5mkzU4xeuOXFVToG6DbEl6YZUS4d67OWAwq14+uaBcGafb4N 6PU33BlS/8Wz0ZmczMxiNY72VJHHILknLqGP3ntU/XTaXUEvDBLHzVrEvq7M22waIpr3 kt67F8sh6dx1Ovo4NBr4d8FfIXMfkui0XY2EOOmGeuhHhjBujhHxJbmzMREESD78evph VWA5glSbKgoD/JbuGvWmkOwdQT8MJxtJAwddsIPa9k+ATv4bk487SPjtWKMcHLRSpiIa JpZqpTb0oRgf7Y3VjriKiCEJQx4C2P3CX17SeK7Gc5/TvxlA86oc9lYVhE4pMEmfQq8V BcTA== 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:message-id :content-language:content-transfer-encoding:in-reply-to:mime-version :user-agent:date:from:cc:to:subject:dkim-signature:dkim-filter; bh=omn37BRFkXouUUmTDbfff3MAt739A7kJOVfI1hoi6BM=; b=h7sMVaZBPawQdlQRvmvzVEVxY1ARrOmN6EGjAwQJ77Cu7cPcyPp3XY78t4mwXdfqwC unFP+48eNvKREKXPnQ3E6oVc8qHiXl2j2kMUNuMJrv/YfPwH3EUkFxUUshjQGhokMbWg iS0P93iXA7+9SCMUVCYeYwcXzoVISZoVLhitdMJOpu/BgXI+R34Cdtt93Yzh/Kh9Vjbe o/mksAXPDLYcyrzopk4JvfaAURAT+RWf6bTVkztqS36nRpkdwSZHink9Vh6LYCEObYum dzE70Qh8FJZOgbFZFns+NUiwqAkn1wcn8KwNBW3Fa4hzkuuGOTug0vcW6Z4jKQGi05xh lr+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=eY1YyAiN; 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 l3-v6si21033090pld.404.2018.10.18.02.40.37; Thu, 18 Oct 2018 02:40:53 -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=eY1YyAiN; 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 S1727758AbeJRRkY (ORCPT + 99 others); Thu, 18 Oct 2018 13:40:24 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:52345 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727423AbeJRRkY (ORCPT ); Thu, 18 Oct 2018 13:40:24 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20181018094013euoutp0291d911bede4c45a7b5e1576b938d4fb0~eqoWYH-BP2244522445euoutp02f for ; Thu, 18 Oct 2018 09:40:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20181018094013euoutp0291d911bede4c45a7b5e1576b938d4fb0~eqoWYH-BP2244522445euoutp02f DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1539855613; bh=omn37BRFkXouUUmTDbfff3MAt739A7kJOVfI1hoi6BM=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=eY1YyAiNksV4TKKZWowNKAPGy0eau4S0eYN0oaBaGE40Cvg40shEs15qAaCq8SY4J TRvlFyIq/EmAkBcf6SHf04f/dsY77/Whs9BEHN/0n0rn9driroAzNK7Ws9wqMsc/Kd lTH7nzoYaG1wM8gM6F13/FC/c5uEtFCGnsKYW4cs= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20181018094012eucas1p2dd1f19559e2242f2f360b80c4c1f3623~eqoVTA7V-2851828518eucas1p2b; Thu, 18 Oct 2018 09:40:12 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id 4D.F0.04441.BF458CB5; Thu, 18 Oct 2018 10:40:11 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20181018094011eucas1p11831fa3b26007be54af17d57852e120b~eqoUWGdbK0807208072eucas1p1I; Thu, 18 Oct 2018 09:40:11 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20181018094010eusmtrp28b2dd8349a7f63fd01b6924e7a4b670c~eqoUFmdsX2897428974eusmtrp2z; Thu, 18 Oct 2018 09:40:10 +0000 (GMT) X-AuditID: cbfec7f2-a1ae89c000001159-30-5bc854fb6dd8 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 52.A0.04284.AF458CB5; Thu, 18 Oct 2018 10:40:10 +0100 (BST) Received: from [106.116.147.30] (unknown [106.116.147.30]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20181018094010eusmtip1b33e01e2ecef3aa4c703320fd90c6a0d~eqoTlR0W50528505285eusmtip1G; Thu, 18 Oct 2018 09:40:10 +0000 (GMT) Subject: Re: [PATCH v3 3/6] clocksource: exynos_mct: Refactor resources allocation To: Krzysztof Kozlowski Cc: "linux-samsung-soc@vger.kernel.org" , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, will.deacon@arm.com, catalin.marinas@arm.com, marc.zyngier@arm.com, tglx@linutronix.de, daniel.lezcano@linaro.org, Chanwoo Choi , =?UTF-8?Q?Bart=c5=82omiej_=c5=bbo=c5=82nierkiewicz?= , Inki Dae From: Marek Szyprowski Date: Thu, 18 Oct 2018 11:40:09 +0200 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01Se0hTcRjl5713u5qT61z5YVawrDDwVWE3FmEPaER/lAlSSrryptamsquW RaRIqUtNBUnnozDRMp/zbSVsopsVaioqQ0pUKBXT1Hxk09xulv+dc77z/b5z4Ediwo+EExke Ec0oI2RyMc8Gb+hY6XJb9TMEeI51HKVrcqoIeqYkFdGDC18JunB+F531JQOnu7ur+bRmbICg +1ryeXROd6sVbRpe49G1mmyMnvhhwH1speWF5UiqKUvhSYcH3vKk37u6+NLa4gfS9LoyJJ3X 7L7Av2JzPISRh8cySo8TwTZheaO1RFTijjvpGZn8eJRmr0LWJFBHoKiz1UqFbEgh9RLBiyoD nyMLCJp0YwRH5hFUL2qxzZWC9kZkxkKqFEFlt5AzzSAwFGRYTA6UH6Q/1vHMWES5wqBpyfIS RpVgMGVYJswDHuUFqmmVxYRT+yDTlLYRhCS3U4Gw2iIxywLKHjpzx3EztqYugi673YIxag80 TudjHHYE4/gzSwegjHxo6lrEuOVYWO9/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jdtuxn5t3 MF7aGHyIUYCDUYmH90Hq8Wgh1sSy4srcQ4wSHMxKIrzVZieihXhTEiurUovy44tKc1KLDzGa Aj03kVlKNDkfmFDySuINTQ3NLSwNzY3Njc0slMR5zxtURgkJpCeWpGanphakFsH0MXFwSjUw St2eoczX8mHn/u4+U1Fz72OzCzx26fxbIJX80lB8m9fZdwvXzasqvrBi3pkFXxszFwYwpuh4 /vFs1xNx6zJoSItd0LO1YuvSxiPLd3++61+ecmftpe7yMyedNmek59usyv3/709FUvqDyQoc M2JUi04sZd0p4rxnmqCn67K7+TWfYxcwXYtwVGIpzkg01GIuKk4EAGuDw4DwAgAA Message-Id: <20181018094011eucas1p11831fa3b26007be54af17d57852e120b~eqoUWGdbK0807208072eucas1p1I@eucas1p1.samsung.com> X-CMS-MailID: 20181018094011eucas1p11831fa3b26007be54af17d57852e120b X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20181017134206eucas1p1ebc76569f706675d41f2d2183349f1f3 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20181017134206eucas1p1ebc76569f706675d41f2d2183349f1f3 References: <20181017134159.9656-1-m.szyprowski@samsung.com> <20181017134159.9656-4-m.szyprowski@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof, On 2018-10-17 16:29, Krzysztof Kozlowski wrote: > On Wed, 17 Oct 2018 at 15:42, Marek Szyprowski wrote: >> 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(-) >> >> 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 does not look good. Before, assignment was done before call to > exynos4_timer_resources(). Now, if I follow the path correctly, it > will be after. Therefore the exynos4_timer_resources() will use wrong > value. This should pop up during tests. After refactoring exynos4_timer_resource() doesn't use int_type, but you are right, there is one item missing: nr_irqs as local variable, what causes the driver to mess with the global one, what is fatal to the system. I will send a fixed version in a few minutes. > ... Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland