public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
* Backporting Renesas IA55 IRQC driver
@ 2024-03-15 15:18 Claudiu Beznea
  2024-03-15 18:31 ` Jan Kiszka
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Claudiu Beznea @ 2024-03-15 15:18 UTC (permalink / raw)
  To: Pavel Machek, Nobuhiro Iwamatsu
  Cc: cip-dev@lists.cip-project.org, Prabhakar Mahadev Lad, Biju Das

Hi, CIP maintainers,

I'm trying to backport the IA55 IRQC driver [1] to v5.10.209-cip44.

The controller is connected to GIC and pin controller as follows:

                                          ┌──────────┐          ┌──────────┐
                                          │          │ SPIX     │          │
                                          │          ├─────────►│          │
                                          │          │          │          │
                                          │          │          │          │
                  ┌────────┐IRQ0-7        │  IA55    │          │  GIC     │
     Pin0 ───────►│        ├─────────────►│          │          │          │
                  │        │              │          │ PPIY     │          │
     ...          │  GPIO  │              │          ├─────────►│          │
                  │        │GPIOINT0-127  │          │          │          │
     PinN ───────►│        ├─────────────►│          │          │          │
                  └────────┘              └──────────┘          └──────────┘

While working on mainline driver, my colleague, Prabhakar, found that there
are issues with this kind of hierarchy due to
platform_get_resource(pdev, IORESOURCE_IRQ, ...) which relies on static
allocation of IRQ resources in DT core code causing issues
when using hierarchical interrupt domains with "interrupts" property
in the node as this bypasses the hierarchical setup and messes up the
irq chaining.

As a result he run a cleanup campaign in mainline kernel and changed
drivers from using platform_get_resource(pdev, IORESOURCE_IRQ, ...)
to platform_get_irq(pdev, ...) (see list here [2]) and at the submitting [3].

Now we want to backport the IA55 driver to v5.10.209-cip44 (in the first instance).

At the moment we have 2 working approaches:
1/ backport all the work that Prabhakar did (I counted ~80 commits)
2/ change the mainline IA55 driver to not use the interrupts bindings
   to describe the interrupts (see [4] for the mainline approach)
   but another DT property (we have a working version that uses
   interrupt-map and interrupt-map-mask) and adapt the
   rzg2l_irqc_parse_interrupts() to do the proper mapping

The issue we see with 1 is that it affects multiple drivers but not only Renesas ones.
The issue we see with 2 is that the DT bindings are changed and we don't know
if we should keep the DTB as ABI: should a CIP DTB be able to work with a mainline
kernel? Should a mainline DTB be able to work with a CIP kernel?

Could you please share your knowledge on this?
What solution would you prefer?

Thank you,
Claudiu Beznea

[1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/irqchip/irq-renesas-rzg2l.c
[2] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/log/?qt=grep&q=Use+platform_get_irq%28%29+to+get+the+interrupt
[3] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/drivers/of/platform.c?id=a1a2b7125e1079cfcc13a116aa3af3df2f9e002b
[4] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/devicetree/bindings/interrupt-controller/renesas,rzg2l-irqc.yaml#n196
________________________________

Renesas Electronics Europe GmbH
Registered Office: Arcadiastrasse 10
DE-40472 Duesseldorf
Commercial Registry: Duesseldorf, HRB 3708
Managing Director: Carsten Jauch
VAT-No.: DE 14978647
Tax-ID-No: 105/5839/1793

Legal Disclaimer: This e-mail communication (and any attachment/s) is confidential and contains proprietary information, some or all of which may be legally privileged. It is intended solely for the use of the individual or entity to which it is addressed. Access to this email by anyone else is unauthorized. If you are not the intended recipient, any disclosure, copying, distribution or any action taken or omitted to be taken in reliance on it, is prohibited and may be unlawful.

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

end of thread, other threads:[~2024-03-18 19:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-15 15:18 Backporting Renesas IA55 IRQC driver Claudiu Beznea
2024-03-15 18:31 ` Jan Kiszka
2024-03-18 12:00 ` Pavel Machek
2024-03-18 12:12 ` Pavel Machek
2024-03-18 15:49   ` Claudiu Beznea
2024-03-18 19:01     ` Pavel Machek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox