[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20251107115457.i6tkt466bp62mwp2@whiff>
Date: Fri, 7 Nov 2025 05:54:57 -0600
From: Nishanth Menon <nm@...com>
To: "Thomas Richard (TI.com)" <thomas.richard@...tlin.com>
CC: Tero Kristo <kristo@...nel.org>, Santosh Shilimkar <ssantosh@...nel.org>,
Gregory CLEMENT <gregory.clement@...tlin.com>, <richard.genoud@...tlin.com>,
Udit Kumar <u-kumar1@...com>, Prasanth Mantena <p-mantena@...com>, "Abhash
Kumar" <a-kumar2@...com>, Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
<linux-arm-kernel@...ts.infradead.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RFC 2/2] firmware: ti_sci: handle IRQ restore in
BOARDCFG_MANAGED mode during resume
On 16:44-20251017, 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.
Couple of drive by comments:
clarify why is this not handled by ia / ir driver?
>
> Signed-off-by: Thomas Richard (TI.com) <thomas.richard@...tlin.com>
> ---
> drivers/firmware/ti_sci.c | 143 +++++++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 135 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
> index f9f1a67e8e66b0a4048fae04ce31be54ca5cba7a..a211f8805dd21c7675b8cefd61929ecfda8e0f7f 100644
> --- a/drivers/firmware/ti_sci.c
> +++ b/drivers/firmware/ti_sci.c
> @@ -87,6 +87,16 @@ struct ti_sci_desc {
> int max_msg_size;
[...]
> +
> + irq_desc.valid_params = valid_params;
> + irq_desc.src_id = src_id;
> + irq_desc.src_index = src_index;
> + irq_desc.dst_id = dst_id;
> + irq_desc.dst_host_irq = dst_host_irq;
> + irq_desc.ia_id = ia_id;
> + irq_desc.vint = vint;
> + irq_desc.global_event = global_event;
> + irq_desc.vint_status_bit = vint_status_bit;
> + irq_desc.secondary_host = s_host;
> +
> + list_for_each(this, &info->irqs.list) {
list_for_each_entry_safe ?
How big is this list on a j784s4 class device? is it worth creating a
irq_desc_hash and using a hlist a better option?
> + this_irq = list_entry(this, struct ti_sci_irq, list);
> + if (ti_sci_irq_equal(irq_desc, this_irq->desc)) {
> + list_del(&this_irq->list);
> + kfree(this_irq);
> + break;
> + }
> + }
> +
[...]
> ret = ti_sci_msg_cmd_lpm_wake_reason(&info->handle, &source, &time, &pin, &mode);
> /* Do not fail to resume on error as the wake reason is not critical */
> if (!ret)
> @@ -3961,6 +4085,9 @@ static int ti_sci_probe(struct platform_device *pdev)
> list_add_tail(&info->node, &ti_sci_list);
> mutex_unlock(&ti_sci_list_mutex);
>
> + if (info->fw_caps & MSG_FLAG_CAPS_LPM_BOARDCFG_MANAGED)
> + INIT_LIST_HEAD(&info->irqs.list);
probably not worth doing a conditional initialization here.
--
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3 1A34 DDB5 849D 1736 249D
https://ti.com/opensource
Powered by blists - more mailing lists