Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1435254

Re: [PATCH v4 2/2] PCI: Rockchip: Add Rockchip PCIe controller support

From Marc Zyngier <marc.zyngier@arm.com>
Newsgroups linux.kernel
Subject Re: [PATCH v4 2/2] PCI: Rockchip: Add Rockchip PCIe controller support
Date 2016-07-01 12:50 +0200
Message-ID <rQ4bf-5yT-11@gated-at.bofh.it> (permalink)
References <rPVrj-71-7@gated-at.bofh.it> <rPVrj-71-5@gated-at.bofh.it>
Organization ARM Ltd

Show all headers | View raw


On 01/07/16 02:24, Shawn Lin wrote:
> This patch adds Rockchip PCIe controller support found
> on RK3399 Soc platform.
> 
> Signed-off-by: Shawn Lin <shawn.lin@rock-chips.com>
> 
> ---

[...]

> +static void rockchip_pcie_legacy_int_handler(struct irq_desc *desc)
> +{
> +	struct irq_chip *chip = irq_desc_get_chip(desc);
> +	struct rockchip_pcie_port *port;
> +	u32 reg;
> +
> +	chained_irq_enter(chip, desc);
> +	port = irq_desc_get_handler_data(desc);
> +
> +	reg = pcie_read(port, PCIE_CLIENT_INT_STATUS);
> +	reg = (reg & ROCKCHIP_PCIE_RPIFR1_INTR_MASK) >>
> +	       ROCKCHIP_PCIE_RPIFR1_INTR_SHIFT;
> +	if (reg)
> +		generic_handle_irq(irq_find_mapping(port->irq_domain,
> +						    ffs(reg)));

Can't you get multiple pending interrupts at the same time? Here, you
seem to only process one interrupt at a time, which is going to be
pretty inefficient.

How about something like:

	while (reg) {
		int hwirq = ffs(reg);
		int irq;
		
		reg &= ~BIT(hwirq);
		irq = irq_find_mapping(port->irq_domain, hwirq);
		if (irq)
			generic_handle_irq(irq);
	}

> +	chained_irq_exit(chip, desc);
> +}
> +

Thanks,

	M.
-- 
Jazz is not dead. It just smells funny...

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v4 2/2] PCI: Rockchip: Add Rockchip PCIe controller support Shawn Lin <shawn.lin@rock-chips.com> - 2016-07-01 03:30 +0200
  Re: [PATCH v4 2/2] PCI: Rockchip: Add Rockchip PCIe controller  support Marc Zyngier <marc.zyngier@arm.com> - 2016-07-01 12:50 +0200
    Re: [PATCH v4 2/2] PCI: Rockchip: Add Rockchip PCIe controller  support Shawn Lin <shawn.lin@rock-chips.com> - 2016-07-05 04:10 +0200

csiph-web