Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-10-01 Thread Pavel Machek
On Fri 2017-09-29 18:45:19, tristram...@microchip.com wrote: > > > > > > Similar code will be needed by other drivers, right? > > > > > > > > > > Although KSZ8795 and KSZ8895 may use the same code, the other > > > > > chips will have different code. > > > > > > > > Ok, please make sure code is

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-10-01 Thread Pavel Machek
On Fri 2017-09-29 18:45:19, tristram...@microchip.com wrote: > > > > > > Similar code will be needed by other drivers, right? > > > > > > > > > > Although KSZ8795 and KSZ8895 may use the same code, the other > > > > > chips will have different code. > > > > > > > > Ok, please make sure code is

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Andrew Lunn
On Fri, Sep 29, 2017 at 07:19:17PM +, tristram...@microchip.com wrote: > > > My concern is if a task is already running with SPI access to a lot > > > of registers like reading the 32 MIB counters in every port of the > > > switch, another register access has to wait until they are finished. >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Andrew Lunn
On Fri, Sep 29, 2017 at 07:19:17PM +, tristram...@microchip.com wrote: > > > My concern is if a task is already running with SPI access to a lot > > > of registers like reading the 32 MIB counters in every port of the > > > switch, another register access has to wait until they are finished. >

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> > My concern is if a task is already running with SPI access to a lot > > of registers like reading the 32 MIB counters in every port of the > > switch, another register access has to wait until they are finished. > > Why does it have to wait? Looking at the code in > ksz_get_ethtool_stats(),

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> > My concern is if a task is already running with SPI access to a lot > > of registers like reading the 32 MIB counters in every port of the > > switch, another register access has to wait until they are finished. > > Why does it have to wait? Looking at the code in > ksz_get_ethtool_stats(),

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> On Mon 2017-09-18 20:27:13, tristram...@microchip.com wrote: > > > > +/** > > > > + * Some counters do not need to be read too often because they are > less > > > likely > > > > + * to increase much. > > > > + */ > > > > > > What does comment mean? Are you caching statistics, and updating > > >

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> On Mon 2017-09-18 20:27:13, tristram...@microchip.com wrote: > > > > +/** > > > > + * Some counters do not need to be read too often because they are > less > > > likely > > > > + * to increase much. > > > > + */ > > > > > > What does comment mean? Are you caching statistics, and updating > > >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Andrew Lunn
> My concern is if a task is already running with SPI access to a lot > of registers like reading the 32 MIB counters in every port of the > switch, another register access has to wait until they are finished. Why does it have to wait? Looking at the code in ksz_get_ethtool_stats(), you don't

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Andrew Lunn
> My concern is if a task is already running with SPI access to a lot > of registers like reading the 32 MIB counters in every port of the > switch, another register access has to wait until they are finished. Why does it have to wait? Looking at the code in ksz_get_ethtool_stats(), you don't

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> > > > > Similar code will be needed by other drivers, right? > > > > > > > > Although KSZ8795 and KSZ8895 may use the same code, the other > > > > chips will have different code. > > > > > > Ok, please make sure code is shared between these two. > > > > The exact function probably cannot be

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
> > > > > Similar code will be needed by other drivers, right? > > > > > > > > Although KSZ8795 and KSZ8895 may use the same code, the other > > > > chips will have different code. > > > > > > Ok, please make sure code is shared between these two. > > > > The exact function probably cannot be

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
; nathan.leigh.con...@gmail.com; vivien.dide...@savoirfairelinux.com; > f.faine...@gmail.com; net...@vger.kernel.org; linux- > ker...@vger.kernel.org; Woojung Huh - C21699 > Subject: Re: [PATCH RFC 3/5] Add KSZ8795 switch driver > > On Fri, Sep 29, 2017 at 09:14:26AM +, David La

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Tristram.Ha
; nathan.leigh.con...@gmail.com; vivien.dide...@savoirfairelinux.com; > f.faine...@gmail.com; net...@vger.kernel.org; linux- > ker...@vger.kernel.org; Woojung Huh - C21699 > Subject: Re: [PATCH RFC 3/5] Add KSZ8795 switch driver > > On Fri, Sep 29, 2017 at 09:14:26AM +, David La

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Andrew Lunn
On Fri, Sep 29, 2017 at 09:14:26AM +, David Laight wrote: > From: Andrew Lunn > > Sent: 28 September 2017 20:34 > ... > > > There are 34 counters. In normal case using generic bus I/O or PCI to > > > read them > > > is very quick, but the switch is mostly accessed using SPI, or even I2C. >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread Andrew Lunn
On Fri, Sep 29, 2017 at 09:14:26AM +, David Laight wrote: > From: Andrew Lunn > > Sent: 28 September 2017 20:34 > ... > > > There are 34 counters. In normal case using generic bus I/O or PCI to > > > read them > > > is very quick, but the switch is mostly accessed using SPI, or even I2C. >

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread David Laight
From: Andrew Lunn > Sent: 28 September 2017 20:34 ... > > There are 34 counters. In normal case using generic bus I/O or PCI to read > > them > > is very quick, but the switch is mostly accessed using SPI, or even I2C. > > As the SPI > > access is very slow. > > How slow is it? The Marvell

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-29 Thread David Laight
From: Andrew Lunn > Sent: 28 September 2017 20:34 ... > > There are 34 counters. In normal case using generic bus I/O or PCI to read > > them > > is very quick, but the switch is mostly accessed using SPI, or even I2C. > > As the SPI > > access is very slow. > > How slow is it? The Marvell

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-28 Thread Andrew Lunn
On Mon, Sep 18, 2017 at 08:27:13PM +, tristram...@microchip.com wrote: > > > +/** > > > + * Some counters do not need to be read too often because they are less > > likely > > > + * to increase much. > > > + */ > > > > What does comment mean? Are you caching statistics, and updating > >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-28 Thread Andrew Lunn
On Mon, Sep 18, 2017 at 08:27:13PM +, tristram...@microchip.com wrote: > > > +/** > > > + * Some counters do not need to be read too often because they are less > > likely > > > + * to increase much. > > > + */ > > > > What does comment mean? Are you caching statistics, and updating > >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-28 Thread Florian Fainelli
On 09/28/2017 11:40 AM, Pavel Machek wrote: > Hi! > > On Mon 2017-09-18 20:27:13, tristram...@microchip.com wrote: +/** + * Some counters do not need to be read too often because they are less >>> likely + * to increase much. + */ >>> >>> What does comment mean? Are you

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-28 Thread Florian Fainelli
On 09/28/2017 11:40 AM, Pavel Machek wrote: > Hi! > > On Mon 2017-09-18 20:27:13, tristram...@microchip.com wrote: +/** + * Some counters do not need to be read too often because they are less >>> likely + * to increase much. + */ >>> >>> What does comment mean? Are you

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-28 Thread Pavel Machek
Hi! On Mon 2017-09-18 20:27:13, tristram...@microchip.com wrote: > > > +/** > > > + * Some counters do not need to be read too often because they are less > > likely > > > + * to increase much. > > > + */ > > > > What does comment mean? Are you caching statistics, and updating > > different

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-28 Thread Pavel Machek
Hi! On Mon 2017-09-18 20:27:13, tristram...@microchip.com wrote: > > > +/** > > > + * Some counters do not need to be read too often because they are less > > likely > > > + * to increase much. > > > + */ > > > > What does comment mean? Are you caching statistics, and updating > > different

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-28 Thread Pavel Machek
> > > > Similar code will be needed by other drivers, right? > > > > > > Although KSZ8795 and KSZ8895 may use the same code, the other > > > chips will have different code. > > > > Ok, please make sure code is shared between these two. > > The exact function probably cannot be shared between

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-28 Thread Pavel Machek
> > > > Similar code will be needed by other drivers, right? > > > > > > Although KSZ8795 and KSZ8895 may use the same code, the other > > > chips will have different code. > > > > Ok, please make sure code is shared between these two. > > The exact function probably cannot be shared between

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-18 Thread Tristram.Ha
> > +/** > > + * Some counters do not need to be read too often because they are less > likely > > + * to increase much. > > + */ > > What does comment mean? Are you caching statistics, and updating > different values at different rates? > There are 34 counters. In normal case using generic

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-18 Thread Tristram.Ha
> > +/** > > + * Some counters do not need to be read too often because they are less > likely > > + * to increase much. > > + */ > > What does comment mean? Are you caching statistics, and updating > different values at different rates? > There are 34 counters. In normal case using generic

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-09 Thread Andrew Lunn
nathan.leigh.con...@gmail.com; > > vivien.dide...@savoirfairelinux.com; f.faine...@gmail.com; > > net...@vger.kernel.org; linux-kernel@vger.kernel.org; Woojung Huh - > > C21699 > > Subject: Re: [PATCH RFC 3/5] Add KSZ8795 switch driver > > > > Hi! >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-09 Thread Andrew Lunn
nathan.leigh.con...@gmail.com; > > vivien.dide...@savoirfairelinux.com; f.faine...@gmail.com; > > net...@vger.kernel.org; linux-kernel@vger.kernel.org; Woojung Huh - > > C21699 > > Subject: Re: [PATCH RFC 3/5] Add KSZ8795 switch driver > > > > Hi! >

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Tristram.Ha
.@gmail.com; > net...@vger.kernel.org; linux-kernel@vger.kernel.org; Woojung Huh - > C21699 > Subject: Re: [PATCH RFC 3/5] Add KSZ8795 switch driver > > Hi! > > > > > + default: > > > > + processed = false; > > > >

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Tristram.Ha
.@gmail.com; > net...@vger.kernel.org; linux-kernel@vger.kernel.org; Woojung Huh - > C21699 > Subject: Re: [PATCH RFC 3/5] Add KSZ8795 switch driver > > Hi! > > > > > + default: > > > > + processed = false; > > > >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Pavel Machek
Hi! > > > + default: > > > + processed = false; > > > + break; > > > + } > > > + if (processed) > > > + *val = data; > > > +} > > > > Similar code will be needed by other drivers, right? > > Although KSZ8795 and KSZ8895 may use the same code, the other > chips will have

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Pavel Machek
Hi! > > > + default: > > > + processed = false; > > > + break; > > > + } > > > + if (processed) > > > + *val = data; > > > +} > > > > Similar code will be needed by other drivers, right? > > Although KSZ8795 and KSZ8895 may use the same code, the other > chips will have

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Woojung.Huh
> > > > @@ -0,0 +1,2066 @@ > > > > +/* > > > > + * Microchip KSZ8795 switch driver > > > > + * > > > > + * Copyright (C) 2017 Microchip Technology Inc. > > > > + * Tristram Ha > > > > + * > > > > + * Permission to use, copy, modify, and/or distribute this software

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Woojung.Huh
> > > > @@ -0,0 +1,2066 @@ > > > > +/* > > > > + * Microchip KSZ8795 switch driver > > > > + * > > > > + * Copyright (C) 2017 Microchip Technology Inc. > > > > + * Tristram Ha > > > > + * > > > > + * Permission to use, copy, modify, and/or distribute this software for > any > > > > + *

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Andrew Lunn
> > > @@ -0,0 +1,2066 @@ > > > +/* > > > + * Microchip KSZ8795 switch driver > > > + * > > > + * Copyright (C) 2017 Microchip Technology Inc. > > > + * Tristram Ha > > > + * > > > + * Permission to use, copy, modify, and/or distribute this software for > > > any

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Andrew Lunn
> > > @@ -0,0 +1,2066 @@ > > > +/* > > > + * Microchip KSZ8795 switch driver > > > + * > > > + * Copyright (C) 2017 Microchip Technology Inc. > > > + * Tristram Ha > > > + * > > > + * Permission to use, copy, modify, and/or distribute this software for > > > any > > > + * purpose with or

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Tristram.Ha
.@gmail.com; > net...@vger.kernel.org; linux-kernel@vger.kernel.org; Woojung Huh - C21699 > Subject: Re: [PATCH RFC 3/5] Add KSZ8795 switch driver > > On Thu 2017-09-07 21:17:16, tristram...@microchip.com wrote: > > From: Tristram Ha <tristram...@microchip.com> > > > > Add KSZ8795

RE: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Tristram.Ha
.@gmail.com; > net...@vger.kernel.org; linux-kernel@vger.kernel.org; Woojung Huh - C21699 > Subject: Re: [PATCH RFC 3/5] Add KSZ8795 switch driver > > On Thu 2017-09-07 21:17:16, tristram...@microchip.com wrote: > > From: Tristram Ha > > > > Add KSZ8795 switch support with function

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Pavel Machek
On Thu 2017-09-07 21:17:16, tristram...@microchip.com wrote: > From: Tristram Ha > > Add KSZ8795 switch support with function code. English? "Add KSZ8795 switch support." ? > Signed-off-by: Tristram Ha > --- > diff --git

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-08 Thread Pavel Machek
On Thu 2017-09-07 21:17:16, tristram...@microchip.com wrote: > From: Tristram Ha > > Add KSZ8795 switch support with function code. English? "Add KSZ8795 switch support." ? > Signed-off-by: Tristram Ha > --- > diff --git a/drivers/net/dsa/microchip/ksz8795.c >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-07 Thread Andrew Lunn
On Thu, Sep 07, 2017 at 09:17:16PM +, tristram...@microchip.com wrote: > From: Tristram Ha > > Add KSZ8795 switch support with function code. > > Signed-off-by: Tristram Ha > --- > diff --git a/drivers/net/dsa/microchip/ksz8795.c >

Re: [PATCH RFC 3/5] Add KSZ8795 switch driver

2017-09-07 Thread Andrew Lunn
On Thu, Sep 07, 2017 at 09:17:16PM +, tristram...@microchip.com wrote: > From: Tristram Ha > > Add KSZ8795 switch support with function code. > > Signed-off-by: Tristram Ha > --- > diff --git a/drivers/net/dsa/microchip/ksz8795.c > b/drivers/net/dsa/microchip/ksz8795.c > new file mode