netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks
@ 2025-10-29 23:16 Vadim Fedorenko
  2025-10-29 23:16 ` [PATCH net-next 1/3] can: convert generic HW timestamp ioctl to " Vadim Fedorenko
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Vadim Fedorenko @ 2025-10-29 23:16 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman, Vadim Fedorenko
  Cc: linux-can, netdev, Jakub Kicinski, Vladimir Oltean, Kory Maincent,
	Jacob Keller

The patchset converts generic ioctl implementation into a pair of
ndo_hwtstamp_get/ndo_hwtstamp_set generic callbacks and replaces
callbacks in drivers.

Vadim Fedorenko (3):
  can: convert generic HW timestamp ioctl to ndo_hwtstamp callbacks
  can: peak_canfd: convert to use ndo_hwtstamp callbacks
  can: peak_usb: convert to use ndo_hwtstamp callbacks

 drivers/net/can/dev/dev.c                     | 45 +++++++++----------
 drivers/net/can/esd/esd_402_pci-core.c        |  3 +-
 .../can/kvaser_pciefd/kvaser_pciefd_core.c    |  3 +-
 drivers/net/can/peak_canfd/peak_canfd.c       | 35 +++++++--------
 .../net/can/spi/mcp251xfd/mcp251xfd-core.c    |  3 +-
 drivers/net/can/usb/etas_es58x/es58x_core.c   |  3 +-
 drivers/net/can/usb/gs_usb.c                  | 20 +++++++--
 .../net/can/usb/kvaser_usb/kvaser_usb_core.c  |  3 +-
 drivers/net/can/usb/peak_usb/pcan_usb_core.c  | 39 ++++++++--------
 include/linux/can/dev.h                       |  6 ++-
 10 files changed, 88 insertions(+), 72 deletions(-)

-- 
2.47.3


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

* [PATCH net-next 1/3] can: convert generic HW timestamp ioctl to ndo_hwtstamp callbacks
  2025-10-29 23:16 [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks Vadim Fedorenko
@ 2025-10-29 23:16 ` Vadim Fedorenko
  2025-10-30 17:01   ` Kory Maincent
  2025-10-29 23:16 ` [PATCH net-next 2/3] can: peak_canfd: convert to use " Vadim Fedorenko
                   ` (4 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Vadim Fedorenko @ 2025-10-29 23:16 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman, Vadim Fedorenko
  Cc: linux-can, netdev, Jakub Kicinski, Vladimir Oltean, Kory Maincent,
	Jacob Keller

Can has generic implementation of ndo_eth_ioctl which implements only HW
timestamping commands. Implement generic ndo_hwtstamp callbacks and use
it in drivers instead of generic ioctl interface.

Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
---
 drivers/net/can/dev/dev.c                     | 45 +++++++++----------
 drivers/net/can/esd/esd_402_pci-core.c        |  3 +-
 .../can/kvaser_pciefd/kvaser_pciefd_core.c    |  3 +-
 .../net/can/spi/mcp251xfd/mcp251xfd-core.c    |  3 +-
 drivers/net/can/usb/etas_es58x/es58x_core.c   |  3 +-
 drivers/net/can/usb/gs_usb.c                  | 20 +++++++--
 .../net/can/usb/kvaser_usb/kvaser_usb_core.c  |  3 +-
 include/linux/can/dev.h                       |  6 ++-
 8 files changed, 54 insertions(+), 32 deletions(-)

diff --git a/drivers/net/can/dev/dev.c b/drivers/net/can/dev/dev.c
index 0cc3d008adb3..80e1ab18de87 100644
--- a/drivers/net/can/dev/dev.c
+++ b/drivers/net/can/dev/dev.c
@@ -379,34 +379,33 @@ int can_set_static_ctrlmode(struct net_device *dev, u32 static_mode)
 }
 EXPORT_SYMBOL_GPL(can_set_static_ctrlmode);
 
-/* generic implementation of netdev_ops::ndo_eth_ioctl for CAN devices
+/* generic implementation of netdev_ops::ndo_hwtstamp_get for CAN devices
  * supporting hardware timestamps
  */
-int can_eth_ioctl_hwts(struct net_device *netdev, struct ifreq *ifr, int cmd)
+int can_hwtstamp_get(struct net_device *netdev,
+		     struct kernel_hwtstamp_config *cfg)
 {
-	struct hwtstamp_config hwts_cfg = { 0 };
-
-	switch (cmd) {
-	case SIOCSHWTSTAMP: /* set */
-		if (copy_from_user(&hwts_cfg, ifr->ifr_data, sizeof(hwts_cfg)))
-			return -EFAULT;
-		if (hwts_cfg.tx_type == HWTSTAMP_TX_ON &&
-		    hwts_cfg.rx_filter == HWTSTAMP_FILTER_ALL)
-			return 0;
-		return -ERANGE;
-
-	case SIOCGHWTSTAMP: /* get */
-		hwts_cfg.tx_type = HWTSTAMP_TX_ON;
-		hwts_cfg.rx_filter = HWTSTAMP_FILTER_ALL;
-		if (copy_to_user(ifr->ifr_data, &hwts_cfg, sizeof(hwts_cfg)))
-			return -EFAULT;
-		return 0;
+	cfg->tx_type = HWTSTAMP_TX_ON;
+	cfg->rx_filter = HWTSTAMP_FILTER_ALL;
 
-	default:
-		return -EOPNOTSUPP;
-	}
+	return 0;
+}
+EXPORT_SYMBOL(can_hwtstamp_get);
+
+/* generic implementation of netdev_ops::ndo_hwtstamp_set for CAN devices
+ * supporting hardware timestamps
+ */
+int can_hwtstamp_set(struct net_device *netdev,
+		     struct kernel_hwtstamp_config *cfg,
+		     struct netlink_ext_ack *extack)
+{
+	if (cfg->tx_type == HWTSTAMP_TX_ON &&
+	    cfg->rx_filter == HWTSTAMP_FILTER_ALL)
+		return 0;
+	NL_SET_ERR_MSG_MOD(extack, "Only TX on and RX all packets filter supported");
+	return -ERANGE;
 }
-EXPORT_SYMBOL(can_eth_ioctl_hwts);
+EXPORT_SYMBOL(can_hwtstamp_set);
 
 /* generic implementation of ethtool_ops::get_ts_info for CAN devices
  * supporting hardware timestamps
diff --git a/drivers/net/can/esd/esd_402_pci-core.c b/drivers/net/can/esd/esd_402_pci-core.c
index 05adecae6375..c826f00c551b 100644
--- a/drivers/net/can/esd/esd_402_pci-core.c
+++ b/drivers/net/can/esd/esd_402_pci-core.c
@@ -86,7 +86,8 @@ static const struct net_device_ops pci402_acc_netdev_ops = {
 	.ndo_open = acc_open,
 	.ndo_stop = acc_close,
 	.ndo_start_xmit = acc_start_xmit,
-	.ndo_eth_ioctl = can_eth_ioctl_hwts,
+	.ndo_hwtstamp_get = can_hwtstamp_get,
+	.ndo_hwtstamp_set = can_hwtstamp_set,
 };
 
 static const struct ethtool_ops pci402_acc_ethtool_ops = {
diff --git a/drivers/net/can/kvaser_pciefd/kvaser_pciefd_core.c b/drivers/net/can/kvaser_pciefd/kvaser_pciefd_core.c
index 705f9bb74cd2..d8c9bfb20230 100644
--- a/drivers/net/can/kvaser_pciefd/kvaser_pciefd_core.c
+++ b/drivers/net/can/kvaser_pciefd/kvaser_pciefd_core.c
@@ -902,8 +902,9 @@ static void kvaser_pciefd_bec_poll_timer(struct timer_list *data)
 static const struct net_device_ops kvaser_pciefd_netdev_ops = {
 	.ndo_open = kvaser_pciefd_open,
 	.ndo_stop = kvaser_pciefd_stop,
-	.ndo_eth_ioctl = can_eth_ioctl_hwts,
 	.ndo_start_xmit = kvaser_pciefd_start_xmit,
+	.ndo_hwtstamp_get = can_hwtstamp_get,
+	.ndo_hwtstamp_set = can_hwtstamp_set,
 };
 
 static int kvaser_pciefd_set_phys_id(struct net_device *netdev,
diff --git a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
index 9402530ba3d4..c0f9d9fed02e 100644
--- a/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
+++ b/drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
@@ -1714,7 +1714,8 @@ static const struct net_device_ops mcp251xfd_netdev_ops = {
 	.ndo_open = mcp251xfd_open,
 	.ndo_stop = mcp251xfd_stop,
 	.ndo_start_xmit	= mcp251xfd_start_xmit,
-	.ndo_eth_ioctl = can_eth_ioctl_hwts,
+	.ndo_hwtstamp_get = can_hwtstamp_get,
+	.ndo_hwtstamp_set = can_hwtstamp_set,
 };
 
 static void
diff --git a/drivers/net/can/usb/etas_es58x/es58x_core.c b/drivers/net/can/usb/etas_es58x/es58x_core.c
index 47d9e03f3044..f799233c2b72 100644
--- a/drivers/net/can/usb/etas_es58x/es58x_core.c
+++ b/drivers/net/can/usb/etas_es58x/es58x_core.c
@@ -1976,7 +1976,8 @@ static const struct net_device_ops es58x_netdev_ops = {
 	.ndo_open = es58x_open,
 	.ndo_stop = es58x_stop,
 	.ndo_start_xmit = es58x_start_xmit,
-	.ndo_eth_ioctl = can_eth_ioctl_hwts,
+	.ndo_hwtstamp_get = can_hwtstamp_get,
+	.ndo_hwtstamp_set = can_hwtstamp_set,
 };
 
 static const struct ethtool_ops es58x_ethtool_ops = {
diff --git a/drivers/net/can/usb/gs_usb.c b/drivers/net/can/usb/gs_usb.c
index 30608901a974..1321eb5e89ae 100644
--- a/drivers/net/can/usb/gs_usb.c
+++ b/drivers/net/can/usb/gs_usb.c
@@ -1087,12 +1087,25 @@ static int gs_can_close(struct net_device *netdev)
 	return 0;
 }
 
-static int gs_can_eth_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
+static int gs_can_hwtstamp_get(struct net_device *netdev,
+			       struct kernel_hwtstamp_config *cfg)
 {
 	const struct gs_can *dev = netdev_priv(netdev);
 
 	if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
-		return can_eth_ioctl_hwts(netdev, ifr, cmd);
+		return can_hwtstamp_get(netdev, cfg);
+
+	return -EOPNOTSUPP;
+}
+
+static int gs_can_hwtstamp_set(struct net_device *netdev,
+			       struct kernel_hwtstamp_config *cfg,
+			       struct netlink_ext_ack *extack)
+{
+	const struct gs_can *dev = netdev_priv(netdev);
+
+	if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP)
+		return can_hwtstamp_set(netdev, cfg, extack);
 
 	return -EOPNOTSUPP;
 }
@@ -1101,7 +1114,8 @@ static const struct net_device_ops gs_usb_netdev_ops = {
 	.ndo_open = gs_can_open,
 	.ndo_stop = gs_can_close,
 	.ndo_start_xmit = gs_can_start_xmit,
-	.ndo_eth_ioctl = gs_can_eth_ioctl,
+	.ndo_hwtstamp_get = gs_can_hwtstamp_get,
+	.ndo_hwtstamp_set = gs_can_hwtstamp_set,
 };
 
 static int gs_usb_set_identify(struct net_device *netdev, bool do_identify)
diff --git a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
index 89e22b66f919..62701ec34272 100644
--- a/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
+++ b/drivers/net/can/usb/kvaser_usb/kvaser_usb_core.c
@@ -784,8 +784,9 @@ static int kvaser_usb_set_phys_id(struct net_device *netdev,
 static const struct net_device_ops kvaser_usb_netdev_ops = {
 	.ndo_open = kvaser_usb_open,
 	.ndo_stop = kvaser_usb_close,
-	.ndo_eth_ioctl = can_eth_ioctl_hwts,
 	.ndo_start_xmit = kvaser_usb_start_xmit,
+	.ndo_hwtstamp_get = can_hwtstamp_get,
+	.ndo_hwtstamp_set = can_hwtstamp_set,
 };
 
 static const struct ethtool_ops kvaser_usb_ethtool_ops = {
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index 0fe8f80f223e..bd7410b5d8a6 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -129,7 +129,11 @@ void close_candev(struct net_device *dev);
 void can_set_default_mtu(struct net_device *dev);
 int __must_check can_set_static_ctrlmode(struct net_device *dev,
 					 u32 static_mode);
-int can_eth_ioctl_hwts(struct net_device *netdev, struct ifreq *ifr, int cmd);
+int can_hwtstamp_get(struct net_device *netdev,
+		     struct kernel_hwtstamp_config *cfg);
+int can_hwtstamp_set(struct net_device *netdev,
+		     struct kernel_hwtstamp_config *cfg,
+		     struct netlink_ext_ack *extack);
 int can_ethtool_op_get_ts_info_hwts(struct net_device *dev,
 				    struct kernel_ethtool_ts_info *info);
 
-- 
2.47.3


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

* [PATCH net-next 2/3] can: peak_canfd: convert to use ndo_hwtstamp callbacks
  2025-10-29 23:16 [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks Vadim Fedorenko
  2025-10-29 23:16 ` [PATCH net-next 1/3] can: convert generic HW timestamp ioctl to " Vadim Fedorenko
@ 2025-10-29 23:16 ` Vadim Fedorenko
  2025-10-30 17:04   ` Kory Maincent
  2025-10-29 23:16 ` [PATCH net-next 3/3] can: peak_usb: " Vadim Fedorenko
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Vadim Fedorenko @ 2025-10-29 23:16 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman, Vadim Fedorenko
  Cc: linux-can, netdev, Jakub Kicinski, Vladimir Oltean, Kory Maincent,
	Jacob Keller

Convert driver to use ndo_hwtstamp_set()/ndo_hwtstamp_get() callbacks.
ndo_eth_ioctl handler does nothing after conversion - remove it.

Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
---
 drivers/net/can/peak_canfd/peak_canfd.c | 35 +++++++++++--------------
 1 file changed, 16 insertions(+), 19 deletions(-)

diff --git a/drivers/net/can/peak_canfd/peak_canfd.c b/drivers/net/can/peak_canfd/peak_canfd.c
index a53c9d347b7b..06cb2629f66a 100644
--- a/drivers/net/can/peak_canfd/peak_canfd.c
+++ b/drivers/net/can/peak_canfd/peak_canfd.c
@@ -743,36 +743,33 @@ static netdev_tx_t peak_canfd_start_xmit(struct sk_buff *skb,
 	return NETDEV_TX_OK;
 }
 
-static int peak_eth_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
+static int peak_eth_hwtstamp_get(struct net_device *netdev,
+				 struct kernel_hwtstamp_config *config)
 {
-	struct hwtstamp_config hwts_cfg = { 0 };
+	config->tx_type = HWTSTAMP_TX_OFF;
+	config->rx_filter = HWTSTAMP_FILTER_ALL;
 
-	switch (cmd) {
-	case SIOCSHWTSTAMP: /* set */
-		if (copy_from_user(&hwts_cfg, ifr->ifr_data, sizeof(hwts_cfg)))
-			return -EFAULT;
-		if (hwts_cfg.tx_type == HWTSTAMP_TX_OFF &&
-		    hwts_cfg.rx_filter == HWTSTAMP_FILTER_ALL)
-			return 0;
-		return -ERANGE;
+	return 0;
+}
 
-	case SIOCGHWTSTAMP: /* get */
-		hwts_cfg.tx_type = HWTSTAMP_TX_OFF;
-		hwts_cfg.rx_filter = HWTSTAMP_FILTER_ALL;
-		if (copy_to_user(ifr->ifr_data, &hwts_cfg, sizeof(hwts_cfg)))
-			return -EFAULT;
+static int peak_eth_hwtstamp_set(struct net_device *netdev,
+				 struct kernel_hwtstamp_config *config,
+				 struct netlink_ext_ack *extack)
+{
+	if (config->tx_type == HWTSTAMP_TX_OFF &&
+	    config->rx_filter == HWTSTAMP_FILTER_ALL)
 		return 0;
 
-	default:
-		return -EOPNOTSUPP;
-	}
+	NL_SET_ERR_MSG_MOD(extack, "Only RX HWTSTAMP_FILTER_ALL is supported");
+	return -ERANGE;
 }
 
 static const struct net_device_ops peak_canfd_netdev_ops = {
 	.ndo_open = peak_canfd_open,
 	.ndo_stop = peak_canfd_close,
-	.ndo_eth_ioctl = peak_eth_ioctl,
 	.ndo_start_xmit = peak_canfd_start_xmit,
+	.ndo_hwtstamp_get = peak_eth_hwtstamp_get,
+	.ndo_hwtstamp_set = peak_eth_hwtstamp_set,
 };
 
 static int peak_get_ts_info(struct net_device *dev,
-- 
2.47.3


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

* [PATCH net-next 3/3] can: peak_usb: convert to use ndo_hwtstamp callbacks
  2025-10-29 23:16 [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks Vadim Fedorenko
  2025-10-29 23:16 ` [PATCH net-next 1/3] can: convert generic HW timestamp ioctl to " Vadim Fedorenko
  2025-10-29 23:16 ` [PATCH net-next 2/3] can: peak_canfd: convert to use " Vadim Fedorenko
@ 2025-10-29 23:16 ` Vadim Fedorenko
  2025-10-30 17:05   ` Kory Maincent
  2025-10-30  6:36 ` [PATCH net-next 0/3] convert can drivers " Vincent Mailhol
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 10+ messages in thread
From: Vadim Fedorenko @ 2025-10-29 23:16 UTC (permalink / raw)
  To: Marc Kleine-Budde, Vincent Mailhol, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman, Vadim Fedorenko
  Cc: linux-can, netdev, Jakub Kicinski, Vladimir Oltean, Kory Maincent,
	Jacob Keller

Convert driver to use ndo_hwtstamp_set()/ndo_hwtstamp_get() callbacks.
ndo_eth_ioctl handler does nothing after conversion - remove it.

Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>
---
 drivers/net/can/usb/peak_usb/pcan_usb_core.c | 39 +++++++++-----------
 1 file changed, 18 insertions(+), 21 deletions(-)

diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_core.c b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
index 94b1d7f15d27..cf48bb26d46d 100644
--- a/drivers/net/can/usb/peak_usb/pcan_usb_core.c
+++ b/drivers/net/can/usb/peak_usb/pcan_usb_core.c
@@ -784,36 +784,33 @@ static int peak_usb_set_data_bittiming(struct net_device *netdev)
 	return 0;
 }
 
-static int peak_eth_ioctl(struct net_device *netdev, struct ifreq *ifr, int cmd)
+static int peak_hwtstamp_get(struct net_device *netdev,
+			     struct kernel_hwtstamp_config *config)
 {
-	struct hwtstamp_config hwts_cfg = { 0 };
-
-	switch (cmd) {
-	case SIOCSHWTSTAMP: /* set */
-		if (copy_from_user(&hwts_cfg, ifr->ifr_data, sizeof(hwts_cfg)))
-			return -EFAULT;
-		if (hwts_cfg.tx_type == HWTSTAMP_TX_OFF &&
-		    hwts_cfg.rx_filter == HWTSTAMP_FILTER_ALL)
-			return 0;
-		return -ERANGE;
-
-	case SIOCGHWTSTAMP: /* get */
-		hwts_cfg.tx_type = HWTSTAMP_TX_OFF;
-		hwts_cfg.rx_filter = HWTSTAMP_FILTER_ALL;
-		if (copy_to_user(ifr->ifr_data, &hwts_cfg, sizeof(hwts_cfg)))
-			return -EFAULT;
+	config->tx_type = HWTSTAMP_TX_OFF;
+	config->rx_filter = HWTSTAMP_FILTER_ALL;
+
+	return 0;
+}
+
+static int peak_hwtstamp_set(struct net_device *netdev,
+			     struct kernel_hwtstamp_config *config,
+			     struct netlink_ext_ack *extack)
+{
+	if (config->tx_type == HWTSTAMP_TX_OFF &&
+	    config->rx_filter == HWTSTAMP_FILTER_ALL)
 		return 0;
 
-	default:
-		return -EOPNOTSUPP;
-	}
+	NL_SET_ERR_MSG_MOD(extack, "Only RX HWTSTAMP_FILTER_ALL is supported");
+	return -ERANGE;
 }
 
 static const struct net_device_ops peak_usb_netdev_ops = {
 	.ndo_open = peak_usb_ndo_open,
 	.ndo_stop = peak_usb_ndo_stop,
-	.ndo_eth_ioctl = peak_eth_ioctl,
 	.ndo_start_xmit = peak_usb_ndo_start_xmit,
+	.ndo_hwtstamp_get = peak_hwtstamp_get,
+	.ndo_hwtstamp_set = peak_hwtstamp_set,
 };
 
 /* CAN-USB devices generally handle 32-bit CAN channel IDs.
-- 
2.47.3


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

* Re: [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks
  2025-10-29 23:16 [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks Vadim Fedorenko
                   ` (2 preceding siblings ...)
  2025-10-29 23:16 ` [PATCH net-next 3/3] can: peak_usb: " Vadim Fedorenko
@ 2025-10-30  6:36 ` Vincent Mailhol
  2025-10-31 12:19 ` Marc Kleine-Budde
  2025-11-12  8:45 ` Marc Kleine-Budde
  5 siblings, 0 replies; 10+ messages in thread
From: Vincent Mailhol @ 2025-10-30  6:36 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: linux-can, netdev, Jakub Kicinski, Vladimir Oltean, Kory Maincent,
	Jacob Keller, Marc Kleine-Budde, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman

Hi Vadim,

On 30/10/2025 at 00:16, Vadim Fedorenko wrote:
> The patchset converts generic ioctl implementation into a pair of
> ndo_hwtstamp_get/ndo_hwtstamp_set generic callbacks and replaces
> callbacks in drivers.
Thanks for the series. I wasn't aware of the ndo_hwtstamp_{get,set}()
when I wrote the original series. The code looks nicer like this
without the need to use the copy_{from,to}_user() anymore.

I do not have access to my hardware at the moment, so I can not
test. But the code looks straightforward to me, so:

Reviewed-by: Vincent Mailhol <mailhol@kernel.org>


Yours sincerely,
Vincent Mailhol


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

* Re: [PATCH net-next 1/3] can: convert generic HW timestamp ioctl to ndo_hwtstamp callbacks
  2025-10-29 23:16 ` [PATCH net-next 1/3] can: convert generic HW timestamp ioctl to " Vadim Fedorenko
@ 2025-10-30 17:01   ` Kory Maincent
  0 siblings, 0 replies; 10+ messages in thread
From: Kory Maincent @ 2025-10-30 17:01 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: Marc Kleine-Budde, Vincent Mailhol, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman, linux-can, netdev, Jakub Kicinski,
	Vladimir Oltean, Jacob Keller

On Wed, 29 Oct 2025 23:16:18 +0000
Vadim Fedorenko <vadim.fedorenko@linux.dev> wrote:

> Can has generic implementation of ndo_eth_ioctl which implements only HW
> timestamping commands. Implement generic ndo_hwtstamp callbacks and use
> it in drivers instead of generic ioctl interface.
> 
> Signed-off-by: Vadim Fedorenko <vadim.fedorenko@linux.dev>

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

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

* Re: [PATCH net-next 2/3] can: peak_canfd: convert to use ndo_hwtstamp callbacks
  2025-10-29 23:16 ` [PATCH net-next 2/3] can: peak_canfd: convert to use " Vadim Fedorenko
@ 2025-10-30 17:04   ` Kory Maincent
  0 siblings, 0 replies; 10+ messages in thread
From: Kory Maincent @ 2025-10-30 17:04 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: Marc Kleine-Budde, Vincent Mailhol, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman, linux-can, netdev, Jakub Kicinski,
	Vladimir Oltean, Jacob Keller

On Wed, 29 Oct 2025 23:16:19 +0000
Vadim Fedorenko <vadim.fedorenko@linux.dev> wrote:

> Convert driver to use ndo_hwtstamp_set()/ndo_hwtstamp_get() callbacks.
> ndo_eth_ioctl handler does nothing after conversion - remove it.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

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

* Re: [PATCH net-next 3/3] can: peak_usb: convert to use ndo_hwtstamp callbacks
  2025-10-29 23:16 ` [PATCH net-next 3/3] can: peak_usb: " Vadim Fedorenko
@ 2025-10-30 17:05   ` Kory Maincent
  0 siblings, 0 replies; 10+ messages in thread
From: Kory Maincent @ 2025-10-30 17:05 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: Marc Kleine-Budde, Vincent Mailhol, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman, linux-can, netdev, Jakub Kicinski,
	Vladimir Oltean, Jacob Keller

On Wed, 29 Oct 2025 23:16:20 +0000
Vadim Fedorenko <vadim.fedorenko@linux.dev> wrote:

> Convert driver to use ndo_hwtstamp_set()/ndo_hwtstamp_get() callbacks.
> ndo_eth_ioctl handler does nothing after conversion - remove it.

Reviewed-by: Kory Maincent <kory.maincent@bootlin.com>

Thank you!
-- 
Köry Maincent, Bootlin
Embedded Linux and kernel engineering
https://bootlin.com

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

* Re: [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks
  2025-10-29 23:16 [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks Vadim Fedorenko
                   ` (3 preceding siblings ...)
  2025-10-30  6:36 ` [PATCH net-next 0/3] convert can drivers " Vincent Mailhol
@ 2025-10-31 12:19 ` Marc Kleine-Budde
  2025-11-12  8:45 ` Marc Kleine-Budde
  5 siblings, 0 replies; 10+ messages in thread
From: Marc Kleine-Budde @ 2025-10-31 12:19 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: Vincent Mailhol, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman, linux-can, netdev, Jakub Kicinski,
	Vladimir Oltean, Kory Maincent, Jacob Keller

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

On 29.10.2025 23:16:17, Vadim Fedorenko wrote:
> The patchset converts generic ioctl implementation into a pair of
> ndo_hwtstamp_get/ndo_hwtstamp_set generic callbacks and replaces
> callbacks in drivers.

applied to linux-can-next

Thanks,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

* Re: [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks
  2025-10-29 23:16 [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks Vadim Fedorenko
                   ` (4 preceding siblings ...)
  2025-10-31 12:19 ` Marc Kleine-Budde
@ 2025-11-12  8:45 ` Marc Kleine-Budde
  5 siblings, 0 replies; 10+ messages in thread
From: Marc Kleine-Budde @ 2025-11-12  8:45 UTC (permalink / raw)
  To: Vadim Fedorenko
  Cc: Vincent Mailhol, Stefan Mätje, socketcan,
	Manivannan Sadhasivam, Thomas Kopp, Oliver Hartkopp,
	Jimmy Assarsson, Axel Forsman, linux-can, netdev, Jakub Kicinski,
	Vladimir Oltean, Kory Maincent, Jacob Keller

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

On 29.10.2025 23:16:17, Vadim Fedorenko wrote:
> The patchset converts generic ioctl implementation into a pair of
> ndo_hwtstamp_get/ndo_hwtstamp_set generic callbacks and replaces
> callbacks in drivers.

Applied to linux-can-next.

Thanks,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde          |
Embedded Linux                   | https://www.pengutronix.de |
Vertretung Nürnberg              | Phone: +49-5121-206917-129 |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-9   |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2025-11-12  8:46 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-29 23:16 [PATCH net-next 0/3] convert can drivers to use ndo_hwtstamp callbacks Vadim Fedorenko
2025-10-29 23:16 ` [PATCH net-next 1/3] can: convert generic HW timestamp ioctl to " Vadim Fedorenko
2025-10-30 17:01   ` Kory Maincent
2025-10-29 23:16 ` [PATCH net-next 2/3] can: peak_canfd: convert to use " Vadim Fedorenko
2025-10-30 17:04   ` Kory Maincent
2025-10-29 23:16 ` [PATCH net-next 3/3] can: peak_usb: " Vadim Fedorenko
2025-10-30 17:05   ` Kory Maincent
2025-10-30  6:36 ` [PATCH net-next 0/3] convert can drivers " Vincent Mailhol
2025-10-31 12:19 ` Marc Kleine-Budde
2025-11-12  8:45 ` Marc Kleine-Budde

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).