Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Kumar, Udit" <u-kumar1@ti.com>
To: "Thomas Richard (TI)" <thomas.richard@bootlin.com>,
	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>,
	Brian Masney <bmasney@redhat.com>
Cc: Gregory CLEMENT <gregory.clement@bootlin.com>,
	<richard.genoud@bootlin.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>,
	Dhruva Gole <d-gole@ti.com>, Kendall Willis <k-willis@ti.com>,
	<u-kumar1@ti.com>
Subject: Re: [PATCH v8 2/4] firmware: ti_sci: add support for restoring IRQs during resume
Date: Mon, 18 May 2026 18:52:11 +0530	[thread overview]
Message-ID: <495082a3-1a08-45d9-90f0-4723837ec4be@ti.com> (raw)
In-Reply-To: <20260513-ti-sci-jacinto-s2r-restore-irq-v8-2-195b27f91519@bootlin.com>



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@ti.com>
> Reviewed-by: Kendall Willis <k-willis@ti.com>
> Signed-off-by: Thomas Richard (TI) <thomas.richard@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

> @@ -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

>  	u8 host_id;
>  	u64 fw_caps;
>  	/* protected by ti_sci_list_mutex */
> @@ -2301,6 +2317,32 @@ static int ti_sci_manage_irq(const struct ti_sci_handle *handle,
>  	return ret;
>  }
>  
[..]


  reply	other threads:[~2026-05-18 13:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-13 12:46 [PATCH v8 0/4] firmware: ti_sci: Introduce BOARDCFG_MANAGED mode for Jacinto family Thomas Richard (TI)
2026-05-13 12:46 ` [PATCH v8 1/4] firmware: ti_sci: add BOARDCFG_MANAGED mode support Thomas Richard (TI)
2026-05-13 12:46 ` [PATCH v8 2/4] firmware: ti_sci: add support for restoring IRQs during resume Thomas Richard (TI)
2026-05-18 13:22   ` Kumar, Udit [this message]
2026-05-18 15:31     ` Thomas Richard
2026-05-13 12:46 ` [PATCH v8 3/4] clk: keystone: sci-clk: add restore_context() operation Thomas Richard (TI)
2026-05-13 12:46 ` [PATCH v8 4/4] firmware: ti_sci: add support for restoring clock context during resume Thomas Richard (TI)

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=495082a3-1a08-45d9-90f0-4723837ec4be@ti.com \
    --to=u-kumar1@ti.com \
    --cc=a-kumar2@ti.com \
    --cc=bmasney@redhat.com \
    --cc=d-gole@ti.com \
    --cc=gregory.clement@bootlin.com \
    --cc=k-willis@ti.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=richard.genoud@bootlin.com \
    --cc=sboyd@kernel.org \
    --cc=ssantosh@kernel.org \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=thomas.richard@bootlin.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