Skip to contentSkip to conversation

pull-request: can 2022-01-24

PATCH Applied Marc Kleine-Budde 2 participants 7 messages Jan 24, 2022

Subsystems (6)
lore
Share & tools
lore

Marc Kleine-Budde

author maintainer
#0 lore raw

cover pull-request: can 2022-01-24

Hello Jakub, hello David,

this is a pull request of 5 patches for net/master. All patches are by me.

The first patch updates the email address of Brian Silverman from his former employer to his private address.

The next patch fixes DT bindings information for the tcan4x5x SPI CAN driver.

The following patch targets the m_can driver and fixes the introduction of FIFO bulk read support.

Another patch for the tcan4x5x driver, which fixes the max register value for the regmap config.

The last patch for the flexcan driver marks the RX mailbox support for the MCF5441X as support.

regards,
Marc

---

The following changes since commit c0bf3d8a943b6f2e912b7c1de03e2ef28e76f760:

net/smc: Transitional solution for clcsock race issue (2022-01-24 12:06:08 +0000)

are available in the Git repository at:

git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git tags/linux-can-fixes-for-5.17-20220124

for you to fetch changes up to f04aefd4659b7959e50e6d0d649936c6940f9d34:

can: flexcan: mark RX via mailboxes as supported on MCF5441X (2022-01-24 18:27:43 +0100)

----------------------------------------------------------------
linux-can-fixes-for-5.17-20220124

----------------------------------------------------------------
Marc Kleine-Budde (5):
mailmap: update email address of Brian Silverman
dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config
can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0
can: tcan4x5x: regmap: fix max register value
can: flexcan: mark RX via mailboxes as supported on MCF5441X

 .mailmap                                               | 1 +
 Documentation/devicetree/bindings/net/can/tcan4x5x.txt | 2 +-
 drivers/net/can/flexcan/flexcan-core.c                 | 1 +
 drivers/net/can/flexcan/flexcan.h                      | 2 +-
 drivers/net/can/m_can/m_can.c                          | 6 ++++++
 drivers/net/can/m_can/tcan4x5x-regmap.c                | 2 +-
 6 files changed, 11 insertions(+), 3 deletions(-)
author maintainer
#1 lore raw

PATCH 1/5 mailmap: update email address of Brian Silverman

Brian Silverman's address at bluerivertech.com is not valid anymore, use Brian's private email address instead.

---
 .mailmap | 1 +
 1 file changed, 1 insertion(+)
.mailmap +1 -0
index b157f88ce26a..b76e520809d0 100644
@@ -70,6 +70,7 @@ Boris Brezillon <[email protected]> <[email protected]>
 Boris Brezillon <[email protected]> <[email protected]>
 Brian Avery <[email protected]>
 Brian King <[email protected]>
+Brian Silverman <[email protected]> <[email protected]>
 Changbin Du <[email protected]> <[email protected]>
 Changbin Du <[email protected]> <[email protected]>
 Chao Yu <[email protected]> <[email protected]>

base-commit: c0bf3d8a943b6f2e912b7c1de03e2ef28e76f760

Signature · 1 line
2.34.1
#2 lore raw

Re: [PATCH net 1/5] mailmap: update email address of Brian Silverman

This series was applied to netdev/net.git (master) by Marc Kleine-Budde <[email protected]>:

Hello:

This series was applied to netdev/net.git (master) by Marc Kleine-Budde <[email protected]>:

Quoted 8 lines · On Mon, 24 Jan 2022 18:59:51 +0100 you wrote:

Brian Silverman's address at bluerivertech.com is not valid anymore, use Brian's private email address instead.

[...]

Here is the summary with links:
- [net,1/5] mailmap: update email address of Brian Silverman

    https://git.kernel.org/netdev/net/c/984d1efff230
  - [net,2/5] dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config
    https://git.kernel.org/netdev/net/c/17a30422621c
  - [net,3/5] can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0
    https://git.kernel.org/netdev/net/c/db72589c49fd
  - [net,4/5] can: tcan4x5x: regmap: fix max register value
    https://git.kernel.org/netdev/net/c/e59986de5ff7
  - [net,5/5] can: flexcan: mark RX via mailboxes as supported on MCF5441X
    https://git.kernel.org/netdev/net/c/f04aefd4659b

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
author maintainer
#3 lore raw

PATCH 2/5 dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config

In reply to Marc Kleine-Budde

This tcan4x5x only comes with 2K of MRAM, a RX FIFO with a dept of 32 doesn't fit into the MRAM. Use a depth of 16 instead.

Fixes 4edd396a1911 ("dt-bindings: can: tcan4x5x: Add DT bindings for TCAN4x5X driver")
---
 Documentation/devicetree/bindings/net/can/tcan4x5x.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/net/can/tcan4x5x.txt +1 -1
