Linux CAN drivers development
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: Hartley Sweeten <HartleyS@visionengravers.com>,
	Michal Simek <michal.simek@amd.com>,
	Appana Durga Kedareswara rao <appana.durga.rao@xilinx.com>,
	Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>,
	linux-can <linux-can@vger.kernel.org>,
	Michal Simek <michal.simek@xilinx.com>
Cc: Marc Kleine-Budde <mkl@pengutronix.de>
Subject: Re: xlinix_can: bug when sending two RTR frames
Date: Thu, 16 Feb 2023 18:09:58 +0100	[thread overview]
Message-ID: <5b5acff7-30ee-433c-ab59-59da4b371a49@hartkopp.net> (raw)
In-Reply-To: <BY3PR01MB6515CC4390A51A5564C69634D0A09@BY3PR01MB6515.prod.exchangelabs.com>

Hi Michal,

On 2/16/23 16:34, Hartley Sweeten wrote:
> On Thursday, February 16, 2023 4:19 AM, Michal Simek wrote:
>>> On 2/7/23 21:45, Oliver Hartkopp wrote:
>>> Hi xilinx_can maintainers,
>>>>
>>>> Hartley Sweeten reported a bug when sending RTR frames with the
>>>> xilinx_can driver here:
>>>>
>>>> https://github.com/linux-can/can-utils/issues/405#
>>>>
>>>> The problem: When sending a single RTR frame (e.g. with 'cansend can0
>>>> 001#R') nothing happens.
>>>>
>>>> Only after sending a *second* RTR frame with 'cansend can0 001#R' the
>>>> two (pending) RTR-frames are sent directly after each other.
>>>>
>>>> This faulty behavior of RTR frame sending is independent of the time
>>>> gap between the two cansend attempts.
>>
>> I read that thread and I am missing details about Zynq board.
>> Are you using any custom zynq board or any xilinx standard evaluation board?
> 
> The system is a Trenz TE0720 SoM on a custom carrier board.
> 
> CAN0 is routed to EMIO.
> 	Tx -> pin E16 (LVCMOS33)
> 	Rx -> pin F16 (LVCMOS33)
> 
> The CAN implementation on the carrier board is like on the ZC702 (TXS0104 buffer / TJA1040T transceiver).
> 
>> Can you please c&p dt fragment you use?
> 
> All of the can@e0008000 node information is from what is created automatically by PetaLinux.
> 
> This is the node info from 'dtc -I fs /sys/firmware/devicetree/base'
> 
>                  can@e0008000 {
>                          compatible = "xlnx,zynq-can-1.0";
>                          clocks = <0x01 0x13 0x01 0x24>;
>                          tx-fifo-depth = <0x40>;
>                          clock-names = "can_clk\0pclk";
>                          status = "okay";
>                          interrupt-parent = <0x04>;
>                          interrupts = <0x00 0x1c 0x04>;
>                          phandle = <0x1a>;
>                          reg = <0xe0008000 0x1000>;
>                          rx-fifo-depth = <0x40>;
>                  };
> 
>> You are using 5.4 kernel which is quite old. Can you please switch to the latest upstream or 5.15 xilinx?
> 
> Uh.. Difficult.
> 
> I'm using PetaLinux 2020.2 right now and _finally_ have something working with it after spending the last year trying to figure it out.
> 
> I'm a bit nervous about installing a newer version of Vivado/Vitis/PetaLinux right now. And I don't know how to make PetaLinux 2020.2 use a different kernel version.
> 

Thanks for picking up this topic!

I double-checked the code and commits from either

- 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/drivers/net/can/xilinx_can.c?h=linux-5.15.y

- 
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/log/drivers/net/can/xilinx_can.c?h=linux-5.4.y

- 
https://github.com/Xilinx/linux-xlnx/blob/xlnx_rebase_v5.15_LTS/drivers/net/can/xilinx_can.c

- xilinx_can.c from the latest 6.2-rc8

And the code sections relevant for this bug report (in the tx path) - 
especially xcan_write_frame() 
https://github.com/Xilinx/linux-xlnx/blob/xlnx_rebase_v5.15_LTS/drivers/net/can/xilinx_can.c#L569 
- do not differ.

So the bug should show up with all the Linux versions and you should be 
able to see it whatever setup you have on your desk.

Best regards,
Oliver

  reply	other threads:[~2023-02-16 17:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-07 20:45 xlinix_can: bug when sending two RTR frames Oliver Hartkopp
2023-02-07 21:04 ` Marc Kleine-Budde
2023-02-09 17:53 ` Oliver Hartkopp
2023-02-16 11:18   ` Michal Simek
2023-02-16 15:34     ` Hartley Sweeten
2023-02-16 17:09       ` Oliver Hartkopp [this message]
2023-02-17 15:52         ` Hartley Sweeten
2023-02-21 10:53           ` Marc Kleine-Budde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5b5acff7-30ee-433c-ab59-59da4b371a49@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=HartleyS@visionengravers.com \
    --cc=appana.durga.rao@xilinx.com \
    --cc=linux-can@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=michal.simek@xilinx.com \
    --cc=mkl@pengutronix.de \
    --cc=naga.sureshkumar.relli@xilinx.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox