All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhao Chenhui <chenhui.zhao@freescale.com>
To: Tabi Timur-B04825 <B04825@freescale.com>
Cc: Wood Scott-B07421 <B07421@freescale.com>,
	Zhao Chenhui-B35336 <B35336@freescale.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH v7 1/5] powerpc/85xx: implement hardware timebase sync
Date: Wed, 4 Jul 2012 11:14:26 +0800	[thread overview]
Message-ID: <20120704031426.GA6133@localhost.localdomain> (raw)
In-Reply-To: <CAOZdJXUeY-_mmBLoA25_g4eLqwHxYX4c_ECbU+KYqfM307THNQ@mail.gmail.com>

On Tue, Jul 03, 2012 at 07:46:24AM -0500, Tabi Timur-B04825 wrote:
> On Tue, Jul 3, 2012 at 5:21 AM, Zhao Chenhui <chenhui.zhao@freescale.com> wrote:
> 
> > +       np = of_find_matching_node(NULL, mpc85xx_smp_guts_ids);
> > +       if (np) {
> > +               guts = of_iomap(np, 0);
> > +               of_node_put(np);
> > +               if (!guts) {
> > +                       pr_err("%s: Could not map guts node address\n",
> > +                                                               __func__);
> > +                       return;
> > +               }
> > +               smp_85xx_ops.give_timebase = mpc85xx_give_timebase;
> > +               smp_85xx_ops.take_timebase = mpc85xx_take_timebase;
> > +       }
> 
> I had this in mind:
> 
>                guts = of_iomap(np, 0);
>                of_node_put(np);
>                if (guts) {
>                        smp_85xx_ops.give_timebase = mpc85xx_give_timebase;
>                        smp_85xx_ops.take_timebase = mpc85xx_take_timebase;
>                 } else {
>                        pr_err("%s: Could not map guts node address\n",
>                                                                __func__);
>                }
> 
> That way, a missing GUTS node does not break everything.
> 

If the guts variable is NULL, it indicates there is error in dts or kernel.
We should fix the error, rather than ignore it.

Moreover, if smp_85xx_ops.give/take_timebase is NULL, kernel can not do the timebase sync.

-Chenhui

WARNING: multiple messages have this Message-ID (diff)
From: Zhao Chenhui <chenhui.zhao@freescale.com>
To: Tabi Timur-B04825 <B04825@freescale.com>
Cc: Zhao Chenhui-B35336 <B35336@freescale.com>,
	"linuxppc-dev@lists.ozlabs.org" <linuxppc-dev@lists.ozlabs.org>,
	Wood Scott-B07421 <B07421@freescale.com>,
	"galak@kernel.crashing.org" <galak@kernel.crashing.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	<leoli@freescale.com>
Subject: Re: [PATCH v7 1/5] powerpc/85xx: implement hardware timebase sync
Date: Wed, 4 Jul 2012 11:14:26 +0800	[thread overview]
Message-ID: <20120704031426.GA6133@localhost.localdomain> (raw)
In-Reply-To: <CAOZdJXUeY-_mmBLoA25_g4eLqwHxYX4c_ECbU+KYqfM307THNQ@mail.gmail.com>

On Tue, Jul 03, 2012 at 07:46:24AM -0500, Tabi Timur-B04825 wrote:
> On Tue, Jul 3, 2012 at 5:21 AM, Zhao Chenhui <chenhui.zhao@freescale.com> wrote:
> 
> > +       np = of_find_matching_node(NULL, mpc85xx_smp_guts_ids);
> > +       if (np) {
> > +               guts = of_iomap(np, 0);
> > +               of_node_put(np);
> > +               if (!guts) {
> > +                       pr_err("%s: Could not map guts node address\n",
> > +                                                               __func__);
> > +                       return;
> > +               }
> > +               smp_85xx_ops.give_timebase = mpc85xx_give_timebase;
> > +               smp_85xx_ops.take_timebase = mpc85xx_take_timebase;
> > +       }
> 
> I had this in mind:
> 
>                guts = of_iomap(np, 0);
>                of_node_put(np);
>                if (guts) {
>                        smp_85xx_ops.give_timebase = mpc85xx_give_timebase;
>                        smp_85xx_ops.take_timebase = mpc85xx_take_timebase;
>                 } else {
>                        pr_err("%s: Could not map guts node address\n",
>                                                                __func__);
>                }
> 
> That way, a missing GUTS node does not break everything.
> 

If the guts variable is NULL, it indicates there is error in dts or kernel.
We should fix the error, rather than ignore it.

Moreover, if smp_85xx_ops.give/take_timebase is NULL, kernel can not do the timebase sync.

-Chenhui


  reply	other threads:[~2012-07-04  3:13 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-03 10:21 [PATCH v7 1/5] powerpc/85xx: implement hardware timebase sync Zhao Chenhui
2012-07-03 10:21 ` Zhao Chenhui
2012-07-03 10:21 ` [PATCH v7 2/5] powerpc/85xx: add HOTPLUG_CPU support Zhao Chenhui
2012-07-03 10:21   ` Zhao Chenhui
2012-07-13 12:15   ` Kumar Gala
2012-07-13 12:15     ` Kumar Gala
2012-07-17 11:39     ` Zhao Chenhui-B35336
2012-07-17 11:39       ` Zhao Chenhui-B35336
2012-07-03 12:46 ` [PATCH v7 1/5] powerpc/85xx: implement hardware timebase sync Tabi Timur-B04825
2012-07-03 12:46   ` Tabi Timur-B04825
2012-07-04  3:14   ` Zhao Chenhui [this message]
2012-07-04  3:14     ` Zhao Chenhui
2012-07-04  3:17     ` Tabi Timur-B04825
2012-07-04  3:17       ` Tabi Timur-B04825
2012-07-04  3:45       ` Zhao Chenhui
2012-07-04  3:45         ` Zhao Chenhui
2012-07-04 15:19         ` Tabi Timur-B04825
2012-07-04 15:19           ` Tabi Timur-B04825
2012-07-05 10:25           ` Zhao Chenhui
2012-07-05 10:25             ` Zhao Chenhui
2012-07-05 15:30             ` Timur Tabi
2012-07-05 15:30               ` Timur Tabi
2012-07-05 17:11         ` Scott Wood
2012-07-05 17:11           ` Scott Wood
2012-07-05 15:31 ` Tabi Timur-B04825
2012-07-05 15:31   ` Tabi Timur-B04825

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=20120704031426.GA6133@localhost.localdomain \
    --to=chenhui.zhao@freescale.com \
    --cc=B04825@freescale.com \
    --cc=B07421@freescale.com \
    --cc=B35336@freescale.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /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.