Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Richard Cochran
On Tue, Dec 06, 2016 at 11:49:14AM -0600, Grygorii Strashko wrote: > But we do reset whole cpsw :( and that's required to support PM use cases as > suspend/resume. The code is resetting the clock unconditionally on ifup/down. That sucks. If you reset the clock *only* after resume, that would be

Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Richard Cochran
On Tue, Dec 06, 2016 at 11:49:14AM -0600, Grygorii Strashko wrote: > But we do reset whole cpsw :( and that's required to support PM use cases as > suspend/resume. The code is resetting the clock unconditionally on ifup/down. That sucks. If you reset the clock *only* after resume, that would be

Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Grygorii Strashko
Hi Richard, On 12/06/2016 11:18 AM, Richard Cochran wrote: > 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

Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Grygorii Strashko
Hi Richard, On 12/06/2016 11:18 AM, Richard Cochran wrote: > 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

Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Richard Cochran
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

Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Richard Cochran
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

Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Grygorii Strashko
On 12/06/2016 07:40 AM, Richard Cochran wrote: > On Mon, Dec 05, 2016 at 02:05:21PM -0600, Grygorii Strashko wrote: >> @@ -372,34 +354,27 @@ void cpts_tx_timestamp(struct cpts *cpts, struct >> sk_buff *skb) >> } >> EXPORT_SYMBOL_GPL(cpts_tx_timestamp); >> >> -int cpts_register(struct device

Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Grygorii Strashko
On 12/06/2016 07:40 AM, Richard Cochran wrote: > On Mon, Dec 05, 2016 at 02:05:21PM -0600, Grygorii Strashko wrote: >> @@ -372,34 +354,27 @@ void cpts_tx_timestamp(struct cpts *cpts, struct >> sk_buff *skb) >> } >> EXPORT_SYMBOL_GPL(cpts_tx_timestamp); >> >> -int cpts_register(struct device

Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Richard Cochran
On Mon, Dec 05, 2016 at 02:05:21PM -0600, Grygorii Strashko wrote: > @@ -372,34 +354,27 @@ void cpts_tx_timestamp(struct cpts *cpts, struct > sk_buff *skb) > } > EXPORT_SYMBOL_GPL(cpts_tx_timestamp); > > -int cpts_register(struct device *dev, struct cpts *cpts, > - u32 mult, u32

Re: [PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-06 Thread Richard Cochran
On Mon, Dec 05, 2016 at 02:05:21PM -0600, Grygorii Strashko wrote: > @@ -372,34 +354,27 @@ void cpts_tx_timestamp(struct cpts *cpts, struct > sk_buff *skb) > } > EXPORT_SYMBOL_GPL(cpts_tx_timestamp); > > -int cpts_register(struct device *dev, struct cpts *cpts, > - u32 mult, u32

[PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-05 Thread Grygorii Strashko
The current implementation CPTS initialization and deinitialization (represented by cpts_register/unregister()) does too many static initialization from .ndo_open(), which is reasonable to do once at probe time instead, and also require caller to allocate memory for struct cpts, which is internal

[PATCH v4 09/13] net: ethernet: ti: cpts: rework initialization/deinitialization

2016-12-05 Thread Grygorii Strashko
The current implementation CPTS initialization and deinitialization (represented by cpts_register/unregister()) does too many static initialization from .ndo_open(), which is reasonable to do once at probe time instead, and also require caller to allocate memory for struct cpts, which is internal