Re: [PATCH V2] n_gsm: race between ld close and gsmtty open

2013-11-25 Thread channing
On Mon, 2013-11-25 at 19:16 -0800, Greg KH wrote: > > > > > > What is different from the previous version? That information needs to > > > be somewhere, otherwise I'm just going to guess and say this is the same > > > as your last one, which was incorrect. > > The difference with previous one is

Re: [PATCH V2] n_gsm: race between ld close and gsmtty open

2013-11-25 Thread channing
On Mon, 2013-11-25 at 18:54 -0800, Greg KH wrote: > On Tue, Nov 26, 2013 at 11:14:05AM +0800, channing wrote: > > This patch is try to avoid it by: > > > > 1) in n_gsm driver, use a global gsm mutex lock to avoid gsm_dlci_release() > > run in > > parallel wit

[PATCH V2] n_gsm: race between ld close and gsmtty open

2013-11-25 Thread channing
ttyA has ld associated to n_gsm, when ttyA is closing, it triggers to release gsmttyB's ld data dlci[B], then race would happen if gsmttyB is opening in parallel. Here are race cases we found recently in test: CASE #1 releasing

Re: [PATCH] n_gsm: race between ld close and gsmtty open

2013-10-17 Thread channing
On Thu, 2013-10-17 at 10:14 -0700, Greg KH wrote: > On Thu, Oct 17, 2013 at 11:29:10AM +0800, channing wrote: > > > > ttyA has ld associated to n_gsm, when ttyA is closing, it triggers > > to release gsmttyB's ld data dlci[B], then race would happen if gsmttyB

[PATCH v2] n_gsm: race between ld close and gsmtty open

2013-10-16 Thread channing
ttyA has ld associated to n_gsm, when ttyA is closing, it triggers to release gsmttyB's ld data dlci[B], then race would happen if gsmttyB is opening in parallel. Here are race cases we found recently in test: CASE #1 releasing

[PATCH] n_gsm: race between ld close and gsmtty open

2013-10-16 Thread channing
ttyA has ld associated to n_gsm, when ttyA is closing, it triggers to release gsmttyB's ld data dlci[B], then race would happen if gsmttyB is opening in parallel. Here are some of race cases we found recently in test: CASE #1 r

Re: [PATCH] TTY: memory leakage in tty_buffer_find()

2013-06-26 Thread channing
On Wed, 2013-06-26 at 08:43 -0400, Peter Hurley wrote: > On 06/26/2013 04:51 AM, channing wrote: > > > > In tty_buffer_find(), it scans all tty buffers in > > free buffer queue, if it finds matched one, > > tty->buf.free will point to matched one's next buffe

[PATCH] TTY: memory leakage in tty_buffer_find()

2013-06-26 Thread channing
In tty_buffer_find(), it scans all tty buffers in free buffer queue, if it finds matched one, tty->buf.free will point to matched one's next buffer, so tty buffers that ahead of matched one are removed from free queue, they will never be used but they are not released, then memory leak happen. Th

[PATCH] TTY: fix memory leakage in tty_buffer_find()

2013-06-26 Thread channing
In tty_buffer_find(), it scans all tty buffers in free buffer queue, if it finds matched one, tty->buf.free will point to matched one's next buffer, so tty buffers that ahead of matched one are removed from free queue, they will never be used but they are not released, then memory leak happen. Th

Re: [PATCH] tty_buffer: avoid race due to tty_buffer_free_all() being misused

2013-05-16 Thread channing
On Thu, 2013-05-16 at 08:54 -0400, Peter Hurley wrote: > On 05/16/2013 04:59 AM, channing wrote: > > > > In tty_buffer.c, function tty_buffer_free_all() is used to remove > > all buffers for a tty, although it's declared that it mustn't be called > > when t

[PATCH] tty_buffer: avoid race due to tty_buffer_free_all() being misused

2013-05-16 Thread channing
safer to strengthen protection in the view of tty buffer, by adding a tty->buf.lock in tty_buffer_free_all() to avoid it racing with ongoing tty buffer operations. Signed-off-by: channing --- drivers/tty/tty_buffer.c |3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/dri

[PATCH] Notify and correct preempt count if irq/x86 handler change it

2013-03-01 Thread channing
print out a notification when hardirq handler change preempt count, it would helpful to faster debuger to find misbehavior irq handler; On the other hand, when above case happen, set back current preempt count to its previous value, to avoid impacting on blocked process or other irq handler. Signed

Re: [PATCH] n_gsm: Add Mutex to avoid race when net destroy

2013-03-01 Thread channing
On Thu, 2013-02-28 at 10:53 +0100, Jiri Slaby wrote: > On 02/28/2013 06:31 AM, channing wrote: > > > > when gsm Net is enabled, data on dlci is transferrd by > > gsm_mux_net_start_xmit(), while userspace may trigger > > ioctrl to call gsm_destroy_network() durin

[PATCH] n_gsm: Add Mutex to avoid race when net destroy

2013-02-27 Thread channing
when gsm Net is enabled, data on dlci is transferrd by gsm_mux_net_start_xmit(), while userspace may trigger ioctrl to call gsm_destroy_network() during data was transferring, because there is no mutex protection between the two functions, following scenario may happen: 1) gsm_mux_net_start_xmit(

[PATCH] serial:ifx6x60: Remove memset for SPI frame

2013-01-21 Thread channing
Chen Jun Signed-off-by: channing --- drivers/tty/serial/ifx6x60.c |1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/drivers/tty/serial/ifx6x60.c b/drivers/tty/serial/ifx6x60.c index 8cb6d8d..fa4ec7e 100644 --- a/drivers/tty/serial/ifx6x60.c +++ b/drivers/tty/serial/ifx6

[PATCH] serial:ifx6x60:Keep word size accordance with SPI controller

2013-01-15 Thread channing
keep align with Controller, IFX driver should make use of this value during SPI transfer, but the default one. Signed-off-by: Chen Jun Signed-off-by: channing --- drivers/tty/serial/ifx6x60.c |3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/drivers/tty/serial/ifx6x6

[PATCH] ST_CORE: Error triggered by convert "char" to "int"

2013-01-10 Thread channing
filter such case and may continue access memory pointed by this minus index. This patch is to change the variable type of index from "int" to "unsigned char", so that it avoids do such kind of type conversion. cc: liu chuansheng Signed-off-by: channing --- drivers/misc/ti-

[PATCH] serial:ifx6x60:Delete SPI timer when shut down port

2013-01-09 Thread channing
When shut down SPI port, it's possible that MRDY has been asserted and a SPI timer was activated waiting for SRDY assert, in the case, it needs to delete this timer. Signed-off-by: Chen Jun Signed-off-by: channing --- drivers/tty/serial/ifx6x60.c |1 + 1 files changed, 1 insertions(

Re: [PATCH] SPI: SSP SPI Controller driver v3

2013-01-06 Thread channing
>> applied and > >> validated on intel Moorestown & Medfield platform. The patch are > >> originated by > >> Ken Mills and Sylvain Centelles > >> , > >> migrating to lateset Linux mainline SPI framework by Channing > >> > >>