From: Tom Lendacky <thomas.lendacky@amd.com>
To: Marion & Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
<davem@davemloft.net>
Cc: <netdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
Kernel Janitors <kernel-janitors@vger.kernel.org>
Subject: Re: Spurious code in commit 1bf40ada6290 ("amd-xgbe: Add support for clause 37 auto-negotiation"
Date: Sat, 12 Nov 2016 09:47:44 -0600 [thread overview]
Message-ID: <b9c9483a-76d1-b568-d60c-59f24ac5dea5@amd.com> (raw)
In-Reply-To: <80c6a7b3-4a03-e087-3638-7048adebbda8@wanadoo.fr>
On 11/12/2016 8:34 AM, Marion & Christophe JAILLET wrote:
> Hi,
>
> in commit 1bf40ada6290 ("amd-xgbe: Add support for clause 37
> auto-negotiation"), we can find:
>
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-common.h
> b/drivers/net/ethernet/amd/xgbe/xgbe-common.h
> index 695e982..8bcf4ef 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-common.h
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-common.h
> [...]
> #define XGBE_AN_CL37_PCS_MODE_MASK 0x06
> #define XGBE_AN_CL37_PCS_MODE_BASEX 0x00
> #define XGBE_AN_CL37_PCS_MODE_SGMII 0x04
> #define XGBE_AN_CL37_TX_CONFIG_MASK 0x08
> [...]
>
> diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> index d5bfbe4..723eb90 100644
> --- a/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> +++ b/drivers/net/ethernet/amd/xgbe/xgbe-mdio.c
> [...]
> /* Set up the Control register */
> reg = XMDIO_READ(pdata, MDIO_MMD_VEND2, MDIO_VEND2_AN_CTRL);
> reg &= XGBE_AN_CL37_TX_CONFIG_MASK;
> reg &= XGBE_AN_CL37_PCS_MODE_MASK;
> [...]
>
> the "reg &=" statements look spurious. The 2 constants being 0x06 and
> 0x08, the current code is equivalent to "reg = 0"
>
> It is likely that "reg |=" (or "reg &= ~") was expected here.
Yes, those should have been "reg &= ~". I didn't find this in my testing
because the register is all zeroes after reset. I'll submit a patch to
fix that.
Thanks,
Tom
>
> Best regards,
> CJ
>
prev parent reply other threads:[~2016-11-12 15:49 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-12 14:34 Spurious code in commit 1bf40ada6290 ("amd-xgbe: Add support for clause 37 auto-negotiation" Marion & Christophe JAILLET
2016-11-12 15:47 ` Tom Lendacky [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=b9c9483a-76d1-b568-d60c-59f24ac5dea5@amd.com \
--to=thomas.lendacky@amd.com \
--cc=christophe.jaillet@wanadoo.fr \
--cc=davem@davemloft.net \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox