[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <adaveo7gv69.fsf@cisco.com>
Date: Fri, 01 Sep 2006 13:59:26 -0700
From: Roland Dreier <rdreier@...co.com>
To: "Bryan O'Sullivan" <bos@...hscale.com>
Cc: Andrew Morton <akpm@...l.org>, linux-kernel@...r.kernel.org,
openib-general@...nib.org, Adrian Bunk <bunk@...sta.de>,
"David S. Miller" <davem@...emloft.net>
Subject: Re: [openib-general] 2.6.18-rc5-mm1: drivers/infiniband/hw/amso1100/c2.c compile error
Roland> Yes, I agree that's a good plan, especially the
Roland> documentation part. However I would argue that what's in
Roland> drivers/infiniband/hw/mthca/mthca_doorbell.h is
Roland> legitimate: the driver uses __raw_writeq() when it exists
Roland> and uses two __raw_writel()s properly serialized with a
Roland> device-specific lock to get exactly the atomicity it needs
Roland> on 32-bit archs.
Bryan> On the off chance that you might be arguing that
Bryan> mthca_write64 could be a candidate drop-in for writeq on
Bryan> 32-bit arches:
No, quite the opposite. I'm arguing that the wrappers in mthca do
legitimately belong in a device driver, since they encapsulate
device-specific knowledge about what serialization suffices when an
atomic __raw_writeq() is not available.
Bryan> That approach might work on mthca hardware, but it's not
Bryan> safe in general. The ipath driver requires a proper
Bryan> writeq(), for example, because the hardware will quite
Bryan> legitimately treat 32-bit writes to some registers as
Bryan> separate accesses, and screw things up royally.
Yes, that's an unfortunate feature of the ipath hardware that
apparently makes it impossible to drive on a generic 32-bit architecture.
So perhaps writeq()/__raw_writeq() need to be defined to generate a
single bus cycle to the extent that makes sense. Which would mean
that it's not possible to implement on all architectures.
- R.
--
VGER BF report: H 0
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists