All of lore.kernel.org
 help / color / mirror / Atom feed
From: J <jhnlmn@yahoo.com>
To: linux-kernel@vger.kernel.org
Subject: Re: Possible race condition in usb-serial.c
Date: Wed, 20 Dec 2006 11:32:31 -0800 (PST)	[thread overview]
Message-ID: <20061220193231.39261.qmail@web32911.mail.mud.yahoo.com> (raw)
In-Reply-To: <200612201047.20842.oliver@neukum.org>

Thank you for the explanation.

> serial_close is safe because serial_disconnect
> lowers the refcount

Sorry, I meant serial_open, as in my original example.

I am currently trying to fix a legacy 2.4 based USB
driver and I am having various races, 
serial_open/usb_serial_disconnect is the most lively.
I am not asking your help in fixing this old 2.4 junk
(in fact I already fixed it using a global semaphore
to protect serial_table).

But I still want to understand how the latest and
greatest 2.6 driver is supposed to work so I can
adopt some of the changes. At first I thought that
the ref-counting will help, but then found that 
it does not fix much! The race is as lively 
as ever.

Also I found that BKL/lock_kernel is compiled out in
my configuration because it is not an SMP build.

I see that in 2.6 BKL/lock_kernel are also optional
for non-SMP builds. Is it true?
If yes, then again, how this is supposed to work
and avoid races?


Thank you
John


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

  parent reply	other threads:[~2006-12-20 19:32 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-19 19:21 Possible race condition in usb-serial.c J
2006-12-19 20:15 ` Oliver Neukum
2006-12-19 22:33   ` J
2006-12-20  9:47     ` Oliver Neukum
2006-12-20 15:10       ` [linux-usb-devel] " Alan Stern
2006-12-20 21:02         ` Oliver Neukum
2006-12-20 19:32       ` J [this message]
2006-12-20 20:43         ` Oliver Neukum
2006-12-20 22:24           ` J
2006-12-22 18:14             ` Oliver Neukum
2006-12-22 19:08               ` J
2006-12-22 19:59                 ` Oliver Neukum
2006-12-22 20:51                   ` J
2006-12-20 20:43         ` Greg KH
2006-12-20 22:39           ` J
2006-12-20 22:52             ` Greg KH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061220193231.39261.qmail@web32911.mail.mud.yahoo.com \
    --to=jhnlmn@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.