Linux-ARM-Kernel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Shah, Tanmay" <tanmays@amd.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>, <tanmay.shah@amd.com>
Cc: <linux-kernel@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>,
	Jassi Brar <jassisinghbrar@gmail.com>,
	Michal Simek <michal.simek@amd.com>, Harini T <harini.t@amd.com>,
	Saeed Nowshadi <saeed.nowshadi@amd.com>
Subject: Re: [Q] zynqmp-ipi-mailbox and SGI interrupts
Date: Fri, 16 Oct 2026 12:30:57 -0500	[thread overview]
Message-ID: <cf779b51-0124-4fde-956e-ddce76ae7dc4@amd.com> (raw)
In-Reply-To: <20261016171029.wSftndCb@linutronix.de>



On 10/16/2026 12:10 PM, Sebastian Andrzej Siewior wrote:
> On 2026-10-16 11:44:07 [-0500], Shah, Tanmay wrote:
>>> And it has to be a per-CPU interrupt? It can't become a regular
>>> interrupt which is not per-CPU? Does the driver at some point access
>>> per-CPU registers?
>>>
>>
>> As per my understanding, it has to be a per-CPU interrupt.
> 
> I see.
> 
>> Driver access those registers via percpu APIs, for example:
>> xlnx_mbox_cpuhp_start() uses enable_percpu_irq(). It is called for each CPU.
> 
> Yes I know that part but this is not the question.
> 
> I meant _why_ the interrupt has to be per-CPU. I'm not sure if this is
> internal wired as such or just configured.
> 

I think the SGI is configured that way in the driver. Probably at the
implementation time couldn't find the better way.

> For instance a timer is using a per-CPU interrupt. While the timer is
> programmed for the next expiry it uses per-CPU registers. So the timer
> accessed from CPU0 is different than the one accessed from CPU1. Once
> the interrupt fires, the processing that follows is different on both
> CPUs.
> 
> Looking through zynqmp_sgi_interrupt() which just invokes
> zynqmp_ipi_interrupt() I don't see the difference. The OP-TEE firmware
> is invoked at least the bits I saw, it just masks the source and moves
> on. So I am not sure what is the difference between the interrupt on
> CPU0 vs CPU1. Both could fire at the same time and handle the same
> request unless the firmware returns a different
> IPI_MB_STATUS_RECV_PENDING bit. I don't see how the remote side would
> make a difference between those two CPUs.
> 

There is no difference between the interrupt on CPU0 vs CPU1. The CPU
affinity is decided by the TF-A when configuring the SGI. The driver has
just lazy implementation where it doesn't check for the SGI's CPU
affinity before configuring it and will assume that SGI can happen for
any CPU. The driver can be improved to find out SGI's CPU affinity and
request SGI only for that particular CPU. But current implementation is
not optimized that way.

I am not expert in the GIC interrupt handling of SGI, but I think your
question is valid. The answer IMHO is the driver's implementation might
not be the most optimized.

Thank you,
Tanmay

> So this is what I am wondering about. Based on your response so far this
> has to be that way.
> 

>>>> Thank you,
>>>> Tanmay
> 
> Sebastian



      reply	other threads:[~2026-10-16 17:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-15  8:39 [Q] zynqmp-ipi-mailbox and SGI interrupts Sebastian Andrzej Siewior
2026-10-16 16:10 ` Shah, Tanmay
2026-10-16 16:23   ` Sebastian Andrzej Siewior
2026-10-16 16:44     ` Shah, Tanmay
2026-10-16 17:10       ` Sebastian Andrzej Siewior
2026-10-16 17:30         ` Shah, Tanmay [this message]

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=cf779b51-0124-4fde-956e-ddce76ae7dc4@amd.com \
    --to=tanmays@amd.com \
    --cc=bigeasy@linutronix.de \
    --cc=harini.t@amd.com \
    --cc=jassisinghbrar@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@amd.com \
    --cc=saeed.nowshadi@amd.com \
    --cc=tanmay.shah@amd.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