All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch 1/2] tulip: fix for 64-bit mips
@ 2006-06-25  8:45 akpm
  2006-06-25  9:31 ` Martin Michlmayr
  0 siblings, 1 reply; 4+ messages in thread
From: akpm @ 2006-06-25  8:45 UTC (permalink / raw)
  To: val_henson; +Cc: jeff, netdev, akpm, maillist, grundler, pdh


From: Jim Gifford <maillist@jg555.com>,
      Grant Grundler <grundler@parisc-linux.org>,
      Peter Horton <pdh@colonel-panic.org>

With Grant's help I was able to get the tulip driver to work with 64 bit 
MIPS.

Cc: Valerie Henson <val_henson@linux.intel.com>

[akpm: this is a previously-nacked patch, but the problem is real]
Signed-off-by: Andrew Morton <akpm@osdl.org>
---

 drivers/net/tulip/media.c      |   22 ++++++++++++++++++++--
 drivers/net/tulip/tulip.h      |    7 +++++--
 drivers/net/tulip/tulip_core.c |    2 +-
 3 files changed, 26 insertions(+), 5 deletions(-)

diff -puN drivers/net/tulip/media.c~tulip-fix-for-64-bit-mips drivers/net/tulip/media.c
--- a/drivers/net/tulip/media.c~tulip-fix-for-64-bit-mips
+++ a/drivers/net/tulip/media.c
@@ -44,8 +44,10 @@ static const unsigned char comet_miireg2
 
 /* MII transceiver control section.
    Read and write the MII registers using software-generated serial
-   MDIO protocol.  See the MII specifications or DP83840A data sheet
-   for details. */
+   MDIO protocol.
+   See IEEE 802.3-2002.pdf (Section 2, Chapter "22.2.4 Management functions")
+   or DP83840A data sheet for more details.
+   */
 
 int tulip_mdio_read(struct net_device *dev, int phy_id, int location)
 {
@@ -272,13 +274,29 @@ void tulip_select_media(struct net_devic
 				int reset_length = p[2 + init_length];
 				misc_info = (u16*)(reset_sequence + reset_length);
 				if (startup) {
+					int timeout = 10;	/* max 1 ms */
 					iowrite32(mtable->csr12dir | 0x100, ioaddr + CSR12);
 					for (i = 0; i < reset_length; i++)
 						iowrite32(reset_sequence[i], ioaddr + CSR12);
+
+					/* flush posted writes */
+					ioread32(ioaddr + CSR12);
+
+					/* Sect 3.10.3 in DP83840A.pdf (p39) */
+					udelay(500);
+
+					/* Section 4.2 in DP83840A.pdf (p43) */
+					/* and IEEE 802.3 "22.2.4.1.1 Reset" */
+					while (timeout-- &&
+						(tulip_mdio_read (dev, phy_num, MII_BMCR) & BMCR_RESET))
+						udelay(100);
 				}
 				for (i = 0; i < init_length; i++)
 					iowrite32(init_sequence[i], ioaddr + CSR12);
+
+				ioread32(ioaddr + CSR12);	/* flush posted writes */
 			}
+
 			tmp_info = get_u16(&misc_info[1]);
 			if (tmp_info)
 				tp->advertising[phy_num] = tmp_info | 1;
diff -puN drivers/net/tulip/tulip_core.c~tulip-fix-for-64-bit-mips drivers/net/tulip/tulip_core.c
--- a/drivers/net/tulip/tulip_core.c~tulip-fix-for-64-bit-mips
+++ a/drivers/net/tulip/tulip_core.c
@@ -22,7 +22,7 @@
 #else
 #define DRV_VERSION	"1.1.13"
 #endif
-#define DRV_RELDATE	"May 11, 2002"
+#define DRV_RELDATE	"December 15, 2004"
 
 
 #include <linux/module.h>
diff -puN drivers/net/tulip/tulip.h~tulip-fix-for-64-bit-mips drivers/net/tulip/tulip.h
--- a/drivers/net/tulip/tulip.h~tulip-fix-for-64-bit-mips
+++ a/drivers/net/tulip/tulip.h
@@ -474,8 +474,11 @@ static inline void tulip_stop_rxtx(struc
 			udelay(10);
 
 		if (!i)
-			printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed\n",
-					pci_name(tp->pdev));
+			printk(KERN_DEBUG "%s: tulip_stop_rxtx() failed"
+					" (CSR5 0x%x CSR6 0x%x)\n",
+					pci_name(tp->pdev),
+					ioread32(ioaddr + CSR5),
+					ioread32(ioaddr + CSR6));
 	}
 }
 
_

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

* Re: [patch 1/2] tulip: fix for 64-bit mips
  2006-06-25  8:45 [patch 1/2] tulip: fix for 64-bit mips akpm
@ 2006-06-25  9:31 ` Martin Michlmayr
  2006-06-25 23:44   ` Grant Grundler
  0 siblings, 1 reply; 4+ messages in thread
From: Martin Michlmayr @ 2006-06-25  9:31 UTC (permalink / raw)
  To: akpm; +Cc: val_henson, jeff, netdev, maillist, grundler, pdh

* akpm@osdl.org <akpm@osdl.org> [2006-06-25 01:45]:
> Cc: Valerie Henson <val_henson@linux.intel.com>
> 
> [akpm: this is a previously-nacked patch, but the problem is real]

And, for the record, Jeff's suggestion as to how to rework the patch:

| Answer hasn't changed since this was last discussed:  sleep, rather than
| delay for an extra-long time.  That's the only hurdle for the tulip
| patches you keep resending.

| Francois Romieu even had an untested patch that attempted this,
| somewhere.

Now we just need someone to complete this work...
-- 
Martin Michlmayr
tbm@cyrius.com

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

* Re: [patch 1/2] tulip: fix for 64-bit mips
  2006-06-25  9:31 ` Martin Michlmayr
@ 2006-06-25 23:44   ` Grant Grundler
  2006-06-26 22:07     ` Valerie Henson
  0 siblings, 1 reply; 4+ messages in thread
From: Grant Grundler @ 2006-06-25 23:44 UTC (permalink / raw)
  To: Martin Michlmayr
  Cc: akpm, val_henson, jeff, netdev, maillist, grundler, pdh, Kyle McMartin

On Sun, Jun 25, 2006 at 10:31:08AM +0100, Martin Michlmayr wrote:
> * akpm@osdl.org <akpm@osdl.org> [2006-06-25 01:45]:
> > Cc: Valerie Henson <val_henson@linux.intel.com>
> > 
> > [akpm: this is a previously-nacked patch, but the problem is real]

ia64 and parisc need the changes to tulip_select_media() too.


> And, for the record, Jeff's suggestion as to how to rework the patch:
> 
> | Answer hasn't changed since this was last discussed:  sleep, rather than
> | delay for an extra-long time.  That's the only hurdle for the tulip
> | patches you keep resending.
> 
> | Francois Romieu even had an untested patch that attempted this,
> | somewhere.
> 
> Now we just need someone to complete this work...

Kyle McMartin has the work queue patch merged into the cvs.parisc-linux.org
CVS tree. It would be easiest to accept this patch and then add the
tulip work queue patch next.

Note that the work queue does NOT solve all of the "spin delay with
interrupts blocked" problems. tulip_stop_rxtx() polls for nearly as long
and tulip_select_media().

thanks,
grant

> -- 
> Martin Michlmayr
> tbm@cyrius.com

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

* Re: [patch 1/2] tulip: fix for 64-bit mips
  2006-06-25 23:44   ` Grant Grundler
@ 2006-06-26 22:07     ` Valerie Henson
  0 siblings, 0 replies; 4+ messages in thread
From: Valerie Henson @ 2006-06-26 22:07 UTC (permalink / raw)
  To: Grant Grundler
  Cc: Martin Michlmayr, akpm, jeff, netdev, maillist, pdh, Kyle McMartin

On Sun, Jun 25, 2006 at 05:44:00PM -0600, Grant Grundler wrote:
> On Sun, Jun 25, 2006 at 10:31:08AM +0100, Martin Michlmayr wrote:
> > * akpm@osdl.org <akpm@osdl.org> [2006-06-25 01:45]:
> > > Cc: Valerie Henson <val_henson@linux.intel.com>
> > > 
> > > [akpm: this is a previously-nacked patch, but the problem is real]
> 
> ia64 and parisc need the changes to tulip_select_media() too.
> 
> 
> > And, for the record, Jeff's suggestion as to how to rework the patch:
> > 
> > | Answer hasn't changed since this was last discussed:  sleep, rather than
> > | delay for an extra-long time.  That's the only hurdle for the tulip
> > | patches you keep resending.
> > 
> > | Francois Romieu even had an untested patch that attempted this,
> > | somewhere.
> > 
> > Now we just need someone to complete this work...
> 
> Kyle McMartin has the work queue patch merged into the cvs.parisc-linux.org
> CVS tree. It would be easiest to accept this patch and then add the
> tulip work queue patch next.

I like the work queue approach; I'll be talking with Kyle and Grant
about it.

> Note that the work queue does NOT solve all of the "spin delay with
> interrupts blocked" problems. tulip_stop_rxtx() polls for nearly as long
> and tulip_select_media().

Let's chat...

-VAL

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

end of thread, other threads:[~2006-06-26 22:10 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-25  8:45 [patch 1/2] tulip: fix for 64-bit mips akpm
2006-06-25  9:31 ` Martin Michlmayr
2006-06-25 23:44   ` Grant Grundler
2006-06-26 22:07     ` Valerie Henson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.