From: Richard Cochran <richardcochran-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Grygorii Strashko <grygorii.strashko-l0cyMroinI0@public.gmane.org>
Cc: "David S. Miller" <davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>,
netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Mugunthan V N <mugunthanvnm-l0cyMroinI0@public.gmane.org>,
Sekhar Nori <nsekhar-l0cyMroinI0@public.gmane.org>,
linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
Murali Karicheri <m-karicheri2-l0cyMroinI0@public.gmane.org>,
Wingman Kwok <w-kwok2-l0cyMroinI0@public.gmane.org>,
Thomas Gleixner <tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org>
Subject: Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization
Date: Tue, 6 Dec 2016 18:18:02 +0100 [thread overview]
Message-ID: <20161206171802.GA19646@localhost.localdomain> (raw)
In-Reply-To: <4e7888b6-9f1c-ca31-e83e-15109bf1df3f-l0cyMroinI0@public.gmane.org>
On Tue, Dec 06, 2016 at 10:45:55AM -0600, Grygorii Strashko wrote:
> On 12/06/2016 07:40 AM, Richard Cochran wrote:
> > [ BTW, resetting the timecounter here makes no sense either. Why
> > reset the clock just because the interface goes down? ]
> >
>
> Huh. This is how it works now (even before my changes) - this is just refactoring!
> (really new thing is the only cpts_calc_mult_shift()).
The cpts_register() used to be called from probe(), but this changed
without any review in f280e89ad. That wasn't your fault, but still...
> Also there are additional questions such as:
> - is there guarantee that cpsw port will be connected to the same network after ifup?
The network is not relevant. PTP time is a global standard, just like
with NTP. We don't reset the NTP clock with ifup/down, do we?
> - should there be possibility to reset cc.mult if it's value will be kept from the previous run?
cc.mult will change naturally according to the operation of the user
space PTP stack. There is no need to reset it that I can see.
> > Secondly, you have made the initialization order of these fields hard
> > to follow. With the whole series applied:
> >
> > probe()
> > cpts_create()
> > cpts_of_parse()
> > {
> > /* Set cc_mult but not cc.mult! */
> > set cc_mult
> > set cc.shift
> > }
> > cpts_calc_mult_shift()
> > {
> > /* Set them both. */
> > cpts->cc_mult = mult;
> > cpts->cc.mult = mult;
>
> ^^ this assignment of cpts->cc.mult not required.
You wrote the code, not me.
> > cpts->cc.shift = shift;
>
>
> only in case there were not set in DT before
> (I have a requirement to support both - DT and cpts_calc_mult_shift and
> that introduces a bit of complexity)
>
> Also, I've tried not to add more fields in struct cpts.
>
> > }
> > /* later on */
> > cpts_register()
> > cpts->cc.mult = cpts->cc_mult;
> >
> > There is no need for such complexity. Simply set cc.mult in
> > cpts_create() _once_, immediately after the call to
> > cpts_calc_mult_shift().
> >
> > You can remove the assignment from cpts_calc_mult_shift() and
> > cpts_register().
>
> Just to clarify: do you propose to get rid of cpts->cc_mult at all?
No. Read what I said before:
There is no need for such complexity. Simply set cc.mult in
cpts_create() _once_, immediately after the call to
cpts_calc_mult_shift().
> Honestly, i'd not prefer to change functional behavior of ptp clock as part of
> this series.
Fair enough. The bogus clock reset existed before your series.
But please don't obfuscate simple initialization routines. The way
you set cc.mult and cc_mult is illogical and convoluted.
Thanks,
Richard
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
next prev parent reply other threads:[~2016-12-06 17:18 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-05 20:05 [PATCH v4 00/13] net: ethernet: ti: cpts: update and fixes Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 01/13] net: ethernet: ti: cpts: switch to readl/writel_relaxed() Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 03/13] net: ethernet: ti: cpsw: minimize direct access to struct cpts Grygorii Strashko
[not found] ` <20161205200525.16664-1-grygorii.strashko-l0cyMroinI0@public.gmane.org>
2016-12-05 20:05 ` [PATCH v4 02/13] net: ethernet: ti: allow cpts to be built separately Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 04/13] net: ethernet: ti: cpts: fix unbalanced clk api usage in cpts_register/unregister Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 07/13] net: ethernet: ti: cpts: clean up event list if event pool is empty Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization Grygorii Strashko
[not found] ` <20161205200525.16664-10-grygorii.strashko-l0cyMroinI0@public.gmane.org>
2016-12-06 13:40 ` Richard Cochran
[not found] ` <20161206134037.GA15946-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2016-12-06 16:45 ` Grygorii Strashko
[not found] ` <4e7888b6-9f1c-ca31-e83e-15109bf1df3f-l0cyMroinI0@public.gmane.org>
2016-12-06 17:18 ` Richard Cochran [this message]
[not found] ` <20161206171802.GA19646-bi+AKbBUZKY6gyzm1THtWbp2dZbC/Bob@public.gmane.org>
2016-12-06 17:49 ` Grygorii Strashko
2016-12-06 18:04 ` Richard Cochran
2016-12-05 20:05 ` [PATCH v4 05/13] net: ethernet: ti: cpts: fix registration order Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 06/13] net: ethernet: ti: cpts: disable cpts when unregistered Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 08/13] net: ethernet: ti: cpts: drop excessive writes to CTRL and INT_EN regs Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 10/13] net: ethernet: ti: cpts: move dt props parsing to cpts driver Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 11/13] clocksource: export the clocks_calc_mult_shift to use by timestamp code Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 12/13] net: ethernet: ti: cpts: calc mult and shift from refclk freq Grygorii Strashko
2016-12-05 20:05 ` [PATCH v4 13/13] net: ethernet: ti: cpts: fix overflow check period Grygorii Strashko
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=20161206171802.GA19646@localhost.localdomain \
--to=richardcochran-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
--cc=davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org \
--cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=grygorii.strashko-l0cyMroinI0@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-omap-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=m-karicheri2-l0cyMroinI0@public.gmane.org \
--cc=mugunthanvnm-l0cyMroinI0@public.gmane.org \
--cc=netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=nsekhar-l0cyMroinI0@public.gmane.org \
--cc=tglx-hfZtesqFncYOwBW4kG4KsQ@public.gmane.org \
--cc=w-kwok2-l0cyMroinI0@public.gmane.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 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).