LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: valmiki <valmikibow@gmail.com>
To: Marc Zyngier <marc.zyngier@arm.com>, linux-kernel@vger.kernel.org
Cc: tglx@linutronix.de, jason@lakedaemon.net,
	Catalin Marinas <catalin.marinas@arm.com>
Subject: Re: Affinity for GIC irq line
Date: Thu, 26 Apr 2018 09:19:40 +0530	[thread overview]
Message-ID: <f7958252-8a3f-ae77-f3c9-e4c0686db1dc@gmail.com> (raw)
In-Reply-To: <2d9f0678-ec5c-2b09-7ddd-407dd37c55a1@arm.com>

> On 25/04/18 04:23, valmiki wrote:
>> Hi all,
>>
>> When an IRQ line is set affinity using irq_set_affinity, which calls
>> irq_do_set_affinity, this API copies affinity mask to affinity variable
>> in irq_common_data of this irq descriptor.
>
> It does a wee bit more. Crucially, it contains the line:
>
>         ret = chip->irq_set_affinity(data, mask, force);
Yes, i overlooked this part.
>
>> But as per ARM GICv2 document in order to drive a interrupt to a
>> specific CPU we need to program GICD_ITARGETSRn register.
>>
>> But irq_set_affinity isn't writing to this register.Please correct me if
>> I'm wrong i did not find code for this register being updated in
>> irq_set_affinity flow.
>> So how affinity is being set for an IRQ line ?
>
> I would have though that a function name such as "gic_set_affinity" was
> clear enough?
>
>> If affinity was set successfully on what CPU does asm_do_IRQ run ?
>
> It runs on the CPU that the interrupt targets, I'd say.
Thanks Marc.
How does affinity for virtual irq work ?
For example pci-xgene-msi.c has xgene_msi_set_affinity function which 
sets affinity for each virq.
As per arm64/boot/dts/apm/apm-storm.dtsi they use GICv2.
They are trying to map each virq to specific cpu but already GIC lines 
affinity is set, when this affinity would be used ?

What does
/* Update MSI number to target the new CPU */
irqdata->hwirq = hwirq_to_canonical_hwirq(irqdata->hwirq) + target_cpu;

the above code do ?
Already mapping for hwirq to virq is done by this time for this domain.
Now if hwirq is updated its mapping doesn't it lead to wrong virq ?

Regards,
Valmiki


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus

      reply	other threads:[~2018-04-26  3:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-25  3:23 valmiki
2018-04-25  7:07 ` Marc Zyngier
2018-04-26  3:49   ` valmiki [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=f7958252-8a3f-ae77-f3c9-e4c0686db1dc@gmail.com \
    --to=valmikibow@gmail.com \
    --cc=catalin.marinas@arm.com \
    --cc=jason@lakedaemon.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc.zyngier@arm.com \
    --cc=tglx@linutronix.de \
    --subject='Re: Affinity for GIC irq line' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).