Skip to contentSkip to conversation

Microchip mcp25xxfd can controller driver

PATCH Superseded [email protected] 2 participants 10 messages May 14, 2018 – Jun 21, 2018

Subsystems (2)

v4 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v4 cover Microchip mcp25xxfd can controller driver

From: Martin Sperl <[email protected]>

This patchset adds a driver for the mcp25xxfd CanFD controller.

Most of the features of the controller are supported by this driver release.

The controller includes a few features that the current core Can(FD) implementation does not support:
* Transmit Bandwidth Sharing bits
- this waits for a configurable number of syncronization bits before atempting to transmit the next frame - for the moment controllable via a module parameter
* SID11 with CanFD frames
- at this moment not supported by driver
* 3 transmit attempts in addition to ONE_SHOT
* transmitter delay compensation configurations
* micro second exact transmission and reception timestamps
- used internally by driver
* variable number of tx-fifos
- exposed via module parameter at this moment

The driver has been heavily optimized so that it can handle a 100% utilized 1MHz Can-bus (with 11 bit can frames with DLC=0) even on less powerful SOCs like the raspberry pi 1 without dropping frames due to driver/spi latencies (still dropps are observed in the can/network stack).

To achive this the driver includes several code optimization Two of which prefers continuous long spi transfers over multiple small individual spi transfers of variable length.
This is an optimization that would favour spi dma transfers instead of more expensive PIO in typical SPI controllers.
Both of them can get explicitly enabled by the use of a module parameter. One of those is automatically used in the case of Can2.0 only bus configurations.

Finer details of the implementation and rational is included with the driver code it self for future reference.

The driver has also been tested for basic CanFD transfers with BRS up to 5.7Mhz data bitrates - the available transceiver did not allow for faster rates...

The driver itself exposes lots of internal data/statistics via debugfs.

The driver implements a lock-less design for transmissions making use instead of prepared spi messages submitted via spi_async for transmission in the start_xmit_start code without requireing an extra workqueue and the corresponding latencies.

Note that there is an extra patch in the pipeline to implement pinctrl but this still shows some issues, so it is not included in this patchset.

Changelog:
V1 -> V2: new more generic name based on feedback from microchip
cleanup of code (checkpatch)
address all feedback on code
handle (HW) systemerrors in a much better/reliable way cleanup of dt custom properties removing (most) gpio
related properties
implemented GPIOLIB support as per feedback
V2 -> V3: added vendor-prefix for gpio-opendrain to dt-binding
added gpio-controller to dt-binding
added feedback by Rob Herring
waited for other feedback regarding the code
V3 -> V4: resend
Patch-1 (dt) added: Reviewed-by: Rob Herring <[email protected]>

Martin Sperl (3):
dt-binding: can: mcp25xxfd: document device tree bindings
can: mcp25xxfd: Add Microchip mcp25xxfd CAN FD driver
can: mcp25xxfd: add gpiolib support for GPIO0/1 (aka. INT0/INT1)

 .../bindings/net/can/microchip,mcp25xxfd.txt       |   32 +
 drivers/net/can/spi/Kconfig                        |    6 +
 drivers/net/can/spi/Makefile                       |    1 +
 drivers/net/can/spi/mcp25xxfd.c                    | 4509 ++++++++++++++++++++
 4 files changed, 4548 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.txt
 create mode 100644 drivers/net/can/spi/mcp25xxfd.c

--
2.11.0

#1 lore raw

PATCH v4 1/3 dt-binding: can: mcp25xxfd: document device tree bindings

From: Martin Sperl <[email protected]>

Add device-tree bindings for Microcip CanFD Controller mcp2517fd

--
Changelog:
V1 -> V2: new more generic name based on feedback from microchip
cleanup of dt custom properties removing (most) gpio functions
V2 -> V3: added vendor-prefix for gpio-opendrain

            s/_/-/
            added gpio-controller

V3 -> V4: resend
added: Reviewed-by: Rob Herring <[email protected]>

