[PATCH v8 2/4] firmware: ti_sci: add support for restoring IRQs during resume

Thomas Richard thomas.richard at bootlin.com
Mon May 18 08:31:38 PDT 2026


Hello Udit,

On 5/18/26 3:22 PM, Kumar, Udit wrote:
> 
> 
> On 5/13/2026 6:16 PM, Thomas Richard (TI) wrote:
>> Some DM-Firmware are not able to restore the IRQ context after a
>> suspend-resume. The IRQ_CONTEXT_LOST firmware capability has been
>> introduced to identify this characteristic. In this case the
>> 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.
>>
>> Reviewed-by: Dhruva Gole <d-gole at ti.com>
>> Reviewed-by: Kendall Willis <k-willis at ti.com>
>> Signed-off-by: Thomas Richard (TI) <thomas.richard at bootlin.com>
>> ---
>>  drivers/firmware/ti_sci.c | 201 +++++++++++++++++++++++++++++++++++++++++++---
>>  drivers/firmware/ti_sci.h |   3 +
>>  2 files changed, 192 insertions(+), 12 deletions(-)
>>
>> diff --git a/drivers/firmware/ti_sci.c b/drivers/firmware/ti_sci.c
>> index eaeaaae94142..35ee8cc830c8 100644
>> --- a/drivers/firmware/ti_sci.c
>> +++ b/drivers/firmware/ti_sci.c
>> @@ -12,11 +12,13 @@
>>  #include <linux/cpu.h>
>>  #include <linux/debugfs.h>
>>  #include <linux/export.h>
>> +#include <linux/hashtable.h>
>>  #include <linux/io.h>
>>  #include <linux/iopoll.h>
>>  #include <linux/kernel.h>
>>  #include <linux/mailbox_client.h>
>>  #include <linux/module.h>
>> +#include <linux/mutex.h>
>>  #include <linux/of.h>
>>  #include <linux/of_platform.h>
>>  #include <linux/platform_device.h>
> 
> Could you check, recursive header inclusion header warning
> In file included from linux/printk.h,
>                   from linux/srcu.h:85
>                   from linux/notifier.h:16
>                   from linux/reboot.h:6
> -drivers/firmware/ti_sci.c:31: warning: recursive header inclusion
> +drivers/firmware/ti_sci.c:33: warning: recursive header inclusion

This warning was already present. It just means the line changed because
I added some new headers. But this patch did not introduce the recursive
header inclusion.

> 
>> @@ -87,6 +89,16 @@ struct ti_sci_desc {
>>  	int max_msg_size;
>>  };
>>  
>> +/**
>> + * struct ti_sci_irq - Description of allocated irqs
>> + * @node: Link to hash table
>> + * @desc: Description of the irq
>> + */
>> +struct ti_sci_irq {
>> +	struct hlist_node node;
>> +	struct ti_sci_msg_req_manage_irq desc;
>> +};
>> +
>>  /**
>>   * struct ti_sci_info - Structure representing a TI SCI instance
>>   * @dev:	Device pointer
>> @@ -101,6 +113,8 @@ struct ti_sci_desc {
>>   * @chan_rx:	Receive mailbox channel
>>   * @minfo:	Message info
>>   * @node:	list head
>> + * @irqs:	List of allocated irqs
>> + * @irq_lock:	Protection for irq hash list
>>   * @host_id:	Host ID
>>   * @fw_caps:	FW/SoC low power capabilities
>>   * @users:	Number of users of this instance
>> @@ -118,6 +132,8 @@ struct ti_sci_info {
>>  	struct mbox_chan *chan_rx;
>>  	struct ti_sci_xfers_info minfo;
>>  	struct list_head node;
>> +	DECLARE_HASHTABLE(irqs, 8);
>> +	struct mutex irq_lock;
> 
> One of script report errors, you might need to document hashtabke.
> However warning is unrelated
> CHECK: struct mutex definition without commen

mutex and hashtable are documented.
checkpatch returns there is no comment for struct mutex which not true.
It's a false positive.

Best Regards,
Thomas



More information about the linux-arm-kernel mailing list