linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pankaj Dubey <pankaj.dubey@samsung.com>
To: "'Tomasz Figa'" <t.figa@samsung.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: kgene.kim@samsung.com, linux@arm.linux.org.uk,
	vikas.sajjan@samsung.com, joshi@samsung.com, naushad@samsung.com,
	thomas.ab@samsung.com, chow.kim@samsung.com
Subject: RE: [PATCH v5 1/5] ARM: EXYNOS: Add support for mapping PMU base address via DT
Date: Sat, 05 Jul 2014 12:01:19 +0530	[thread overview]
Message-ID: <001b01cf981a$bd5dda90$38198fb0$@samsung.com> (raw)
In-Reply-To: <53B18C46.9010405@samsung.com>

Hi Tomasz,

On Monday, June 30, 2014 Tomasz Figa wrote:
> 
> Hi Pankaj,
> 
> In general the patch seems quite nice, but please see few comments inline.
> 
> On 25.06.2014 16:03, Pankaj Dubey wrote:
> > Add support for mapping Samsung Power Management Unit (PMU) base
> > address from device tree.
> >
> > Signed-off-by: Pankaj Dubey <pankaj.dubey@samsung.com>
> > ---
> >  arch/arm/mach-exynos/common.h |    1 +
> >  arch/arm/mach-exynos/exynos.c |   45
> +++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 46 insertions(+)
> 
> [snip]
> 
> > +static void exynos_map_pmu(void)
> > +{
> > +	struct device_node *np = NULL;
> 
> nit: Unnecessary variable initialization.
>

OK, will correct it.
 
> > +
> > +	np = of_find_matching_node(NULL, exynos_dt_pmu_match);
> > +
> 
> nit: Unnecessary blank line.
> 

OK, will remove this.

> > +	if (!np) {
> > +		pr_err("Failed to find PMU node\n");
> > +		return;
> 
> Returning here probably doesn't make too much sense, especially when you
just panic
> if the mapping fails and you remove the static mapping in patch 2/5, so
backwards
> compatibility isn't provided anyway.
> 
> So something like this might be a better idea:
> 
> 	np = of_find_matching_node(NULL, exynos_dt_pmu_match);
> 	if (np)
> 		pmu_base_addr = of_iomap(np, 0);
> 
> 	if (!pmu_base_addr)
> 		panic("failed to find exynos pmu register\n");
> 

Yes, this will be better. I will modify this part.

> > +	}
> > +
> > +	pmu_base_addr = of_iomap(np, 0);
> > +
> > +	if (!pmu_base_addr)
> > +		panic("failed to find exynos pmu register\n"); }
> > +
> > +static void __init exynos_init_time(void) {
> > +	/* Nothing to do timer specific.
> > +	 * Since platsmp.c needs pmu base address by the time
> > +	 * DT is not unflatten so we can't use DT APIs before
> > +	 * init_time
> > +	 */
> > +	exynos_map_pmu();
> 
> Would moving this to .init_irq() callback work too? There are more things
happening
> in .init_time() so it seems more fragile and some platforms (e.g.
mach-tegra) do such
> platform-specific initialization in
> .init_irq() instead.
> 

I need to check this, if it works I will update as suggested.

> Best regards,
> Tomasz

Thanks,
Pankaj Dubey


  reply	other threads:[~2014-07-05  6:30 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-25 14:03 [PATCH v5 0/5] ARM: Exynos: PMU cleanup and refactoring for using DT Pankaj Dubey
2014-06-25 14:03 ` [PATCH v5 1/5] ARM: EXYNOS: Add support for mapping PMU base address via DT Pankaj Dubey
2014-06-30 16:11   ` Tomasz Figa
2014-07-05  6:31     ` Pankaj Dubey [this message]
2014-06-25 14:03 ` [PATCH v5 2/5] ARM: EXYNOS: Refactored code for using PMU " Pankaj Dubey
2014-06-30 16:19   ` Tomasz Figa
2014-07-05  6:34     ` Pankaj Dubey
2014-06-25 14:03 ` [PATCH v5 3/5] ARM: EXYNOS: Move "mach/map.h" inclusion from regs-pmu.h to platsmp.c Pankaj Dubey
2014-06-30 16:20   ` Tomasz Figa
2014-07-05  6:35     ` Pankaj Dubey
2014-06-25 14:03 ` [PATCH v5 4/5] ARM: EXYNOS: Add platform driver support for Exynos PMU Pankaj Dubey
2014-06-30 17:05   ` Tomasz Figa
2014-07-05  7:09     ` Pankaj Dubey
2014-07-08 14:14       ` Tomasz Figa
2014-06-25 14:03 ` [PATCH v5 5/5] ARM: EXYNOS: Move PMU specific definitions from common.h Pankaj Dubey
2014-06-30 17:15   ` Tomasz Figa
2014-07-05  7:10     ` Pankaj Dubey
2014-06-26 11:30 ` [PATCH v5 0/5] ARM: Exynos: PMU cleanup and refactoring for using DT Vikas Sajjan

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='001b01cf981a$bd5dda90$38198fb0$@samsung.com' \
    --to=pankaj.dubey@samsung.com \
    --cc=chow.kim@samsung.com \
    --cc=joshi@samsung.com \
    --cc=kgene.kim@samsung.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-samsung-soc@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=naushad@samsung.com \
    --cc=t.figa@samsung.com \
    --cc=thomas.ab@samsung.com \
    --cc=vikas.sajjan@samsung.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).