Re: [PATCH v2] PCI: rockchip: Avoid accessing PCIe registers with clocks gated
From: Javier Martinez Canillas
Date: Wed Jun 30 2021 - 18:10:07 EST
On 6/30/21 10:30 PM, Bjorn Helgaas wrote:
> On Wed, Jun 30, 2021 at 09:59:58PM +0200, Javier Martinez Canillas wrote:
[snip]
>>
>> But maybe you can also add a paragraph that mentions the CONFIG_DEBUG_SHIRQ
>> option and shared interrupts? That way, other driver authors could know that
>> by enabling this an underlying problem might be exposed for them to fix.
>
> Good idea, thanks! I added this; is it something like what you had in
> mind?
>
Thanks a lot for doing this rewording. I just have a small nit for the text.
> Found by enabling CONFIG_DEBUG_SHIRQ, which calls the IRQ handler when it
> is being unregistered. An error during the probe path might cause this
> unregistration and IRQ handler execution before the device or data
> structure init has finished.
>
The IRQ handler is not called when unregistered, but it is called when another
handler for the shared IRQ is unregistered. In this particular driver, both a
"pcie-sys" and "pcie-client" handlers are registered, then an error leads to
"pcie-sys" being unregistered and the handler for "pcie-client" being called.
So maybe the following instead?
Found by enabling CONFIG_DEBUG_SHIRQ, which calls the IRQ handlers when a
handler for the shared IRQ is unregistered. An error during the probe path
might cause this unregistration and handler execution before the device or
data structure init has finished.
Best regards,
--
Javier Martinez Canillas
Software Engineer
New Platform Technologies Enablement team
RHEL Engineering