Hi Geert,
Thanks for the feedback.
-----Original Message----- From: Geert Uytterhoeven geert@linux-m68k.org Sent: 10 March 2025 09:03 Subject: Re: [PATCH v2 2/2] can: rcar_canfd: Fix page entries in the AFL list
Hi Biju,
On Sat, 8 Mar 2025 at 07:30, Biju Das biju.das.jz@bp.renesas.com wrote:
Subject: Re: [PATCH v2 2/2] can: rcar_canfd: Fix page entries in the AFL list
On Thu, 20 Feb 2025 at 10:45, Biju Das biju.das.jz@bp.renesas.com wrote:
There are a total of 96 AFL pages and each page has 16 entries with registers CFDGAFLIDr, CFDGAFLMr, CFDGAFLP0r, CFDGAFLP1r holding the rule entries (r = 0..15).
Currently, RCANFD_GAFL* macros use a start variable to find AFL entries, which is incorrect as the testing on RZ/G3E shows ch1 and ch4 gets a start value of 0 and the register contents are overwritten.
Fix this issue by using rule_entry corresponding to the channel to find the page entries in the AFL list.
Fixes: dd3bd23eb438 ("can: rcar_canfd: Add Renesas R-Car CAN FD driver") Cc: stable@vger.kernel.org Signed-off-by: Biju Das biju.das.jz@bp.renesas.com
Thanks for your patch!
This finally fixes CAN2 and CAN3 on the White Hawk and White Hawk Single development boards based on R-Car V4H with 8 CAN channels (the transceivers for CAN4-7 are not mounted), so Tested-by: Geert Uytterhoeven geert+renesas@glider.be
Thanks for testing.
So, the fix now works on 3 different boards with channel number > 2 RZ/G3E SMARC(6 channels), White Hawk and White Hawk Single development boards based on R-Car V4H(8 Channels).
Note that only channels 0-3 are tested on White Hawk, as the latter have no transceivers mounted.
Note to self: test channels 4-7 on the CAN board connector, using a transceiver-less bus from Siemens ApNote AP2921.
Unfortunately, it does not fix CAN2 and CAN3 on the Gray Hawk Single development board, which is based on R-Car V4M with 4 CAN channels.
Q1) Does it worked with downstream BSP?
IIRC, it did not at the time CAN support for R-Car V4M was upstreamed.
Maybe we need to check with R-Car BSP people to confirm? Let me check internally for contact person of the R-Car V4M BSP.
Q2) Does it by chance is in standby mode?
You mean the transceiver?
Yes, for some boards. we need to toggle GPIO to move it from stand by to normal mode, so that it can start communication.
All channels but channel zero use the same type of transceiver, and similar wiring. There might still be a pin control bug, though.
Maybe checking with BSP team will confirm this.
Q3) Does it work if you just configure single channel by connecting to an external CAN device?
Haven't tried that yet, same for logic analyzer. (before this patch, the logic analyzer showed that channel 2 did not seem to work at all, and channel 3 worked for transmit only, but that info probably doesn't help much :^).
When I tried without this patch on RZ/G3E, using 1 channel ( disabling other one) always worked.
Q4) if you are testing in loopback mode, is failure happens CAN2->CAN3 or CAN3>CAN2?
Fails in both directions.
On RZ/G3E SMARC, without this patch. CAN2->CAN3 fails. But CAN3>CAN2 is mirroring messages, and I received 2 messages, when I sent 1.
Cheers, Biju