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: <20220208171219.022165d1@thinkpad>
Date:   Tue, 8 Feb 2022 17:12:19 +0100
From:   Marek BehĂșn <kabel@...nel.org>
To:     Holger Brunck <holger.brunck@...achienergy.com>
Cc:     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

On Tue,  8 Feb 2022 10:44:55 +0100
Holger Brunck <holger.brunck@...achienergy.com> wrote:

> +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.

...

> +#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...

Marek

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