Re: [PATCH 3/9] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-09-15 Thread Richard Cochran
On Wed, Sep 14, 2016 at 04:02:25PM +0300, Grygorii Strashko wrote: > The current implementation CPTS initialization and deinitialization > (represented by cpts_register/unregister()) is pretty entangled and > has some issues, like: > - ptp clock registered before spinlock, which is protecting it,

Re: [PATCH 3/9] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-09-14 Thread Grygorii Strashko
On 09/14/2016 11:52 PM, Richard Cochran wrote: > On Wed, Sep 14, 2016 at 11:37:45PM +0300, Grygorii Strashko wrote: >> The problem is that if cpts not initialized than pinter on >> cpts (in consumer/parent driver - NETCP) will be NULL. > > You made that problem with your "clean up" in this

Re: [PATCH 3/9] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-09-14 Thread Richard Cochran
On Wed, Sep 14, 2016 at 11:37:45PM +0300, Grygorii Strashko wrote: > The problem is that if cpts not initialized than pinter on > cpts (in consumer/parent driver - NETCP) will be NULL. You made that problem with your "clean up" in this series. Previously, cpts was always allocated. > So,

Re: [PATCH 3/9] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-09-14 Thread Grygorii Strashko
On 09/14/2016 11:32 PM, Richard Cochran wrote: > On Wed, Sep 14, 2016 at 11:10:48PM +0300, Grygorii Strashko wrote: >> On 09/14/2016 04:52 PM, Richard Cochran wrote: >>> On Wed, Sep 14, 2016 at 04:02:25PM +0300, Grygorii Strashko wrote: > - if (!cpts->rx_enable) + if (!cpts ||

Re: [PATCH 3/9] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-09-14 Thread Richard Cochran
On Wed, Sep 14, 2016 at 11:10:48PM +0300, Grygorii Strashko wrote: > On 09/14/2016 04:52 PM, Richard Cochran wrote: > > On Wed, Sep 14, 2016 at 04:02:25PM +0300, Grygorii Strashko wrote: > >> - if (!cpts->rx_enable) > >> + if (!cpts || !cpts->rx_enable) > >>return; > Ok. I can't

Re: [PATCH 3/9] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-09-14 Thread Grygorii Strashko
On 09/14/2016 04:52 PM, Richard Cochran wrote: > On Wed, Sep 14, 2016 at 04:02:25PM +0300, Grygorii Strashko wrote: >> @@ -323,7 +307,7 @@ void cpts_rx_timestamp(struct cpts *cpts, struct sk_buff >> *skb) >> u64 ns; >> struct skb_shared_hwtstamps *ssh; >> >> -if (!cpts->rx_enable)

Re: [PATCH 3/9] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-09-14 Thread Richard Cochran
On Wed, Sep 14, 2016 at 04:02:25PM +0300, Grygorii Strashko wrote: > @@ -323,7 +307,7 @@ void cpts_rx_timestamp(struct cpts *cpts, struct sk_buff > *skb) > u64 ns; > struct skb_shared_hwtstamps *ssh; > > - if (!cpts->rx_enable) > + if (!cpts || !cpts->rx_enable) >

[PATCH 3/9] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-09-14 Thread Grygorii Strashko
The current implementation CPTS initialization and deinitialization (represented by cpts_register/unregister()) is pretty entangled and has some issues, like: - ptp clock registered before spinlock, which is protecting it, and before timecounter and cyclecounter initialization; - CPTS ref_clk