[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <n7na4pl6xfhwdk3xq3ulwrxm5d32kdub44otuk7avwjgb32sjz@erqbkyzhohqv>
Date: Mon, 25 Aug 2025 15:33:57 +0800
From: Inochi Amaoto <inochiama@...il.com>
To: Chen Wang <unicornxw@...il.com>, u.kleine-koenig@...libre.com,
aou@...s.berkeley.edu, unicorn_wang@...look.com, conor+dt@...nel.org,
inochiama@...il.com, krzk+dt@...nel.org, looong.bin@...il.com, palmer@...belt.com,
paul.walmsley@...ive.com, robh@...nel.org, tglx@...utronix.de, sycamoremoon376@...il.com,
devicetree@...r.kernel.org, linux-kernel@...r.kernel.org, linux-riscv@...ts.infradead.org,
sophgo@...ts.linux.dev
Subject: Re: [PATCH 1/4] irqchip/sg2042-msi: Improve the logic of obtaining
msi-ranges parameters
On Mon, Aug 25, 2025 at 02:55:03PM +0800, Chen Wang wrote:
> From: Chen Wang <unicorn_wang@...look.com>
>
> Get the arguments of msi-ranges by specifying nargs directly instead of
> using nargs_prop. This only takes one step, unlike the previous two
> steps to get the values of all the arguments.
>
> Signed-off-by: Chen Wang <unicorn_wang@...look.com>
> ---
> drivers/irqchip/irq-sg2042-msi.c | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/irqchip/irq-sg2042-msi.c b/drivers/irqchip/irq-sg2042-msi.c
> index 3b13dbbfdb51..5249afd93b4a 100644
> --- a/drivers/irqchip/irq-sg2042-msi.c
> +++ b/drivers/irqchip/irq-sg2042-msi.c
> @@ -276,17 +276,9 @@ static int sg2042_msi_probe(struct platform_device *pdev)
> data->doorbell_addr = res->start;
>
> ret = fwnode_property_get_reference_args(dev_fwnode(dev), "msi-ranges",
> - "#interrupt-cells", 0, 0, &args);
> + NULL, 3, 0, &args);
Why using a fixed range here? I see no improvement. I think using #interrupt-cells
is just OK.
Regards,
Inochi
> if (ret) {
> - dev_err(dev, "Unable to parse MSI vec base\n");
> - return ret;
> - }
> - fwnode_handle_put(args.fwnode);
> -
> - ret = fwnode_property_get_reference_args(dev_fwnode(dev), "msi-ranges", NULL,
> - args.nargs + 1, 0, &args);
> - if (ret) {
> - dev_err(dev, "Unable to parse MSI vec number\n");
> + dev_err(dev, "Unable to parse MSI Ranges\n");
> return ret;
> }
>
> @@ -298,7 +290,7 @@ static int sg2042_msi_probe(struct platform_device *pdev)
> }
>
> data->irq_first = (u32)args.args[0];
> - data->num_irqs = (u32)args.args[args.nargs - 1];
> + data->num_irqs = (u32)args.args[2];
>
> mutex_init(&data->msi_map_lock);
>
> --
> 2.34.1
>
Powered by blists - more mailing lists