On Wed 2019-02-20 15:49:25, Joe Perches wrote:
> On Tue, 2019-02-12 at 19:51 -0800, Florian Fainelli wrote:
> > On February 12, 2019 6:39:49 PM PST, tristram...@microchip.com wrote:
> > > > > +static void ksz9477_freeze_mib(struct ksz_device *dev, int port,
> > > > > + b
On Tue, 2019-02-12 at 19:51 -0800, Florian Fainelli wrote:
> On February 12, 2019 6:39:49 PM PST, tristram...@microchip.com wrote:
> > > > +static void ksz9477_freeze_mib(struct ksz_device *dev, int port,
> > > > + bool freeze)
> > > > +{
> > > > + struct ksz_por
On 2/14/19 11:26 AM, tristram...@microchip.com wrote:
> + /* read only dropped counters when link is not up */
> + if (p->link_just_down)
> + p->link_just_down = 0;
> + else if (!p->phydev.link)
> + mib->cnt_ptr = dev->reg_
> >> > +/* read only dropped counters when link is not up */
> >> > +if (p->link_just_down)
> >> > +p->link_just_down = 0;
> >> > +else if (!p->phydev.link)
> >> > +mib->cnt_ptr = dev->reg_mib_cnt;
> >>
On February 12, 2019 6:39:49 PM PST, tristram...@microchip.com wrote:
>> > +static void ksz9477_freeze_mib(struct ksz_device *dev, int port,
>bool
>> freeze)
>> > +{
>> > + struct ksz_port *p = &dev->ports[port];
>> > + u32 val = freeze ? MIB_COUNTER_FLUSH_FREEZE : 0;
>>
>> Reverse Christmas
> All of the MIB counters, except some that may be marked by driver,
> do not get updated when the link is down, so it is a waste of time
> to read them.
Hi Tristram
O.K, so make this clear in the code. Maybe rather than having this
link_just_down, have the adjust link callback update the cached
> > +static void ksz9477_freeze_mib(struct ksz_device *dev, int port, bool
> freeze)
> > +{
> > + struct ksz_port *p = &dev->ports[port];
> > + u32 val = freeze ? MIB_COUNTER_FLUSH_FREEZE : 0;
>
> Reverse Christmas tree.
There was a checkpatch.pl patch in 2016 that tried to check this, but it
On Thu, Feb 07, 2019 at 08:07:07PM -0800, tristram...@microchip.com wrote:
> From: Tristram Ha
>
> Add MIB counter reading support.
>
> Signed-off-by: Tristram Ha
> ---
> drivers/net/dsa/microchip/ksz9477.c| 139
> +++--
> drivers/net/dsa/microchip/ksz_common.c
From: Tristram Ha
Add MIB counter reading support.
Signed-off-by: Tristram Ha
---
drivers/net/dsa/microchip/ksz9477.c| 139 +++--
drivers/net/dsa/microchip/ksz_common.c | 96 +++
drivers/net/dsa/microchip/ksz_common.h | 2 +
drivers/net/ds