index 0968b40aef1e..e3501bfa22e9 100644
@@ -31,7 +31,7 @@ tcan4x5x: tcan4x5x@0 {
 		#address-cells = <1>;
 		#size-cells = <1>;
 		spi-max-frequency = <10000000>;
-		bosch,mram-cfg = <0x0 0 0 32 0 0 1 1>;
+		bosch,mram-cfg = <0x0 0 0 16 0 0 1 1>;
 		interrupt-parent = <&gpio1>;
 		interrupts = <14 IRQ_TYPE_LEVEL_LOW>;
 		device-state-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>;
Signature · 1 line
2.34.1
author maintainer
#4 lore raw

PATCH 3/5 can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0

In reply to Marc Kleine-Budde

In order to optimize FIFO access, especially on m_can cores attached to slow busses like SPI, in patch

| e39381770ec9 ("can: m_can: Disable IRQs on FIFO bus errors")

bulk read/write support has been added to the m_can_fifo_{read,write} functions.

That change leads to the tcan driver to call regmap_bulk_{read,write}() with a length of 0 (for CAN frames with 0 data length). regmap treats this as an error:

| tcan4x5x spi1.0 tcan4x5x0: FIFO write returned -22

This patch fixes the problem by not calling the cdev->ops->{read,write)_fifo() in case of a 0 length read/write.

Fixes e39381770ec9 ("can: m_can: Disable IRQs on FIFO bus errors")
Cc Matt Kline <[email protected]>
Cc Chandrasekar Ramakrishnan <[email protected]>
---
 drivers/net/can/m_can/m_can.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/net/can/m_can/m_can.c +6 -0
index 5b47cd867783..1a4b56f6fa8c 100644
@@ -336,6 +336,9 @@ m_can_fifo_read(struct m_can_classdev *cdev,
 	u32 addr_offset = cdev->mcfg[MRAM_RXF0].off + fgi * RXF0_ELEMENT_SIZE +
 		offset;
 
+	if (val_count == 0)
+		return 0;
+
 	return cdev->ops->read_fifo(cdev, addr_offset, val, val_count);
 }
 
@@ -346,6 +349,9 @@ m_can_fifo_write(struct m_can_classdev *cdev,
 	u32 addr_offset = cdev->mcfg[MRAM_TXB].off + fpi * TXB_ELEMENT_SIZE +
 		offset;
 
+	if (val_count == 0)
+		return 0;
+
 	return cdev->ops->write_fifo(cdev, addr_offset, val, val_count);
 }
 
Signature · 1 line
2.34.1
author maintainer
#5 lore raw

PATCH 4/5 can: tcan4x5x: regmap: fix max register value

In reply to Marc Kleine-Budde

The MRAM of the tcan4x5x has a size of 2K and starts at 0x8000. There are no further registers in the tcan4x5x making 0x87fc the biggest addressable register.

This patch fixes the max register value of the regmap config from 0x8ffc to 0x87fc.

Fixes 6e1caaf8ed22 ("can: tcan4x5x: fix max register value")
---
 drivers/net/can/m_can/tcan4x5x-regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/can/m_can/tcan4x5x-regmap.c +1 -1
index ca80dbaf7a3f..26e212b8ca7a 100644
@@ -12,7 +12,7 @@
 #define TCAN4X5X_SPI_INSTRUCTION_WRITE (0x61 << 24)
 #define TCAN4X5X_SPI_INSTRUCTION_READ (0x41 << 24)
 
-#define TCAN4X5X_MAX_REGISTER 0x8ffc
+#define TCAN4X5X_MAX_REGISTER 0x87fc
 
 static int tcan4x5x_regmap_gather_write(void *context,
 					const void *reg, size_t reg_len,
Signature · 1 line
2.34.1
author maintainer
#6 lore raw

PATCH 5/5 can: flexcan: mark RX via mailboxes as supported on MCF5441X

In reply to Marc Kleine-Budde

Most flexcan IP cores support 2 RX modes:
- FIFO
- mailbox

The flexcan IP core on the MCF5441X cannot receive CAN RTR messages via mailboxes. However the mailbox mode is more performant. The commit

| 1c45f5778a3b ("can: flexcan: add ethtool support to change rx-rtr setting during runtime")

added support to switch from FIFO to mailbox mode on these cores.

After testing the mailbox mode on the MCF5441X by Angelo Dureghello, this patch marks it (without RTR capability) as supported. Further the IP core overview table is updated, that RTR reception via mailboxes is not supported.

---
 drivers/net/can/flexcan/flexcan-core.c | 1 +
 drivers/net/can/flexcan/flexcan.h      | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/net/can/flexcan/flexcan-core.c +1 -0
index 0bff1884d5cc..74d7fcbfd065 100644
@@ -296,6 +296,7 @@ static_assert(sizeof(struct flexcan_regs) ==  0x4 * 18 + 0xfb8);
 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 |
+		FLEXCAN_QUIRK_SUPPPORT_RX_MAILBOX |
 		FLEXCAN_QUIRK_SUPPPORT_RX_FIFO,
 };
 
drivers/net/can/flexcan/flexcan.h +1 -1
index fccdff8b1f0f..23fc09a7e10f 100644
@@ -21,7 +21,7 @@
  * 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
+ * MCF5441X FlexCAN2  ?               no       yes        no       no        no           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
Signature · 1 line
2.34.1