Am Tuesday 23 March 2004 01:28 schrieb Pete Zaitcev:
> On Mon, 22 Mar 2004 22:21:14 +0100
> Oliver Neukum <[EMAIL PROTECTED]> wrote:
> 
> > you are using an irqsave spinlock in a completion handler. Not actually
> > wrong but it tends to confuse people about the context the function is
> > executed under.
> 
> >     priv = usb_get_serial_port_data(port);
> > -   spin_lock_irqsave(&priv->lock, flags);
> > +   spin_lock(&priv->lock);
> >     priv->last_msr = data[BELKIN_SA_MSR_INDEX];
> 
> I strongly disagree with this point of view. Keeping track of a
> context in which a function can be called places an unreasonable
> burden on a programmer and introduces extremely annoying code rot
> whenever code migrates contexts.

You cannot efficiently write code that runs under several contexts.
Too many things mostly related to the ability to sleep depend on the
context. We continously get buggy drivers which sleep in interrupt
because people are not aware.

        Regards
                Oliver


-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
[EMAIL PROTECTED]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel

Reply via email to