All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpsw: cpts: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter
@ 2017-06-05 23:21 ` Grygorii Strashko
  0 siblings, 0 replies; 6+ messages in thread
From: Grygorii Strashko @ 2017-06-05 23:21 UTC (permalink / raw)
  To: David S. Miller, netdev, Sekhar Nori
  Cc: linux-kernel, linux-omap, Grygorii Strashko

CPSW driver supports PTP v1 messages, but for unknown reasons this filter
is not advertised. As result,
./tools/testing/selftests/networking/timestamping/timestamping utility
can't be used for testing of CPSW RX timestamping with option
SOF_TIMESTAMPING_RX_HARDWARE, because it uses
HWTSTAMP_FILTER_PTP_V1_L4_SYNC filter.

Hence, fix it by advertising HWTSTAMP_FILTER_PTP_V1_L4_XXX filters
in CPSW driver.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/net/ethernet/ti/cpsw.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 37fc165..b6a0d92 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1731,11 +1731,14 @@ static int cpsw_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
 		cpts_rx_enable(cpts, 0);
 		break;
 	case HWTSTAMP_FILTER_ALL:
+	case HWTSTAMP_FILTER_NTP_ALL:
+		return -ERANGE;
 	case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
 	case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
 	case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
-	case HWTSTAMP_FILTER_NTP_ALL:
-		return -ERANGE;
+		cpts_rx_enable(cpts, HWTSTAMP_FILTER_PTP_V1_L4_EVENT);
+		cfg.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
+		break;
 	case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
 	case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
 	case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
@@ -1745,7 +1748,7 @@ static int cpsw_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
 	case HWTSTAMP_FILTER_PTP_V2_EVENT:
 	case HWTSTAMP_FILTER_PTP_V2_SYNC:
 	case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
-		cpts_rx_enable(cpts, 1);
+		cpts_rx_enable(cpts, HWTSTAMP_FILTER_PTP_V2_EVENT);
 		cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
 		break;
 	default:
@@ -1784,7 +1787,7 @@ static int cpsw_hwtstamp_get(struct net_device *dev, struct ifreq *ifr)
 	cfg.tx_type = cpts_is_tx_enabled(cpts) ?
 		      HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF;
 	cfg.rx_filter = (cpts_is_rx_enabled(cpts) ?
-			 HWTSTAMP_FILTER_PTP_V2_EVENT : HWTSTAMP_FILTER_NONE);
+			 cpts->rx_enable : HWTSTAMP_FILTER_NONE);
 
 	return copy_to_user(ifr->ifr_data, &cfg, sizeof(cfg)) ? -EFAULT : 0;
 }
@@ -2141,6 +2144,7 @@ static int cpsw_get_ts_info(struct net_device *ndev,
 		(1 << HWTSTAMP_TX_ON);
 	info->rx_filters =
 		(1 << HWTSTAMP_FILTER_NONE) |
+		(1 << HWTSTAMP_FILTER_PTP_V1_L4_EVENT) |
 		(1 << HWTSTAMP_FILTER_PTP_V2_EVENT);
 	return 0;
 }
-- 
2.10.1

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

* [PATCH] cpsw: cpts: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter
@ 2017-06-05 23:21 ` Grygorii Strashko
  0 siblings, 0 replies; 6+ messages in thread
From: Grygorii Strashko @ 2017-06-05 23:21 UTC (permalink / raw)
  To: David S. Miller, netdev, Sekhar Nori
  Cc: linux-kernel, linux-omap, Grygorii Strashko

CPSW driver supports PTP v1 messages, but for unknown reasons this filter
is not advertised. As result,
./tools/testing/selftests/networking/timestamping/timestamping utility
can't be used for testing of CPSW RX timestamping with option
SOF_TIMESTAMPING_RX_HARDWARE, because it uses
HWTSTAMP_FILTER_PTP_V1_L4_SYNC filter.

Hence, fix it by advertising HWTSTAMP_FILTER_PTP_V1_L4_XXX filters
in CPSW driver.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/net/ethernet/ti/cpsw.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/drivers/net/ethernet/ti/cpsw.c b/drivers/net/ethernet/ti/cpsw.c
index 37fc165..b6a0d92 100644
--- a/drivers/net/ethernet/ti/cpsw.c
+++ b/drivers/net/ethernet/ti/cpsw.c
@@ -1731,11 +1731,14 @@ static int cpsw_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
 		cpts_rx_enable(cpts, 0);
 		break;
 	case HWTSTAMP_FILTER_ALL:
+	case HWTSTAMP_FILTER_NTP_ALL:
+		return -ERANGE;
 	case HWTSTAMP_FILTER_PTP_V1_L4_EVENT:
 	case HWTSTAMP_FILTER_PTP_V1_L4_SYNC:
 	case HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ:
-	case HWTSTAMP_FILTER_NTP_ALL:
-		return -ERANGE;
+		cpts_rx_enable(cpts, HWTSTAMP_FILTER_PTP_V1_L4_EVENT);
+		cfg.rx_filter = HWTSTAMP_FILTER_PTP_V1_L4_EVENT;
+		break;
 	case HWTSTAMP_FILTER_PTP_V2_L4_EVENT:
 	case HWTSTAMP_FILTER_PTP_V2_L4_SYNC:
 	case HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ:
@@ -1745,7 +1748,7 @@ static int cpsw_hwtstamp_set(struct net_device *dev, struct ifreq *ifr)
 	case HWTSTAMP_FILTER_PTP_V2_EVENT:
 	case HWTSTAMP_FILTER_PTP_V2_SYNC:
 	case HWTSTAMP_FILTER_PTP_V2_DELAY_REQ:
-		cpts_rx_enable(cpts, 1);
+		cpts_rx_enable(cpts, HWTSTAMP_FILTER_PTP_V2_EVENT);
 		cfg.rx_filter = HWTSTAMP_FILTER_PTP_V2_EVENT;
 		break;
 	default:
@@ -1784,7 +1787,7 @@ static int cpsw_hwtstamp_get(struct net_device *dev, struct ifreq *ifr)
 	cfg.tx_type = cpts_is_tx_enabled(cpts) ?
 		      HWTSTAMP_TX_ON : HWTSTAMP_TX_OFF;
 	cfg.rx_filter = (cpts_is_rx_enabled(cpts) ?
-			 HWTSTAMP_FILTER_PTP_V2_EVENT : HWTSTAMP_FILTER_NONE);
+			 cpts->rx_enable : HWTSTAMP_FILTER_NONE);
 
 	return copy_to_user(ifr->ifr_data, &cfg, sizeof(cfg)) ? -EFAULT : 0;
 }
@@ -2141,6 +2144,7 @@ static int cpsw_get_ts_info(struct net_device *ndev,
 		(1 << HWTSTAMP_TX_ON);
 	info->rx_filters =
 		(1 << HWTSTAMP_FILTER_NONE) |
+		(1 << HWTSTAMP_FILTER_PTP_V1_L4_EVENT) |
 		(1 << HWTSTAMP_FILTER_PTP_V2_EVENT);
 	return 0;
 }
-- 
2.10.1

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

* Re: [PATCH] cpsw: cpts: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter
  2017-06-05 23:21 ` Grygorii Strashko
  (?)
@ 2017-06-08 13:52 ` David Miller
  2017-06-08 16:40     ` Grygorii Strashko
  -1 siblings, 1 reply; 6+ messages in thread
From: David Miller @ 2017-06-08 13:52 UTC (permalink / raw)
  To: grygorii.strashko; +Cc: netdev, nsekhar, linux-kernel, linux-omap


These two patches do not apply cleanly to my net GIT tree, please respin.

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

* Re: [PATCH] cpsw: cpts: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter
  2017-06-08 13:52 ` David Miller
@ 2017-06-08 16:40     ` Grygorii Strashko
  0 siblings, 0 replies; 6+ messages in thread
From: Grygorii Strashko @ 2017-06-08 16:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, nsekhar, linux-kernel, linux-omap

Hi David,

On 06/08/2017 08:52 AM, David Miller wrote:
> 
> These two patches do not apply cleanly to my net GIT tree, please respin.
> 

I did it on top of net-next as there some conflicts,
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git

I've just re-checked and both can be applied with no issues on top of 
net-next.

Sorry for inconvenience.

-- 
regards,
-grygorii

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

* Re: [PATCH] cpsw: cpts: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter
@ 2017-06-08 16:40     ` Grygorii Strashko
  0 siblings, 0 replies; 6+ messages in thread
From: Grygorii Strashko @ 2017-06-08 16:40 UTC (permalink / raw)
  To: David Miller; +Cc: netdev, nsekhar, linux-kernel, linux-omap

Hi David,

On 06/08/2017 08:52 AM, David Miller wrote:
> 
> These two patches do not apply cleanly to my net GIT tree, please respin.
> 

I did it on top of net-next as there some conflicts,
git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git

I've just re-checked and both can be applied with no issues on top of 
net-next.

Sorry for inconvenience.

-- 
regards,
-grygorii

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

* Re: [PATCH] cpsw: cpts: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter
  2017-06-08 16:40     ` Grygorii Strashko
  (?)
@ 2017-06-08 18:10     ` David Miller
  -1 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2017-06-08 18:10 UTC (permalink / raw)
  To: grygorii.strashko; +Cc: netdev, nsekhar, linux-kernel, linux-omap

From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Thu, 8 Jun 2017 11:40:44 -0500

> Hi David,
> 
> On 06/08/2017 08:52 AM, David Miller wrote:
>> These two patches do not apply cleanly to my net GIT tree, please
>> respin.
>> 
> 
> I did it on top of net-next as there some conflicts,
> git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git
> 
> I've just re-checked and both can be applied with no issues on top of
> net-next.
> 
> Sorry for inconvenience.

You should mention explicitly the tree your patches are targetting
in your Subject line in order to avoid this problem, like

Subject: [PATCH net-next] ...

Please resubmit your patches with proper Subject lines.

Thank you.

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

end of thread, other threads:[~2017-06-08 18:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-05 23:21 [PATCH] cpsw: cpts: enable HWTSTAMP_FILTER_PTP_V1_L4_EVENT filter Grygorii Strashko
2017-06-05 23:21 ` Grygorii Strashko
2017-06-08 13:52 ` David Miller
2017-06-08 16:40   ` Grygorii Strashko
2017-06-08 16:40     ` Grygorii Strashko
2017-06-08 18:10     ` David Miller

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.