lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dcb37af0-89c5-ec37-5ace-7e4df61724a5@rock-chips.com>
Date:	Tue, 5 Jul 2016 10:08:08 +0800
From:	Shawn Lin <shawn.lin@...k-chips.com>
To:	Marc Zyngier <marc.zyngier@....com>,
	Bjorn Helgaas <bhelgaas@...gle.com>
Cc:	shawn.lin@...k-chips.com, linux-pci@...r.kernel.org,
	Arnd Bergmann <arnd@...db.de>, linux-kernel@...r.kernel.org,
	linux-rockchip@...ts.infradead.org,
	Heiko Stuebner <heiko@...ech.de>,
	Doug Anderson <dianders@...omium.org>,
	Wenrui Li <wenrui.li@...k-chips.com>,
	Rob Herring <robh+dt@...nel.org>, devicetree@...r.kernel.org,
	Brian Norris <briannorris@...omium.org>
Subject: Re: [PATCH v4 2/2] PCI: Rockchip: Add Rockchip PCIe controller
 support

在 2016/7/1 18:32, Marc Zyngier 写道:
> 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@...k-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.
>

Yup, will fix it, thanks.

> 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.
>


-- 
Best Regards
Shawn Lin

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