* [PATCH] UPIO_TSI cleanup
@ 2006-09-23 0:39 Al Viro
2006-09-24 15:00 ` Sergei Shtylyov
0 siblings, 1 reply; 2+ messages in thread
From: Al Viro @ 2006-09-23 0:39 UTC (permalink / raw)
To: linuxppc-dev
(le32_to_cpu(x) >> 8) & 0xff is a very odd way to spell (x >> 16) & 0xff,
even if that code is hit only on ppc. The value is host-endian - we've
got it from readl(), after all...
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
---
drivers/serial/8250.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
index 0ae9ced..10c2daa 100644
--- a/drivers/serial/8250.c
+++ b/drivers/serial/8250.c
@@ -320,8 +320,8 @@ #endif
case UPIO_TSI:
if (offset == UART_IIR) {
- tmp = readl((u32 *)(up->port.membase + UART_RX));
- return (cpu_to_le32(tmp) >> 8) & 0xff;
+ tmp = readl(up->port.membase + (UART_IIR & ~3));
+ return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
} else
return readb(up->port.membase + offset);
--
1.4.2.GIT
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] UPIO_TSI cleanup
2006-09-23 0:39 [PATCH] UPIO_TSI cleanup Al Viro
@ 2006-09-24 15:00 ` Sergei Shtylyov
0 siblings, 0 replies; 2+ messages in thread
From: Sergei Shtylyov @ 2006-09-24 15:00 UTC (permalink / raw)
To: Al Viro; +Cc: linuxppc-dev, rmk+serial
Hello.
Al Viro wrote:
> (le32_to_cpu(x) >> 8) & 0xff is a very odd way to spell (x >> 16) & 0xff,
> even if that code is hit only on ppc. The value is host-endian - we've
> got it from readl(), after all...
> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
> ---
> drivers/serial/8250.c | 4 ++--
> 1 files changed, 2 insertions(+), 2 deletions(-)
> diff --git a/drivers/serial/8250.c b/drivers/serial/8250.c
> index 0ae9ced..10c2daa 100644
> --- a/drivers/serial/8250.c
> +++ b/drivers/serial/8250.c
Shouldn't this go to rmk+serial@arm.linux.org.uk instead?
> @@ -320,8 +320,8 @@ #endif
>
> case UPIO_TSI:
> if (offset == UART_IIR) {
> - tmp = readl((u32 *)(up->port.membase + UART_RX));
> - return (cpu_to_le32(tmp) >> 8) & 0xff;
> + tmp = readl(up->port.membase + (UART_IIR & ~3));
> + return (tmp >> 16) & 0xff; /* UART_IIR % 4 == 2 */
> } else
> return readb(up->port.membase + offset);
>
I'd also like to suggest actually writing to IER in the serial_out() even
if the UUE bit is set, jusk mask 2 MSBs off (Xscale UART detection code which
breaks Tsi10x UART sould have been CONFIG_ARM dependent I think). The whole
UPIO_TSI thing looks much like an abuse to me, however it still seems to be a
necessary evil... :-/
WBR, Sergei
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2006-09-24 15:00 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-09-23 0:39 [PATCH] UPIO_TSI cleanup Al Viro
2006-09-24 15:00 ` Sergei Shtylyov
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.