linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net 0/5] pull-request: can 2022-01-24
@ 2022-01-24 17:59 Marc Kleine-Budde
  2022-01-24 17:59 ` [PATCH net 1/5] mailmap: update email address of Brian Silverman Marc Kleine-Budde
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2022-01-24 17:59 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel

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



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

* [PATCH net 1/5] mailmap: update email address of Brian Silverman
  2022-01-24 17:59 [PATCH net 0/5] pull-request: can 2022-01-24 Marc Kleine-Budde
@ 2022-01-24 17:59 ` Marc Kleine-Budde
  2022-01-24 20:50   ` patchwork-bot+netdevbpf
  2022-01-24 17:59 ` [PATCH net 2/5] dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config Marc Kleine-Budde
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Marc Kleine-Budde @ 2022-01-24 17:59 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel, Marc Kleine-Budde, Brian Silverman

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

Link: https://lore.kernel.org/all/20220110082359.2019735-1-mkl@pengutronix.de
Cc: Brian Silverman <bsilver16384@gmail.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 .mailmap | 1 +
 1 file changed, 1 insertion(+)

diff --git a/.mailmap b/.mailmap
index b157f88ce26a..b76e520809d0 100644
--- a/.mailmap
+++ b/.mailmap
@@ -70,6 +70,7 @@ Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@bootlin.com>
 Boris Brezillon <bbrezillon@kernel.org> <boris.brezillon@free-electrons.com>
 Brian Avery <b.avery@hp.com>
 Brian King <brking@us.ibm.com>
+Brian Silverman <bsilver16384@gmail.com> <brian.silverman@bluerivertech.com>
 Changbin Du <changbin.du@intel.com> <changbin.du@gmail.com>
 Changbin Du <changbin.du@intel.com> <changbin.du@intel.com>
 Chao Yu <chao@kernel.org> <chao2.yu@samsung.com>

base-commit: c0bf3d8a943b6f2e912b7c1de03e2ef28e76f760
-- 
2.34.1



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

* [PATCH net 2/5] dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config
  2022-01-24 17:59 [PATCH net 0/5] pull-request: can 2022-01-24 Marc Kleine-Budde
  2022-01-24 17:59 ` [PATCH net 1/5] mailmap: update email address of Brian Silverman Marc Kleine-Budde
@ 2022-01-24 17:59 ` Marc Kleine-Budde
  2022-01-24 17:59 ` [PATCH net 3/5] can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0 Marc Kleine-Budde
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2022-01-24 17:59 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel, 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")
Link: https://lore.kernel.org/all/20220119062951.2939851-1-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 Documentation/devicetree/bindings/net/can/tcan4x5x.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
index 0968b40aef1e..e3501bfa22e9 100644
--- a/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
+++ b/Documentation/devicetree/bindings/net/can/tcan4x5x.txt
@@ -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>;
-- 
2.34.1



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

* [PATCH net 3/5] can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0
  2022-01-24 17:59 [PATCH net 0/5] pull-request: can 2022-01-24 Marc Kleine-Budde
  2022-01-24 17:59 ` [PATCH net 1/5] mailmap: update email address of Brian Silverman Marc Kleine-Budde
  2022-01-24 17:59 ` [PATCH net 2/5] dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config Marc Kleine-Budde
@ 2022-01-24 17:59 ` Marc Kleine-Budde
  2022-01-24 17:59 ` [PATCH net 4/5] can: tcan4x5x: regmap: fix max register value Marc Kleine-Budde
  2022-01-24 17:59 ` [PATCH net 5/5] can: flexcan: mark RX via mailboxes as supported on MCF5441X Marc Kleine-Budde
  4 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2022-01-24 17:59 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, linux-can, kernel, Marc Kleine-Budde, stable,
	Matt Kline, Chandrasekar Ramakrishnan, Michael Anochin

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")
Link: https://lore.kernel.org/all/20220114155751.2651888-1-mkl@pengutronix.de
Cc: stable@vger.kernel.org
Cc: Matt Kline <matt@bitbashing.io>
Cc: Chandrasekar Ramakrishnan <rcsekar@samsung.com>
Reported-by: Michael Anochin <anochin@photo-meter.com>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/m_can/m_can.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/drivers/net/can/m_can/m_can.c b/drivers/net/can/m_can/m_can.c
index 5b47cd867783..1a4b56f6fa8c 100644
--- a/drivers/net/can/m_can/m_can.c
+++ b/drivers/net/can/m_can/m_can.c
@@ -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);
 }
 
-- 
2.34.1



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

