All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: David Miller <davem@davemloft.net>
Cc: mingo@elte.hu, netdev@vger.kernel.org
Subject: Re: drivers/net/enic/vnic_cq.c
Date: Thu, 9 Oct 2008 21:27:55 -0700	[thread overview]
Message-ID: <20081009212755.94fe11f6.akpm@linux-foundation.org> (raw)
In-Reply-To: <20081009.211552.20994950.davem@davemloft.net>

On Thu, 09 Oct 2008 21:15:52 -0700 (PDT) David Miller <davem@davemloft.net> wrote:

> From: Andrew Morton <akpm@linux-foundation.org>
> Date: Thu, 9 Oct 2008 21:12:17 -0700
> 
> > 
> > i386 allmodconfig, all trees applied:
> > 
> > drivers/net/enic/vnic_cq.c: In function 'vnic_cq_init':
> > drivers/net/enic/vnic_cq.c:65: error: implicit declaration of function 'writeq'
> > 
> > I can't immediately find an i386 implementation of writeq.
> 
> There isn't, because only a non-atomic implementation (two writew's)
> is possible.
> 
> So what ends up happening is that every driver that wants readq and
> writeq does this ifdef dance:
> 
> #ifndef readq
> static u64 readq(void __iomem *reg)
> {
> 	return (((u64)readl(reg + 0x4UL) << 32) |
> 		(u64)readl(reg));
> }
> 
> static void writeq(u64 val, void __iomem *reg)
> {
> 	writel(val & 0xffffffff, reg);
> 	writel(val >> 32, reg + 0x4UL);
> }
> #endif
> 
> basically stating that they explicitly understand that these are
> non-atomic and that the driver can handle it.
> 
> But this is completely stupid.  Instead of putting this in every driver
> we should put it in the 32-bit asm/io.h files and guard it with
> some ifdef test, on a macro that the driver can define.

Well OK.



We have a driver which has never been compileable on i386 which has
slipped through at least three sets of fingers only to land on the
usual guy's head.

Someone should write a book about this or something.

  reply	other threads:[~2008-10-10  4:28 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   ` Andrew Morton [this message]
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                 ` 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=20081009212755.94fe11f6.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davem@davemloft.net \
    --cc=mingo@elte.hu \
    --cc=netdev@vger.kernel.org \
    /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.