---
 .../bindings/net/can/microchip,mcp25xxfd.txt       | 32 ++++++++++++++++++++++
 1 file changed, 32 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.txt
Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.txt new file +32 -0
new file mode 100644
index 000000000000..b388b3eb3905
@@ -0,0 +1,32 @@
+* Microchip MCP2517 stand-alone CAN controller device tree bindings
+
+Required properties:
+ - compatible: Should be one of the following:
+   - "microchip,mcp2517fd" for MCP2517fd.
+ - reg: SPI chip select.
+ - clocks: The clock feeding the CAN controller.
+ - interrupt-parent: The parent interrupt controller.
+ - interrupts: Should contain IRQ line for the CAN controller.
+ - gpio-controller: Marks the device node as a GPIO controller
+
+Optional properties:
+ - vdd-supply: Regulator that powers the CAN controller.
+ - xceiver-supply: Regulator that powers the CAN transceiver.
+ - microchip,clock-out-div = <0|1|2|4|10>: Clock output pin divider
+					   0 = Start of Frame output
+					   default: 10
+ - microchip,clock-div2: bool: divide the internal clock by 2
+ - microchip,gpio-open-drain: bool: enable open-drain for all pins
+                                    (except cantx)
+
+Example:
+	can0: can@1 {
+		compatible = "microchip,mcp2517fd";
+		reg = <1>;
+		clocks = <&clk24m>;
+		interrupt-parent = <&gpio4>;
+		interrupts = <13 0x8>;
+		vdd-supply = <&reg5v0>;
+		xceiver-supply = <&reg5v0>;
+		gpio-controller;
+	};

--
2.11.0

#2 lore raw

PATCH v4 2/3 can: mcp25xxfd: Add Microchip mcp25xxfd CAN FD driver

In reply to [email protected]

From: Martin Sperl <[email protected]>

This patch adds support for the Microchip mcp2517fd CAN-FD controller. The mcp2517fd is capable of transmitting and receiving standard data frames, extended data frames, remote frames and Can-FD frames. The mcp2517fd interfaces with the host over SPI.

Datasheet:
* http://ww1.microchip.com/downloads/en/DeviceDoc/20005688A.pdf
Reference manual:
* http://ww1.microchip.com/downloads/en/DeviceDoc/20005678A.pdf

---
Changelog:
V1 -> V2: new more generic name based on feedback from microchip
cleanup of code (checkpatch)
address all feedback on code
prepare code for GPIO handling (separate patches) handle systemerrors in a much better/reliable way
V2 -> V3: added vendor-prefix for gpio-opendrain
V3 -> V4: resend

---
 drivers/net/can/spi/Kconfig     |    6 +
 drivers/net/can/spi/Makefile    |    1 +
 drivers/net/can/spi/mcp25xxfd.c | 4324 +++++++++++++++++++++++++++++++++++++++
 3 files changed, 4331 insertions(+)
 create mode 100644 drivers/net/can/spi/mcp25xxfd.c
drivers/net/can/spi/Kconfig +6 -0
index 8f2e0dd7b756..06d588e28c35 100644
@@ -13,4 +13,10 @@ config CAN_MCP251X
 	---help---
 	  Driver for the Microchip MCP251x SPI CAN controllers.
 
+config CAN_MCP25XXFD
+	tristate "Microchip MCP25xxFD SPI CAN controllers"
+	depends on HAS_DMA
+	---help---
+	  Driver for the Microchip MCP25XXFD SPI FD-CAN controller family.
+
 endmenu
drivers/net/can/spi/Makefile +1 -0
index f59fa3731073..805643e0a01e 100644
@@ -5,3 +5,4 @@
 
 obj-$(CONFIG_CAN_HI311X)	+= hi311x.o
 obj-$(CONFIG_CAN_MCP251X)	+= mcp251x.o
+obj-$(CONFIG_CAN_MCP25XXFD)	+= mcp25xxfd.o
drivers/net/can/spi/mcp25xxfd.c new file +4324 -0

2,986 lines not on this page · raw message

The rest of this diff is not shown. View the raw message.

--
2.11.0

Part of the diff is not shown here. View the raw message.

#3 lore raw

PATCH v4 3/3 can: mcp25xxfd: add gpiolib support for GPIO0/1 (aka. INT0/INT1)

In reply to [email protected]

From: Martin Sperl <[email protected]>

