netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "David S. Miller" <davem@davemloft.net>
To: Harald Welte <laforge@gnumonks.org>
Cc: jgarzik@pobox.com, netdev@oss.sgi.com, linuxppc-dev@lists.linuxppc.org
Subject: Re: [PATCH 2.6] Add NAPI support to sungem.c
Date: Tue, 14 Sep 2004 13:52:34 -0700	[thread overview]
Message-ID: <20040914135234.72465d1a.davem@davemloft.net> (raw)
In-Reply-To: <20040914195052.GK8434@sunbeam.de.gnumonks.org>

On Tue, 14 Sep 2004 21:50:52 +0200
Harald Welte <laforge@gnumonks.org> wrote:

> Hi Jeff, thanks for your comments.
> 
> 
> On Tue, Sep 14, 2004 at 11:56:08AM -0400, Jeff Garzik wrote:
> > >+static inline void
> > >+gem_irq_acknowledge(struct gem *gp, unsigned int mask)
> > >+{
> > >+	writel(mask, gp->regs + GREG_IACK);
> > >+}
> > 
> > PCI posting
> 
> I'm not sure whether I need mb() or wmb() ? 

No, it's something else.

If you do something like, as one example:

	/* Chip resets require 40msec settle delay. */
	writel(FOO_RESET, regs + FOO);
	udelay(40);

It's not going to work properly because the writel() can
be delayed quite a long time, so you have to force the
writel() to completion somehow, the usual way is via:

	writel(FOO_RESET, regs + FOO);
	(void) readl(regs + FOO);
	udelay(40);

or similar.  The read back of the register forces the
write to complete on the PCI bus.

But be very careful and don't do the readl() readbacks too
much, especially in critical code paths, because they are
expensive as they cause a full round-trip to occur on the PCI
bus from the cpu.

Make sure you absolutely do need the read back.

Jeff, can you comment on why it is needed in this specific
case of writing the chip interrupt enabling?  I think it might
not be.

  reply	other threads:[~2004-09-14 20:52 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-09-14 15:35 [PATCH 2.6] Add NAPI support to sungem.c Harald Welte
2004-09-14 15:56 ` Jeff Garzik
2004-09-14 19:50   ` Harald Welte
2004-09-14 20:52     ` David S. Miller [this message]
2004-09-14 19:43 ` David S. Miller
2004-09-14 20:02   ` Harald Welte
2004-09-14 20:48     ` David S. Miller
2004-09-14 21:01       ` Jeff Garzik
2004-09-15 16:19         ` Manfred Spraul
2004-09-15  5:50     ` Eric Lemoine
2004-09-15 19:37       ` Harald Welte

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=20040914135234.72465d1a.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=jgarzik@pobox.com \
    --cc=laforge@gnumonks.org \
    --cc=linuxppc-dev@lists.linuxppc.org \
    --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).