Re: [PATCH] natsemi: netpoll fixes

2007-03-13 Thread Sergei Shtylyov
Hello. Mark Brown wrote: Subject: natsemi: Fix NAPI for interrupt sharing The interrupt status register for the natsemi chips is clear on read and was read unconditionally from both the interrupt and from the NAPI poll routine, meaning that if the interrupt service routine was called (for

Re: [PATCH] natsemi: netpoll fixes

2007-03-13 Thread Sergei Shtylyov
Hello. Mark Brown wrote: Moving netdev_rx() would fix that one but there's some others too - there's one in the timer routine if the chip crashes. In the case you Erm, sorry, I'm not seeing it -- could you point with finger please? :-) In netdev_timer() when the device is using

Re: [PATCH] natsemi: netpoll fixes

2007-03-13 Thread Mark Brown
On Tue, Mar 13, 2007 at 04:53:54PM +0300, Sergei Shtylyov wrote: Mark Brown wrote: confused and eventually locks up. Before locking up it will usually report one or more oversided packets so this is a useful hint that we should reset the recieve state machine in order to recover from this.

Re: [PATCH] natsemi: netpoll fixes

2007-03-12 Thread Sergei Shtylyov
Hello. Mark Brown wrote: Oops, I was going to recast the patch but my attention switched elsewhere for couple of days, and it slipped into mainline. I'm now preparing a better patch to also protect... Ah, I was also looking at it. I enclose my current patch which appears to work

Re: [PATCH] natsemi: netpoll fixes

2007-03-12 Thread Mark Huth
Mark Brown wrote: On Sat, Mar 10, 2007 at 11:25:05PM +0300, Sergei Shtylyov wrote: Oops, I was going to recast the patch but my attention switched elsewhere for couple of days, and it slipped into mainline. I'm now preparing a better patch to also protect... Ah, I was also

Re: [PATCH] natsemi: netpoll fixes

2007-03-12 Thread Mark Brown
On Mon, Mar 12, 2007 at 04:05:48PM +0300, Sergei Shtylyov wrote: Mark Brown wrote: hands_off is stronger than that - it's used for sync with some of the other code paths like suspend/resume and means don't touch the chip. I've added a new driver local flag instead. I'm not sure it was

Re: [PATCH] natsemi: netpoll fixes

2007-03-12 Thread Sergei Shtylyov
Hello, I wrote: Subject: natsemi: Fix NAPI for interrupt sharing To: Jeff Garzik [EMAIL PROTECTED] Cc: Sergei Shtylyov [EMAIL PROTECTED], Simon Blake [EMAIL PROTECTED], John Philips [EMAIL PROTECTED], netdev@vger.kernel.org The interrupt status register for the natsemi chips is clear on

Re: [PATCH] natsemi: netpoll fixes

2007-03-12 Thread Mark Brown
On Mon, Mar 12, 2007 at 12:05:46PM -0700, Mark Huth wrote: Since the interrupts are enabled as the NAPI-callback exits, and the interrupts are disabled in the isr after the callback is scheduled, this fully avoids the potential race conditions, and requires no locking. If I've benchmarked

Re: [PATCH] natsemi: netpoll fixes

2007-03-11 Thread Mark Brown
On Sat, Mar 10, 2007 at 11:25:05PM +0300, Sergei Shtylyov wrote: Oops, I was going to recast the patch but my attention switched elsewhere for couple of days, and it slipped into mainline. I'm now preparing a better patch to also protect... Ah, I was also looking at it. I enclose my

Re: [PATCH] natsemi: netpoll fixes

2007-03-10 Thread Sergei Shtylyov
Hello. Mark Huth wrote: #ifdef CONFIG_NET_POLL_CONTROLLER static void natsemi_poll_controller(struct net_device *dev) { + struct netdev_private *np = netdev_priv(dev); + disable_irq(dev-irq); - intr_handler(dev-irq, dev); + + /* + * A real interrupt might have already

Re: [PATCH] natsemi: netpoll fixes

2007-03-06 Thread Jeff Garzik
Sergei Shtylyov wrote: Fix two issues in this driver's netpoll path: one usual, with spin_unlock_irq() enabling interrupts which nobody asks it to do (that has been fixed recently in a number of drivers) and one unusual, with poll_controller() method possibly causing loss of interrupts due to

[PATCH] natsemi: netpoll fixes

2007-03-05 Thread Sergei Shtylyov
Fix two issues in this driver's netpoll path: one usual, with spin_unlock_irq() enabling interrupts which nobody asks it to do (that has been fixed recently in a number of drivers) and one unusual, with poll_controller() method possibly causing loss of interrupts due to the interrupt status

Re: [PATCH] natsemi: netpoll fixes

2007-03-05 Thread Mark Brown
On Tue, Mar 06, 2007 at 12:10:08AM +0400, Sergei Shtylyov wrote: #ifdef CONFIG_NET_POLL_CONTROLLER static void natsemi_poll_controller(struct net_device *dev) { + struct netdev_private *np = netdev_priv(dev); + disable_irq(dev-irq); - intr_handler(dev-irq, dev); + +

Re: [PATCH] natsemi: netpoll fixes

2007-03-05 Thread Mark Brown
[Once more with CCs] On Tue, Mar 06, 2007 at 12:10:08AM +0400, Sergei Shtylyov wrote: #ifdef CONFIG_NET_POLL_CONTROLLER static void natsemi_poll_controller(struct net_device *dev) { + struct netdev_private *np = netdev_priv(dev); + disable_irq(dev-irq); -