Add GPIOLIB support to mcp25xxfd.

---
Changelog:
V1 -> V2: implemented support as per feedback
V2 -> V3: moved dt-binding changes to patch 1
V3 -> V4: resend

---
 drivers/net/can/spi/mcp25xxfd.c | 185 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 185 insertions(+)
drivers/net/can/spi/mcp25xxfd.c +185 -0
index 49a454da2196..10b60baddfb2 100644
@@ -20,6 +20,7 @@
 #include <linux/device.h>
 #include <linux/dma-mapping.h>
 #include <linux/freezer.h>
+#include <linux/gpio/driver.h>
 #include <linux/interrupt.h>
 #include <linux/io.h>
 #include <linux/jiffies.h>
@@ -806,9 +807,15 @@ struct mcp25xxfd_priv {
 	struct mutex clk_user_lock; /* lock for enabling/disabling the clock */
 	int clk_user_mask;
 #define MCP25XXFD_CLK_USER_CAN BIT(0)
+#define MCP25XXFD_CLK_USER_GPIO0 BIT(1)
+#define MCP25XXFD_CLK_USER_GPIO1 BIT(2)
 
 	struct dentry *debugfs_dir;
 
+#ifdef CONFIG_GPIOLIB
+	struct gpio_chip gpio;
+#endif
+
 	/* the actual model of the mcp25xxfd */
 	enum mcp25xxfd_model model;
 
@@ -1494,6 +1501,179 @@ static int mcp25xxfd_stop_clock(struct spi_device *spi, int requestor_mask)
 	return 0;
 }
 
