From: Segher Boessenkool <segher@kernel.crashing.org>
To: Scott Wood <scottwood@freescale.com>
Cc: netdev@vger.kernel.org, jgarzik@pobox.com, linuxppc-dev@ozlabs.org
Subject: Re: [PATCH] gianfar: Add I/O barriers when touching buffer descriptor ownership.
Date: Wed, 2 May 2007 02:54:40 +0200 [thread overview]
Message-ID: <65f0b79871a670eb595cca7d78e2f4e9@kernel.crashing.org> (raw)
In-Reply-To: <20070501165542.GA31285@ld0162-tx32.am.freescale.net>
> The hardware must not see that is given ownership of a buffer until it
> is
> completely written, and when the driver receives ownership of a buffer,
> it must ensure that any other reads to the buffer reflect its final
> state. Thus, I/O barriers are added where required.
>
> Without this patch, I have observed GCC reordering the setting of
> bdp->length and bdp->status in gfar_new_skb.
The :::"memory" in the barriers you used prevent GCC
from reordering accesses around the barriers.
AFAICS you need stronger barriers though; {w,r,}mb(),
to prevent _any_ reordering of those memory accesses,
not just the compiler-generated ones.
Segher
WARNING: multiple messages have this Message-ID (diff)
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Scott Wood <scottwood@freescale.com>
Cc: netdev@vger.kernel.org, linuxppc-dev@ozlabs.org, jgarzik@pobox.com
Subject: Re: [PATCH] gianfar: Add I/O barriers when touching buffer descriptor ownership.
Date: Wed, 2 May 2007 02:54:40 +0200 [thread overview]
Message-ID: <65f0b79871a670eb595cca7d78e2f4e9@kernel.crashing.org> (raw)
In-Reply-To: <20070501165542.GA31285@ld0162-tx32.am.freescale.net>
> The hardware must not see that is given ownership of a buffer until it
> is
> completely written, and when the driver receives ownership of a buffer,
> it must ensure that any other reads to the buffer reflect its final
> state. Thus, I/O barriers are added where required.
>
> Without this patch, I have observed GCC reordering the setting of
> bdp->length and bdp->status in gfar_new_skb.
The :::"memory" in the barriers you used prevent GCC
from reordering accesses around the barriers.
AFAICS you need stronger barriers though; {w,r,}mb(),
to prevent _any_ reordering of those memory accesses,
not just the compiler-generated ones.
Segher
next prev parent reply other threads:[~2007-05-02 0:54 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-01 16:55 [PATCH] gianfar: Add I/O barriers when touching buffer descriptor ownership Scott Wood
2007-05-02 0:54 ` Segher Boessenkool [this message]
2007-05-02 0:54 ` Segher Boessenkool
2007-05-02 16:04 ` Scott Wood
2007-05-02 16:04 ` Scott Wood
2007-05-02 18:05 ` Segher Boessenkool
2007-05-02 18:05 ` Segher Boessenkool
-- strict thread matches above, loose matches on Subject: below --
2007-05-16 20:06 Scott Wood
2007-05-18 0:45 ` Jeff Garzik
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=65f0b79871a670eb595cca7d78e2f4e9@kernel.crashing.org \
--to=segher@kernel.crashing.org \
--cc=jgarzik@pobox.com \
--cc=linuxppc-dev@ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=scottwood@freescale.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 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.