Netdev List
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Julia Lawall <julia.lawall@inria.fr>,
	horms+renesas@verge.net.au, tho.vu.wh@rvc.renesas.com,
	uli+renesas@fpond.eu
Cc: netdev@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	linux-kernel@vger.kernel.org, joe@perches.com
Subject: Re: question about drivers/net/ethernet/renesas/ravb_main.c
Date: Tue, 7 Apr 2020 00:14:07 +0300	[thread overview]
Message-ID: <4c39386e-4259-ba45-1f7f-1e6307a7753a@cogentembedded.com> (raw)
In-Reply-To: <alpine.DEB.2.21.2004031559240.2694@hadrien>

Hello!

On 04/03/2020 05:04 PM, Julia Lawall wrote:

> In the function ravb_hwtstamp_get in ravb_main.c, the following code looks
> suspicious:
> 
>         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;
>         else
>                 config.rx_filter = HWTSTAMP_FILTER_NONE;
> 
> According to drivers/net/ethernet/renesas/ravb.h,
> RAVB_RXTSTAMP_TYPE_V2_L2_EVENT is 0x00000002 and RAVB_RXTSTAMP_TYPE_ALL is
> 0x00000006.  Therefore, if the test on RAVB_RXTSTAMP_TYPE_ALL should be
> true, it will never be reached.  How should the code be changed?

   After looking at the code, I think that setting RAVB_RXTSTAMP_TYPE_ALL to
0x00000004 should be enough. BTW, the RAVB_{R,T}XTSTAMP_VALID don't seem be
used anywhere...

> thanks,
> julia

MBR, Sergei

      reply	other threads:[~2020-04-06 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-03 14:04 question about drivers/net/ethernet/renesas/ravb_main.c Julia Lawall
2020-04-06 21:14 ` Sergei Shtylyov [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=4c39386e-4259-ba45-1f7f-1e6307a7753a@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=horms+renesas@verge.net.au \
    --cc=joe@perches.com \
    --cc=julia.lawall@inria.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=tho.vu.wh@rvc.renesas.com \
    --cc=uli+renesas@fpond.eu \
    /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