From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Simon Horman <horms+renesas@verge.net.au>,
David Miller <davem@davemloft.net>
Cc: Magnus Damm <magnus.damm@gmail.com>,
netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
Subject: Re: [PATCH net-next] ravb: do not write 1 to reserved bits
Date: Mon, 17 Sep 2018 20:58:52 +0300 [thread overview]
Message-ID: <12758acf-6444-47eb-ad74-170034959bd7@cogentembedded.com> (raw)
In-Reply-To: <20180917151911.25450-1-horms+renesas@verge.net.au>
On 09/17/2018 06:19 PM, Simon Horman wrote:
> From: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
>
> EtherAVB hardware requires 0 to be written to status register bits in
> order to clear them, however, care must be taken not to:
>
> 1. Clear other bits, by writing zero to them
> 2. Write one to reserved bits
>
> This patch corrects the ravb driver with respect to the second point above.
> This is done by defining reserved bit masks for the affected registers and,
> after auditing the code, ensure all sites that may write a one to a
> reserved bit use are suitably masked.
>
> Signed-off-by: Kazuya Mizuguchi <kazuya.mizuguchi.ks@renesas.com>
> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>
> ---
> v2 [Simon Horman]
> * Cover ravb_timestamp_interrupt() by this change
> * Use enum value rather than #define for reserved masks
> * Reword changelog
>
> v1 [Kazuya Mizuguchi]
> ---
> drivers/net/ethernet/renesas/ravb.h | 6 ++++++
> drivers/net/ethernet/renesas/ravb_main.c | 11 ++++++-----
> drivers/net/ethernet/renesas/ravb_ptp.c | 2 +-
> 3 files changed, 13 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h
> index 1470fc12282b..bca219edcf94 100644
> --- a/drivers/net/ethernet/renesas/ravb.h
> +++ b/drivers/net/ethernet/renesas/ravb.h
> @@ -428,6 +428,7 @@ enum EIS_BIT {
> EIS_CULF1 = 0x00000080,
> EIS_TFFF = 0x00000100,
> EIS_QFS = 0x00010000,
> + EIS_RESERVED = (u32)(GENMASK(31, 17) | GENMASK(15, 11)),
Are you sure those (u32) casts are necessary? Happily builds in both 32- and 64-bit
mode without them...
[...]
> @@ -528,6 +530,7 @@ enum RIS2_BIT {
> RIS2_QFF16 = 0x00010000,
> RIS2_QFF17 = 0x00020000,
> RIS2_RFFF = 0x80000000,
> + RIS2_RESERVED = (u32)GENMASK_ULL(30, 18),
Why GENMASK_ULL() suddenly? Doesn't seem needed at all...
[...]
> @@ -544,6 +547,8 @@ enum TIS_BIT {
> TIS_FTF1 = 0x00000002, /* Undocumented? */
> TIS_TFUF = 0x00000100,
> TIS_TFWF = 0x00000200,
> + TIS_RESERVED = (u32)(GENMASK_ULL(31, 20) | GENMASK_ULL(15, 12) | \
> + GENMASK_ULL(7, 4))
Same question.
[...]
MBR, Sergei
next prev parent reply other threads:[~2018-09-17 23:27 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-17 15:19 [PATCH net-next] ravb: do not write 1 to reserved bits Simon Horman
2018-09-17 17:58 ` Sergei Shtylyov [this message]
2018-09-18 6:56 ` Simon Horman
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=12758acf-6444-47eb-ad74-170034959bd7@cogentembedded.com \
--to=sergei.shtylyov@cogentembedded.com \
--cc=davem@davemloft.net \
--cc=horms+renesas@verge.net.au \
--cc=kazuya.mizuguchi.ks@renesas.com \
--cc=linux-renesas-soc@vger.kernel.org \
--cc=magnus.damm@gmail.com \
--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