netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Garzik <jgarzik@pobox.com>
To: "David S. Miller" <davem@redhat.com>
Cc: netdev@oss.sgi.com, kuznet@ms2.inr.ac.ru
Subject: Re: [PATCH] tg3 locking update (with NAPI overtones)
Date: Tue, 26 Nov 2002 19:53:13 -0500	[thread overview]
Message-ID: <3DE41779.9030804@pobox.com> (raw)
In-Reply-To: <3DE406AE.2000908@pobox.com>

David S. Miller wrote:

> Looks good to me on first glance, testing will confirm
> further :-)

yeppers :)

> Probably, to kill the long delays with locks held, we just
> need to add a PHY config semaphore.  Interrupts that want to
> try and program the PHY just do a down_trylock() on that semaphore
> and defer their work if it cannot be acquired.


I was thinking along similar lines, and you just gave me an idea as well 
:)  Hopefully I can present a patch later on tonight showing these ideas.

For now, just responding to the above, I think there are further needs: 
  even if you acquire that semaphore, you can still wind up a full 
tg3_halt + tg3_init_hw in interrupt context, which means you could be 
there a while.  MAC/firmware init can be expensive, even ignoring the 
phy init.  Also consider the general argument that once you are 
resetting the MAC or phy, you aren't really doing useful RX/TX work; you 
can concentrate on making the slow path simple and safe while knowing 
that the fast path is idle.

So...   I prefer to simply always defer MAC/phy reset if in interrupt 
context.  This allows us to sleep as long as we want during phy and MAC 
init.  If the manual says "poll each block max of 2ms", we can do it 
easily with yield() in a loop or schedule_timeout(), the way God 
intended drivers to sleep :)

	Jeff

  parent reply	other threads:[~2002-11-27  0:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-26 23:41 [PATCH] tg3 locking update (with NAPI overtones) Jeff Garzik
2002-11-26 23:51 ` David S. Miller
2002-11-27  0:53 ` Jeff Garzik [this message]
2002-11-27  7:40   ` Ben Greear
2002-11-28  2:48 ` Jeff Garzik
2002-11-28 10:12 ` Robert Olsson

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=3DE41779.9030804@pobox.com \
    --to=jgarzik@pobox.com \
    --cc=davem@redhat.com \
    --cc=kuznet@ms2.inr.ac.ru \
    --cc=netdev@oss.sgi.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;
as well as URLs for NNTP newsgroup(s).