diff mbox series

[14/42] PCI: aardvark: Don't mask irq when mapping

Message ID 20210506153153.30454-15-pali@kernel.org (mailing list archive)
State New, archived
Headers show
Series PCI: aardvark: Various driver fixes | expand

Commit Message

Pali Rohár May 6, 2021, 3:31 p.m. UTC
By default, all Legacy INTx interrupts are masked, so there is no need to
mask this interrupt during irq_map callback.

Signed-off-by: Pali Rohár <pali@kernel.org>
Reviewed-by: Marek Behún <kabel@kernel.org>
---
 drivers/pci/controller/pci-aardvark.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Marc Zyngier May 7, 2021, 9:20 a.m. UTC | #1
On Thu, 06 May 2021 16:31:25 +0100,
Pali Rohár <pali@kernel.org> wrote:
> 
> By default, all Legacy INTx interrupts are masked, so there is no need to
> mask this interrupt during irq_map callback.

What guarantees that they are actually masked? I would actually assume
that the HW is in an unknown state at boot time.

Thanks,

	M.

> 
> Signed-off-by: Pali Rohár <pali@kernel.org>
> Reviewed-by: Marek Behún <kabel@kernel.org>
> ---
>  drivers/pci/controller/pci-aardvark.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
> index 2aced8c9ae9f..08f1157e1c5e 100644
> --- a/drivers/pci/controller/pci-aardvark.c
> +++ b/drivers/pci/controller/pci-aardvark.c
> @@ -940,7 +940,6 @@ static int advk_pcie_irq_map(struct irq_domain *h,
>  {
>  	struct advk_pcie *pcie = h->host_data;
>  
> -	advk_pcie_irq_mask(irq_get_irq_data(virq));
>  	irq_set_status_flags(virq, IRQ_LEVEL);
>  	irq_set_chip_and_handler(virq, &pcie->irq_chip,
>  				 handle_level_irq);
> -- 
> 2.20.1
> 
>
Pali Rohár May 7, 2021, 9:27 a.m. UTC | #2
On Friday 07 May 2021 10:20:39 Marc Zyngier wrote:
> On Thu, 06 May 2021 16:31:25 +0100,
> Pali Rohár <pali@kernel.org> wrote:
> > 
> > By default, all Legacy INTx interrupts are masked, so there is no need to
> > mask this interrupt during irq_map callback.
> 
> What guarantees that they are actually masked? I would actually assume
> that the HW is in an unknown state at boot time.

Function advk_pcie_setup_hw() during driver probing mask all INTx interrupts:

    advk_writel(pcie, PCIE_ISR1_ALL_MASK, PCIE_ISR1_MASK_REG);

Individual INTx interrupts can be unmasked by PCIE_ISR1_INTX_ASSERT(val).
Macro PCIE_ISR1_ALL_MASK contains all bits from PCIE_ISR1_INTX_ASSERT(val).

> Thanks,
> 
> 	M.
> 
> > 
> > Signed-off-by: Pali Rohár <pali@kernel.org>
> > Reviewed-by: Marek Behún <kabel@kernel.org>
> > ---
> >  drivers/pci/controller/pci-aardvark.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
> > index 2aced8c9ae9f..08f1157e1c5e 100644
> > --- a/drivers/pci/controller/pci-aardvark.c
> > +++ b/drivers/pci/controller/pci-aardvark.c
> > @@ -940,7 +940,6 @@ static int advk_pcie_irq_map(struct irq_domain *h,
> >  {
> >  	struct advk_pcie *pcie = h->host_data;
> >  
> > -	advk_pcie_irq_mask(irq_get_irq_data(virq));
> >  	irq_set_status_flags(virq, IRQ_LEVEL);
> >  	irq_set_chip_and_handler(virq, &pcie->irq_chip,
> >  				 handle_level_irq);
> > -- 
> > 2.20.1
> > 
> > 
> 
> -- 
> Without deviation from the norm, progress is not possible.
diff mbox series

Patch

diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c
index 2aced8c9ae9f..08f1157e1c5e 100644
--- a/drivers/pci/controller/pci-aardvark.c
+++ b/drivers/pci/controller/pci-aardvark.c
@@ -940,7 +940,6 @@  static int advk_pcie_irq_map(struct irq_domain *h,
 {
 	struct advk_pcie *pcie = h->host_data;
 
-	advk_pcie_irq_mask(irq_get_irq_data(virq));
 	irq_set_status_flags(virq, IRQ_LEVEL);
 	irq_set_chip_and_handler(virq, &pcie->irq_chip,
 				 handle_level_irq);