+/* mcp25xxfd GPIO helper functions */
+#ifdef CONFIG_GPIOLIB
+
+enum mcp25xxfd_gpio_pins {
+	MCP25XXFD_GPIO_GPIO0 = 0,
+	MCP25XXFD_GPIO_GPIO1 = 1,
+};
+
+static int mcp25xxfd_gpio_request(struct gpio_chip *chip,
+				  unsigned int offset)
+{
+	struct mcp25xxfd_priv *priv = gpiochip_get_data(chip);
+	int clock_requestor = offset ?
+		MCP25XXFD_CLK_USER_GPIO1 : MCP25XXFD_CLK_USER_GPIO0;
+
+	/* only handle gpio 0/1 */
+	if (offset > 1)
+		return -EINVAL;
+
+	mcp25xxfd_start_clock(priv->spi, clock_requestor);
+
+	return 0;
+}
+
+static void mcp25xxfd_gpio_free(struct gpio_chip *chip,
+				unsigned int offset)
+{
+	struct mcp25xxfd_priv *priv = gpiochip_get_data(chip);
+	int clock_requestor = offset ?
+		MCP25XXFD_CLK_USER_GPIO1 : MCP25XXFD_CLK_USER_GPIO0;
+
+	/* only handle gpio 0/1 */
+	if (offset > 1)
+		return;
+
+	mcp25xxfd_stop_clock(priv->spi, clock_requestor);
+}
+
+static int mcp25xxfd_gpio_get(struct gpio_chip *chip, unsigned int offset)
+{
+	struct mcp25xxfd_priv *priv = gpiochip_get_data(chip);
+	u32 mask = (offset) ? MCP25XXFD_IOCON_GPIO1 : MCP25XXFD_IOCON_GPIO0;
+	int ret;
+
+	/* only handle gpio 0/1 */
+	if (offset > 1)
+		return -EINVAL;
+
+	/* read the relevant gpio Latch */
+	ret = mcp25xxfd_cmd_read_mask(priv->spi, MCP25XXFD_IOCON,
+				      &priv->regs.iocon, mask,
+				      priv->spi_setup_speed_hz);
+	if (ret)
+		return ret;
+
+	/* return the match */
+	return priv->regs.iocon & mask;
+}
+
+static void mcp25xxfd_gpio_set(struct gpio_chip *chip, unsigned int offset,
+			       int value)
+{
+	struct mcp25xxfd_priv *priv = gpiochip_get_data(chip);
+	u32 mask = (offset) ? MCP25XXFD_IOCON_LAT1 : MCP25XXFD_IOCON_LAT0;
+
+	/* only handle gpio 0/1 */
+	if (offset > 1)
+		return;
+
+	/* update in memory representation with the corresponding value */
+	if (value)
+		priv->regs.iocon |= mask;
+	else
+		priv->regs.iocon &= ~mask;
+
+	mcp25xxfd_cmd_write_mask(priv->spi, MCP25XXFD_IOCON,
+				 priv->regs.iocon, mask,
+				 priv->spi_setup_speed_hz);
+}
+
+static int mcp25xxfd_gpio_direction_input(struct gpio_chip *chip,
+					  unsigned int offset)
+{
+	struct mcp25xxfd_priv *priv = gpiochip_get_data(chip);
+	u32 mask_tri = (offset) ?
+		MCP25XXFD_IOCON_TRIS1 : MCP25XXFD_IOCON_TRIS0;
+	u32 mask_stby = (offset) ?
+		0 : MCP25XXFD_IOCON_XSTBYEN;
+	u32 mask_pm = (offset) ?
+		MCP25XXFD_IOCON_PM1 : MCP25XXFD_IOCON_PM0;
+
+	/* only handle gpio 0/1 */
+	if (offset > 1)
+		return -EINVAL;
+
+	/* set the mask */
+	priv->regs.iocon |= mask_tri | mask_pm;
+
+	/* clear stby */
+	priv->regs.iocon &= ~mask_stby;
+
+	return mcp25xxfd_cmd_write_mask(priv->spi, MCP25XXFD_IOCON,
+					priv->regs.iocon,
+					mask_tri | mask_stby | mask_pm,
+					priv->spi_setup_speed_hz);
+}
+
+static int mcp25xxfd_gpio_direction_output(struct gpio_chip *chip,
+					   unsigned int offset, int value)
+{
+	struct mcp25xxfd_priv *priv = gpiochip_get_data(chip);
+	u32 mask_tri = (offset) ?
+		MCP25XXFD_IOCON_TRIS1 : MCP25XXFD_IOCON_TRIS0;
+	u32 mask_lat = (offset) ?
+		MCP25XXFD_IOCON_LAT1 : MCP25XXFD_IOCON_LAT0;
+	u32 mask_pm = (offset) ?
+		MCP25XXFD_IOCON_PM1 : MCP25XXFD_IOCON_PM0;
+	u32 mask_stby = (offset) ?
+		0 : MCP25XXFD_IOCON_XSTBYEN;
+
+	/* only handle gpio 0/1 */
+	if (offset > 1)
+		return -EINVAL;
+
+	/* clear the tristate bit and also clear stby */
+	priv->regs.iocon &= ~(mask_tri | mask_stby);
+
+	/* set GPIO mode */
+	priv->regs.iocon |= mask_pm;
+
+	/* set the value */
+	if (value)
+		priv->regs.iocon |= mask_lat;
+	else
+		priv->regs.iocon &= ~mask_lat;
+
+	return mcp25xxfd_cmd_write_mask(priv->spi, MCP25XXFD_IOCON,
+					priv->regs.iocon,
+					mask_tri | mask_lat |
+					mask_pm | mask_stby,
+					priv->spi_setup_speed_hz);
+}
+
+static int mcp25xxfd_gpio_setup(struct spi_device *spi)
+{
+	struct mcp25xxfd_priv *priv = spi_get_drvdata(spi);
+
+	/* gpiochip only handles GPIO0 and GPIO1 */
+	priv->gpio.owner		= THIS_MODULE;
+	priv->gpio.parent		= &spi->dev;
+	priv->gpio.label		= dev_name(&spi->dev);
+	priv->gpio.direction_input	= mcp25xxfd_gpio_direction_input;
+	priv->gpio.get			= mcp25xxfd_gpio_get;
+	priv->gpio.direction_output	= mcp25xxfd_gpio_direction_output;
+	priv->gpio.set			= mcp25xxfd_gpio_set;
+	priv->gpio.request		= mcp25xxfd_gpio_request;
+	priv->gpio.free			= mcp25xxfd_gpio_free;
+	priv->gpio.base			= -1;
+	priv->gpio.ngpio		= 2;
+	priv->gpio.can_sleep		= 1;
+
+	return devm_gpiochip_add_data(&spi->dev, &priv->gpio, priv);
+}
+
+#else
+
+static int mcp25xxfd_gpio_setup(struct spi_device *spi)
+{
+	return 0;
+}
+
+#endif
+
 /* ideally these would be defined in uapi/linux/can.h */
 #define CAN_EFF_SID_SHIFT		(CAN_EFF_ID_BITS - CAN_SFF_ID_BITS)
 #define CAN_EFF_SID_BITS		CAN_SFF_ID_BITS
@@ -4104,6 +4284,11 @@ static int mcp25xxfd_can_probe(struct spi_device *spi)
 	if (ret)
 		goto out_free;
 
+	/* Setup GPIO controller */
+	ret = mcp25xxfd_gpio_setup(spi);
+	if (ret)
+		goto out_clk;
+
 	/* all by default as push/pull */
 	priv->config.gpio_opendrain = false;
 

--
2.11.0

author Tested-by Gerhard Bertelsmann on the v4 series
#4 lore raw
In reply to [email protected]

Hi!

Any updates/feedback on this driver?

It has been sitting here almost unchanged for the last 4 month without any feedback (except for Rob).

What is still needed to get it included?

As far as I see all the comments from end of November have been addressed already in V2 of this patch series…

Note also that:

(from January)

Thanks,
Martin

Quoted 87 lines · On 14.05.2018, at 18:03, [email protected] wrote:

From: Martin Sperl <[email protected]>

This patchset adds a driver for the mcp25xxfd CanFD controller.

Most of the features of the controller are supported by this driver release.

The controller includes a few features that the current core Can(FD) implementation does not support:
* Transmit Bandwidth Sharing bits
- this waits for a configurable number of syncronization bits before atempting to transmit the next frame - for the moment controllable via a module parameter
* SID11 with CanFD frames
- at this moment not supported by driver
* 3 transmit attempts in addition to ONE_SHOT
* transmitter delay compensation configurations
* micro second exact transmission and reception timestamps
- used internally by driver
* variable number of tx-fifos
- exposed via module parameter at this moment

The driver has been heavily optimized so that it can handle a 100% utilized 1MHz Can-bus (with 11 bit can frames with DLC=0) even on less powerful SOCs like the raspberry pi 1 without dropping frames due to driver/spi latencies (still dropps are observed in the can/network stack).

To achive this the driver includes several code optimization Two of which prefers continuous long spi transfers over multiple small individual spi transfers of variable length.
This is an optimization that would favour spi dma transfers instead of more expensive PIO in typical SPI controllers.
Both of them can get explicitly enabled by the use of a module parameter. One of those is automatically used in the case of Can2.0 only bus configurations.

Finer details of the implementation and rational is included with the driver code it self for future reference.

The driver has also been tested for basic CanFD transfers with BRS up to 5.7Mhz data bitrates - the available transceiver did not allow for faster rates...

The driver itself exposes lots of internal data/statistics via debugfs.

The driver implements a lock-less design for transmissions making use instead of prepared spi messages submitted via spi_async for transmission in the start_xmit_start code without requireing an extra workqueue and the corresponding latencies.

Note that there is an extra patch in the pipeline to implement pinctrl but this still shows some issues, so it is not included in this patchset.

Changelog:
V1 -> V2: new more generic name based on feedback from microchip
cleanup of code (checkpatch)
address all feedback on code
handle (HW) systemerrors in a much better/reliable way cleanup of dt custom properties removing (most) gpio
related properties
implemented GPIOLIB support as per feedback
V2 -> V3: added vendor-prefix for gpio-opendrain to dt-binding
added gpio-controller to dt-binding
added feedback by Rob Herring
waited for other feedback regarding the code
V3 -> V4: resend
Patch-1 (dt) added: Reviewed-by: Rob Herring <[email protected]>

Martin Sperl (3):
dt-binding: can: mcp25xxfd: document device tree bindings
can: mcp25xxfd: Add Microchip mcp25xxfd CAN FD driver
can: mcp25xxfd: add gpiolib support for GPIO0/1 (aka. INT0/INT1)

.../bindings/net/can/microchip,mcp25xxfd.txt       |   32 +
drivers/net/can/spi/Kconfig                        |    6 +
drivers/net/can/spi/Makefile                       |    1 +
drivers/net/can/spi/mcp25xxfd.c                    | 4509 ++++++++++++++++++++
4 files changed, 4548 insertions(+)

create mode 100644 Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.txt create mode 100644 drivers/net/can/spi/mcp25xxfd.c

--
2.11.0

#5 lore raw

v4 cover Microchip mcp25xxfd can controller driver

Hello Martin,

this driver is huge... more than 4300 lines of code. That's maybe one reason why it has not yet been reviewed. The driver includes a debugfs interface and is also very verbose in general. I'm not sure if the debugging code is really useful for the end user, but well, debugfs is exactly for that purpose. What about splitting up the driver in a subdirectory "mcp2517fd" into core, spi, debugfs, etc. Other opinions?

I hope to find some time end of this week for a review.

Thanks for your patience.

Wolfgang.

Am 06.06.2018 um 19:32 schrieb [email protected]:

Quoted 116 lines

Hi!

Any updates/feedback on this driver?

It has been sitting here almost unchanged for the last 4 month without any feedback (except for Rob).

What is still needed to get it included?

As far as I see all the comments from end of November have been addressed already in V2 of this patch series…

Note also that:

(from January)

Thanks,
Martin

Quoted 82 lines · On 14.05.2018, at 18:03, [email protected] wrote:

From: Martin Sperl <[email protected]>

This patchset adds a driver for the mcp25xxfd CanFD controller.

Most of the features of the controller are supported by this driver release.

The controller includes a few features that the current core Can(FD) implementation does not support:
* Transmit Bandwidth Sharing bits
- this waits for a configurable number of syncronization bits before atempting to transmit the next frame - for the moment controllable via a module parameter
* SID11 with CanFD frames
- at this moment not supported by driver
* 3 transmit attempts in addition to ONE_SHOT
* transmitter delay compensation configurations
* micro second exact transmission and reception timestamps
- used internally by driver
* variable number of tx-fifos
- exposed via module parameter at this moment

The driver has been heavily optimized so that it can handle a 100% utilized 1MHz Can-bus (with 11 bit can frames with DLC=0) even on less powerful SOCs like the raspberry pi 1 without dropping frames due to driver/spi latencies (still dropps are observed in the can/network stack).

To achive this the driver includes several code optimization Two of which prefers continuous long spi transfers over multiple small individual spi transfers of variable length.
This is an optimization that would favour spi dma transfers instead of more expensive PIO in typical SPI controllers.
Both of them can get explicitly enabled by the use of a module parameter. One of those is automatically used in the case of Can2.0 only bus configurations.

Finer details of the implementation and rational is included with the driver code it self for future reference.

The driver has also been tested for basic CanFD transfers with BRS up to 5.7Mhz data bitrates - the available transceiver did not allow for faster rates...

The driver itself exposes lots of internal data/statistics via debugfs.

The driver implements a lock-less design for transmissions making use instead of prepared spi messages submitted via spi_async for transmission in the start_xmit_start code without requireing an extra workqueue and the corresponding latencies.

Note that there is an extra patch in the pipeline to implement pinctrl but this still shows some issues, so it is not included in this patchset.

Changelog:
V1 -> V2: new more generic name based on feedback from microchip
cleanup of code (checkpatch)
address all feedback on code
handle (HW) systemerrors in a much better/reliable way cleanup of dt custom properties removing (most) gpio
related properties
implemented GPIOLIB support as per feedback
V2 -> V3: added vendor-prefix for gpio-opendrain to dt-binding
added gpio-controller to dt-binding
added feedback by Rob Herring
waited for other feedback regarding the code
V3 -> V4: resend
Patch-1 (dt) added: Reviewed-by: Rob Herring <[email protected]>

Martin Sperl (3):
dt-binding: can: mcp25xxfd: document device tree bindings
can: mcp25xxfd: Add Microchip mcp25xxfd CAN FD driver
can: mcp25xxfd: add gpiolib support for GPIO0/1 (aka. INT0/INT1)

