mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Thomas Richard <thomas.richard@bootlin.com>
To: Dhruva Gole <d-gole@ti.com>, "Kumar, Udit" <u-kumar1@ti.com>
Cc: Nishanth Menon <nm@ti.com>, Tero Kristo <kristo@kernel.org>,
	Santosh Shilimkar <ssantosh@kernel.org>,
	Michael Turquette <mturquette@baylibre.com>,
	Stephen Boyd <sboyd@kernel.org>,
	Gregory CLEMENT <gregory.clement@bootlin.com>,
	richard.genoud@bootlin.com, Prasanth Mantena <p-mantena@ti.com>,
	Abhash Kumar <a-kumar2@ti.com>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org
Subject: Re: [PATCH v3 2/4] firmware: ti_sci: handle IRQ restore in BOARDCFG_MANAGED mode during resume
Date: Thu, 18 Dec 2025 11:17:06 +0100	[thread overview]
Message-ID: <9ed481c4-0a47-4616-97f6-89f58e423eed@bootlin.com> (raw)
In-Reply-To: <20251217052938.fpgclxhmyydvw7ce@lcpd911>

On 12/17/25 6:29 AM, Dhruva Gole wrote:
> On Dec 16, 2025 at 08:17:24 +0530, Kumar, Udit wrote:
>>
>> On 12/5/2025 7:58 PM, Thomas Richard (TI.com) wrote:
>>> In BOARDCFG_MANAGED mode, the firmware cannot restore IRQs during
>>> resume. This responsibility is delegated to the ti_sci driver,
>>> which maintains an internal list of all requested IRQs. This list
>>> is updated on each set/free operation, and all IRQs are restored
>>> during the resume_noirq() phase.
>>>
>>> Signed-off-by: Thomas Richard (TI.com) <thomas.richard@bootlin.com>

[...]

>>> +
>>> +	hash_for_each_possible_safe(info->irqs, this_irq, tmp_node, node,
>>> +				    ti_sci_irq_hash(&irq_desc)) {
>>> +		if (ti_sci_irq_equal(&irq_desc, &this_irq->desc)) {
>>> +			hlist_del(&this_irq->node);
>>> +			kfree(this_irq);
>>> +			return 0;
>>
>>
>> IMO,  you can restrict saving of irq and list management to fw having
>>
>> BOARDCFG_MANAGED capability.
>>
>> Dhurva ?
> 
> Yes I agree with Udit, we should gate hash operations by firmware capability.
> Everywhere else you'll need to make it conditional accordingly.

ack

> 
> Also, how much is the IRQ count usually? If IRQ count is typically small (< 50),
> then won't a simple linked list be more efficient than a hash table? The
> code becomes a bit more readable too that way IMO.
> Take a call based on if there's really that many IRQs that LL's become
> less practical.
> 

I tested a TI kernel on J721S2 and I got 60 entries. I guess we can
expect this number to grow with the next SOCs. But maybe the test does
not reflect the usual cases.

Best Regards,
Thomas



  reply	other threads:[~2025-12-18 10:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-05 14:28 [PATCH v3 0/4] firmware: ti_sci: Introduce BOARDCFG_MANAGED mode for Jacinto family Thomas Richard (TI.com)
2025-12-05 14:28 ` [PATCH v3 1/4] firmware: ti_sci: add BOARDCFG_MANAGED mode support Thomas Richard (TI.com)
2025-12-16  2:43   ` Kumar, Udit
2025-12-05 14:28 ` [PATCH v3 2/4] firmware: ti_sci: handle IRQ restore in BOARDCFG_MANAGED mode during resume Thomas Richard (TI.com)
2025-12-16  2:47   ` Kumar, Udit
2025-12-17  5:29     ` Dhruva Gole
2025-12-18 10:17       ` Thomas Richard [this message]
2025-12-05 14:28 ` [PATCH v3 3/4] clk: keystone: sci-clk: add restore_context() operation Thomas Richard (TI.com)
2025-12-16  2:55   ` Kumar, Udit
2025-12-05 14:28 ` [PATCH v3 4/4] firmware: ti_sci: restore clock context during resume in BOARDCFG_MANAGED mode Thomas Richard (TI.com)
2025-12-17  6:07   ` Dhruva Gole
2025-12-18 10:19     ` Thomas Richard

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=9ed481c4-0a47-4616-97f6-89f58e423eed@bootlin.com \
    --to=thomas.richard@bootlin.com \
    --cc=a-kumar2@ti.com \
    --cc=d-gole@ti.com \
    --cc=gregory.clement@bootlin.com \
    --cc=kristo@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=nm@ti.com \
    --cc=p-mantena@ti.com \
    --cc=richard.genoud@bootlin.com \
    --cc=sboyd@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=u-kumar1@ti.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®