From: Scott Feldman <sfeldma@nuovasystems.com>
To: David Miller <davem@davemloft.net>
Cc: <rdreier@cisco.com>, <akpm@linux-foundation.org>, <mingo@elte.hu>,
<netdev@vger.kernel.org>
Subject: Re: drivers/net/enic/vnic_cq.c
Date: Fri, 10 Oct 2008 15:34:37 -0700 [thread overview]
Message-ID: <C515268D.C81F%sfeldma@nuovasystems.com> (raw)
In-Reply-To: <20081010.115849.215623604.davem@davemloft.net>
On 10/10/08 11:58 AM, "David Miller" <davem@davemloft.net> wrote:
> From: Scott Feldman <sfeldma@nuovasystems.com>
> Date: Fri, 10 Oct 2008 11:29:23 -0700
>> Yes, enic hw provides atomic read/write for 64-bit regs even if register is
>> accessed with 32-bit read/writes.
>
> Sure, and this is why 32-bit arch's don't provide readq/writeq
> implementations,
> things are much more subtle here.
>
> The hardware may allow 2 32-bit writes to a 64-bit register, but...
>
> Are there potential problems when the register is half-way updated?
>
> For example, consider a ring index where the upper and lower 32-bits
> are actually significant. If you change the top part and then the
> bottom part, in the intermediate step there is an invalid state and
> the card might try to access an invalid ring index.
Yes, I'd like to retract my original remark. :( There is a mechanism for
atomic access to a wide register, but it's not enabled for the register
cases in question, and even if it was, an intermediate access to another
address would invalidate the mechanism, as you point out. So...
> Then also, of course, the driver itself has to make sure it does
> enough locking to make sure a partial 64-bit update isn't interrupted
> by a parallel one on another cpu to the same register but I'll assume
> the driver takes care of that here :-)
...There is enough locking.
-scott
next prev parent reply other threads:[~2008-10-10 22:34 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-10 4:12 drivers/net/enic/vnic_cq.c Andrew Morton
2008-10-10 4:15 ` drivers/net/enic/vnic_cq.c David Miller
2008-10-10 4:27 ` drivers/net/enic/vnic_cq.c Andrew Morton
2008-10-10 4:54 ` drivers/net/enic/vnic_cq.c David Miller
2008-10-10 5:05 ` drivers/net/enic/vnic_cq.c David Miller
2008-10-10 5:14 ` drivers/net/enic/vnic_cq.c David Miller
2008-10-10 17:10 ` drivers/net/enic/vnic_cq.c Roland Dreier
2008-10-10 18:29 ` drivers/net/enic/vnic_cq.c Scott Feldman
2008-10-10 18:58 ` drivers/net/enic/vnic_cq.c David Miller
2008-10-10 22:34 ` Scott Feldman [this message]
2008-10-10 5:16 ` drivers/net/enic/vnic_cq.c Andrew Morton
2008-10-10 5:25 ` drivers/net/enic/vnic_cq.c David Miller
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=C515268D.C81F%sfeldma@nuovasystems.com \
--to=sfeldma@nuovasystems.com \
--cc=akpm@linux-foundation.org \
--cc=davem@davemloft.net \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
--cc=rdreier@cisco.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).