* [PATCH] omap: make serial_in_override() address the right uart port
@ 2010-01-05 16:57 Alexander Shishkin
2010-01-05 18:03 ` Tony Lindgren
2010-01-07 0:05 ` Kevin Hilman
0 siblings, 2 replies; 5+ messages in thread
From: Alexander Shishkin @ 2010-01-05 16:57 UTC (permalink / raw)
To: Tony Lindgren
Cc: linux-omap, Alexander Shishkin, Mika Westerberg, Kevin Hilman
Commit f62349ee9788b1d94c55eb6c291d74a1f69bdd9e makes it possible to
have some other than first uart port as ttyS0, which breaks the workaround
serial_in_override() function which will try to address the first uart
port (for ttyS0) and not the one that was initialized.
Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
CC: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
CC: Kevin Hilman <khilman@deeprootsystems.com>
---
arch/arm/mach-omap2/serial.c | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
index 19805a7..8c964be 100644
--- a/arch/arm/mach-omap2/serial.c
+++ b/arch/arm/mach-omap2/serial.c
@@ -125,6 +125,13 @@ static struct plat_serial8250_port serial_platform_data3[] = {
}
};
#endif
+static inline unsigned int __serial_read_reg(struct uart_port *up,
+ int offset)
+{
+ offset <<= up->regshift;
+ return (unsigned int)__raw_readb(up->membase + offset);
+}
+
static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
int offset)
{
@@ -583,11 +590,12 @@ static unsigned int serial_in_override(struct uart_port *up, int offset)
{
if (UART_RX == offset) {
unsigned int lsr;
- lsr = serial_read_reg(omap_uart[up->line].p, UART_LSR);
+ lsr = __serial_read_reg(up, UART_LSR);
if (!(lsr & UART_LSR_DR))
return -EPERM;
}
- return serial_read_reg(omap_uart[up->line].p, offset);
+
+ return __serial_read_reg(up, offset);
}
void __init omap_serial_early_init(void)
--
1.6.3.3
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] omap: make serial_in_override() address the right uart port
2010-01-05 16:57 [PATCH] omap: make serial_in_override() address the right uart port Alexander Shishkin
@ 2010-01-05 18:03 ` Tony Lindgren
2010-01-05 18:09 ` Alexander Shishkin
2010-01-07 0:05 ` Kevin Hilman
1 sibling, 1 reply; 5+ messages in thread
From: Tony Lindgren @ 2010-01-05 18:03 UTC (permalink / raw)
To: Alexander Shishkin; +Cc: linux-omap, Mika Westerberg, Kevin Hilman
* Alexander Shishkin <virtuoso@slind.org> [100105 08:56]:
> Commit f62349ee9788b1d94c55eb6c291d74a1f69bdd9e makes it possible to
> have some other than first uart port as ttyS0, which breaks the workaround
> serial_in_override() function which will try to address the first uart
> port (for ttyS0) and not the one that was initialized.
Nothing wrong with this patch.. But so we're back to having the ports move
around again? That sucks. I wonder if we can initialize dummy 8250 ports
somehow to keep the order correct to avoid confusion.
Regards,
Tony
> Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
> CC: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
> CC: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> arch/arm/mach-omap2/serial.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> index 19805a7..8c964be 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -125,6 +125,13 @@ static struct plat_serial8250_port serial_platform_data3[] = {
> }
> };
> #endif
> +static inline unsigned int __serial_read_reg(struct uart_port *up,
> + int offset)
> +{
> + offset <<= up->regshift;
> + return (unsigned int)__raw_readb(up->membase + offset);
> +}
> +
> static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
> int offset)
> {
> @@ -583,11 +590,12 @@ static unsigned int serial_in_override(struct uart_port *up, int offset)
> {
> if (UART_RX == offset) {
> unsigned int lsr;
> - lsr = serial_read_reg(omap_uart[up->line].p, UART_LSR);
> + lsr = __serial_read_reg(up, UART_LSR);
> if (!(lsr & UART_LSR_DR))
> return -EPERM;
> }
> - return serial_read_reg(omap_uart[up->line].p, offset);
> +
> + return __serial_read_reg(up, offset);
> }
>
> void __init omap_serial_early_init(void)
> --
> 1.6.3.3
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] omap: make serial_in_override() address the right uart port
2010-01-05 18:03 ` Tony Lindgren
@ 2010-01-05 18:09 ` Alexander Shishkin
2010-01-05 18:16 ` Tony Lindgren
0 siblings, 1 reply; 5+ messages in thread
From: Alexander Shishkin @ 2010-01-05 18:09 UTC (permalink / raw)
To: Tony Lindgren; +Cc: linux-omap, Mika Westerberg, Kevin Hilman
On Tue, Jan 05, 2010 at 10:03:01 -0800, Tony Lindgren wrote:
> * Alexander Shishkin <virtuoso@slind.org> [100105 08:56]:
> > Commit f62349ee9788b1d94c55eb6c291d74a1f69bdd9e makes it possible to
> > have some other than first uart port as ttyS0, which breaks the workaround
> > serial_in_override() function which will try to address the first uart
> > port (for ttyS0) and not the one that was initialized.
>
> Nothing wrong with this patch.. But so we're back to having the ports move
> around again? That sucks. I wonder if we can initialize dummy 8250 ports
> somehow to keep the order correct to avoid confusion.
It doesn't seem like any solution to this problem will suck less than the
current one, but let's think about it. My patch only addresses the issue I'm
having with the current solution.
Regards,
--
Alex
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] omap: make serial_in_override() address the right uart port
2010-01-05 18:09 ` Alexander Shishkin
@ 2010-01-05 18:16 ` Tony Lindgren
0 siblings, 0 replies; 5+ messages in thread
From: Tony Lindgren @ 2010-01-05 18:16 UTC (permalink / raw)
To: linux-omap, Mika Westerberg, Kevin Hilman
* Alexander Shishkin <virtuoso@slind.org> [100105 10:08]:
> On Tue, Jan 05, 2010 at 10:03:01 -0800, Tony Lindgren wrote:
> > * Alexander Shishkin <virtuoso@slind.org> [100105 08:56]:
> > > Commit f62349ee9788b1d94c55eb6c291d74a1f69bdd9e makes it possible to
> > > have some other than first uart port as ttyS0, which breaks the workaround
> > > serial_in_override() function which will try to address the first uart
> > > port (for ttyS0) and not the one that was initialized.
> >
> > Nothing wrong with this patch.. But so we're back to having the ports move
> > around again? That sucks. I wonder if we can initialize dummy 8250 ports
> > somehow to keep the order correct to avoid confusion.
>
> It doesn't seem like any solution to this problem will suck less than the
> current one, but let's think about it. My patch only addresses the issue I'm
> having with the current solution.
Agreed, we need to fix the problem first.
Regards,
Tony
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] omap: make serial_in_override() address the right uart port
2010-01-05 16:57 [PATCH] omap: make serial_in_override() address the right uart port Alexander Shishkin
2010-01-05 18:03 ` Tony Lindgren
@ 2010-01-07 0:05 ` Kevin Hilman
1 sibling, 0 replies; 5+ messages in thread
From: Kevin Hilman @ 2010-01-07 0:05 UTC (permalink / raw)
To: Alexander Shishkin; +Cc: Tony Lindgren, linux-omap, Mika Westerberg
Alexander Shishkin <virtuoso@slind.org> writes:
> Commit f62349ee9788b1d94c55eb6c291d74a1f69bdd9e makes it possible to
> have some other than first uart port as ttyS0, which breaks the workaround
> serial_in_override() function which will try to address the first uart
> port (for ttyS0) and not the one that was initialized.
>
> Signed-off-by: Alexander Shishkin <virtuoso@slind.org>
> CC: Mika Westerberg <ext-mika.1.westerberg@nokia.com>
> CC: Kevin Hilman <khilman@deeprootsystems.com>
Acked-by: Kevin Hilman <khilman@deeprootsystems.com>
> ---
> arch/arm/mach-omap2/serial.c | 12 ++++++++++--
> 1 files changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-omap2/serial.c b/arch/arm/mach-omap2/serial.c
> index 19805a7..8c964be 100644
> --- a/arch/arm/mach-omap2/serial.c
> +++ b/arch/arm/mach-omap2/serial.c
> @@ -125,6 +125,13 @@ static struct plat_serial8250_port serial_platform_data3[] = {
> }
> };
> #endif
> +static inline unsigned int __serial_read_reg(struct uart_port *up,
> + int offset)
> +{
> + offset <<= up->regshift;
> + return (unsigned int)__raw_readb(up->membase + offset);
> +}
> +
> static inline unsigned int serial_read_reg(struct plat_serial8250_port *up,
> int offset)
> {
> @@ -583,11 +590,12 @@ static unsigned int serial_in_override(struct uart_port *up, int offset)
> {
> if (UART_RX == offset) {
> unsigned int lsr;
> - lsr = serial_read_reg(omap_uart[up->line].p, UART_LSR);
> + lsr = __serial_read_reg(up, UART_LSR);
> if (!(lsr & UART_LSR_DR))
> return -EPERM;
> }
> - return serial_read_reg(omap_uart[up->line].p, offset);
> +
> + return __serial_read_reg(up, offset);
> }
>
> void __init omap_serial_early_init(void)
> --
> 1.6.3.3
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-01-07 0:05 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-05 16:57 [PATCH] omap: make serial_in_override() address the right uart port Alexander Shishkin
2010-01-05 18:03 ` Tony Lindgren
2010-01-05 18:09 ` Alexander Shishkin
2010-01-05 18:16 ` Tony Lindgren
2010-01-07 0:05 ` Kevin Hilman
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox