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] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 17 Sep 2009 12:11:26 -0700
From:	"Choi, David" <David.Choi@...rel.Com>
To:	"Stephen Hemminger" <shemminger@...tta.com>,
	"Li, Charles" <Charles.Li@...rel.Com>
Cc:	"Greg KH" <greg@...ah.com>, <netdev@...r.kernel.org>,
	"David S. Miller" <davem@...emloft.net>, <Choi@...ah.com>,
	"Jeff Garzik" <jgarzik@...hat.com>
Subject: RE: [PATCH] ks8851_ml ethernet network driver

Hello Stephen Hemminger,

My fix up is as followings;
	Even if the irq is not shared, it is safe not to process
	when there is no interrupt status change in the hardware.

====================
@@ -818,6 +811,11 @@ static irqreturn_t ks_irq(int irq, void 
 	ks_save_cmd_reg(ks);
 
 	status = ks_rdreg16(ks, KS_ISR);
+	if (unlikely(!status)) {
+		ks_restore_cmd_reg(ks);
+		return IRQ_NONE;
+	}
+
 	ks_wrreg16(ks, KS_ISR, status);
 
 	if (likely(status & IRQ_RXI))



Regards,
David J. Choi


-----Original Message-----
From: Stephen Hemminger [mailto:shemminger@...tta.com] 
Sent: Wednesday, September 16, 2009 9:03 PM
To: Li, Charles
Cc: Greg KH; netdev@...r.kernel.org; David S. Miller; Choi@...ah.com;
Choi, David; Jeff Garzik
Subject: Re: [PATCH] ks8851_ml ethernet network driver

On Wed, 16 Sep 2009 19:38:36 -0700
Greg KH <greg@...ah.com> wrote:

> /**
> + * ks_irq - device interrupt handler
> + * @irq: Interrupt number passed from the IRQ hnalder.
> + * @pw: The private word passed to register_irq(), our struct ks_net.
> + *
> + * This is the handler invoked to find out what happened
> + *
> + * Read the interrupt status, work out what needs to be done and then
clear
> + * any of the interrupts that are not needed.
> + */
> +
> +static irqreturn_t ks_irq(int irq, void *pw)
> +{
> +	struct ks_net *ks = pw;
> +	struct net_device *netdev = ks->netdev;
> +	u16 status;
> +
> +	/*this should be the first in IRQ handler */
> +	ks_save_cmd_reg(ks);
> +
> +	status = ks_rdreg16(ks, KS_ISR);
> +	ks_wrreg16(ks, KS_ISR, status);

if status == 0 or status == ~0 then device should not return
IRQ_HANDLED.
In the former case, the IRQ is shared, in later case the device is not
present
on the bus (hotplug).
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