* [PATCH net 4/5] can: tcan4x5x: regmap: fix max register value
  2022-01-24 17:59 [PATCH net 0/5] pull-request: can 2022-01-24 Marc Kleine-Budde
                   ` (2 preceding siblings ...)
  2022-01-24 17:59 ` [PATCH net 3/5] can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0 Marc Kleine-Budde
@ 2022-01-24 17:59 ` Marc Kleine-Budde
  2022-01-24 17:59 ` [PATCH net 5/5] can: flexcan: mark RX via mailboxes as supported on MCF5441X Marc Kleine-Budde
  4 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2022-01-24 17:59 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, linux-can, kernel, 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")
Link: https://lore.kernel.org/all/20220119064011.2943292-1-mkl@pengutronix.de
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/m_can/tcan4x5x-regmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/can/m_can/tcan4x5x-regmap.c b/drivers/net/can/m_can/tcan4x5x-regmap.c
index ca80dbaf7a3f..26e212b8ca7a 100644
--- a/drivers/net/can/m_can/tcan4x5x-regmap.c
+++ b/drivers/net/can/m_can/tcan4x5x-regmap.c
@@ -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,
-- 
2.34.1



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

* [PATCH net 5/5] can: flexcan: mark RX via mailboxes as supported on MCF5441X
  2022-01-24 17:59 [PATCH net 0/5] pull-request: can 2022-01-24 Marc Kleine-Budde
                   ` (3 preceding siblings ...)
  2022-01-24 17:59 ` [PATCH net 4/5] can: tcan4x5x: regmap: fix max register value Marc Kleine-Budde
@ 2022-01-24 17:59 ` Marc Kleine-Budde
  4 siblings, 0 replies; 7+ messages in thread
From: Marc Kleine-Budde @ 2022-01-24 17:59 UTC (permalink / raw)
  To: netdev
  Cc: davem, kuba, linux-can, kernel, Marc Kleine-Budde, Angelo Dureghello

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.

Link: https://lore.kernel.org/all/20220121084425.3141218-1-mkl@pengutronix.de
Tested-by: Angelo Dureghello <angelo@kernel-space.org>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
---
 drivers/net/can/flexcan/flexcan-core.c | 1 +
 drivers/net/can/flexcan/flexcan.h      | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/can/flexcan/flexcan-core.c b/drivers/net/can/flexcan/flexcan-core.c
index 0bff1884d5cc..74d7fcbfd065 100644
--- a/drivers/net/can/flexcan/flexcan-core.c
+++ b/drivers/net/can/flexcan/flexcan-core.c
@@ -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,
 };
 
diff --git a/drivers/net/can/flexcan/flexcan.h b/drivers/net/can/flexcan/flexcan.h
index fccdff8b1f0f..23fc09a7e10f 100644
--- a/drivers/net/can/flexcan/flexcan.h
+++ b/drivers/net/can/flexcan/flexcan.h
@@ -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
-- 
2.34.1



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

* Re: [PATCH net 1/5] mailmap: update email address of Brian Silverman
  2022-01-24 17:59 ` [PATCH net 1/5] mailmap: update email address of Brian Silverman Marc Kleine-Budde
@ 2022-01-24 20:50   ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 7+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-01-24 20:50 UTC (permalink / raw)
  To: Marc Kleine-Budde; +Cc: netdev, davem, kuba, linux-can, kernel, bsilver16384

Hello:

This series was applied to netdev/net.git (master)
by Marc Kleine-Budde <mkl@pengutronix.de>:

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.
> 
> Link: https://lore.kernel.org/all/20220110082359.2019735-1-mkl@pengutronix.de
> Cc: Brian Silverman <bsilver16384@gmail.com>
> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
> 
> [...]

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!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-01-24 22:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-24 17:59 [PATCH net 0/5] pull-request: can 2022-01-24 Marc Kleine-Budde
2022-01-24 17:59 ` [PATCH net 1/5] mailmap: update email address of Brian Silverman Marc Kleine-Budde
2022-01-24 20:50   ` patchwork-bot+netdevbpf
2022-01-24 17:59 ` [PATCH net 2/5] dt-bindings: can: tcan4x5x: fix mram-cfg RX FIFO config Marc Kleine-Budde
2022-01-24 17:59 ` [PATCH net 3/5] can: m_can: m_can_fifo_{read,write}: don't read or write from/to FIFO if length is 0 Marc Kleine-Budde
2022-01-24 17:59 ` [PATCH net 4/5] can: tcan4x5x: regmap: fix max register value Marc Kleine-Budde
2022-01-24 17:59 ` [PATCH net 5/5] can: flexcan: mark RX via mailboxes as supported on MCF5441X Marc Kleine-Budde

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).