All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dirk Behme <dirk.behme@de.bosch.com>
To: <linux-renesas-soc@vger.kernel.org>,
	Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Cc: <geert+renesas@glider.be>, <dirk.behme@de.bosch.com>,
	Julia Lawall <julia.lawall@inria.fr>
Subject: [PATCH v2 1/2] ravb: Fix RAVB_RXTSTAMP_TYPE_ALL value
Date: Thu, 9 Apr 2020 11:48:50 +0200	[thread overview]
Message-ID: <20200409094851.22142-1-dirk.behme@de.bosch.com> (raw)

In the function ravb_hwtstamp_get() in ravb_main.c with the existing
values for RAVB_RXTSTAMP_TYPE_V2_L2_EVENT (0x2) and RAVB_RXTSTAMP_TYPE_ALL
(0x6)

if (priv->tstamp_rx_ctrl & RAVB_RXTSTAMP_TYPE_V2_L2_EVENT)
        config.rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT;
else if (priv->tstamp_rx_ctrl & RAVB_RXTSTAMP_TYPE_ALL)
        config.rx_filter = HWTSTAMP_FILTER_ALL;

if the test on RAVB_RXTSTAMP_TYPE_ALL should be true, it will never
be reached. Correct this by changing RAVB_RXTSTAMP_TYPE_ALL to 0x4.

Fixes: c156633f1353 ("Renesas Ethernet AVB driver proper")
Reported-by: Julia Lawall <julia.lawall@inria.fr>
Suggested-by: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Dirk Behme <dirk.behme@de.bosch.com>
---
Changes in v2: Split fix and cleanup into two patches.

 drivers/net/ethernet/renesas/ravb.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/renesas/ravb.h b/drivers/net/ethernet/renesas/ravb.h
index 9f88b5db4f89..e921eae82022 100644
--- a/drivers/net/ethernet/renesas/ravb.h
+++ b/drivers/net/ethernet/renesas/ravb.h
@@ -41,7 +41,7 @@
 #define RAVB_RXTSTAMP_VALID	0x00000001	/* RX timestamp valid */
 #define RAVB_RXTSTAMP_TYPE	0x00000006	/* RX type mask */
 #define RAVB_RXTSTAMP_TYPE_V2_L2_EVENT 0x00000002
-#define RAVB_RXTSTAMP_TYPE_ALL	0x00000006
+#define RAVB_RXTSTAMP_TYPE_ALL	0x00000004
 #define RAVB_RXTSTAMP_ENABLED	0x00000010	/* Enable RX timestamping */
 
 enum ravb_reg {
-- 
2.20.0


             reply	other threads:[~2020-04-09  9:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-09  9:48 Dirk Behme [this message]
2020-04-09  9:48 ` [PATCH v2 2/2] ravb: Drop unused RAVB_{R,T}XTSTAMP_VALID macros Dirk Behme
2020-04-16  9:55   ` Sergei Shtylyov
2020-04-16  9:52 ` [PATCH v2 1/2] ravb: Fix RAVB_RXTSTAMP_TYPE_ALL value Sergei Shtylyov

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=20200409094851.22142-1-dirk.behme@de.bosch.com \
    --to=dirk.behme@de.bosch.com \
    --cc=geert+renesas@glider.be \
    --cc=julia.lawall@inria.fr \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=sergei.shtylyov@cogentembedded.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.