From: Marc Zyngier <maz@kernel.org>
To: Jason Liu <jason.hui.liu@nxp.com>
Cc: sashal@kernel.org, catalin.marinas@arm.com,
linux-kernel@vger.kernel.org, Sudeep Holla <sudeep.holla@arm.com>,
will@kernel.org, linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH 1/1] arm64: kexec: no need to do irq_chip->irq_mask if it already masked
Date: Thu, 06 Aug 2020 13:25:35 +0100 [thread overview]
Message-ID: <1e4496c263e486be3438f2797630164a@kernel.org> (raw)
In-Reply-To: <VI1PR0402MB38249815EA37338953E8AAC1AE480@VI1PR0402MB3824.eurprd04.prod.outlook.com>
On 2020-08-06 11:05, Jason Liu wrote:
>> -----Original Message-----
>> From: Marc Zyngier <maz@kernel.org>
[...]
>> > No, this patch is not papering over a much deeper issue in the driver.
>> > This is just to make things better for the ARM64 kexec.
>>
>> Yes, I'm sure it is... However:
>>
>> request_irq()
>> <goes into suspend, panic somewhere after having turned the irqchip
>> clock off>
>> if (chip->irq_mask && !irqd_irq_masked(&desc->irq_data))
>> <explodes, as the interrupt isn't masked>
>>
>> This is because the PM in the irqsteer driver is completely busted:
>> request_irq() should get a reference on the driver to prevent it from
>> being
>> suspended. Since you don't implement it correctly, this doesn't happen
>> and
>> your "improvement" doesn't help at all.
>
> The request_irq will get a reference to prevent the irqchip from being
> suspended due to it call
> irq_chip_pm_get(). I am pretty sure we have implemented correctly and
> that is also the common Linux code.
Then it seems you cannot read your own driver. At no point do you
set the parent_device that would give you a fighting chance to
get the device clocked and powered on. How does it work? Magic?
> In order to save power and let the irqchip enter into runtime SUSPEND
> mode, the driver will call free_irq()
> When it was not used(idle). Then free_irq() will decrease the
> reference and let the irqchip enter suspend state.
The reference count on *what*? There is nothing to take a reference
on. So yes, you understand how the core kernel works. But you don't
seem to notice that there is no link between the irq and the device
that implements the controller.
> So, when the irqchip entered suspend, which means there is no user for
> the irqchip and all the irqs were DISABLED + MASKED.
> Due to the runtimePM support for the irqchip, when kexec runs, it will
> sometimes meet the situation that the irqchip is suspend due to
> no users for it. So from either the performance(time cost) or coding
> logic, the machine_kexec_mask_interrupts() should not do
> double mask for the irqs which already masked.
I strongly suggest you start by fixing the damn driver first.
In the meantime, NAK to this patch.
M.
--
Jazz is not dead. It just smells funny...
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-08-06 12:26 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-04 8:56 [PATCH 1/1] arm64: kexec: no need to do irq_chip->irq_mask if it already masked Jason Liu
2020-08-04 10:20 ` Sudeep Holla
2020-08-05 6:30 ` Jason Liu
2020-08-04 10:58 ` Marc Zyngier
2020-08-04 11:38 ` Sudeep Holla
2020-08-05 6:31 ` Jason Liu
2020-08-05 8:17 ` Marc Zyngier
2020-08-06 10:05 ` Jason Liu
2020-08-06 12:25 ` Marc Zyngier [this message]
2020-08-13 6:03 ` Jason Liu
2020-08-13 10:08 ` Marc Zyngier
2020-08-05 8:47 ` Sudeep Holla
2020-08-06 10:09 ` Jason Liu
-- strict thread matches above, loose matches on Subject: below --
2020-07-02 9:27 Jason Liu
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=1e4496c263e486be3438f2797630164a@kernel.org \
--to=maz@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=jason.hui.liu@nxp.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sashal@kernel.org \
--cc=sudeep.holla@arm.com \
--cc=will@kernel.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).