* [PATCH] cris: lower the printk level in cris serial driver
@ 2011-09-01 6:14 WANG Cong
2011-09-01 6:35 ` Geert Uytterhoeven
0 siblings, 1 reply; 5+ messages in thread
From: WANG Cong @ 2011-09-01 6:14 UTC (permalink / raw)
To: linux-kernel
Cc: akpm, Mikael Starvik, Jesper Nilsson, WANG Cong, Alan Cox,
linux-cris-kernel, linux-serial
KERN_CRIT is too high, replace those KERN_CRIT with KERN_ERR or KERN_INFO.
Cc: Mikael Starvik <starvik@axis.com>
Cc: Jesper Nilsson <jesper.nilsson@axis.com>
Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
---
diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
index 225123b..77ba4ed 100644
--- a/drivers/tty/serial/crisv10.c
+++ b/drivers/tty/serial/crisv10.c
@@ -1788,7 +1788,7 @@ static unsigned int handle_descr_data(struct e100_serial *info,
struct etrax_recv_buffer *buffer = phys_to_virt(descr->buf) - sizeof *buffer;
if (info->recv_cnt + recvl > 65536) {
- printk(KERN_CRIT
+ printk(KERN_INFO
"%s: Too much pending incoming serial data! Dropping %u bytes.\n", __func__, recvl);
return 0;
}
@@ -3813,13 +3813,13 @@ rs_close(struct tty_struct *tty, struct file * filp)
* one, we've got real problems, since it means the
* serial port won't be shutdown.
*/
- printk(KERN_CRIT
+ printk(KERN_ERR
"rs_close: bad serial port count; tty->count is 1, "
"info->count is %d\n", info->count);
info->count = 1;
}
if (--info->count < 0) {
- printk(KERN_CRIT "rs_close: bad serial port count for ttyS%d: %d\n",
+ printk(KERN_ERR "rs_close: bad serial port count for ttyS%d: %d\n",
info->line, info->count);
info->count = 0;
}
@@ -4452,7 +4452,7 @@ static int __init rs_init(void)
#if defined(CONFIG_ETRAX_RS485_ON_PA)
if (cris_io_interface_allocate_pins(if_ser0, 'a', rs485_pa_bit,
rs485_pa_bit)) {
- printk(KERN_CRIT "ETRAX100LX serial: Could not allocate "
+ printk(KERN_ERR "ETRAX100LX serial: Could not allocate "
"RS485 pin\n");
put_tty_driver(driver);
return -EBUSY;
@@ -4461,7 +4461,7 @@ static int __init rs_init(void)
#if defined(CONFIG_ETRAX_RS485_ON_PORT_G)
if (cris_io_interface_allocate_pins(if_ser0, 'g', rs485_pa_bit,
rs485_port_g_bit)) {
- printk(KERN_CRIT "ETRAX100LX serial: Could not allocate "
+ printk(KERN_ERR "ETRAX100LX serial: Could not allocate "
"RS485 pin\n");
put_tty_driver(driver);
return -EBUSY;
@@ -4494,7 +4494,7 @@ static int __init rs_init(void)
if (info->enabled) {
if (cris_request_io_interface(info->io_if,
info->io_if_description)) {
- printk(KERN_CRIT "ETRAX100LX async serial: "
+ printk(KERN_ERR "ETRAX100LX async serial: "
"Could not allocate IO pins for "
"%s, port %d\n",
info->io_if_description, i);
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] cris: lower the printk level in cris serial driver
2011-09-01 6:14 [PATCH] cris: lower the printk level in cris serial driver WANG Cong
@ 2011-09-01 6:35 ` Geert Uytterhoeven
2011-09-01 7:16 ` Américo Wang
2011-09-01 8:09 ` Alan Cox
0 siblings, 2 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2011-09-01 6:35 UTC (permalink / raw)
To: WANG Cong
Cc: linux-kernel, akpm, Mikael Starvik, Jesper Nilsson, Alan Cox,
linux-cris-kernel, linux-serial
On Thu, Sep 1, 2011 at 08:14, WANG Cong <xiyou.wangcong@gmail.com> wrote:
> KERN_CRIT is too high, replace those KERN_CRIT with KERN_ERR or KERN_INFO.
>
> Cc: Mikael Starvik <starvik@axis.com>
> Cc: Jesper Nilsson <jesper.nilsson@axis.com>
> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
>
> ---
> diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
> index 225123b..77ba4ed 100644
> --- a/drivers/tty/serial/crisv10.c
> +++ b/drivers/tty/serial/crisv10.c
> @@ -1788,7 +1788,7 @@ static unsigned int handle_descr_data(struct e100_serial *info,
> struct etrax_recv_buffer *buffer = phys_to_virt(descr->buf) - sizeof *buffer;
>
> if (info->recv_cnt + recvl > 65536) {
> - printk(KERN_CRIT
> + printk(KERN_INFO
> "%s: Too much pending incoming serial data! Dropping %u bytes.\n", __func__, recvl);
> return 0;
> }
I think dropped data warrants KERN_WARN.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cris: lower the printk level in cris serial driver
2011-09-01 6:35 ` Geert Uytterhoeven
@ 2011-09-01 7:16 ` Américo Wang
2011-09-01 8:09 ` Alan Cox
1 sibling, 0 replies; 5+ messages in thread
From: Américo Wang @ 2011-09-01 7:16 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: linux-kernel, akpm, Mikael Starvik, Jesper Nilsson, Alan Cox,
linux-cris-kernel, linux-serial
On Thu, Sep 1, 2011 at 2:35 PM, Geert Uytterhoeven <geert@linux-m68k.org> wrote:
> On Thu, Sep 1, 2011 at 08:14, WANG Cong <xiyou.wangcong@gmail.com> wrote:
>> KERN_CRIT is too high, replace those KERN_CRIT with KERN_ERR or KERN_INFO.
>>
>> Cc: Mikael Starvik <starvik@axis.com>
>> Cc: Jesper Nilsson <jesper.nilsson@axis.com>
>> Signed-off-by: WANG Cong <xiyou.wangcong@gmail.com>
>>
>> ---
>> diff --git a/drivers/tty/serial/crisv10.c b/drivers/tty/serial/crisv10.c
>> index 225123b..77ba4ed 100644
>> --- a/drivers/tty/serial/crisv10.c
>> +++ b/drivers/tty/serial/crisv10.c
>> @@ -1788,7 +1788,7 @@ static unsigned int handle_descr_data(struct e100_serial *info,
>> struct etrax_recv_buffer *buffer = phys_to_virt(descr->buf) - sizeof *buffer;
>>
>> if (info->recv_cnt + recvl > 65536) {
>> - printk(KERN_CRIT
>> + printk(KERN_INFO
>> "%s: Too much pending incoming serial data! Dropping %u bytes.\n", __func__, recvl);
>> return 0;
>> }
>
> I think dropped data warrants KERN_WARN.
>
Yeah, agreed! I will update this patch shortly.
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] cris: lower the printk level in cris serial driver
2011-09-01 6:35 ` Geert Uytterhoeven
2011-09-01 7:16 ` Américo Wang
@ 2011-09-01 8:09 ` Alan Cox
2011-09-01 8:34 ` Mikael Starvik
1 sibling, 1 reply; 5+ messages in thread
From: Alan Cox @ 2011-09-01 8:09 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: WANG Cong, linux-kernel, akpm, Mikael Starvik, Jesper Nilsson,
Alan Cox, linux-cris-kernel, linux-serial
> > if (info->recv_cnt + recvl > 65536) {
> > - printk(KERN_CRIT
> > + printk(KERN_INFO
> > "%s: Too much pending incoming serial data! Dropping %u bytes.\n", __func__, recvl);
> > return 0;
> > }
>
> I think dropped data warrants KERN_WARN.
If you have an overflow you want to push the relevant tty flag into the
queue. I'm not sure a printk is that useful - end users of embedded
devices (or even PC desktops) won't see it anyway and if you have serial
console it can actually make things worse
Plus of course it's not rate limited here so its a log wiping vector ...
--
To unsubscribe from this list: send the line "unsubscribe linux-serial" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* RE: [PATCH] cris: lower the printk level in cris serial driver
2011-09-01 8:09 ` Alan Cox
@ 2011-09-01 8:34 ` Mikael Starvik
0 siblings, 0 replies; 5+ messages in thread
From: Mikael Starvik @ 2011-09-01 8:34 UTC (permalink / raw)
To: Alan Cox, Geert Uytterhoeven
Cc: WANG Cong, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org, Jesper Nilsson, Alan Cox,
linux-cris-kernel, linux-serial@vger.kernel.org
As a side note crisv10 is old stuff. If you want to change anything keep it simple (like changing log level). Finding someone to verify more correct modifications as Alan proposes may be difficult.
/Mikael
-----Original Message-----
From: Alan Cox [mailto:alan@lxorguk.ukuu.org.uk]
Sent: den 1 september 2011 10:10
To: Geert Uytterhoeven
Cc: WANG Cong; linux-kernel@vger.kernel.org; akpm@linux-foundation.org; Mikael Starvik; Jesper Nilsson; Alan Cox; linux-cris-kernel; linux-serial@vger.kernel.org
Subject: Re: [PATCH] cris: lower the printk level in cris serial driver
> > if (info->recv_cnt + recvl > 65536) {
> > - printk(KERN_CRIT
> > + printk(KERN_INFO
> > "%s: Too much pending incoming serial data! Dropping %u bytes.\n", __func__, recvl);
> > return 0;
> > }
>
> I think dropped data warrants KERN_WARN.
If you have an overflow you want to push the relevant tty flag into the
queue. I'm not sure a printk is that useful - end users of embedded
devices (or even PC desktops) won't see it anyway and if you have serial
console it can actually make things worse
Plus of course it's not rate limited here so its a log wiping vector ...
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-09-01 8:44 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-01 6:14 [PATCH] cris: lower the printk level in cris serial driver WANG Cong
2011-09-01 6:35 ` Geert Uytterhoeven
2011-09-01 7:16 ` Américo Wang
2011-09-01 8:09 ` Alan Cox
2011-09-01 8:34 ` Mikael Starvik
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox