public inbox for cip-dev@lists.cip-project.org
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Cc: Pavel Machek <pavel@denx.de>,
	Nobuhiro Iwamatsu <nobuhiro1.iwamatsu@toshiba.co.jp>,
	"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: Re: Backporting Renesas IA55 IRQC driver
Date: Mon, 18 Mar 2024 20:01:17 +0100	[thread overview]
Message-ID: <ZfiPfc9UZGcIL25F@duo.ucw.cz> (raw)
In-Reply-To: <TYCPR01MB6478033DC33FDEA53E2D809D9F2D2@TYCPR01MB6478.jpnprd01.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 2498 bytes --]

Hi!

> > and then arrange new_style_board to be set on machines you converted but
> > nowhere else. Best would be passing that information down the callchain
> > somehow, but you use have global variable or even config option...
> 
> IIUC the proposal here: the of_device_alloc() is called in the
> initialization phase, this being the call stack:
> 
> [    0.057410] Call trace:
> [    0.057438]  dump_backtrace+0x0/0x1c0
> [    0.057453]  show_stack+0x18/0x40
> [    0.057471]  dump_stack+0xe8/0x124
> [    0.057489]  of_device_alloc+0x54/0x1dc
> [    0.057501]  of_platform_device_create_pdata.part.0+0x24/0xc4
> [    0.057520]  of_platform_device_create_pdata+0x74/0xa0
> [    0.057533]  of_platform_bus_create+0x180/0x3e0
> [    0.057545]  of_platform_populate+0x58/0xfc
> [    0.057563]  of_platform_default_populate_init+0xb8/0xdc
> [    0.057576]  do_one_initcall+0x50/0x1c0
> [    0.057596]  kernel_init_freeable+0x230/0x298
> [    0.057609]  kernel_init+0x14/0x118
> [    0.057620]  ret_from_fork+0x10/0x38
> 
> while the IRQ driver is probed and used later, so, I cannot pass
> information from driver to of_device_alloc().
> 
> Based on your proposal, what about the following diff (or something
> similar)? Would it be acceptable for CIP:

This is just a warning workarond, AFAICT, so I guess more will be
needed and I'm not the only stakeholder. We'll need to see whole
series. But this sounds better than 1/ or 2/ alternatives proposed.

> diff --git a/drivers/of/platform.c b/drivers/of/platform.c
> index 43748c6480c8..ddbd46043d46 100644
> --- a/drivers/of/platform.c
> +++ b/drivers/of/platform.c
> @@ -135,7 +135,8 @@ struct platform_device *of_device_alloc(struct device_node *np,
>                         rc = of_address_to_resource(np, i, res);
>                         WARN_ON(rc);
>                 }
> -               if (of_irq_to_resource_table(np, res, num_irq) != num_irq)
> +               if (!of_device_is_compatible(np, "renesas,rzg2l-irqc") &&
> +                   of_irq_to_resource_table(np, res, num_irq) != num_irq)
>                         pr_debug("not all legacy IRQ resources mapped for %pOFn\n",
>                                  np);
>         }
> 
> where "renesas,rzg2l-irqc" is the compatible for IA55 IRQ driver.

Best regards,
								Pavel

-- 
DENX Software Engineering GmbH,        Managing Director: Erika Unter
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

      reply	other threads:[~2024-03-18 19:01 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 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=ZfiPfc9UZGcIL25F@duo.ucw.cz \
    --to=pavel@denx.de \
    --cc=biju.das.jz@bp.renesas.com \
    --cc=cip-dev@lists.cip-project.org \
    --cc=claudiu.beznea.uj@bp.renesas.com \
    --cc=nobuhiro1.iwamatsu@toshiba.co.jp \
    --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