linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration
@ 2020-07-15 16:10 Sergey Organov
  2020-07-16 18:56 ` Richard Cochran
  0 siblings, 1 reply; 3+ messages in thread
From: Sergey Organov @ 2020-07-15 16:10 UTC (permalink / raw)
  To: netdev
  Cc: linux-kernel, Richard Cochran, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, Russell King, David S. Miller, Jakub Kicinski,
	John Stultz, Vladimir Oltean, Sergey Organov

From Documentation/networking/timestamping.txt:

  A driver which supports hardware time stamping shall update the
  struct with the actual, possibly more permissive configuration.

Do update the struct passed when we upscale the requested time
stamping mode.

Fixes: cb646e2b02b2 ("ptp: Added a clock driver for the National Semiconductor PHYTER.")
Signed-off-by: Sergey Organov <sorganov@gmail.com>
---
 drivers/net/phy/dp83640.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/net/phy/dp83640.c b/drivers/net/phy/dp83640.c
index ecbd5e0d685c..acb0aae60755 100644
--- a/drivers/net/phy/dp83640.c
+++ b/drivers/net/phy/dp83640.c
@@ -1260,6 +1260,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)
 		dp83640->hwts_rx_en = 1;
 		dp83640->layer = PTP_CLASS_L4;
 		dp83640->version = PTP_CLASS_V1;
+		cfg.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
 		break;
 	case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
 	case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
@@ -1267,6 +1268,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)
 		dp83640->hwts_rx_en = 1;
 		dp83640->layer = PTP_CLASS_L4;
 		dp83640->version = PTP_CLASS_V2;
+		cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_L4_EVENT;
 		break;
 	case HWTSTAMP_FILTER_PTP_V2_L2_EVENT:
 	case HWTSTAMP_FILTER_PTP_V2_L2_SYNC:
@@ -1274,6 +1276,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)
 		dp83640->hwts_rx_en = 1;
 		dp83640->layer = PTP_CLASS_L2;
 		dp83640->version = PTP_CLASS_V2;
+		cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_L2_EVENT;
 		break;
 	case HWTSTAMP_FILTER_PTP_V2_EVENT:
 	case HWTSTAMP_FILTER_PTP_V2_SYNC:
@@ -1281,6 +1284,7 @@ static int dp83640_hwtstamp(struct mii_timestamper *mii_ts, struct ifreq *ifr)
 		dp83640->hwts_rx_en = 1;
 		dp83640->layer = PTP_CLASS_L4 | PTP_CLASS_L2;
 		dp83640->version = PTP_CLASS_V2;
+		cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
 		break;
 	default:
 		return -ERANGE;
-- 
2.10.0.1.g57b01a3


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration
  2020-07-15 16:10 [PATCH net] net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration Sergey Organov
@ 2020-07-16 18:56 ` Richard Cochran
  2020-07-16 20:32   ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Richard Cochran @ 2020-07-16 18:56 UTC (permalink / raw)
  To: Sergey Organov
  Cc: netdev, linux-kernel, Andrew Lunn, Florian Fainelli,
	Heiner Kallweit, Russell King, David S. Miller, Jakub Kicinski,
	John Stultz, Vladimir Oltean

On Wed, Jul 15, 2020 at 07:10:00PM +0300, Sergey Organov wrote:
> From Documentation/networking/timestamping.txt:
> 
>   A driver which supports hardware time stamping shall update the
>   struct with the actual, possibly more permissive configuration.
> 
> Do update the struct passed when we upscale the requested time
> stamping mode.
> 
> Fixes: cb646e2b02b2 ("ptp: Added a clock driver for the National Semiconductor PHYTER.")
> Signed-off-by: Sergey Organov <sorganov@gmail.com>

Acked-by: Richard Cochran <richardcochran@gmail.com>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net] net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration
  2020-07-16 18:56 ` Richard Cochran
@ 2020-07-16 20:32   ` Jakub Kicinski
  0 siblings, 0 replies; 3+ messages in thread
From: Jakub Kicinski @ 2020-07-16 20:32 UTC (permalink / raw)
  To: Richard Cochran
  Cc: Sergey Organov, netdev, linux-kernel, Andrew Lunn,
	Florian Fainelli, Heiner Kallweit, Russell King, David S. Miller,
	John Stultz, Vladimir Oltean

On Thu, 16 Jul 2020 11:56:50 -0700 Richard Cochran wrote:
> On Wed, Jul 15, 2020 at 07:10:00PM +0300, Sergey Organov wrote:
> > From Documentation/networking/timestamping.txt:
> > 
> >   A driver which supports hardware time stamping shall update the
> >   struct with the actual, possibly more permissive configuration.
> > 
> > Do update the struct passed when we upscale the requested time
> > stamping mode.
> > 
> > Fixes: cb646e2b02b2 ("ptp: Added a clock driver for the National Semiconductor PHYTER.")
> > Signed-off-by: Sergey Organov <sorganov@gmail.com>  
> 
> Acked-by: Richard Cochran <richardcochran@gmail.com>

Applied, thank you!

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-07-16 20:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-15 16:10 [PATCH net] net: dp83640: fix SIOCSHWTSTAMP to update the struct with actual configuration Sergey Organov
2020-07-16 18:56 ` Richard Cochran
2020-07-16 20:32   ` Jakub Kicinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).