lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <AM0PR0602MB3666D7273A855A23E188F065F72D9@AM0PR0602MB3666.eurprd06.prod.outlook.com>
Date:   Tue, 8 Feb 2022 18:44:10 +0000
From:   Holger Brunck <holger.brunck@...achienergy.com>
To:     Marek BehĂșn <kabel@...nel.org>
CC:     "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        Andrew Lunn <andrew@...n.ch>, Jakub Kicinski <kuba@...nel.org>
Subject: RE: [v4] dsa: mv88e6xxx: make serdes SGMII/Fiber tx amplitude
 configurable

> > +static struct mv88e6352_serdes_p2p_to_val
> mv88e6352_serdes_p2p_to_val[] = {
> > +     /* Mapping of configurable mikrovolt values to the register value */
> > +     { 14000, 0},
> > +     { 112000, 1},
> > +     { 210000, 2},
> > +     { 308000, 3},
> > +     { 406000, 4},
> > +     { 504000, 5},
> > +     { 602000, 6},
> > +     { 700000, 7},
> > +};
> 
> ...
> 
> > +     reg = (reg & MV88E6352_SERDES_OUT_AMP_MASK) | val;
> 
> This is weird: normally in mask we have those bits set that are to be changed.
> So amplitude mask should be bits that specify the amplitue, and this should be
>   reg &= ~MV88E6352_SERDES_OUT_AMP_MASK;
>   reg |= val & MV88E6352_SERDES_OUT_AMP_MASK; and mask should be
> defined inversely.
> 

ok I will change that.

> ...
> 
> > +#define MV88E6352_SERDES_OUT_AMP_MASK                0xfffc
> 
> And this is also weird. 0xfffc is all bits set except last 2, but in the mapping above
> the maximum value is 7, so you use 3 bits for amplitude...
>

you are absolutely right. In this case it would be 0xfff8 to handle all three bits.

Thanks
Holger

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