public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 00/10] usb-serial: Switches from spin lock to atomic_t.
@ 2005-12-06 11:56 Luiz Fernando Capitulino
  2005-12-06 19:40 ` Greg KH
  2005-12-07 16:41 ` Greg KH
  0 siblings, 2 replies; 37+ messages in thread
From: Luiz Fernando Capitulino @ 2005-12-06 11:56 UTC (permalink / raw)
  To: gregkh; +Cc: linux-kernel, linux-usb-devel, ehabkost

 Greg,

 Don't get scared. :-)

 As showed by Eduardo Habkost some days ago, the spin lock 'lock' in the
struct 'usb_serial_port' is being used by some USB serial drivers to protect
the access to the 'write_urb_busy' member of the same struct.

 The spin lock however, is needless: we can change 'write_urb_busy' type
to be atomic_t and remove all the spin lock usage.

 The following patch series does that. It introduces a very simple URB write
lock abstraction and four macros to do the same job currently done by the
spin lock.

 The final result is a simpler and easy to read/understand code, with no
spin lock at all.

 I've splited the work that way: the frist patch introduces the new macros;
from the second patch until the eight all the drivers are ported; patch
nine removes the 'lock' member from the usb-serial driver and patch ten
adds the write URB lock initialization for all the ports.

 An important note is about the omninet driver. In its omninet_write_room()
method, it's accessing the 'write_urb_busy' member from the 'serial->port[1]'
port, and _not_ from the usb_serial_port passed as its argument. I have no
sure if it is right, but my port does perserve that semantic.

 As I don't have any of the changed drivers, I have only made the compilation
test. Would be good to hold the patches in -mm for a while.

 A final note: all the patches have been made with my usb-serial fixes
(which are already in your tree) applyed. They are:

usbserial-adds-missing-checks-and-bug-fix.patch
usbserial-race-condition-fix.patch

 Thank you,

-- 
Luiz Fernando N. Capitulino

^ permalink raw reply	[flat|nested] 37+ messages in thread

end of thread, other threads:[~2005-12-07 19:07 UTC | newest]

Thread overview: 37+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-12-06 11:56 [PATCH 00/10] usb-serial: Switches from spin lock to atomic_t Luiz Fernando Capitulino
2005-12-06 19:40 ` Greg KH
2005-12-06 20:13   ` Eduardo Pereira Habkost
2005-12-06 22:48     ` [linux-usb-devel] " Oliver Neukum
2005-12-07 12:24       ` Luiz Fernando Capitulino
2005-12-07 12:27         ` Arjan van de Ven
2005-12-07 12:30           ` Luiz Fernando Capitulino
2005-12-07 12:34             ` Arjan van de Ven
2005-12-07 12:41               ` Luiz Fernando Capitulino
2005-12-07 12:54                 ` Luiz Fernando Capitulino
2005-12-07 15:07       ` Alan Stern
2005-12-07 15:22         ` Arjan van de Ven
2005-12-07 15:37           ` Oliver Neukum
2005-12-07 15:40             ` Arjan van de Ven
2005-12-07 15:50               ` Oliver Neukum
2005-12-07 16:02                 ` Alan Cox
2005-12-07 16:00           ` Eduardo Pereira Habkost
2005-12-07 16:02             ` Arjan van de Ven
2005-12-07 16:23               ` Eduardo Pereira Habkost
2005-12-07 16:01           ` Alan Stern
2005-12-07 16:04             ` Arjan van de Ven
2005-12-07 15:32         ` linux-os (Dick Johnson)
2005-12-07 16:08           ` Alan Stern
2005-12-06 20:14   ` Luiz Fernando Capitulino
2005-12-06 21:02     ` Pete Zaitcev
2005-12-06 21:18       ` Luiz Fernando Capitulino
2005-12-06 22:36         ` [linux-usb-devel] " Oliver Neukum
2005-12-07 12:25           ` Luiz Fernando Capitulino
2005-12-07 13:01             ` Oliver Neukum
2005-12-07 13:17               ` Luiz Fernando Capitulino
2005-12-07 16:41 ` Greg KH
2005-12-07 16:51   ` Luiz Fernando Capitulino
2005-12-07 17:13     ` Eduardo Pereira Habkost
2005-12-07 17:56       ` Greg KH
2005-12-07 19:10         ` Eduardo Pereira Habkost
2005-12-07 16:55   ` Otavio Salvador
2005-12-07 16:59     ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox