linux-can.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Mendez, Judith" <jm@ti.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	<linux-can@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Wolfgang Grandegger <wg@grandegger.com>,
	Andrew Davis <afd@ti.com>, Vignesh Raghavendra <vigneshr@ti.com>,
	Nishanth Menon <nm@ti.com>,
	Chandrasekar Ramakrishnan <rcsekar@samsung.com>,
	<devicetree@vger.kernel.org>, <netdev@vger.kernel.org>
Subject: Re: [RFC PATCH 0/5] Enable multiple MCAN on AM62x
Date: Thu, 20 Apr 2023 10:17:52 -0500	[thread overview]
Message-ID: <19d8ae7f-7b74-a869-a818-93b74d106709@ti.com> (raw)
In-Reply-To: <20230420-scarf-landscape-86202cc821ca-mkl@pengutronix.de>

Hello Marc,

On 4/20/2023 4:36 AM, Marc Kleine-Budde wrote:
> On 19.04.2023 15:40:24, Mendez, Judith wrote:
>> Hello Marc,
>>
>> On 4/19/2023 1:10 AM, Marc Kleine-Budde wrote:
>>> On 18.04.2023 11:15:35, Mendez, Judith wrote:
>>>> Hello Marc,
>>>>
>>>> On 4/14/2023 12:49 PM, Marc Kleine-Budde wrote:
>>>>> On 13.04.2023 17:30:46, Judith Mendez wrote:
>>>>>> On AM62x there is one MCAN in MAIN domain and two in MCU domain.
>>>>>> The MCANs in MCU domain were not enabled since there is no
>>>>>> hardware interrupt routed to A53 GIC interrupt controller.
>>>>>> Therefore A53 Linux cannot be interrupted by MCU MCANs.
>>>>>
>>>>> Is this a general hardware limitation, that effects all MCU domain
>>>>> peripherals? Is there a mailbox mechanism between the MCU and the MAIN
>>>>> domain, would it be possible to pass the IRQ with a small firmware on
>>>>> the MCU? Anyways, that's future optimization.
>>>>
>>>> This is a hardware limitation that affects AM62x SoC and has been carried
>>>> over to at least 1 other SoC. Using the MCU is an idea that we have juggled
>>>> around for a while, we will definitely keep it in mind for future
>>>> optimization. Thanks for your feedback.
>>>
>>> Once you have a proper IRQ de-multiplexer, you can integrate it into the
>>> system with a DT change only. No need for changes in the m_can driver.
>>>
>>
>> Is this a recommendation for the current patch?
> 
> It is a recommendation on how to get around the hardware limitation,
> instead of falling back to polling.
> 
>> The reason I am asking is because adding firmware for the M4 to forward
>> a mailbox with the IRQ to the A53 sounds like a good idea and we have been
>> juggling the idea, but it is not an ideal solution if customers are
>> using the M4 for other purposes like safety.
> 
> Of course, the feasibility of this approach depends on your system
> design.

I understand your concern. Like mentioned, using the M4 approach may not 
be the best solution since some customers use the M4 for various reasons 
that could provide problems for this design.

I think the best way to go would be to enable polling + your suggestion 
of using poll-interval in device tree. If poll-interval is specified, 
then we can enable polling mode for MCAN.

>>>>>> This solution instantiates a hrtimer with 1 ms polling interval
>>>>>> for a MCAN when there is no hardware interrupt. This hrtimer
>>>>>> generates a recurring software interrupt which allows to call the
>>>>>> isr. The isr will check if there is pending transaction by reading
>>>>>> a register and proceed normally if there is.
>>>>>>
>>>>>> On AM62x this series enables two MCU MCAN which will use the hrtimer
>>>>>> implementation. MCANs with hardware interrupt routed to A53 Linux
>>>>>> will continue to use the hardware interrupt as expected.
>>>>>>
>>>>>> Timer polling method was tested on both classic CAN and CAN-FD
>>>>>> at 125 KBPS, 250 KBPS, 1 MBPS and 2.5 MBPS with 4 MBPS bitrate
>>>>>> switching.
>>>>>>
>>>>>> Letency and CPU load benchmarks were tested on 3x MCAN on AM62x.
>>>>>> 1 MBPS timer polling interval is the better timer polling interval
>>>>>> since it has comparable latency to hardware interrupt with the worse
>>>>>> case being 1ms + CAN frame propagation time and CPU load is not
>>>>>> substantial. Latency can be improved further with less than 1 ms
>>>>>> polling intervals, howerver it is at the cost of CPU usage since CPU
>>>>>> load increases at 0.5 ms and lower polling periods than 1ms.
>>>
>>> Have you seen my suggestion of the poll-interval?
>>>
>>> Some Linux input drivers have the property poll-interval, would it make
>>> sense to ass this here too?
>>
>> Looking at some examples, I do think we could implement this poll-interval
>> attribute, then read in the driver and initialize the hrtimer based on this.
>> I like the idea to submit as a future optimization patch, thanks!
> 
> I would like to have the DT bindings in place, as handling legacy DT
> without poll interval adds unnecessary complexity.

Understood, thanks so much for your feedback.

regards,
Judith

      reply	other threads:[~2023-04-20 15:18 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-04-13 22:30 [RFC PATCH 0/5] Enable multiple MCAN on AM62x Judith Mendez
2023-04-13 22:30 ` [RFC PATCH 1/5] arm64: dts: ti: Add AM62x MCAN MAIN domain transceiver overlay Judith Mendez
2023-04-13 22:30 ` [RFC PATCH 2/5] arm64: defconfig: Enable MCAN driver Judith Mendez
2023-04-13 22:30 ` [RFC PATCH 3/5] dt-binding: can: m_can: Remove required interrupt attributes Judith Mendez
2023-04-14  8:00   ` Krzysztof Kozlowski
2023-04-13 22:30 ` [RFC PATCH 4/5] arm64: dts: ti: Enable multiple MCAN for AM62x in MCU MCAN overlay Judith Mendez
2023-04-14  8:01   ` Krzysztof Kozlowski
2023-04-14 18:29     ` Nishanth Menon
2023-04-14 20:44       ` Krzysztof Kozlowski
2023-04-14 22:11         ` Nishanth Menon
2023-04-19 15:54           ` Mendez, Judith
2023-04-13 22:30 ` [RFC PATCH 5/5] can: m_can: Add hrtimer to generate software interrupt Judith Mendez
2023-04-14 18:20   ` Marc Kleine-Budde
2023-04-16 12:33     ` Oliver Hartkopp
2023-04-16 15:35       ` Marc Kleine-Budde
2023-04-16 19:46         ` Oliver Hartkopp
2023-04-17  7:26           ` Marc Kleine-Budde
2023-04-17 17:34             ` Oliver Hartkopp
2023-04-17 19:26               ` Marc Kleine-Budde
2023-04-18 20:59                 ` Mendez, Judith
2023-04-19  6:13                   ` Marc Kleine-Budde
2023-04-19 14:38                     ` Mendez, Judith
2023-04-19 19:06     ` Mendez, Judith
2023-04-14  6:12 ` [RFC PATCH 0/5] Enable multiple MCAN on AM62x Vignesh Raghavendra
2023-04-19 15:12   ` Mendez, Judith
2023-04-14 17:49 ` Marc Kleine-Budde
2023-04-18 16:15   ` Mendez, Judith
2023-04-19  6:10     ` Marc Kleine-Budde
2023-04-19 20:40       ` Mendez, Judith
2023-04-20  9:36         ` Marc Kleine-Budde
2023-04-20 15:17           ` Mendez, Judith [this message]

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=19d8ae7f-7b74-a869-a818-93b74d106709@ti.com \
    --to=jm@ti.com \
    --cc=afd@ti.com \
    --cc=devicetree@vger.kernel.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-can@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=netdev@vger.kernel.org \
    --cc=nm@ti.com \
    --cc=rcsekar@samsung.com \
    --cc=robh+dt@kernel.org \
    --cc=vigneshr@ti.com \
    --cc=wg@grandegger.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;
as well as URLs for NNTP newsgroup(s).