mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chen Wang <unicorn_wang@outlook.com>
To: Inochi Amaoto <inochiama@gmail.com>,
	Chen Wang <unicornxw@gmail.com>,
	u.kleine-koenig@baylibre.com, aou@eecs.berkeley.edu,
	conor+dt@kernel.org, krzk+dt@kernel.org, looong.bin@gmail.com,
	palmer@dabbelt.com, paul.walmsley@sifive.com, robh@kernel.org,
	tglx@linutronix.de, sycamoremoon376@gmail.com,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-riscv@lists.infradead.org, sophgo@lists.linux.dev
Subject: Re: [PATCH 1/4] irqchip/sg2042-msi: Improve the logic of obtaining msi-ranges parameters
Date: Mon, 25 Aug 2025 16:22:22 +0800	[thread overview]
Message-ID: <MAUPR01MB110725A1D283DE4D69AEC137DFE3EA@MAUPR01MB11072.INDPRD01.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <n7na4pl6xfhwdk3xq3ulwrxm5d32kdub44otuk7avwjgb32sjz@erqbkyzhohqv>


On 8/25/2025 3:33 PM, Inochi Amaoto wrote:
> On Mon, Aug 25, 2025 at 02:55:03PM +0800, Chen Wang wrote:
>> From: Chen Wang <unicorn_wang@outlook.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@outlook.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.
Ok, I will revert this change.
> 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
>>

  reply	other threads:[~2025-08-25  8:22 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-25  6:54 [PATCH 0/4] irqchip/sg2042-msi: Set irq type according to DT configuration Chen Wang
2025-08-25  6:55 ` [PATCH 1/4] irqchip/sg2042-msi: Improve the logic of obtaining msi-ranges parameters Chen Wang
2025-08-25  7:33   ` Inochi Amaoto
2025-08-25  8:22     ` Chen Wang [this message]
2025-08-25  6:55 ` [PATCH 2/4] irqchip/sg2042-msi: Set irq type according to DT configuration Chen Wang
2025-08-25  6:56 ` [PATCH 3/4] riscv: sophgo: dts: sg2042: change msi irq type to IRQ_TYPE_EDGE_RISING Chen Wang
2025-08-25  6:56 ` [PATCH 4/4] riscv: sophgo: dts: sg2044: " Chen Wang
2025-08-25  7:00   ` Chen Wang

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=MAUPR01MB110725A1D283DE4D69AEC137DFE3EA@MAUPR01MB11072.INDPRD01.PROD.OUTLOOK.COM \
    --to=unicorn_wang@outlook.com \
    --cc=aou@eecs.berkeley.edu \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=inochiama@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-riscv@lists.infradead.org \
    --cc=looong.bin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paul.walmsley@sifive.com \
    --cc=robh@kernel.org \
    --cc=sophgo@lists.linux.dev \
    --cc=sycamoremoon376@gmail.com \
    --cc=tglx@linutronix.de \
    --cc=u.kleine-koenig@baylibre.com \
    --cc=unicornxw@gmail.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

all inboxes | Powered by JetHome®