* [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()
@ 2015-10-07 20:27 ` Timur Tabi
0 siblings, 0 replies; 6+ messages in thread
From: Timur Tabi @ 2015-10-07 20:27 UTC (permalink / raw)
To: Greg Kroah-Hartman, Russell King, Linus Walleij,
linux-arm-kernel, linux-kernel
The UART_DUMMY_DR_RX status bit is equal to (1 << 16), so a u16 is too small
to hold that value. The result is that UART_DUMMY_DR_RX is never passed
to uart_insert_char(). This means that we're always accepting characters,
even when CREAD (in termios) is not set.
Signed-off-by: Timur Tabi <timur@codeaurora.org>
---
drivers/tty/serial/amba-pl011.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index fd27e98..899a771 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -191,8 +191,8 @@ struct uart_amba_port {
*/
static int pl011_fifo_to_tty(struct uart_amba_port *uap)
{
- u16 status, ch;
- unsigned int flag, max_count = 256;
+ u16 status;
+ unsigned int ch, flag, max_count = 256;
int fifotaken = 0;
while (max_count--) {
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()
@ 2015-10-07 20:27 ` Timur Tabi
0 siblings, 0 replies; 6+ messages in thread
From: Timur Tabi @ 2015-10-07 20:27 UTC (permalink / raw)
To: linux-arm-kernel
The UART_DUMMY_DR_RX status bit is equal to (1 << 16), so a u16 is too small
to hold that value. The result is that UART_DUMMY_DR_RX is never passed
to uart_insert_char(). This means that we're always accepting characters,
even when CREAD (in termios) is not set.
Signed-off-by: Timur Tabi <timur@codeaurora.org>
---
drivers/tty/serial/amba-pl011.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
index fd27e98..899a771 100644
--- a/drivers/tty/serial/amba-pl011.c
+++ b/drivers/tty/serial/amba-pl011.c
@@ -191,8 +191,8 @@ struct uart_amba_port {
*/
static int pl011_fifo_to_tty(struct uart_amba_port *uap)
{
- u16 status, ch;
- unsigned int flag, max_count = 256;
+ u16 status;
+ unsigned int ch, flag, max_count = 256;
int fifotaken = 0;
while (max_count--) {
--
Qualcomm Innovation Center, Inc.
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project.
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()
2015-10-07 20:27 ` Timur Tabi
@ 2015-10-16 12:48 ` Dave Martin
-1 siblings, 0 replies; 6+ messages in thread
From: Dave Martin @ 2015-10-16 12:48 UTC (permalink / raw)
To: Timur Tabi
Cc: Greg Kroah-Hartman, Russell King, Linus Walleij,
linux-arm-kernel, linux-kernel
On Wed, Oct 07, 2015 at 03:27:16PM -0500, Timur Tabi wrote:
> The UART_DUMMY_DR_RX status bit is equal to (1 << 16), so a u16 is too small
> to hold that value. The result is that UART_DUMMY_DR_RX is never passed
> to uart_insert_char(). This means that we're always accepting characters,
> even when CREAD (in termios) is not set.
>
> Signed-off-by: Timur Tabi <timur@codeaurora.org>
> ---
> drivers/tty/serial/amba-pl011.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index fd27e98..899a771 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -191,8 +191,8 @@ struct uart_amba_port {
> */
> static int pl011_fifo_to_tty(struct uart_amba_port *uap)
> {
> - u16 status, ch;
> - unsigned int flag, max_count = 256;
> + u16 status;
> + unsigned int ch, flag, max_count = 256;
> int fifotaken = 0;
FWIW,
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
I guess this tells us something about how often !CREAD is used...
Cheers
---Dave
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()
@ 2015-10-16 12:48 ` Dave Martin
0 siblings, 0 replies; 6+ messages in thread
From: Dave Martin @ 2015-10-16 12:48 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Oct 07, 2015 at 03:27:16PM -0500, Timur Tabi wrote:
> The UART_DUMMY_DR_RX status bit is equal to (1 << 16), so a u16 is too small
> to hold that value. The result is that UART_DUMMY_DR_RX is never passed
> to uart_insert_char(). This means that we're always accepting characters,
> even when CREAD (in termios) is not set.
>
> Signed-off-by: Timur Tabi <timur@codeaurora.org>
> ---
> drivers/tty/serial/amba-pl011.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c
> index fd27e98..899a771 100644
> --- a/drivers/tty/serial/amba-pl011.c
> +++ b/drivers/tty/serial/amba-pl011.c
> @@ -191,8 +191,8 @@ struct uart_amba_port {
> */
> static int pl011_fifo_to_tty(struct uart_amba_port *uap)
> {
> - u16 status, ch;
> - unsigned int flag, max_count = 256;
> + u16 status;
> + unsigned int ch, flag, max_count = 256;
> int fifotaken = 0;
FWIW,
Reviewed-by: Dave Martin <Dave.Martin@arm.com>
I guess this tells us something about how often !CREAD is used...
Cheers
---Dave
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()
2015-10-07 20:27 ` Timur Tabi
@ 2015-10-23 10:04 ` Linus Walleij
-1 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2015-10-23 10:04 UTC (permalink / raw)
To: Timur Tabi
Cc: Greg Kroah-Hartman, Russell King, linux-arm-kernel, linux-kernel
On Wed, Oct 7, 2015 at 10:27 PM, Timur Tabi <timur@codeaurora.org> wrote:
> The UART_DUMMY_DR_RX status bit is equal to (1 << 16), so a u16 is too small
> to hold that value. The result is that UART_DUMMY_DR_RX is never passed
> to uart_insert_char(). This means that we're always accepting characters,
> even when CREAD (in termios) is not set.
>
> Signed-off-by: Timur Tabi <timur@codeaurora.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty()
@ 2015-10-23 10:04 ` Linus Walleij
0 siblings, 0 replies; 6+ messages in thread
From: Linus Walleij @ 2015-10-23 10:04 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Oct 7, 2015 at 10:27 PM, Timur Tabi <timur@codeaurora.org> wrote:
> The UART_DUMMY_DR_RX status bit is equal to (1 << 16), so a u16 is too small
> to hold that value. The result is that UART_DUMMY_DR_RX is never passed
> to uart_insert_char(). This means that we're always accepting characters,
> even when CREAD (in termios) is not set.
>
> Signed-off-by: Timur Tabi <timur@codeaurora.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Yours,
Linus Walleij
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-10-23 10:04 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-07 20:27 [PATCH] serial: amba-pl011: fix incorrect integer size in pl011_fifo_to_tty() Timur Tabi
2015-10-07 20:27 ` Timur Tabi
2015-10-16 12:48 ` Dave Martin
2015-10-16 12:48 ` Dave Martin
2015-10-23 10:04 ` Linus Walleij
2015-10-23 10:04 ` Linus Walleij
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.