From: David Miller <davem@davemloft.net>
To: sfeldma@nuovasystems.com
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 11:58:49 -0700 (PDT) [thread overview]
Message-ID: <20081010.115849.215623604.davem@davemloft.net> (raw)
In-Reply-To: <C514ED13.C7D0%sfeldma@nuovasystems.com>
From: Scott Feldman <sfeldma@nuovasystems.com>
Date: Fri, 10 Oct 2008 11:29:23 -0700
> On 10/10/08 10:10 AM, "Roland Dreier" <rdreier@cisco.com> wrote:
>
> > cc'ing Scott so we can make sure that this actually is atomic enough to
> > work with the enic hardware... (Scott, the context is that enic won't
> > build on any architecture that doesn't define writeq and readq, such as
> > 32-bit x86; however the definitions below make it possible that multiple
> > 32-bit writes will be interleaved, eg if an interrupt occurs between the
> > first writel and the second writel)
>
> 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.
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 :-)
next prev parent reply other threads:[~2008-10-10 18:59 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 ` David Miller [this message]
2008-10-10 22:34 ` drivers/net/enic/vnic_cq.c Scott Feldman
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=20081010.115849.215623604.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=akpm@linux-foundation.org \
--cc=mingo@elte.hu \
--cc=netdev@vger.kernel.org \
--cc=rdreier@cisco.com \
--cc=sfeldma@nuovasystems.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).