netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board
@ 2009-12-03 21:30 Ha, Tristram
  2009-12-04  0:05 ` David Miller
  2009-12-04 10:20 ` Ben Dooks
  0 siblings, 2 replies; 5+ messages in thread
From: Ha, Tristram @ 2009-12-03 21:30 UTC (permalink / raw)
  To: Ben Dooks; +Cc: netdev, linux-kernel

From: Tristram Ha <Tristram.Ha@micrel.com>

The Micrel KSZ8851 SNL Ethernet chip is used in the OMAP Beagle Zippy combo board.  Requesting interrupt using level triggering flag hangs the system because the interrupt handling routine is called continually.  Using edge triggering avoids this problem.  As a result, disabling interrupt may not be necessary.

Signed-off-by: Tristram Ha <Tristram.Ha@micrel.com>
---
diff -urpN linux-2.6.32.old/drivers/net/ks8851.c linux-2.6.32.new/drivers/net/ks8851.c
--- linux-2.6.32.old/drivers/net/ks8851.c	2009-11-03 11:37:49.000000000 -0800
+++ linux-2.6.32.new/drivers/net/ks8851.c	2009-12-02 15:31:39.000000000 -0800
@@ -398,7 +398,6 @@ static irqreturn_t ks8851_irq(int irq, v
 {
 	struct ks8851_net *ks = pw;
 
-	disable_irq_nosync(irq);
 	schedule_work(&ks->irq_work);
 	return IRQ_HANDLED;
 }
@@ -611,8 +610,6 @@ static void ks8851_irq_work(struct work_
 	}
 
 	mutex_unlock(&ks->lock);
-
-	enable_irq(ks->netdev->irq);
 }
 
 /**
@@ -1284,7 +1281,7 @@ static int __devinit ks8851_probe(struct
 	ks8851_init_mac(ks);
 	ks->tx_space = ks8851_rdreg16(ks, KS_TXMIR);
 
-	ret = request_irq(spi->irq, ks8851_irq, IRQF_TRIGGER_LOW,
+	ret = request_irq(spi->irq, ks8851_irq, IRQF_TRIGGER_FALLING,
 			  ndev->name, ks);
 	if (ret < 0) {
 		dev_err(&spi->dev, "failed to get irq\n");

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board
  2009-12-03 21:30 [PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board Ha, Tristram
@ 2009-12-04  0:05 ` David Miller
  2009-12-04  1:17   ` Ha, Tristram
  2009-12-04 10:20 ` Ben Dooks
  1 sibling, 1 reply; 5+ messages in thread
From: David Miller @ 2009-12-04  0:05 UTC (permalink / raw)
  To: Tristram.Ha; +Cc: ben, netdev, linux-kernel

From: "Ha, Tristram" <Tristram.Ha@Micrel.Com>
Date: Thu, 3 Dec 2009 13:30:03 -0800

> From: Tristram Ha <Tristram.Ha@micrel.com>
> 
> The Micrel KSZ8851 SNL Ethernet chip is used in the OMAP Beagle Zippy combo board.  Requesting interrupt using level triggering flag hangs the system because the interrupt handling routine is called continually.  Using edge triggering avoids this problem.  As a result, disabling interrupt may not be necessary.
> 
> Signed-off-by: Tristram Ha <Tristram.Ha@micrel.com>

You say "may not be necessary", do you actually know for sure?

This seems questionable, if the interrupt disabling was there
for a reason what has changed to make it such that it is no
longer necessary?

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board
  2009-12-04  0:05 ` David Miller
@ 2009-12-04  1:17   ` Ha, Tristram
  2009-12-21 22:07     ` Ha, Tristram
  0 siblings, 1 reply; 5+ messages in thread
From: Ha, Tristram @ 2009-12-04  1:17 UTC (permalink / raw)
  To: David Miller; +Cc: ben, netdev, linux-kernel

David Miller wrote:
> From: "Ha, Tristram" <Tristram.Ha@Micrel.Com>
> Date: Thu, 3 Dec 2009 13:30:03 -0800
> 
>> From: Tristram Ha <Tristram.Ha@micrel.com>
>> 
>> The Micrel KSZ8851 SNL Ethernet chip is used in the OMAP Beagle Zippy
combo board.  Requesting
>> interrupt using level triggering flag hangs the system because the
interrupt handling routine
>> is called continually.  Using edge triggering avoids this problem.
As a result, disabling
>> interrupt may not be necessary.   
>> 
>> Signed-off-by: Tristram Ha <Tristram.Ha@micrel.com>
> 
> You say "may not be necessary", do you actually know for sure?
> 
> This seems questionable, if the interrupt disabling was there for a
reason what has changed to
> make it such that it is no longer necessary? 

I have tested the KSZ8851 SNL driver using the OMAP Beagle Zippy combo
board, developed by Tin Can Tools.  Ben Dooks, who implemented the
original driver, has his own KSZ8851 SNL evaluation board, but he
probably did not run any performance test on the driver.  I did sent him
the changes before so that he can verify on his board, but I have not
received any response.

So I really do not know if interrupt disabling is necessary or not.  But
from my understanding of the SPI network driver model, it is almost
required the interrupt be edge triggered, as the hardware interrupt
cannot be disabled inside the actual interrupt handling routine.  So if
the interrupt is level triggered, the interrupt routine will be called
continually, and there is no chance for the workqueue to disable the
interrupt.  As the interrupt is edge triggered, I do not think the
interrupt needs to be disabled.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board
  2009-12-03 21:30 [PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board Ha, Tristram
  2009-12-04  0:05 ` David Miller
@ 2009-12-04 10:20 ` Ben Dooks
  1 sibling, 0 replies; 5+ messages in thread
From: Ben Dooks @ 2009-12-04 10:20 UTC (permalink / raw)
  To: Ha, Tristram; +Cc: netdev, linux-kernel

Ha, Tristram wrote:
> From: Tristram Ha <Tristram.Ha@micrel.com>
> 
> The Micrel KSZ8851 SNL Ethernet chip is used in the OMAP Beagle Zippy combo board.  Requesting interrupt using level triggering flag hangs the system because the interrupt handling routine is called continually.  Using edge triggering avoids this problem.  As a result, disabling interrupt may not be necessary.
> 
> Signed-off-by: Tristram Ha <Tristram.Ha@micrel.com>

Making this sort of change could impact other users. I'll
submit a patch to get the interrupt type properly and push
everything else i've got,

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board
  2009-12-04  1:17   ` Ha, Tristram
@ 2009-12-21 22:07     ` Ha, Tristram
  0 siblings, 0 replies; 5+ messages in thread
From: Ha, Tristram @ 2009-12-21 22:07 UTC (permalink / raw)
  To: David Miller; +Cc: ben, netdev, linux-kernel

Ha, Tristram wrote:
> David Miller wrote:
>> 
>> You say "may not be necessary", do you actually know for sure?
>> 
>> This seems questionable, if the interrupt disabling was there for a
>> reason what has changed to make it such that it is no longer
necessary?
> 
> I have tested the KSZ8851 SNL driver using the OMAP Beagle Zippy combo
board, developed by Tin
> Can Tools.  Ben Dooks, who implemented the original driver, has his
own KSZ8851 SNL evaluation
> board, but he probably did not run any performance test on the driver.
I did sent him the
> changes before so that he can verify on his board, but I have not
received any response.   
> 
> So I really do not know if interrupt disabling is necessary or not.
But from my understanding
> of the SPI network driver model, it is almost required the interrupt
be edge triggered, as the
> hardware interrupt cannot be disabled inside the actual interrupt
handling routine.  So if the
> interrupt is level triggered, the interrupt routine will be called
continually, and there is no
> chance for the workqueue to disable the interrupt.  As the interrupt
is edge triggered, I do not
> think the interrupt needs to be disabled.     

The "[PATCH 2.6.33] net: Fix ks8851 snl receive problem" I just
submitted turns off hardware interrupt during interrupt handling.  That
makes the disable_irq() call really unnecessary when the interrupt is
edge-triggered.  The code also works when the interrupt is
level-triggered under Beagle Zippy combo board, but theoretically the
disable_irq() is required when the interrupt is level-triggered.  When I
first worked on the ks8851 driver I was using Linux 2.6.22, and the
level-triggered interrupt code did not work.  That is why I changed the
code to edge-triggered.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-12-21 22:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-03 21:30 [PATCH 2.6.32 3/3] net: Make ks8851 snl work under Beagle Zippy combo board Ha, Tristram
2009-12-04  0:05 ` David Miller
2009-12-04  1:17   ` Ha, Tristram
2009-12-21 22:07     ` Ha, Tristram
2009-12-04 10:20 ` Ben Dooks

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).