netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roland Dreier <rdreier@cisco.com>
To: David Miller <davem@davemloft.net>, Scott Feldman <scofeldm@cisco.com>
Cc: akpm@linux-foundation.org, mingo@elte.hu, netdev@vger.kernel.org
Subject: Re: drivers/net/enic/vnic_cq.c
Date: Fri, 10 Oct 2008 10:10:51 -0700	[thread overview]
Message-ID: <adaabdcjrz8.fsf@cisco.com> (raw)
In-Reply-To: <20081009.221426.120533568.davem@davemloft.net> (David Miller's message of "Thu, 09 Oct 2008 22:14:26 -0700 (PDT)")

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)

 > I just pushed the following into net-next-2.6:
 > 
 > enic: Attempt to fix build in 32-bit such as i386.
 > 
 > Such platforms lack readq/writeq but this driver want to call them.
 > 
 > Noticed by Andrew Morton.
 > 
 > Signed-off-by: David S. Miller <davem@davemloft.net>
 > ---
 >  drivers/net/enic/vnic_dev.h |   14 ++++++++++++++
 >  1 files changed, 14 insertions(+), 0 deletions(-)
 > 
 > diff --git a/drivers/net/enic/vnic_dev.h b/drivers/net/enic/vnic_dev.h
 > index 2dcffd3..b9dc182 100644
 > --- a/drivers/net/enic/vnic_dev.h
 > +++ b/drivers/net/enic/vnic_dev.h
 > @@ -27,6 +27,20 @@
 >  #define VNIC_PADDR_TARGET	0x0000000000000000ULL
 >  #endif
 >  
 > +#ifndef readq
 > +static inline u64 readq(void __iomem *reg)
 > +{
 > +	return (((u64)readl(reg + 0x4UL) << 32) |
 > +		(u64)readl(reg));
 > +}
 > +
 > +static inline void writeq(u64 val, void __iomem *reg)
 > +{
 > +	writel(val & 0xffffffff, reg);
 > +	writel(val >> 32, reg + 0x4UL);
 > +}
 > +#endif
 > +
 >  enum vnic_dev_intr_mode {
 >  	VNIC_DEV_INTR_MODE_UNKNOWN,
 >  	VNIC_DEV_INTR_MODE_INTX,
 > -- 
 > 1.5.6.5
 > 
 > --
 > To unsubscribe from this list: send the line "unsubscribe netdev" in
 > the body of a message to majordomo@vger.kernel.org
 > More majordomo info at  http://vger.kernel.org/majordomo-info.html
 > 

  reply	other threads:[~2008-10-10 17:10 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           ` Roland Dreier [this message]
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                 ` 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=adaabdcjrz8.fsf@cisco.com \
    --to=rdreier@cisco.com \
    --cc=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    --cc=scofeldm@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).