All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can: mcp25xxfd: minor register definition fixes
@ 2020-02-11 12:04 Thomas Kopp
  2020-02-11 12:24 ` Marc Kleine-Budde
  2020-02-11 12:46 ` Marc Kleine-Budde
  0 siblings, 2 replies; 3+ messages in thread
From: Thomas Kopp @ 2020-02-11 12:04 UTC (permalink / raw)
  To: linux-can; +Cc: mkl, thomas.kopp

Signed-off-by: Thomas Kopp <thomas.kopp@microchip.com>
---
Hi Marc,
I started testing your driver at https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/log/drivers/net/can/spi/mcp25xxfd?h=v5.4/mcp25xxfd and noticed two small things in the register definitions. Overall TX seems to be working fine - one thing I noticed when testing with cangen can0 -b -g 0 and another external node periodically sending frames on the bus (with 2ms gaps) I'm eventually getting stuffing errors from which the driver never really recovers. As soon as the external node then stops sending messages, the MCP2518FD node stops sending as well and gets unresponsive (ssh isn't possible anymore etc.). When resuming the external CAN traffic the node becomes responsive again. The driver was compiled with Additional Debugging output and Logging enabled. Ifconfig doesn't s
 how any RX/TX errors and shows plausible numbers for packets transmitted/received. Am I chasing ghosts here or have you encountered similar behaviour?
Best Regards,
Thomas

 drivers/net/can/spi/mcp25xxfd/mcp25xxfd.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/can/spi/mcp25xxfd/mcp25xxfd.h b/drivers/net/can/spi/mcp25xxfd/mcp25xxfd.h
index 6bf211673d0e..13af06d7fd67 100644
--- a/drivers/net/can/spi/mcp25xxfd/mcp25xxfd.h
+++ b/drivers/net/can/spi/mcp25xxfd/mcp25xxfd.h
@@ -94,7 +94,7 @@ static inline void __dump(const void *d, unsigned int len)
 #define MCP25XXFD_CAN_TDC 0x0c
 #define MCP25XXFD_CAN_TDC_EDGFLTEN BIT(25)
 #define MCP25XXFD_CAN_TDC_SID11EN BIT(24)
-#define MCP25XXFD_CAN_TDC_TDCMOD_MASK GENMASK(17, 6)
+#define MCP25XXFD_CAN_TDC_TDCMOD_MASK GENMASK(17, 16)
 #define MCP25XXFD_CAN_TDC_TDCMOD_AUTO 2
 #define MCP25XXFD_CAN_TDC_TDCMOD_MANUAL 1
 #define MCP25XXFD_CAN_TDC_TDCMOD_DISABLED 0
@@ -304,7 +304,7 @@ static inline void __dump(const void *d, unsigned int len)
 #define MCP25XXFD_CAN_FLTOBJ(x) (0x1f0 + 8 * (x))
 #define MCP25XXFD_CAN_FLTOBJ_EXIDE BIT(30)
 #define MCP25XXFD_CAN_FLTOBJ_SID11 BIT(29)
-#define MCP25XXFD_CAN_FLTOBJ_EID_MASK GENMASK(28. 11)
+#define MCP25XXFD_CAN_FLTOBJ_EID_MASK GENMASK(28, 11)
 #define MCP25XXFD_CAN_FLTOBJ_SID_MASK GENMASK(10, 0)
 
 #define MCP25XXFD_CAN_FLTMASK(x) (0x1f4 + 8 * (x))
-- 
2.17.1

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

* Re: [PATCH] can: mcp25xxfd: minor register definition fixes
  2020-02-11 12:04 [PATCH] can: mcp25xxfd: minor register definition fixes Thomas Kopp
@ 2020-02-11 12:24 ` Marc Kleine-Budde
  2020-02-11 12:46 ` Marc Kleine-Budde
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2020-02-11 12:24 UTC (permalink / raw)
  To: Thomas Kopp, linux-can

On 2/11/20 1:04 PM, Thomas Kopp wrote:
> Signed-off-by: Thomas Kopp <thomas.kopp@microchip.com>

tnx, applied.

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 |

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

* Re: [PATCH] can: mcp25xxfd: minor register definition fixes
  2020-02-11 12:04 [PATCH] can: mcp25xxfd: minor register definition fixes Thomas Kopp
  2020-02-11 12:24 ` Marc Kleine-Budde
@ 2020-02-11 12:46 ` Marc Kleine-Budde
  1 sibling, 0 replies; 3+ messages in thread
From: Marc Kleine-Budde @ 2020-02-11 12:46 UTC (permalink / raw)
  To: Thomas Kopp, linux-can

On 2/11/20 1:04 PM, Thomas Kopp wrote:
> I started testing your driver

yeay!

> at 
> https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/log/drivers/net/can/spi/mcp25xxfd?h=v5.4/mcp25xxfd

For testing use the lastest 5.4/mcp25xxfd-YYYYMMDD-X, they will not be
rebased.

> and noticed two small things in the register definitions.

tnx, applied

> Overall TX seems to be working fine - one thing I noticed when
> testing with cangen can0 -b -g 0 and another external node
                           ^^

I've not tested CAN-FD, yet.

> periodically sending frames on the bus (with 2ms gaps) I'm eventually
> getting stuffing errors from which the driver never really recovers.

Con you describe the complete setup?
- which mcp25xxfd?
- exact "ip" command line to configure the mcp
- exact command line on the mcp
- which controller on the other side
- command line on the other side to generate frames

> As soon as the external node then stops sending messages, the
> MCP2518FD node stops sending as well and gets unresponsive (ssh isn't
> possible anymore etc.).

Do you see anything in the kernel logs?

> When resuming the external CAN traffic the node becomes responsive
> again. The driver was compiled with Additional Debugging output and
> Logging enabled. Ifconfig doesn't show any RX/TX errors and shows
> plausible numbers for packets transmitted/received. Am I chasing
> ghosts here or have you encountered similar behaviour?

With two mcp2518fd on the same machine connected to each other, CAN-2.0
mode, but no third station and a specific test I see errors as well. The
controller finally not sending anymore, however the system keeps
responsive. I've to debug this further.

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 |

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

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

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-11 12:04 [PATCH] can: mcp25xxfd: minor register definition fixes Thomas Kopp
2020-02-11 12:24 ` Marc Kleine-Budde
2020-02-11 12:46 ` 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.