lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <54FD4779.3020902@huawei.com>
Date:	Mon, 9 Mar 2015 15:10:49 +0800
From:	"long.wanglong" <long.wanglong@...wei.com>
To:	Tim Kryger <tim.kryger@...il.com>
CC:	Peter Hurley <peter@...leysoftware.com>,
	Zhang Zhen <zhenzhang.zhang@...wei.com>,
	<linux-serial@...r.kernel.org>,
	"Linux Kernel Mailing List" <linux-kernel@...r.kernel.org>,
	Tim Kryger <tim.kryger@...aro.org>,
	<gregkh@...uxfoundation.org>, <jamie@...ieiles.com>,
	<alan@...ux.intel.com>, <arnd@...db.de>,
	<shenjiangjiang@...wei.com>, "Wang Kai" <morgan.wang@...wei.com>
Subject: Re: [RFC] With 8250 Designware UART, if writes to the LCR failed
 the kernel will hung up

On 2015/3/7 11:01, Tim Kryger wrote:
> You only hit the silicon bug if you bombard the uart with characters
> and simultaneously request a baud rate or framing change.
> 
> I'm not sure why you would do either to the uart console.  Is it
> possible your host machine is doing something weird?
> 
> If you have the leverage, remind the SoC vendor to upgrade the serial
> block.  Synopsys fixed this a long time ago.
> 
> -Tim

Hi, Tim

thanks for you reply. if we bombard the uart with characters and simultaneously
request a baud rate change, we hit the silicon bug.

Our scenario is to do stability testing(at the system booting, we bombard the uart
with characters), With this version(v3.0.6) Synopsys Serial,  the expect are
print out the message(Couldn't set LCR to xxxx) and the kernel will not hung.

Maybe the next release of the board we will upgrade the serial block to the new version.
but the issue is that how we circumvent this problem in kernel?

do you have any ideas? thanks.

Best Regards
Wang Long


> 
> On Fri, Mar 6, 2015 at 8:50 AM, Peter Hurley <peter@...leysoftware.com> wrote:
>> Hi Zhang,
>>
>> On 03/06/2015 04:11 AM, Zhang Zhen wrote:
>>> Hi,
>>>
>>>       I'm testing 4.0-rc1 kernel on my board with 8250 Designware UART.(ARM Cortex-a15 single core).
>>>
>>>       I found if serial is busy and writes to the LCR failed after tried 1000 times.
>>>       The kernel will hung up.
>>>
>>>       The system boot success after changed from:
>>>
>>>  95 static void dw8250_serial_out(struct uart_port *p, int offset, int value)
>>>  96 {
>>>  97         struct dw8250_data *d = p->private_data;
>>>  98
>>> ...
>>> ...
>>> 112                         writeb(value, p->membase + (UART_LCR << p->regshift));
>>> 113                 }
>>> 114                 dev_err(p->dev, "Couldn't set LCR to %d\n", value);
>>> 115         }
>>> 116 }
>>>
>>>       to:
>>>
>>>  95 static void dw8250_serial_out(struct uart_port *p, int offset, int value)
>>>  96 {
>>>  97         struct dw8250_data *d = p->private_data;
>>>  98
>>> ...
>>> ...
>>> 112                         writeb(value, p->membase + (UART_LCR << p->regshift));
>>> 113                 }
>>> 114                 dev_info(p->dev, "Couldn't set LCR to %d\n", value);            //changed here
>>> 115         }
>>> 116 }
>>>
>>>       The reason is serial8250_console_write can't get port->lock because serial8250_do_set_termios has
>>>       got port->lock.
>>>       So i think here we should change from dev_err to dev_info ?
>>
>> That's not really going to help because this will still hang if the
>> console_loglevel is set to < KERN_INFO.
>>
>>>       Any suggestions are welcome.
>>
>> Check that the port is not the uart_console() before logging the error,
>> like;
>>
>>         if (!uart_console(p))
>>                 dev_err(p->dev, "Couldn't .....");
>>
>> Use a global flag to note the error and check it from other contexts.
>> Plus, find out why you can't write LCR there.
>>
>> Also, consider re-designing how the 8250_dw driver implements that
>> "feature".
>>
>> Regards,
>> Peter Hurley
>> --
>> 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/
> 
> .
> 


--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