All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime
@ 2022-01-04 15:41 Marc Kleine-Budde
  2022-01-04 15:41 ` [PATCH v2 1/3] can: flexcan: move driver into separate sub directory Marc Kleine-Budde
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Marc Kleine-Budde @ 2022-01-04 15:41 UTC (permalink / raw)
  To: linux-can

Hello,

this picks up Dario's work.

Changes since RFC:
- move driver into subdir
- rename flexcan_main.c -> flexcan-core.c
  (mcp251xfd and tcan4x5x driver have the same naming scheme)
- use copyright notice from flexcan.c in flexcan.h
- add private flag support to set rx-fifo
- remove drvinfo, the kernel will fall back to the default implementation

Show available private flags:

| $ sudo ethtool --show-priv-flags can0
| Private flags for can0:
| rx-fifo: on

Change private flag:

| $ sudo ethtool --set-priv-flags can0 rx-fifo off
| netlink error: Device or resource busy

...does not work if interface is up.

Shut down interface and change "rx-fifo":

| $ sudo ip link set dev can0 down
| $ sudo ethtool --set-priv-flags can0 rx-fifo off
| $ sudo ethtool --show-priv-flags can0
| Private flags for can0:
| rx-fifo: off
| 
| $ sudo ip link set dev can0 up
| $ sudo ethtool --show-priv-flags can0
| Private flags for can0:
| rx-fifo: off

Is the name "rx-fifo" acceptable? Can you think of a better name?

What about adding a new quirk to the driver, only if that quirk is
that, it is allowed to change between rx-fifo and rx-mailbox mode?

What to you think?

regards,
Marc




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

* [PATCH v2 1/3] can: flexcan: move driver into separate sub directory
  2022-01-04 15:41 [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime Marc Kleine-Budde
@ 2022-01-04 15:41 ` Marc Kleine-Budde
  2022-01-04 15:41 ` [PATCH v2 2/3] can: flexcan: allow to change quirks at runtime Marc Kleine-Budde
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Marc Kleine-Budde @ 2022-01-04 15:41 UTC (permalink / raw)
  To: linux-can; +Cc: Marc Kleine-Budde

This patch moves the flexcan driver into a separate directory, a later
patch will add more files.

Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/Makefile                              | 2 +-
 drivers/net/can/flexcan/Makefile                      | 6 ++++++
 drivers/net/can/{flexcan.c => flexcan/flexcan-core.c} | 0
 3 files changed, 7 insertions(+), 1 deletion(-)
 create mode 100644 drivers/net/can/flexcan/Makefile
 rename drivers/net/can/{flexcan.c => flexcan/flexcan-core.c} (100%)

diff --git a/drivers/net/can/Makefile b/drivers/net/can/Makefile
index a2b4463d8480..1e660afcb61b 100644
--- a/drivers/net/can/Makefile
+++ b/drivers/net/can/Makefile
@@ -16,7 +16,7 @@ obj-y				+= softing/
 obj-$(CONFIG_CAN_AT91)		+= at91_can.o
 obj-$(CONFIG_CAN_CC770)		+= cc770/
 obj-$(CONFIG_CAN_C_CAN)		+= c_can/
-obj-$(CONFIG_CAN_FLEXCAN)	+= flexcan.o
+obj-$(CONFIG_CAN_FLEXCAN)	+= flexcan/
 obj-$(CONFIG_CAN_GRCAN)		+= grcan.o
 obj-$(CONFIG_CAN_IFI_CANFD)	+= ifi_canfd/
 obj-$(CONFIG_CAN_JANZ_ICAN3)	+= janz-ican3.o
diff --git a/drivers/net/can/flexcan/Makefile b/drivers/net/can/flexcan/Makefile
new file mode 100644
index 000000000000..25dd1d12b866
--- /dev/null
+++ b/drivers/net/can/flexcan/Makefile
@@ -0,0 +1,6 @@
+# SPDX-License-Identifier: GPL-2.0
+
+obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
+
+flexcan-objs :=
+flexcan-objs += flexcan-core.o
diff --git a/drivers/net/can/flexcan.c b/drivers/net/can/flexcan/flexcan-core.c
similarity index 100%
rename from drivers/net/can/flexcan.c
rename to drivers/net/can/flexcan/flexcan-core.c
-- 
2.34.1



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

* [PATCH v2 2/3] can: flexcan: allow to change quirks at runtime
  2022-01-04 15:41 [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime Marc Kleine-Budde
  2022-01-04 15:41 ` [PATCH v2 1/3] can: flexcan: move driver into separate sub directory Marc Kleine-Budde
@ 2022-01-04 15:41 ` Marc Kleine-Budde
  2022-01-04 15:41 ` [PATCH v2 3/3] can: flexcan: add ethtool support to change rx-fifo setting during runtime Marc Kleine-Budde
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 12+ messages in thread
From: Marc Kleine-Budde @ 2022-01-04 15:41 UTC (permalink / raw)
  To: linux-can; +Cc: Dario Binacchi, Marc Kleine-Budde

From: Dario Binacchi <dario.binacchi@amarulasolutions.com>

This is a preliminary patch for the upcoming support to ethtool api.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/flexcan/flexcan-core.c | 54 +++++++++++++-------------
 1 file changed, 27 insertions(+), 27 deletions(-)

diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
index 12b60ad95b02..26bf0a0a72f1 100644
--- a/drivers/net/can/flexcan/flexcan-core.c
+++ b/drivers/net/can/flexcan/flexcan-core.c
@@ -369,7 +369,7 @@ struct flexcan_priv {
 
 	struct clk *clk_ipg;
 	struct clk *clk_per;
-	const struct flexcan_devtype_data *devtype_data;
+	struct flexcan_devtype_data devtype_data;
 	struct regulator *reg_xceiver;
 	struct flexcan_stop_mode stm;
 
@@ -600,7 +600,7 @@ static inline int flexcan_enter_stop_mode(struct flexcan_priv *priv)
 	priv->write(reg_mcr, &regs->mcr);
 
 	/* enable stop request */
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
 		ret = flexcan_stop_mode_enable_scfw(priv, true);
 		if (ret < 0)
 			return ret;
@@ -619,7 +619,7 @@ static inline int flexcan_exit_stop_mode(struct flexcan_priv *priv)
 	int ret;
 
 	/* remove stop request */
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW) {
 		ret = flexcan_stop_mode_enable_scfw(priv, false);
 		if (ret < 0)
 			return ret;
@@ -1022,7 +1022,7 @@ static struct sk_buff *flexcan_mailbox_read(struct can_rx_offload *offload,
 
 	mb = flexcan_get_mb(priv, n);
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
 		u32 code;
 
 		do {
@@ -1087,7 +1087,7 @@ static struct sk_buff *flexcan_mailbox_read(struct can_rx_offload *offload,
 	}
 
  mark_as_read:
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)
 		flexcan_write64(priv, FLEXCAN_IFLAG_MB(n), &regs->iflag1);
 	else
 		priv->write(FLEXCAN_IFLAG_RX_FIFO_AVAILABLE, &regs->iflag1);
@@ -1113,7 +1113,7 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
 	enum can_state last_state = priv->can.state;
 
 	/* reception interrupt */
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
 		u64 reg_iflag_rx;
 		int ret;
 
@@ -1173,7 +1173,7 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
 
 	/* state change interrupt or broken error state quirk fix is enabled */
 	if ((reg_esr & FLEXCAN_ESR_ERR_STATE) ||
-	    (priv->devtype_data->quirks & (FLEXCAN_QUIRK_BROKEN_WERR_STATE |
+	    (priv->devtype_data.quirks & (FLEXCAN_QUIRK_BROKEN_WERR_STATE |
 					   FLEXCAN_QUIRK_BROKEN_PERR_STATE)))
 		flexcan_irq_state(dev, reg_esr);
 
@@ -1195,11 +1195,11 @@ static irqreturn_t flexcan_irq(int irq, void *dev_id)
 	 * (1): enabled if FLEXCAN_QUIRK_BROKEN_WERR_STATE is enabled
 	 */
 	if ((last_state != priv->can.state) &&
-	    (priv->devtype_data->quirks & FLEXCAN_QUIRK_BROKEN_PERR_STATE) &&
+	    (priv->devtype_data.quirks & FLEXCAN_QUIRK_BROKEN_PERR_STATE) &&
 	    !(priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)) {
 		switch (priv->can.state) {
 		case CAN_STATE_ERROR_ACTIVE:
-			if (priv->devtype_data->quirks &
+			if (priv->devtype_data.quirks &
 			    FLEXCAN_QUIRK_BROKEN_WERR_STATE)
 				flexcan_error_irq_enable(priv);
 			else
@@ -1423,13 +1423,13 @@ static int flexcan_rx_offload_setup(struct net_device *dev)
 	else
 		priv->mb_size = sizeof(struct flexcan_mb) + CAN_MAX_DLEN;
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_NR_MB_16)
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_NR_MB_16)
 		priv->mb_count = 16;
 	else
 		priv->mb_count = (sizeof(priv->regs->mb[0]) / priv->mb_size) +
 				 (sizeof(priv->regs->mb[1]) / priv->mb_size);
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)
 		priv->tx_mb_reserved =
 			flexcan_get_mb(priv, FLEXCAN_TX_MB_RESERVED_OFF_TIMESTAMP);
 	else
@@ -1441,7 +1441,7 @@ static int flexcan_rx_offload_setup(struct net_device *dev)
 
 	priv->offload.mailbox_read = flexcan_mailbox_read;
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
 		priv->offload.mb_first = FLEXCAN_RX_MB_OFF_TIMESTAMP_FIRST;
 		priv->offload.mb_last = priv->mb_count - 2;
 
@@ -1506,7 +1506,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	if (err)
 		goto out_chip_disable;
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SUPPORT_ECC)
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SUPPORT_ECC)
 		flexcan_ram_init(dev);
 
 	flexcan_set_bittiming(dev);
@@ -1535,7 +1535,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	 * - disable for timestamp mode
 	 * - enable for FIFO mode
 	 */
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP)
 		reg_mcr &= ~FLEXCAN_MCR_FEN;
 	else
 		reg_mcr |= FLEXCAN_MCR_FEN;
@@ -1586,7 +1586,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	 * on most Flexcan cores, too. Otherwise we don't get
 	 * any error warning or passive interrupts.
 	 */
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_BROKEN_WERR_STATE ||
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_BROKEN_WERR_STATE ||
 	    priv->can.ctrlmode & CAN_CTRLMODE_BERR_REPORTING)
 		reg_ctrl |= FLEXCAN_CTRL_ERR_MSK;
 	else
