CIP-dev archive mirror
 help / color / mirror / Atom feed
From: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
To: Pavel Machek <pavel@denx.de>,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>
Cc: "cip-dev@lists.cip-project.org" <cip-dev@lists.cip-project.org>,
	Prabhakar Mahadev Lad <prabhakar.mahadev-lad.rj@bp.renesas.com>,
	Biju Das <biju.das.jz@bp.renesas.com>
Subject: Backporting Renesas IA55 IRQC driver
Date: Fri, 15 Mar 2024 15:18:56 +0000	[thread overview]
Message-ID: <TYCPR01MB64784B67B1AD38E99F08C2ED9F282@TYCPR01MB6478.jpnprd01.prod.outlook.com> (raw)

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.

             reply	other threads:[~2024-03-15 15:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-15 15:18 Claudiu Beznea [this message]
2024-03-15 18:31 ` Backporting Renesas IA55 IRQC driver 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

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=TYCPR01MB64784B67B1AD38E99F08C2ED9F282@TYCPR01MB6478.jpnprd01.prod.outlook.com \
    --to=claudiu.beznea.uj@bp.renesas.com \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --cc=pavel@denx.de \
    --cc=prabhakar.mahadev-lad.rj@bp.renesas.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 read-only IMAP folder(s) and NNTP newsgroup(s).