linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Richard B. Johnson" <root@chaos.analogic.com>
To: Chris Friesen <cfriesen@nortelnetworks.com>
Cc: linux-kernel@vger.kernel.org, becker@scyld.com
Subject: Re: why this 1ms delay in mdio_read?  (cont'd from "are ioctl calls supposed  to take this long?")
Date: Fri, 6 Jul 2001 14:48:46 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.3.95.1010706143953.5031A-100000@chaos.analogic.com> (raw)
In-Reply-To: <3B4602BA.91C5DAD3@nortelnetworks.com>

On Fri, 6 Jul 2001, Chris Friesen wrote:

> The beginning of mdio_read() in tulip.c goes like this:
> 
> static int mdio_read(struct device *dev, int phy_id, int location)
> {
> 	struct tulip_private *tp = (struct tulip_private *)dev->priv;
> 	int i;
> 	int read_cmd = (0xf6 << 10) | (phy_id << 5) | location;
> 	int retval = 0;
> 	long ioaddr = dev->base_addr;
> 	long mdio_addr = ioaddr + CSR9;
> 
> 	if (tp->chip_id == LC82C168) {
> 		int i = 1000;
> 		outl(0x60020000 + (phy_id<<23) + (location<<18), ioaddr + 0xA0);
> 		inl(ioaddr + 0xA0);
> 		inl(ioaddr + 0xA0);
> 		while (--i > 0)
> 			if ( ! ((retval = inl(ioaddr + 0xA0)) & 0x80000000))
> 				return retval & 0xffff;
> 		return 0xffff;
> 	}
> 
> 	if (tp->chip_id == COMET) {
> 		if (phy_id == 1) {
> 			if (location < 7)
> 				return inl(ioaddr + 0xB4 + (location<<2));
> 			else if (location == 17)
> 				return inl(ioaddr + 0xD0);
> 			else if (location >= 29 && location <= 31)
> 				return inl(ioaddr + 0xD4 + ((location-29)<<2));
> 		}
> 		return 0xffff;
> 	}
> 
> 	mdelay(1); /* One ms delay... */
> 
> 	...rest of code...
> 

What? What kernel version? 
The code here says:
     /* Establish sync by sending at least 32 logic ones */
     for (i = 32; i >=0; i--) {..........}

There is a mdio_delay() between each of the bit operations. This
is required to give time for the chip's internals to set up.

There is no mdelay in any of the code in .../linux/drivers/net/tulip/.

Cheers,
Dick Johnson

Penguin : Linux version 2.4.1 on an i686 machine (799.53 BogoMips).

    I was going to compile a list of innovations that could be
    attributed to Microsoft. Once I realized that Ctrl-Alt-Del
    was handled in the BIOS, I found that there aren't any.



  reply	other threads:[~2001-07-06 18:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-06 13:34 are ioctl calls supposed to take this long? Chris Friesen
2001-07-06 14:41 ` Richard B. Johnson
2001-07-06 15:14   ` Chris Friesen
2001-07-06 15:32     ` Richard B. Johnson
2001-07-06 15:40       ` Chris Friesen
2001-07-06 18:26       ` why this 1ms delay in mdio_read? (cont'd from "are ioctl calls supposed to take this long?") Chris Friesen
2001-07-06 18:48         ` Richard B. Johnson [this message]
2001-07-06 19:35           ` Chris Friesen
2001-07-06 21:41         ` Donald Becker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.3.95.1010706143953.5031A-100000@chaos.analogic.com \
    --to=root@chaos.analogic.com \
    --cc=becker@scyld.com \
    --cc=cfriesen@nortelnetworks.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).