lkml.org 
[lkml]   [2005]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [linux-usb-devel] Re: [PATCH 00/10] usb-serial: Switches from spin lock to atomic_t.
On Tue, 6 Dec 2005 23:36:47 +0100
Oliver Neukum <oliver@neukum.org> wrote:

| Am Dienstag, 6. Dezember 2005 22:18 schrieb Luiz Fernando Capitulino:
| >
| > Hi Pete,
| >
| > On Tue, 6 Dec 2005 13:02:07 -0800
| > Pete Zaitcev <zaitcev@redhat.com> wrote:
| >
| > | On Tue, 6 Dec 2005 18:14:49 -0200, Luiz Fernando Capitulino <lcapitulino@mandriva.com.br> wrote:
| > |
| > | > The spinlock makes the code less clear, error prone, and we already a
| > | > semaphore in the struct usb_serial_port.
| > | >
| > | > The spinlocks _seems_ useless to me.
| > |
| > | Dude, semaphores are not compatible with interrupts. Surely you
| > | understand that?
| >
| > Sure thing man, take a look at this thread:
| >
| > http://marc.theaimsgroup.com/?l=linux-kernel&m=113216151918308&w=2
| >
| > My comment 'we already have a semaphore in struct usb_serial_port'
| > was about what we've discussed in that thread, where question like
| > 'why should we have yet another lock here?' have been made.
| >
| > And *not* 'let's use the semaphore instead'.
| >
| > If _speed_ does not make difference, the spinlock seems useless,
| > because we could use atomic_t instead.
|
| You can atomically set _one_ value using atomic_t. A spinlock allows
| that and other more complex schemes.

We only need to set 'write_urb_busy', nothing more.

--
Luiz Fernando N. Capitulino
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-12-07 13:28    [W:0.232 / U:0.252 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site