From: Bartlomiej Zolnierkiewicz <B.Zolnierkiewicz@elka.pw.edu.pl>
To: Francois Romieu <romieu@fr.zoreil.com>,
Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2004@gmx.net>
Cc: Brian Lazara <blazara@nvidia.com>,
Christoph Hellwig <hch@infradead.org>,
Manfred Spraul <manfred@colorfullife.com>,
Andrew de Quincey <adq@lidskialf.net>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] new device support for forcedeth.c second try
Date: Sat, 19 Jun 2004 16:15:48 +0200 [thread overview]
Message-ID: <200406191615.48903.bzolnier@elka.pw.edu.pl> (raw)
In-Reply-To: <20040619155551.A1517@electric-eye.fr.zoreil.com>
On Saturday 19 of June 2004 15:55, Francois Romieu wrote:
> Carl-Daniel Hailfinger <c-d.hailfinger.kernel.2004@gmx.net> :
> [...]
>
> > +static int phy_reset(struct net_device *dev)
> > +{
> > + struct fe_priv *np = get_nvpriv(dev);
> > + u32 miicontrol;
> > + u32 microseconds = 0;
> > + u32 milliseconds = 0;
> > +
> > + miicontrol = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
> > + miicontrol |= BMCR_RESET;
> > + if (mii_rw(dev, np->phyaddr, MII_BMCR, miicontrol)) {
> > + return -1;
> > + }
> > +
> > + //wait for 500ms
> > + mdelay(500);
> > +
> > + //must wait till reset is deasserted
> > + while (miicontrol & BMCR_RESET) {
> > + udelay(NV_MIIBUSY_DELAY);
> > + miicontrol = mii_rw(dev, np->phyaddr, MII_BMCR, MII_READ);
> > + microseconds++;
> > + if (microseconds == 20) {
> > + microseconds = 0;
> > + milliseconds++;
> > + }
> > + if (milliseconds > 50)
> > + return -1;
> > + }
> > + return 0;
> > +}
>
> Afaiks this function is not called from a spinlocked nor is it
> time-critical. You should make it use schedule_timeout().
msleep()
next prev parent reply other threads:[~2004-06-19 14:11 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-06-19 13:21 Carl-Daniel Hailfinger
2004-06-19 13:55 ` Francois Romieu
2004-06-19 14:15 ` Bartlomiej Zolnierkiewicz [this message]
2004-06-19 14:35 ` Carl-Daniel Hailfinger
2004-06-19 14:56 ` Bartlomiej Zolnierkiewicz
2004-06-19 15:08 ` Francois Romieu
2004-06-19 16:18 ` Manfred Spraul
2004-06-19 16:50 ` Carl-Daniel Hailfinger
2004-06-19 16:56 ` Christoph Hellwig
2004-06-21 3:06 ` [PATCH] new device support for forcedeth.c third try Carl-Daniel Hailfinger
2004-06-21 17:10 [PATCH] new device support for forcedeth.c second try Brian Lazara
2004-06-21 17:36 ` Carl-Daniel Hailfinger
2004-06-21 19:00 ` Kalin KOZHUHAROV
2004-06-21 19:48 ` Carl-Daniel Hailfinger
2004-06-21 21:38 ` Kalin KOZHUHAROV
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=200406191615.48903.bzolnier@elka.pw.edu.pl \
--to=b.zolnierkiewicz@elka.pw.edu.pl \
--cc=adq@lidskialf.net \
--cc=blazara@nvidia.com \
--cc=c-d.hailfinger.kernel.2004@gmx.net \
--cc=hch@infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manfred@colorfullife.com \
--cc=romieu@fr.zoreil.com \
/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
all inboxes | Powered by JetHome®