.../bindings/net/can/microchip,mcp25xxfd.txt       |   32 +
drivers/net/can/spi/Kconfig                        |    6 +
drivers/net/can/spi/Makefile                       |    1 +
drivers/net/can/spi/mcp25xxfd.c                    | 4509 ++++++++++++++++++++
4 files changed, 4548 insertions(+)
Quoted 5 lines

create mode 100644 Documentation/devicetree/bindings/net/can/microchip,mcp25xxfd.txt create mode 100644 drivers/net/can/spi/mcp25xxfd.c

--
2.11.0

--
To unsubscribe from this list: send the line "unsubscribe linux-can" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
Quoted 11 lines · Wolfgang Grandegger

Hello Martin,

this driver is huge... more than 4300 lines of code. That's maybe one reason why it has not yet been reviewed. The driver includes a debugfs interface and is also very verbose in general. I'm not sure if the debugging code is really useful for the end user, but well, debugfs is exactly for that purpose. What about splitting up the driver in a subdirectory "mcp2517fd" into core, spi, debugfs, etc. Other opinions?

Splitting does unfortunately strip the compiler from the opportunity to Automatically inline code.

What I was thinking is maybe to split up the patch into:
* basic functionality
* debugfs
* optimization code
* gpio lib related (already separated)
* documentation comments

Would that be helpful?

Thanks, Martin

#7 lore raw

v4 cover Microchip mcp25xxfd can controller driver

Hello Martin,

Am 14.06.2018 um 07:19 schrieb Martin Sperl:

Quoted 15 lines
Quoted 11 lines · Wolfgang Grandegger

Hello Martin,

this driver is huge... more than 4300 lines of code. That's maybe one reason why it has not yet been reviewed. The driver includes a debugfs interface and is also very verbose in general. I'm not sure if the debugging code is really useful for the end user, but well, debugfs is exactly for that purpose. What about splitting up the driver in a subdirectory "mcp2517fd" into core, spi, debugfs, etc. Other opinions?

Splitting does unfortunately strip the compiler from the opportunity to Automatically inline code.

Quoted 6 lines

What I was thinking is maybe to split up the patch into:
* basic functionality
* debugfs
* optimization code
* gpio lib related (already separated)
* documentation comments

And Header files.

Quoted 1 line

Would that be helpful?

Other opinions?

Wolfgang.

#8 lore raw
In reply to Martin Sperl

Hello Martin, all,

Am 14.06.2018 um 07:19 schrieb Martin Sperl:

Quoted 15 lines
Quoted 11 lines · Wolfgang Grandegger

Hello Martin,

this driver is huge... more than 4300 lines of code. That's maybe one reason why it has not yet been reviewed. The driver includes a debugfs interface and is also very verbose in general. I'm not sure if the debugging code is really useful for the end user, but well, debugfs is exactly for that purpose. What about splitting up the driver in a subdirectory "mcp2517fd" into core, spi, debugfs, etc. Other opinions?

Splitting does unfortunately strip the compiler from the opportunity to Automatically inline code.

Quoted 8 lines

What I was thinking is maybe to split up the patch into:
* basic functionality
* debugfs
* optimization code
* gpio lib related (already separated)
* documentation comments

Would that be helpful?

I recently sent a review for:

[PATCH V3 2/3] can: mcp25xxfd: Add Microchip mcp25xxfd CAN FD driver

but it did not show up on the linux-can ml. I also cannot find the original patch. Patch 2/3 from your V3 and V4 series is missing in the archive. Is there a size limitation?

Wolfgang.

#9 lore raw
Quoted 13 lines · Wolfgang Grandegger

Hello Martin, all,

I recently sent a review for:

[PATCH V3 2/3] can: mcp25xxfd: Add Microchip mcp25xxfd CAN FD driver

but it did not show up on the linux-can ml. I also cannot find the original patch. Patch 2/3 from your V3 and V4 series is missing in the archive. Is there a size limitation?

I have experienced something similar - it shows up in the dt archive but not in the can-archive... Version 1 and 2 were less than 128k and were accepted and archived.
That was one of the reasons why I wanted to split the patches themselves and not the file...

Still I have received your comments and I shall incorporate them hopefully this weekend.

Martin