All of lore.kernel.org
 help / color / mirror / Atom feed
From: Chanwoo Choi <cw00.choi@samsung.com>
To: Marek Szyprowski <m.szyprowski@samsung.com>,
	linux-samsung-soc@vger.kernel.org,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org
Cc: Will Deacon <will.deacon@arm.com>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Marc Zyngier <marc.zyngier@arm.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Daniel Lezcano <daniel.lezcano@linaro.org>,
	Krzysztof Kozlowski <krzk@kernel.org>,
	Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>,
	Inki Dae <inki.dae@samsung.com>
Subject: Re: [PATCH v3 3/6] clocksource: exynos_mct: Refactor resources allocation
Date: Thu, 18 Oct 2018 12:50:30 +0900	[thread overview]
Message-ID: <5BC80306.1020005@samsung.com> (raw)
In-Reply-To: <20181017134159.9656-4-m.szyprowski@samsung.com>

Hi Marek,

I tested it for both kernel booting and cpu hotplugging
on Exynos5433-based TM2 board.

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>

On 2018년 10월 17일 22:41, 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 <m.szyprowski@samsung.com>
> ---
>  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 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;
>  
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

WARNING: multiple messages have this Message-ID (diff)
From: cw00.choi@samsung.com (Chanwoo Choi)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v3 3/6] clocksource: exynos_mct: Refactor resources allocation
Date: Thu, 18 Oct 2018 12:50:30 +0900	[thread overview]
Message-ID: <5BC80306.1020005@samsung.com> (raw)
In-Reply-To: <20181017134159.9656-4-m.szyprowski@samsung.com>

Hi Marek,

I tested it for both kernel booting and cpu hotplugging
on Exynos5433-based TM2 board.

Reviewed-by: Chanwoo Choi <cw00.choi@samsung.com>
Tested-by: Chanwoo Choi <cw00.choi@samsung.com>

On 2018? 10? 17? 22:41, 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 <m.szyprowski@samsung.com>
> ---
>  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 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;
>  
> 


-- 
Best Regards,
Chanwoo Choi
Samsung Electronics

  parent reply	other threads:[~2018-10-18  3:50 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20181017134204eucas1p10d92a91f2b945afdc7b39ce6e7813a8e@eucas1p1.samsung.com>
2018-10-17 13:41 ` [PATCH v3 0/6] Proper arch timer support for Exynos5433-based TM2(e) boards Marek Szyprowski
2018-10-17 13:41   ` Marek Szyprowski
2018-10-17 13:41   ` [PATCH v3 1/6] clocksource: exynos_mct: Remove dead code Marek Szyprowski
2018-10-17 13:41     ` Marek Szyprowski
2018-10-17 13:41   ` [PATCH v3 2/6] clocksource: exynos_mct: Fix error path in timer resources initialization Marek Szyprowski
2018-10-17 13:41     ` Marek Szyprowski
2018-10-17 13:41   ` [PATCH v3 3/6] clocksource: exynos_mct: Refactor resources allocation Marek Szyprowski
2018-10-17 13:41     ` Marek Szyprowski
2018-10-17 14:29     ` Krzysztof Kozlowski
2018-10-17 14:29       ` Krzysztof Kozlowski
2018-10-18  9:40       ` Marek Szyprowski
2018-10-18  9:40         ` Marek Szyprowski
2018-10-18  3:50     ` Chanwoo Choi [this message]
2018-10-18  3:50       ` Chanwoo Choi
2018-10-17 13:41   ` [PATCH v3 4/6] clocksource: exynos_mct: Add arch_timer cooperation mode for ARM64 Marek Szyprowski
2018-10-17 13:41     ` Marek Szyprowski
2018-10-18  3:51     ` Chanwoo Choi
2018-10-18  3:51       ` Chanwoo Choi
2018-10-17 13:41   ` [PATCH v3 5/6] arm64: dts: exynos: Move arch-timer node to right place Marek Szyprowski
2018-10-17 13:41     ` Marek Szyprowski
2018-10-17 13:41   ` [PATCH v3 6/6] arm64: platform: Add enable Exynos Multi-Core Timer driver Marek Szyprowski
2018-10-17 13:41     ` Marek Szyprowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5BC80306.1020005@samsung.com \
    --to=cw00.choi@samsung.com \
    --cc=b.zolnierkie@samsung.com \
    --cc=catalin.marinas@arm.com \
    --cc=daniel.lezcano@linaro.org \
    --cc=inki.dae@samsung.com \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=m.szyprowski@samsung.com \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    --cc=will.deacon@arm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.