From: Michael Ellerman <mpe@ellerman.id.au>
To: "Cédric Le Goater" <clg@kaod.org>,
"Alexey Kardashevskiy" <aik@ozlabs.ru>,
linuxppc-dev@lists.ozlabs.org
Cc: Alistair Popple <alistair@popple.id.au>,
Daniel Henrique Barboza <danielhb413@gmail.com>,
Greg Kurz <groug@kaod.org>, Nicholas Piggin <npiggin@gmail.com>,
Paul Mackerras <paulus@samba.org>,
David Gibson <david@gibson.dropbear.id.au>
Subject: Re: [PATCH kernel v2] powerpc/xive: Drop deregistered irqs
Date: Tue, 16 Jul 2019 21:54:13 +1000 [thread overview]
Message-ID: <87r26q8aai.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <9bc6b177-e440-1510-ff65-795e4c3c1695@kaod.org>
Cédric Le Goater <clg@kaod.org> writes:
> On 16/07/2019 11:10, Alexey Kardashevskiy wrote:
>> On 16/07/2019 18:59, Cédric Le Goater wrote:
>>> On 15/07/2019 09:11, Alexey Kardashevskiy wrote:
>>>> There is a race between releasing an irq on one cpu and fetching it
>>>> from XIVE on another cpu as there does not seem to be any locking between
>>>> these, probably because xive_irq_chip::irq_shutdown() is supposed to
>>>> remove the irq from all queues in the system which it does not do.
>>>>
>>>> As a result, when such released irq appears in a queue, we take it
>>>> from the queue but we do not change the current priority on that cpu and
>>>> since there is no handler for the irq, EOI is never called and the cpu
>>>> current priority remains elevated (7 vs. 0xff==unmasked). If another irq
>>>> is assigned to the same cpu, then that device stops working until irq
>>>> is moved to another cpu or the device is reset.
>>>>
>>>> This adds a new ppc_md.orphan_irq callback which is called if no irq
>>>> descriptor is found. The XIVE implementation drops the current priority
>>>> to 0xff which effectively unmasks interrupts in a current CPU.
>>>
>>>
>>> The test on generic_handle_irq() catches interrupt events that
>>> were served on a target CPU while the source interrupt was being
>>> shutdown on another CPU.
>>>
>>> The orphan_irq() handler restores the CPPR in such cases.
>>>
>>> This looks OK to me. I would have added some more comments in the
>>> code.
>>
>> Which and where? Thanks,
>
> Above xive_orphan_irq() explaining the complete problem that we are
> addressing. XIVE is not super obvious when looking at the code ...
Yes adding a comment would be good, thanks.
This will also need a Fixes: tag.
cheers
prev parent reply other threads:[~2019-07-16 12:35 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-15 7:11 [PATCH kernel v2] powerpc/xive: Drop deregistered irqs Alexey Kardashevskiy
2019-07-16 8:59 ` Cédric Le Goater
2019-07-16 9:10 ` Alexey Kardashevskiy
2019-07-16 9:14 ` Cédric Le Goater
2019-07-16 11:54 ` Michael Ellerman [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=87r26q8aai.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=aik@ozlabs.ru \
--cc=alistair@popple.id.au \
--cc=clg@kaod.org \
--cc=danielhb413@gmail.com \
--cc=david@gibson.dropbear.id.au \
--cc=groug@kaod.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=npiggin@gmail.com \
--cc=paulus@samba.org \
/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;
as well as URLs for NNTP newsgroup(s).