On Wed, 7 Dec 2005 14:01:25 +0100 Oliver Neukum <[EMAIL PROTECTED]> wrote:
| Am Mittwoch, 7. Dezember 2005 13:25 schrieb Luiz Fernando Capitulino: | > On Tue, 6 Dec 2005 23:36:47 +0100 | > Oliver Neukum <[EMAIL PROTECTED]> 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 <[EMAIL PROTECTED]> wrote: | > | > | > | > | On Tue, 6 Dec 2005 18:14:49 -0200, Luiz Fernando Capitulino <[EMAIL PROTECTED]> 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. | | So go hence and encapsulate that using the existent infrastructure. Thus | you get the most efficient solution. Yes, I was speaking about it with Eduardo some minutes ago. My only question is: currently the spin lock is not acquired for unlock operations (ie, setting 'write_urb_busy' to 0), and to check 'write_usb_busy' value. I don't know if it's safe. But, If I add the spin_lock()/spin_unlock() functions in my 'unlock' and 'locked' methods, I could increase the latency for SMP systems. Suggestions? Eduardo? Greg? -- Luiz Fernando N. Capitulino ------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Do you grep through log files for problems? Stop! Download the new AJAX search engine that makes searching your log files as easy as surfing the web. DOWNLOAD SPLUNK! http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click _______________________________________________ linux-usb-devel@lists.sourceforge.net To unsubscribe, use the last form field at: https://lists.sourceforge.net/lists/listinfo/linux-usb-devel