@@ -1599,7 +1599,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	netdev_dbg(dev, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
 	priv->write(reg_ctrl, &regs->ctrl);
 
-	if ((priv->devtype_data->quirks & FLEXCAN_QUIRK_ENABLE_EACEN_RRS)) {
+	if ((priv->devtype_data.quirks & FLEXCAN_QUIRK_ENABLE_EACEN_RRS)) {
 		reg_ctrl2 = priv->read(&regs->ctrl2);
 		reg_ctrl2 |= FLEXCAN_CTRL2_EACEN | FLEXCAN_CTRL2_RRS;
 		priv->write(reg_ctrl2, &regs->ctrl2);
@@ -1631,7 +1631,7 @@ static int flexcan_chip_start(struct net_device *dev)
 		priv->write(reg_fdctrl, &regs->fdctrl);
 	}
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP) {
 		for (i = priv->offload.mb_first; i <= priv->offload.mb_last; i++) {
 			mb = flexcan_get_mb(priv, i);
 			priv->write(FLEXCAN_MB_CODE_RX_EMPTY,
@@ -1659,7 +1659,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	priv->write(0x0, &regs->rx14mask);
 	priv->write(0x0, &regs->rx15mask);
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_DISABLE_RXFG)
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_DISABLE_RXFG)
 		priv->write(0x0, &regs->rxfgmask);
 
 	/* clear acceptance filters */
@@ -1673,7 +1673,7 @@ static int flexcan_chip_start(struct net_device *dev)
 	 * This also works around errata e5295 which generates false
 	 * positive memory errors and put the device in freeze mode.
 	 */
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_DISABLE_MECR) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_DISABLE_MECR) {
 		/* Follow the protocol as described in "Detection
 		 * and Correction of Memory Errors" to write to
 		 * MECR register (step 1 - 5)
@@ -1799,7 +1799,7 @@ static int flexcan_open(struct net_device *dev)
 	if (err)
 		goto out_can_rx_offload_disable;
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_NR_IRQ_3) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_NR_IRQ_3) {
 		err = request_irq(priv->irq_boff,
 				  flexcan_irq, IRQF_SHARED, dev->name, dev);
 		if (err)
@@ -1845,7 +1845,7 @@ static int flexcan_close(struct net_device *dev)
 	netif_stop_queue(dev);
 	flexcan_chip_interrupts_disable(dev);
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_NR_IRQ_3) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_NR_IRQ_3) {
 		free_irq(priv->irq_err, dev);
 		free_irq(priv->irq_boff, dev);
 	}
@@ -2051,9 +2051,9 @@ static int flexcan_setup_stop_mode(struct platform_device *pdev)
 
 	priv = netdev_priv(dev);
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW)
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW)
 		ret = flexcan_setup_stop_mode_scfw(pdev);
-	else if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR)
+	else if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR)
 		ret = flexcan_setup_stop_mode_gpr(pdev);
 	else
 		/* return 0 directly if doesn't support stop mode feature */
@@ -2181,9 +2181,10 @@ static int flexcan_probe(struct platform_device *pdev)
 	dev->flags |= IFF_ECHO;
 
 	priv = netdev_priv(dev);
+	priv->devtype_data = *devtype_data;
 
 	if (of_property_read_bool(pdev->dev.of_node, "big-endian") ||
-	    devtype_data->quirks & FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN) {
+	    priv->devtype_data.quirks & FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN) {
 		priv->read = flexcan_read_be;
 		priv->write = flexcan_write_be;
 	} else {
@@ -2202,10 +2203,9 @@ static int flexcan_probe(struct platform_device *pdev)
 	priv->clk_ipg = clk_ipg;
 	priv->clk_per = clk_per;
 	priv->clk_src = clk_src;
-	priv->devtype_data = devtype_data;
 	priv->reg_xceiver = reg_xceiver;
 
-	if (devtype_data->quirks & FLEXCAN_QUIRK_NR_IRQ_3) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_NR_IRQ_3) {
 		priv->irq_boff = platform_get_irq(pdev, 1);
 		if (priv->irq_boff <= 0) {
 			err = -ENODEV;
@@ -2218,7 +2218,7 @@ static int flexcan_probe(struct platform_device *pdev)
 		}
 	}
 
-	if (priv->devtype_data->quirks & FLEXCAN_QUIRK_SUPPORT_FD) {
+	if (priv->devtype_data.quirks & FLEXCAN_QUIRK_SUPPORT_FD) {
 		priv->can.ctrlmode_supported |= CAN_CTRLMODE_FD |
 			CAN_CTRLMODE_FD_NON_ISO;
 		priv->can.bittiming_const = &flexcan_fd_bittiming_const;
-- 
2.34.1



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

* [PATCH v2 3/3] can: flexcan: add ethtool support to change rx-fifo setting during runtime
  2022-01-04 15:41 [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime Marc Kleine-Budde
  2022-01-04 15:41 ` [PATCH v2 1/3] can: flexcan: move driver into separate sub directory Marc Kleine-Budde
  2022-01-04 15:41 ` [PATCH v2 2/3] can: flexcan: allow to change quirks at runtime Marc Kleine-Budde
@ 2022-01-04 15:41 ` Marc Kleine-Budde
  2022-01-05  8:22   ` Dario Binacchi
  2022-01-04 15:44 ` [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime Marc Kleine-Budde
  2022-01-05  8:25 ` Dario Binacchi
  4 siblings, 1 reply; 12+ messages in thread
From: Marc Kleine-Budde @ 2022-01-04 15:41 UTC (permalink / raw)
  To: linux-can; +Cc: Marc Kleine-Budde, Dario Binacchi

This patch adds a private flag to the flexcan driver to switch the
"rx-fifo" setting on and off.

"rx-fifo" on  - the RX FIFO with a depth of 6 CAN frames is used for RX
"rx-fifo" off - the mailboxes are used for RX, the number of mailboxes
                depends on the actual flexcan IP core revision and
		if CAN-FD mode is active or not.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Co-developed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/flexcan/Makefile          |   1 +
 drivers/net/can/flexcan/flexcan-core.c    |  96 +-----------------
 drivers/net/can/flexcan/flexcan-ethtool.c |  81 ++++++++++++++++
 drivers/net/can/flexcan/flexcan.h         | 113 ++++++++++++++++++++++
 4 files changed, 198 insertions(+), 93 deletions(-)
 create mode 100644 drivers/net/can/flexcan/flexcan-ethtool.c
 create mode 100644 drivers/net/can/flexcan/flexcan.h

diff --git a/drivers/net/can/flexcan/Makefile b/drivers/net/can/flexcan/Makefile
index 25dd1d12b866..89d5695c902e 100644
--- a/drivers/net/can/flexcan/Makefile
+++ b/drivers/net/can/flexcan/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
 
 flexcan-objs :=
 flexcan-objs += flexcan-core.o
+flexcan-objs += flexcan-ethtool.o
diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
index 26bf0a0a72f1..ae7c838ff76c 100644
--- a/drivers/net/can/flexcan/flexcan-core.c
+++ b/drivers/net/can/flexcan/flexcan-core.c
@@ -15,7 +15,6 @@
 #include <linux/can/dev.h>
 #include <linux/can/error.h>
 #include <linux/can/led.h>
-#include <linux/can/rx-offload.h>
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/firmware/imx/sci.h>
@@ -33,6 +32,8 @@
 #include <linux/regmap.h>
 #include <linux/regulator/consumer.h>
 
+#include "flexcan.h"
+
 #define DRV_NAME			"flexcan"
 
 /* 8 for RX fifo and 2 error handling */
@@ -206,53 +207,6 @@
 
 #define FLEXCAN_TIMEOUT_US		(250)
 
-/* FLEXCAN hardware feature flags
- *
- * Below is some version info we got:
- *    SOC   Version   IP-Version  Glitch- [TR]WRN_INT IRQ Err Memory err RTR rece-   FD Mode     MB
- *                                Filter? connected?  Passive detection  ption in MB Supported?
- * MCF5441X FlexCAN2  ?               no       yes        no       no       yes           no     16
- *    MX25  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
- *    MX28  FlexCAN2  03.00.04.00    yes       yes        no       no        no           no     64
- *    MX35  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
- *    MX53  FlexCAN2  03.00.00.00    yes        no        no       no        no           no     64
- *    MX6s  FlexCAN3  10.00.12.00    yes       yes        no       no       yes           no     64
- *    MX8QM FlexCAN3  03.00.23.00    yes       yes        no       no       yes          yes     64
- *    MX8MP FlexCAN3  03.00.17.01    yes       yes        no      yes       yes          yes     64
- *    VF610 FlexCAN3  ?               no       yes        no      yes       yes?          no     64
- *  LS1021A FlexCAN2  03.00.04.00     no       yes        no       no       yes           no     64
- *  LX2160A FlexCAN3  03.00.23.00     no       yes        no      yes       yes          yes     64
- *
- * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
- */
-
-/* [TR]WRN_INT not connected */
-#define FLEXCAN_QUIRK_BROKEN_WERR_STATE BIT(1)
- /* Disable RX FIFO Global mask */
-#define FLEXCAN_QUIRK_DISABLE_RXFG BIT(2)
-/* Enable EACEN and RRS bit in ctrl2 */
-#define FLEXCAN_QUIRK_ENABLE_EACEN_RRS  BIT(3)
-/* Disable non-correctable errors interrupt and freeze mode */
-#define FLEXCAN_QUIRK_DISABLE_MECR BIT(4)
-/* Use timestamp based offloading */
-#define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5)
-/* No interrupt for error passive */
-#define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6)
-/* default to BE register access */
-#define FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN BIT(7)
-/* Setup stop mode with GPR to support wakeup */
-#define FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR BIT(8)
-/* Support CAN-FD mode */
-#define FLEXCAN_QUIRK_SUPPORT_FD BIT(9)
-/* support memory detection and correction */
-#define FLEXCAN_QUIRK_SUPPORT_ECC BIT(10)
-/* Setup stop mode with SCU firmware to support wakeup */
-#define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW BIT(11)
-/* Setup 3 separate interrupts, main, boff and err */
-#define FLEXCAN_QUIRK_NR_IRQ_3 BIT(12)
-/* Setup 16 mailboxes */
-#define FLEXCAN_QUIRK_NR_MB_16 BIT(13)
-
 /* Structure of the message buffer */
 struct flexcan_mb {
 	u32 can_ctrl;
@@ -339,51 +293,6 @@ struct flexcan_regs {
 
 static_assert(sizeof(struct flexcan_regs) ==  0x4 * 18 + 0xfb8);
 
-struct flexcan_devtype_data {
-	u32 quirks;		/* quirks needed for different IP cores */
-};
-
-struct flexcan_stop_mode {
-	struct regmap *gpr;
-	u8 req_gpr;
-	u8 req_bit;
-};
-
-struct flexcan_priv {
-	struct can_priv can;
-	struct can_rx_offload offload;
-	struct device *dev;
-
-	struct flexcan_regs __iomem *regs;
-	struct flexcan_mb __iomem *tx_mb;
-	struct flexcan_mb __iomem *tx_mb_reserved;
-	u8 tx_mb_idx;
-	u8 mb_count;
-	u8 mb_size;
-	u8 clk_src;	/* clock source of CAN Protocol Engine */
-	u8 scu_idx;
-
-	u64 rx_mask;
-	u64 tx_mask;
-	u32 reg_ctrl_default;
-
-	struct clk *clk_ipg;
-	struct clk *clk_per;
-	struct flexcan_devtype_data devtype_data;
-	struct regulator *reg_xceiver;
-	struct flexcan_stop_mode stm;
-
-	int irq_boff;
-	int irq_err;
-
-	/* IPC handle when setup stop mode by System Controller firmware(scfw) */
-	struct imx_sc_ipc *sc_ipc_handle;
-
-	/* Read and Write APIs */
-	u32 (*read)(void __iomem *addr);
-	void (*write)(u32 val, void __iomem *addr);
-};
-
 static const struct flexcan_devtype_data fsl_mcf5441x_devtype_data = {
 	.quirks = FLEXCAN_QUIRK_BROKEN_PERR_STATE |
 		FLEXCAN_QUIRK_NR_IRQ_3 | FLEXCAN_QUIRK_NR_MB_16,
@@ -2177,6 +2086,7 @@ static int flexcan_probe(struct platform_device *pdev)
 	SET_NETDEV_DEV(dev, &pdev->dev);
 
 	dev->netdev_ops = &flexcan_netdev_ops;
+	flexcan_set_ethtool_ops(dev);
 	dev->irq = irq;
 	dev->flags |= IFF_ECHO;
 
diff --git a/drivers/net/can/flexcan/flexcan-ethtool.c b/drivers/net/can/flexcan/flexcan-ethtool.c
new file mode 100644
index 000000000000..cfa0cce1d0cf
--- /dev/null
+++ b/drivers/net/can/flexcan/flexcan-ethtool.c
@@ -0,0 +1,81 @@
+// SPDX-License-Identifier: GPL-2.0+
+/* Copyright (c) 2022 Amarula Solutions, Dario Binacchi <dario.binacchi@amarulasolutions.com>
+ * Copyright (c) 2022 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
+ *
+ */
+
+#include <linux/ethtool.h>
+#include <linux/kernel.h>
+#include <linux/platform_device.h>
+#include <linux/netdevice.h>
+#include <linux/can/dev.h>
+
+#include "flexcan.h"
+
+static const char flexcan_priv_flags_strings[][ETH_GSTRING_LEN] = {
+#define FLEXCAN_PRIV_FLAGS_RX_FIFO BIT(0)
+	"rx-fifo",
+};
+
+static void
+flexcan_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
+{
+	switch (stringset) {
+	case ETH_SS_PRIV_FLAGS:
+		memcpy(data, flexcan_priv_flags_strings,
+		       sizeof(flexcan_priv_flags_strings));
+	}
+}
+
+static int flexcan_get_sset_count(struct net_device *netdev, int sset)
+{
+	switch (sset) {
+	case ETH_SS_PRIV_FLAGS:
+		return ARRAY_SIZE(flexcan_priv_flags_strings);
+	default:
+		return -EOPNOTSUPP;
+	}
+}
+
+static u32 flexcan_get_priv_flags(struct net_device *ndev)
+{
+	const struct flexcan_priv *priv = netdev_priv(ndev);
+	const u32 quirks = priv->devtype_data.quirks;
+	u32 priv_flags;
+
+	if (!(quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP))
+		priv_flags |= FLEXCAN_PRIV_FLAGS_RX_FIFO;
+
+	return priv_flags;
+}
+
+static int flexcan_set_priv_flags(struct net_device *ndev, u32 priv_flags)
+{
+	struct flexcan_priv *priv = netdev_priv(ndev);
+	u32 quirks = priv->devtype_data.quirks;
+
+	quirks &= ~FLEXCAN_QUIRK_USE_OFF_TIMESTAMP;
+	if (!(priv_flags & FLEXCAN_PRIV_FLAGS_RX_FIFO))
+		quirks |= FLEXCAN_QUIRK_USE_OFF_TIMESTAMP;
+
+	if (quirks != priv->devtype_data.quirks &&
+	    netif_running(ndev)) {
+		return -EBUSY;
+	}
+
+	priv->devtype_data.quirks = quirks;
+
+	return 0;
+}
+
+static const struct ethtool_ops flexcan_ethtool_ops = {
+	.get_sset_count = flexcan_get_sset_count,
+	.get_strings = flexcan_get_strings,
+	.get_priv_flags = flexcan_get_priv_flags,
+	.set_priv_flags = flexcan_set_priv_flags,
+};
+
+void flexcan_set_ethtool_ops(struct net_device *netdev)
+{
+	netdev->ethtool_ops = &flexcan_ethtool_ops;
+}
diff --git a/drivers/net/can/flexcan/flexcan.h b/drivers/net/can/flexcan/flexcan.h
new file mode 100644
index 000000000000..e64b9f6c1041
--- /dev/null
+++ b/drivers/net/can/flexcan/flexcan.h
@@ -0,0 +1,113 @@
+/* SPDX-License-Identifier: GPL-2.0
+ * flexcan.c - FLEXCAN CAN controller driver
+ *
+ * Copyright (c) 2005-2006 Varma Electronics Oy
+ * Copyright (c) 2009 Sascha Hauer, Pengutronix
+ * Copyright (c) 2010-2017 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
+ * Copyright (c) 2014 David Jander, Protonic Holland
+ * Copyright (C) 2022 Amarula Solutions, Dario Binacchi <dario.binacchi@amarulasolutions.com>
+ *
+ * Based on code originally by Andrey Volkov <avolkov@varma-el.com>
+ *
+ */
+
+#ifndef _FLEXCAN_H
+#define _FLEXCAN_H
+
+#include <linux/can/rx-offload.h>
+
+/* FLEXCAN hardware feature flags
+ *
+ * Below is some version info we got:
+ *    SOC   Version   IP-Version  Glitch- [TR]WRN_INT IRQ Err Memory err RTR rece-   FD Mode     MB
+ *                                Filter? connected?  Passive detection  ption in MB Supported?
+ * MCF5441X FlexCAN2  ?               no       yes        no       no       yes           no     16
+ *    MX25  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
+ *    MX28  FlexCAN2  03.00.04.00    yes       yes        no       no        no           no     64
+ *    MX35  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
+ *    MX53  FlexCAN2  03.00.00.00    yes        no        no       no        no           no     64
+ *    MX6s  FlexCAN3  10.00.12.00    yes       yes        no       no       yes           no     64
+ *    MX8QM FlexCAN3  03.00.23.00    yes       yes        no       no       yes          yes     64
+ *    MX8MP FlexCAN3  03.00.17.01    yes       yes        no      yes       yes          yes     64
+ *    VF610 FlexCAN3  ?               no       yes        no      yes       yes?          no     64
+ *  LS1021A FlexCAN2  03.00.04.00     no       yes        no       no       yes           no     64
+ *  LX2160A FlexCAN3  03.00.23.00     no       yes        no      yes       yes          yes     64
+ *
+ * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
+ */
+
+/* [TR]WRN_INT not connected */
+#define FLEXCAN_QUIRK_BROKEN_WERR_STATE BIT(1)
+ /* Disable RX FIFO Global mask */
+#define FLEXCAN_QUIRK_DISABLE_RXFG BIT(2)
+/* Enable EACEN and RRS bit in ctrl2 */
+#define FLEXCAN_QUIRK_ENABLE_EACEN_RRS  BIT(3)
+/* Disable non-correctable errors interrupt and freeze mode */
+#define FLEXCAN_QUIRK_DISABLE_MECR BIT(4)
+/* Use timestamp based offloading */
+#define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5)
+/* No interrupt for error passive */
+#define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6)
+/* default to BE register access */
+#define FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN BIT(7)
+/* Setup stop mode with GPR to support wakeup */
+#define FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR BIT(8)
+/* Support CAN-FD mode */
+#define FLEXCAN_QUIRK_SUPPORT_FD BIT(9)
+/* support memory detection and correction */
+#define FLEXCAN_QUIRK_SUPPORT_ECC BIT(10)
+/* Setup stop mode with SCU firmware to support wakeup */
+#define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW BIT(11)
+/* Setup 3 separate interrupts, main, boff and err */
+#define FLEXCAN_QUIRK_NR_IRQ_3 BIT(12)
+/* Setup 16 mailboxes */
+#define FLEXCAN_QUIRK_NR_MB_16 BIT(13)
+
+struct flexcan_devtype_data {
+	u32 quirks;		/* quirks needed for different IP cores */
+};
+
+struct flexcan_stop_mode {
+	struct regmap *gpr;
+	u8 req_gpr;
+	u8 req_bit;
+};
+
+struct flexcan_priv {
+	struct can_priv can;
+	struct can_rx_offload offload;
+	struct device *dev;
+
+	struct flexcan_regs __iomem *regs;
+	struct flexcan_mb __iomem *tx_mb;
+	struct flexcan_mb __iomem *tx_mb_reserved;
+	u8 tx_mb_idx;
+	u8 mb_count;
+	u8 mb_size;
+	u8 clk_src;	/* clock source of CAN Protocol Engine */
+	u8 scu_idx;
+
+	u64 rx_mask;
+	u64 tx_mask;
+	u32 reg_ctrl_default;
+
+	struct clk *clk_ipg;
+	struct clk *clk_per;
+	struct flexcan_devtype_data devtype_data;
+	struct regulator *reg_xceiver;
+	struct flexcan_stop_mode stm;
+
+	int irq_boff;
+	int irq_err;
+
+	/* IPC handle when setup stop mode by System Controller firmware(scfw) */
+	struct imx_sc_ipc *sc_ipc_handle;
+
+	/* Read and Write APIs */
+	u32 (*read)(void __iomem *addr);
+	void (*write)(u32 val, void __iomem *addr);
+};
+
+void flexcan_set_ethtool_ops(struct net_device *dev);
+
+#endif /* _FLEXCAN_H */
-- 
2.34.1



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

* Re: [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime
  2022-01-04 15:41 [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime Marc Kleine-Budde
                   ` (2 preceding siblings ...)
  2022-01-04 15:41 ` [PATCH v2 3/3] can: flexcan: add ethtool support to change rx-fifo setting during runtime Marc Kleine-Budde
@ 2022-01-04 15:44 ` Marc Kleine-Budde
  2022-01-05  8:25 ` Dario Binacchi
  4 siblings, 0 replies; 12+ messages in thread
From: Marc Kleine-Budde @ 2022-01-04 15:44 UTC (permalink / raw)
  To: linux-can; +Cc: dario.binacchi

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

On 04.01.2022 16:41:30, Marc Kleine-Budde wrote:

Forgot to list some changes:

> Changes since RFC:
> - move driver into subdir
- replaced memcpy() by direct assignment, do this earlier
- use priv->devtype_data.quirks where possible
> - rename flexcan_main.c -> flexcan-core.c
>   (mcp251xfd and tcan4x5x driver have the same naming scheme)
> - use copyright notice from flexcan.c in flexcan.h
> - add private flag support to set rx-fifo
> - remove drvinfo, the kernel will fall back to the default implementation

Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

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

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

* Re: [PATCH v2 3/3] can: flexcan: add ethtool support to change rx-fifo setting during runtime
  2022-01-04 15:41 ` [PATCH v2 3/3] can: flexcan: add ethtool support to change rx-fifo setting during runtime Marc Kleine-Budde
@ 2022-01-05  8:22   ` Dario Binacchi
  2022-01-05 10:18     ` Marc Kleine-Budde
  0 siblings, 1 reply; 12+ messages in thread
From: Dario Binacchi @ 2022-01-05  8:22 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can

Hi Marc,
reply all and in plain-text,


On Tue, Jan 4, 2022 at 4:41 PM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>
> This patch adds a private flag to the flexcan driver to switch the
> "rx-fifo" setting on and off.
>
> "rx-fifo" on  - the RX FIFO with a depth of 6 CAN frames is used for RX
> "rx-fifo" off - the mailboxes are used for RX, the number of mailboxes
>                 depends on the actual flexcan IP core revision and
>                 if CAN-FD mode is active or not.
>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> Co-developed-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> ---
>  drivers/net/can/flexcan/Makefile          |   1 +
>  drivers/net/can/flexcan/flexcan-core.c    |  96 +-----------------
>  drivers/net/can/flexcan/flexcan-ethtool.c |  81 ++++++++++++++++
>  drivers/net/can/flexcan/flexcan.h         | 113 ++++++++++++++++++++++
>  4 files changed, 198 insertions(+), 93 deletions(-)
>  create mode 100644 drivers/net/can/flexcan/flexcan-ethtool.c
>  create mode 100644 drivers/net/can/flexcan/flexcan.h
>
> diff --git a/drivers/net/can/flexcan/Makefile b/drivers/net/can/flexcan/Makefile
> index 25dd1d12b866..89d5695c902e 100644
> --- a/drivers/net/can/flexcan/Makefile
> +++ b/drivers/net/can/flexcan/Makefile
> @@ -4,3 +4,4 @@ obj-$(CONFIG_CAN_FLEXCAN) += flexcan.o
>
>  flexcan-objs :=
>  flexcan-objs += flexcan-core.o
> +flexcan-objs += flexcan-ethtool.o
> diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
> index 26bf0a0a72f1..ae7c838ff76c 100644
> --- a/drivers/net/can/flexcan/flexcan-core.c
> +++ b/drivers/net/can/flexcan/flexcan-core.c
> @@ -15,7 +15,6 @@
>  #include <linux/can/dev.h>
>  #include <linux/can/error.h>
>  #include <linux/can/led.h>
> -#include <linux/can/rx-offload.h>
>  #include <linux/clk.h>
>  #include <linux/delay.h>
>  #include <linux/firmware/imx/sci.h>
> @@ -33,6 +32,8 @@
>  #include <linux/regmap.h>
>  #include <linux/regulator/consumer.h>
>
> +#include "flexcan.h"
> +
>  #define DRV_NAME                       "flexcan"
>
>  /* 8 for RX fifo and 2 error handling */
> @@ -206,53 +207,6 @@
>
>  #define FLEXCAN_TIMEOUT_US             (250)
>
> -/* FLEXCAN hardware feature flags
> - *
> - * Below is some version info we got:
> - *    SOC   Version   IP-Version  Glitch- [TR]WRN_INT IRQ Err Memory err RTR rece-   FD Mode     MB
> - *                                Filter? connected?  Passive detection  ption in MB Supported?
> - * MCF5441X FlexCAN2  ?               no       yes        no       no       yes           no     16
> - *    MX25  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
> - *    MX28  FlexCAN2  03.00.04.00    yes       yes        no       no        no           no     64
> - *    MX35  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
> - *    MX53  FlexCAN2  03.00.00.00    yes        no        no       no        no           no     64
> - *    MX6s  FlexCAN3  10.00.12.00    yes       yes        no       no       yes           no     64
> - *    MX8QM FlexCAN3  03.00.23.00    yes       yes        no       no       yes          yes     64
> - *    MX8MP FlexCAN3  03.00.17.01    yes       yes        no      yes       yes          yes     64
> - *    VF610 FlexCAN3  ?               no       yes        no      yes       yes?          no     64
> - *  LS1021A FlexCAN2  03.00.04.00     no       yes        no       no       yes           no     64
> - *  LX2160A FlexCAN3  03.00.23.00     no       yes        no      yes       yes          yes     64
> - *
> - * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
> - */
> -
> -/* [TR]WRN_INT not connected */
> -#define FLEXCAN_QUIRK_BROKEN_WERR_STATE BIT(1)
> - /* Disable RX FIFO Global mask */
> -#define FLEXCAN_QUIRK_DISABLE_RXFG BIT(2)
> -/* Enable EACEN and RRS bit in ctrl2 */
> -#define FLEXCAN_QUIRK_ENABLE_EACEN_RRS  BIT(3)
> -/* Disable non-correctable errors interrupt and freeze mode */
> -#define FLEXCAN_QUIRK_DISABLE_MECR BIT(4)
> -/* Use timestamp based offloading */
> -#define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5)
> -/* No interrupt for error passive */
> -#define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6)
> -/* default to BE register access */
> -#define FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN BIT(7)
> -/* Setup stop mode with GPR to support wakeup */
> -#define FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR BIT(8)
> -/* Support CAN-FD mode */
> -#define FLEXCAN_QUIRK_SUPPORT_FD BIT(9)
> -/* support memory detection and correction */
> -#define FLEXCAN_QUIRK_SUPPORT_ECC BIT(10)
> -/* Setup stop mode with SCU firmware to support wakeup */
> -#define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW BIT(11)
> -/* Setup 3 separate interrupts, main, boff and err */
> -#define FLEXCAN_QUIRK_NR_IRQ_3 BIT(12)
> -/* Setup 16 mailboxes */
> -#define FLEXCAN_QUIRK_NR_MB_16 BIT(13)
> -
>  /* Structure of the message buffer */
>  struct flexcan_mb {
>         u32 can_ctrl;
> @@ -339,51 +293,6 @@ struct flexcan_regs {
>
>  static_assert(sizeof(struct flexcan_regs) ==  0x4 * 18 + 0xfb8);
>
> -struct flexcan_devtype_data {
> -       u32 quirks;             /* quirks needed for different IP cores */
> -};
> -
> -struct flexcan_stop_mode {
> -       struct regmap *gpr;
> -       u8 req_gpr;
> -       u8 req_bit;
> -};
> -
> -struct flexcan_priv {
> -       struct can_priv can;
> -       struct can_rx_offload offload;
> -       struct device *dev;
> -
> -       struct flexcan_regs __iomem *regs;
> -       struct flexcan_mb __iomem *tx_mb;
> -       struct flexcan_mb __iomem *tx_mb_reserved;
> -       u8 tx_mb_idx;
> -       u8 mb_count;
> -       u8 mb_size;
> -       u8 clk_src;     /* clock source of CAN Protocol Engine */
> -       u8 scu_idx;
> -
> -       u64 rx_mask;
> -       u64 tx_mask;
> -       u32 reg_ctrl_default;
> -
> -       struct clk *clk_ipg;
> -       struct clk *clk_per;
> -       struct flexcan_devtype_data devtype_data;
> -       struct regulator *reg_xceiver;
> -       struct flexcan_stop_mode stm;
> -
> -       int irq_boff;
> -       int irq_err;
> -
> -       /* IPC handle when setup stop mode by System Controller firmware(scfw) */
> -       struct imx_sc_ipc *sc_ipc_handle;
> -
> -       /* Read and Write APIs */
> -       u32 (*read)(void __iomem *addr);
> -       void (*write)(u32 val, void __iomem *addr);
> -};
> -
>  static const struct flexcan_devtype_data fsl_mcf5441x_devtype_data = {
>         .quirks = FLEXCAN_QUIRK_BROKEN_PERR_STATE |
>                 FLEXCAN_QUIRK_NR_IRQ_3 | FLEXCAN_QUIRK_NR_MB_16,
> @@ -2177,6 +2086,7 @@ static int flexcan_probe(struct platform_device *pdev)
>         SET_NETDEV_DEV(dev, &pdev->dev);
>
>         dev->netdev_ops = &flexcan_netdev_ops;
> +       flexcan_set_ethtool_ops(dev);
>         dev->irq = irq;
>         dev->flags |= IFF_ECHO;
>
> diff --git a/drivers/net/can/flexcan/flexcan-ethtool.c b/drivers/net/can/flexcan/flexcan-ethtool.c
> new file mode 100644
> index 000000000000..cfa0cce1d0cf
> --- /dev/null
> +++ b/drivers/net/can/flexcan/flexcan-ethtool.c
> @@ -0,0 +1,81 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/* Copyright (c) 2022 Amarula Solutions, Dario Binacchi <dario.binacchi@amarulasolutions.com>
> + * Copyright (c) 2022 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
> + *
> + */
> +
> +#include <linux/ethtool.h>
> +#include <linux/kernel.h>
> +#include <linux/platform_device.h>
> +#include <linux/netdevice.h>
> +#include <linux/can/dev.h>
> +
> +#include "flexcan.h"
> +
> +static const char flexcan_priv_flags_strings[][ETH_GSTRING_LEN] = {
> +#define FLEXCAN_PRIV_FLAGS_RX_FIFO BIT(0)
> +       "rx-fifo",
> +};
> +
> +static void
> +flexcan_get_strings(struct net_device *ndev, u32 stringset, u8 *data)
> +{
> +       switch (stringset) {
> +       case ETH_SS_PRIV_FLAGS:
> +               memcpy(data, flexcan_priv_flags_strings,
> +                      sizeof(flexcan_priv_flags_strings));
> +       }
> +}
> +
> +static int flexcan_get_sset_count(struct net_device *netdev, int sset)
> +{
> +       switch (sset) {
> +       case ETH_SS_PRIV_FLAGS:
> +               return ARRAY_SIZE(flexcan_priv_flags_strings);
> +       default:
> +               return -EOPNOTSUPP;
> +       }
> +}
> +
> +static u32 flexcan_get_priv_flags(struct net_device *ndev)
> +{
> +       const struct flexcan_priv *priv = netdev_priv(ndev);
> +       const u32 quirks = priv->devtype_data.quirks;
> +       u32 priv_flags;

u32 priv_flags = 0;

regards,
Dario

> +
> +       if (!(quirks & FLEXCAN_QUIRK_USE_OFF_TIMESTAMP))
> +               priv_flags |= FLEXCAN_PRIV_FLAGS_RX_FIFO;
> +
> +       return priv_flags;
> +}
> +
> +static int flexcan_set_priv_flags(struct net_device *ndev, u32 priv_flags)
> +{
> +       struct flexcan_priv *priv = netdev_priv(ndev);
> +       u32 quirks = priv->devtype_data.quirks;
> +
> +       quirks &= ~FLEXCAN_QUIRK_USE_OFF_TIMESTAMP;
> +       if (!(priv_flags & FLEXCAN_PRIV_FLAGS_RX_FIFO))
> +               quirks |= FLEXCAN_QUIRK_USE_OFF_TIMESTAMP;
> +
> +       if (quirks != priv->devtype_data.quirks &&
> +           netif_running(ndev)) {
> +               return -EBUSY;
> +       }
> +
> +       priv->devtype_data.quirks = quirks;
> +
> +       return 0;
> +}
> +
> +static const struct ethtool_ops flexcan_ethtool_ops = {
> +       .get_sset_count = flexcan_get_sset_count,
> +       .get_strings = flexcan_get_strings,
> +       .get_priv_flags = flexcan_get_priv_flags,
> +       .set_priv_flags = flexcan_set_priv_flags,
> +};
> +
> +void flexcan_set_ethtool_ops(struct net_device *netdev)
> +{
> +       netdev->ethtool_ops = &flexcan_ethtool_ops;
> +}
> diff --git a/drivers/net/can/flexcan/flexcan.h b/drivers/net/can/flexcan/flexcan.h
> new file mode 100644
> index 000000000000..e64b9f6c1041
> --- /dev/null
> +++ b/drivers/net/can/flexcan/flexcan.h
> @@ -0,0 +1,113 @@
> +/* SPDX-License-Identifier: GPL-2.0
> + * flexcan.c - FLEXCAN CAN controller driver
> + *
> + * Copyright (c) 2005-2006 Varma Electronics Oy
> + * Copyright (c) 2009 Sascha Hauer, Pengutronix
> + * Copyright (c) 2010-2017 Pengutronix, Marc Kleine-Budde <kernel@pengutronix.de>
> + * Copyright (c) 2014 David Jander, Protonic Holland
> + * Copyright (C) 2022 Amarula Solutions, Dario Binacchi <dario.binacchi@amarulasolutions.com>
> + *
> + * Based on code originally by Andrey Volkov <avolkov@varma-el.com>
> + *
> + */
> +
> +#ifndef _FLEXCAN_H
> +#define _FLEXCAN_H
> +
> +#include <linux/can/rx-offload.h>
> +
> +/* FLEXCAN hardware feature flags
> + *
> + * Below is some version info we got:
> + *    SOC   Version   IP-Version  Glitch- [TR]WRN_INT IRQ Err Memory err RTR rece-   FD Mode     MB
> + *                                Filter? connected?  Passive detection  ption in MB Supported?
> + * MCF5441X FlexCAN2  ?               no       yes        no       no       yes           no     16
> + *    MX25  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
> + *    MX28  FlexCAN2  03.00.04.00    yes       yes        no       no        no           no     64
> + *    MX35  FlexCAN2  03.00.00.00     no        no        no       no        no           no     64
> + *    MX53  FlexCAN2  03.00.00.00    yes        no        no       no        no           no     64
> + *    MX6s  FlexCAN3  10.00.12.00    yes       yes        no       no       yes           no     64
> + *    MX8QM FlexCAN3  03.00.23.00    yes       yes        no       no       yes          yes     64
> + *    MX8MP FlexCAN3  03.00.17.01    yes       yes        no      yes       yes          yes     64
> + *    VF610 FlexCAN3  ?               no       yes        no      yes       yes?          no     64
> + *  LS1021A FlexCAN2  03.00.04.00     no       yes        no       no       yes           no     64
> + *  LX2160A FlexCAN3  03.00.23.00     no       yes        no      yes       yes          yes     64
> + *
> + * Some SOCs do not have the RX_WARN & TX_WARN interrupt line connected.
> + */
> +
> +/* [TR]WRN_INT not connected */
> +#define FLEXCAN_QUIRK_BROKEN_WERR_STATE BIT(1)
> + /* Disable RX FIFO Global mask */
> +#define FLEXCAN_QUIRK_DISABLE_RXFG BIT(2)
> +/* Enable EACEN and RRS bit in ctrl2 */
> +#define FLEXCAN_QUIRK_ENABLE_EACEN_RRS  BIT(3)
> +/* Disable non-correctable errors interrupt and freeze mode */
> +#define FLEXCAN_QUIRK_DISABLE_MECR BIT(4)
> +/* Use timestamp based offloading */
> +#define FLEXCAN_QUIRK_USE_OFF_TIMESTAMP BIT(5)
> +/* No interrupt for error passive */
> +#define FLEXCAN_QUIRK_BROKEN_PERR_STATE BIT(6)
> +/* default to BE register access */
> +#define FLEXCAN_QUIRK_DEFAULT_BIG_ENDIAN BIT(7)
> +/* Setup stop mode with GPR to support wakeup */
> +#define FLEXCAN_QUIRK_SETUP_STOP_MODE_GPR BIT(8)
> +/* Support CAN-FD mode */
> +#define FLEXCAN_QUIRK_SUPPORT_FD BIT(9)
> +/* support memory detection and correction */
> +#define FLEXCAN_QUIRK_SUPPORT_ECC BIT(10)
> +/* Setup stop mode with SCU firmware to support wakeup */
> +#define FLEXCAN_QUIRK_SETUP_STOP_MODE_SCFW BIT(11)
> +/* Setup 3 separate interrupts, main, boff and err */
> +#define FLEXCAN_QUIRK_NR_IRQ_3 BIT(12)
> +/* Setup 16 mailboxes */
> +#define FLEXCAN_QUIRK_NR_MB_16 BIT(13)
> +
> +struct flexcan_devtype_data {
> +       u32 quirks;             /* quirks needed for different IP cores */
> +};
> +
> +struct flexcan_stop_mode {
> +       struct regmap *gpr;
> +       u8 req_gpr;
> +       u8 req_bit;
> +};
> +
> +struct flexcan_priv {
> +       struct can_priv can;
> +       struct can_rx_offload offload;
> +       struct device *dev;
> +
> +       struct flexcan_regs __iomem *regs;
> +       struct flexcan_mb __iomem *tx_mb;
> +       struct flexcan_mb __iomem *tx_mb_reserved;
> +       u8 tx_mb_idx;
> +       u8 mb_count;
> +       u8 mb_size;
> +       u8 clk_src;     /* clock source of CAN Protocol Engine */
> +       u8 scu_idx;
> +
> +       u64 rx_mask;
> +       u64 tx_mask;
> +       u32 reg_ctrl_default;
> +
> +       struct clk *clk_ipg;
> +       struct clk *clk_per;
> +       struct flexcan_devtype_data devtype_data;
> +       struct regulator *reg_xceiver;
> +       struct flexcan_stop_mode stm;
> +
> +       int irq_boff;
> +       int irq_err;
> +
> +       /* IPC handle when setup stop mode by System Controller firmware(scfw) */
> +       struct imx_sc_ipc *sc_ipc_handle;
> +
> +       /* Read and Write APIs */
> +       u32 (*read)(void __iomem *addr);
> +       void (*write)(u32 val, void __iomem *addr);
> +};
> +
> +void flexcan_set_ethtool_ops(struct net_device *dev);
> +
> +#endif /* _FLEXCAN_H */
> --
> 2.34.1
>
>


-- 

Dario Binacchi

Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com

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

* Re: [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime
  2022-01-04 15:41 [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime Marc Kleine-Budde
                   ` (3 preceding siblings ...)
  2022-01-04 15:44 ` [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime Marc Kleine-Budde
@ 2022-01-05  8:25 ` Dario Binacchi
  2022-01-05  9:31   ` Marc Kleine-Budde
  2022-01-05 10:14   ` Marc Kleine-Budde
  4 siblings, 2 replies; 12+ messages in thread
From: Dario Binacchi @ 2022-01-05  8:25 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can

Hi Marc,
resend in plain text

On Tue, Jan 4, 2022 at 4:42 PM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>
> Hello,
>
> this picks up Dario's work.
>
> Changes since RFC:
> - move driver into subdir
> - rename flexcan_main.c -> flexcan-core.c
>   (mcp251xfd and tcan4x5x driver have the same naming scheme)
> - use copyright notice from flexcan.c in flexcan.h
> - add private flag support to set rx-fifo
> - remove drvinfo, the kernel will fall back to the default implementation
>
> Show available private flags:
>
> | $ sudo ethtool --show-priv-flags can0
> | Private flags for can0:
> | rx-fifo: on
>
> Change private flag:
>
> | $ sudo ethtool --set-priv-flags can0 rx-fifo off
> | netlink error: Device or resource busy
>
> ...does not work if interface is up.
>
> Shut down interface and change "rx-fifo":
>
> | $ sudo ip link set dev can0 down
> | $ sudo ethtool --set-priv-flags can0 rx-fifo off
> | $ sudo ethtool --show-priv-flags can0
> | Private flags for can0:
> | rx-fifo: off
> |
> | $ sudo ip link set dev can0 up
> | $ sudo ethtool --show-priv-flags can0
> | Private flags for can0:
> | rx-fifo: off
>
> Is the name "rx-fifo" acceptable? Can you think of a better name?

If  I am not mistaken this series arises from the need to deactivate
the RxFIFO only if it is
acceptable not to receive the notification of RTR messages. I wonder
if this can be made
explicit to the user.
Do you think it makes sense to explicitly RTR ("rtr-notify") instead
of RxFIFO (rx-fifo) ?
And if it makes sense to make it clear that it occurs at the expense
of a smaller number
of messages allocated for reception?

>
> What about adding a new quirk to the driver, only if that quirk is
> that, it is allowed to change between rx-fifo and rx-mailbox mode?
>

What platforms are you thinking of for this type of quirk to add?

regards,
Dario
>
> What to you think?
>
> regards,
> Marc
>
>
>
>


-- 

Dario Binacchi

Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com

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

* Re: [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime
  2022-01-05  8:25 ` Dario Binacchi
@ 2022-01-05  9:31   ` Marc Kleine-Budde
  2022-01-05 10:14   ` Marc Kleine-Budde
  1 sibling, 0 replies; 12+ messages in thread
From: Marc Kleine-Budde @ 2022-01-05  9:31 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: linux-can

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

On 05.01.2022 09:25:35, Dario Binacchi wrote:
> > Is the name "rx-fifo" acceptable? Can you think of a better name?
> 
> If I am not mistaken this series arises from the need to deactivate
> the RxFIFO only if it is acceptable not to receive the notification of
> RTR messages. I wonder if this can be made explicit to the user.
> 
> Do you think it makes sense to explicitly RTR ("rtr-notify") instead
> of RxFIFO (rx-fifo) ?
> 
> And if it makes sense to make it clear that it occurs at the expense
> of a smaller number of messages allocated for reception?
> 
> >
> > What about adding a new quirk to the driver, only if that quirk is
> > that, it is allowed to change between rx-fifo and rx-mailbox mode?
> >
> 
> What platforms are you thinking of for this type of quirk to add?

Add this quirk for all platforms that currently don't use
FLEXCAN_QUIRK_USE_OFF_TIMESTAMP.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

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

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

* Re: [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime
  2022-01-05  8:25 ` Dario Binacchi
  2022-01-05  9:31   ` Marc Kleine-Budde
@ 2022-01-05 10:14   ` Marc Kleine-Budde
  2022-01-06 10:40     ` Dario Binacchi
  1 sibling, 1 reply; 12+ messages in thread
From: Marc Kleine-Budde @ 2022-01-05 10:14 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: linux-can

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

On 05.01.2022 09:25:35, Dario Binacchi wrote:
> > Is the name "rx-fifo" acceptable? Can you think of a better name?
> 
> If I am not mistaken this series arises from the need to deactivate
> the RxFIFO only if it is acceptable not to receive the notification of
> RTR messages.

ACK

> I wonder if this can be made explicit to the user.

I was hoping that we can find a better string that better represents
what this option does.

> Do you think it makes sense to explicitly RTR ("rtr-notify") instead
> of RxFIFO (rx-fifo)? And if it makes sense to make it clear that it
> occurs at the expense of a smaller number of messages allocated for
> reception?

I see it the other way round, probably biased by the existing driver :)
The user wants to use more buffers at the expense of loosing the ability
to receive RTR messages.

I've talked to one of my colleges and we came to the conclusion that the
driver should present the user the option to opt out from RTR reception.

If the user has opted out from RTR reception the driver can do internal
optimization, such as switching from FIFO to mailbox mode.

What about "rtr-rx" or "rx-rtr"?

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

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

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

* Re: [PATCH v2 3/3] can: flexcan: add ethtool support to change rx-fifo setting during runtime
  2022-01-05  8:22   ` Dario Binacchi
@ 2022-01-05 10:18     ` Marc Kleine-Budde
  0 siblings, 0 replies; 12+ messages in thread
From: Marc Kleine-Budde @ 2022-01-05 10:18 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: linux-can

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

On 05.01.2022 09:22:09, Dario Binacchi wrote:
> > +static u32 flexcan_get_priv_flags(struct net_device *ndev)
> > +{
> > +       const struct flexcan_priv *priv = netdev_priv(ndev);
> > +       const u32 quirks = priv->devtype_data.quirks;
> > +       u32 priv_flags;
> 
> u32 priv_flags = 0;

Fixed.

Thanks,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

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

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

* Re: [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime
  2022-01-05 10:14   ` Marc Kleine-Budde
@ 2022-01-06 10:40     ` Dario Binacchi
  2022-01-06 10:54       ` Marc Kleine-Budde
  0 siblings, 1 reply; 12+ messages in thread
From: Dario Binacchi @ 2022-01-06 10:40 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: linux-can

Hi Marc,

On Wed, Jan 5, 2022 at 11:14 AM Marc Kleine-Budde <mkl@pengutronix.de> wrote:
>
> On 05.01.2022 09:25:35, Dario Binacchi wrote:
> > > Is the name "rx-fifo" acceptable? Can you think of a better name?
> >
> > If I am not mistaken this series arises from the need to deactivate
> > the RxFIFO only if it is acceptable not to receive the notification of
> > RTR messages.
>
> ACK
>
> > I wonder if this can be made explicit to the user.
>
> I was hoping that we can find a better string that better represents
> what this option does.
>
> > Do you think it makes sense to explicitly RTR ("rtr-notify") instead
> > of RxFIFO (rx-fifo)? And if it makes sense to make it clear that it
> > occurs at the expense of a smaller number of messages allocated for
> > reception?
>
> I see it the other way round, probably biased by the existing driver :)

Could this change of perspective then not require the addition of a new
quirk that allows to change between rx-fifo and rx-mailbox mode?

> The user wants to use more buffers at the expense of loosing the ability
> to receive RTR messages.

Can / should it be documented in some way other than the commit message?

>
> I've talked to one of my colleges and we came to the conclusion that the
> driver should present the user the option to opt out from RTR reception.
>
> If the user has opted out from RTR reception the driver can do internal
> optimization, such as switching from FIFO to mailbox mode.

Is it really always true? In the case of imx6 can we still remain in
mailbox mode
and enable / disable RTR reception through Remote Request Storing (CTRL2
[RRS]) bit?

>
> What about "rtr-rx" or "rx-rtr"?

I prefer "rx-rtr"

Thanks and regards,
Dario

>
> regards,
> Marc
>
> --
> Pengutronix e.K.                 | Marc Kleine-Budde           |
> Embedded Linux                   | https://www.pengutronix.de  |
> Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
> Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |



-- 

Dario Binacchi

Embedded Linux Developer

dario.binacchi@amarulasolutions.com

__________________________________


Amarula Solutions SRL

Via Le Canevare 30, 31100 Treviso, Veneto, IT

T. +39 042 243 5310
info@amarulasolutions.com

www.amarulasolutions.com

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

* Re: [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime
  2022-01-06 10:40     ` Dario Binacchi
@ 2022-01-06 10:54       ` Marc Kleine-Budde
  0 siblings, 0 replies; 12+ messages in thread
From: Marc Kleine-Budde @ 2022-01-06 10:54 UTC (permalink / raw)
  To: Dario Binacchi; +Cc: linux-can

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

On 06.01.2022 11:40:52, Dario Binacchi wrote:
> > I was hoping that we can find a better string that better represents
> > what this option does.
> >
> > > Do you think it makes sense to explicitly RTR ("rtr-notify") instead
> > > of RxFIFO (rx-fifo)? And if it makes sense to make it clear that it
> > > occurs at the expense of a smaller number of messages allocated for
> > > reception?
> >
> > I see it the other way round, probably biased by the existing driver :)
> 
> Could this change of perspective then not require the addition of a new
> quirk that allows to change between rx-fifo and rx-mailbox mode?

ACK - I only want to enable switching between rx-fifo and rx-mailbox
mode for the devices that currently use rx-fifo mode. It makes no sense
to switch from rx-mailbox to rx-fifo mode if your flexcan IP core can
receive RTR messages in rx-mailbox mode.

There even is the limitation that rx-fifo mode doesn't support CAN-FD
mode....but the driver checks for this.

> > The user wants to use more buffers at the expense of loosing the ability
> > to receive RTR messages.
> 
> Can / should it be documented in some way other than the commit message?

Yes - Documentation/networking/device_drivers/can/ looks like a good place.

> > I've talked to one of my colleges and we came to the conclusion that the
> > driver should present the user the option to opt out from RTR reception.
> >
> > If the user has opted out from RTR reception the driver can do internal
> > optimization, such as switching from FIFO to mailbox mode.
> 
> Is it really always true? In the case of imx6 can we still remain in
> mailbox mode
> and enable / disable RTR reception through Remote Request Storing (CTRL2
> [RRS]) bit?
> 
> > What about "rtr-rx" or "rx-rtr"?
> 
> I prefer "rx-rtr"

Ok, I'll change the patch. Can you write send a doc RFC patch. Place it
in the path mentioned above, please use rst format.

regards,
Marc

-- 
Pengutronix e.K.                 | Marc Kleine-Budde           |
Embedded Linux                   | https://www.pengutronix.de  |
Vertretung West/Dortmund         | Phone: +49-231-2826-924     |
Amtsgericht Hildesheim, HRA 2686 | Fax:   +49-5121-206917-5555 |

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

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

end of thread, other threads:[~2022-01-06 10:54 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-04 15:41 [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime Marc Kleine-Budde
2022-01-04 15:41 ` [PATCH v2 1/3] can: flexcan: move driver into separate sub directory Marc Kleine-Budde
2022-01-04 15:41 ` [PATCH v2 2/3] can: flexcan: allow to change quirks at runtime Marc Kleine-Budde
2022-01-04 15:41 ` [PATCH v2 3/3] can: flexcan: add ethtool support to change rx-fifo setting during runtime Marc Kleine-Budde
2022-01-05  8:22   ` Dario Binacchi
2022-01-05 10:18     ` Marc Kleine-Budde
2022-01-04 15:44 ` [PATCH v2 1/3] can: flexcan: change RX-FIFO feature at runtime Marc Kleine-Budde
2022-01-05  8:25 ` Dario Binacchi
2022-01-05  9:31   ` Marc Kleine-Budde
2022-01-05 10:14   ` Marc Kleine-Budde
2022-01-06 10:40     ` Dario Binacchi
2022-01-06 10:54       ` Marc Kleine-Budde

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.