[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20090421.172547.85702227.davem@davemloft.net>
Date: Tue, 21 Apr 2009 17:25:47 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: rdreier@...co.com
Cc: hpa@...or.com, h.mitake@...il.com, mingo@...e.hu,
tglx@...utronix.de, rpjday@...shcourse.ca,
linux-kernel@...r.kernel.org
Subject: Re: arch/x86/Kconfig selects invalid HAVE_READQ, HAVE_WRITEQ vars
From: Roland Dreier <rdreier@...co.com>
Date: Tue, 21 Apr 2009 10:07:50 -0700
> This only makes sense if we define a 32-bit fallback for
> readq()/writeq() for all 32-bit architectures -- in fact it would be
> good to do it in asm-generic so that there can be a single
> implementation that guarantees that non-atomic versions always do, say,
> low 32 bits then high 32 bits. (So eg niu can use the generic version)
> And then drivers like drivers/infiniband/hw/mthca can be switched to
> "#ifndef writeq_atomic <...hardware specific fallback...>"
I think if you want to do this right you have to provide two versions
of the 32-bit implementations, when the cpu cannot generate full
64-bit transactions. Especially for readq().
Some devices clear the status bits of a 64-bit register when read, so
it might matter deeply whether the top-half or the bottom-half 32-bits
are read first.
The following are ugly names, but something like "readq_hifirst()"
and "readq_lofirst()" and they just get defined to play "readq()"
in situations where a full 64-bit transaction can be generated by
the cpu.
The driver author has to figure out which is appropriate.
And I'm pretty sure similar high-first/low-first issues can exist
for writeq() as well.
--
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