Re: Linux UVC driver can not handle urb_submit error

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 7 Jun 2011, Soho Soho123 wrote:

> Dear Alan,,
> 
> Could you kindly help to explain more detail about "spin_unlock_irq "
> you mentioned?

Well, netdev->hard_xmit() is called from somewhere, right?  The place 
where it gets called from might be running with interrupts disabled.  
Now see what happens if hard_xmit() uses spin_lock_irq() and 
spin_unlock_irq():

	some_other_function() {
		...
		disable interrupts
		...
		call netdev->hard_xmit()

			hard_xmit() {
				spin_lock_irq();
				...
				spin_unlock_irq();
				/* Now interrupts are enabled again */
			}
		...

		/* An unexpected interrupt occurs -- CRASH! */

		...
		enable interrupts
	}

The problem is that spin_unlock_irq() always enables interrupts, even 
if interrupts were disabled when spin_lock_irq() was called.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux