Re: [RFC PATCH 0/4] USB: HCD/EHCI: giveback of URB in tasklet context

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

 



On Wed, Jun 12, 2013 at 10:43 AM, Ming Lei <ming.lei@xxxxxxxxxxxxx> wrote:
> On Wed, Jun 12, 2013 at 3:10 AM, Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>>
>> I don't follow your reasoning.  Consider the following situation, where
>> the same spinlock is used in both a URB completion handler and an
>> interrupt handler:
>>
>>         URB completes
>>         A tasklet calls the completion handler, with interrupts enabled
>>         The completion handler does
>>                 spin_lock(&lock);
>>         An interrupt occurs
>>         The interrupt handler does
>>                 spin_lock(&lock);       // Deadlock!
>
> If you mean the interrupt handler is HCD irq handler of the device, no
> such problem since all complete() will run in tasklet context.
>
> If not, I am wondering why one USB driver need register another hard
> interrupt handler? Could you share such examples? I understand the
> case only exists with timer handler as discussed with Oliver, don't I?

In fact, timer funtion is still run in softirq context, so the deadlock won't
be caused with acquiring same lock(spin_lock) in both timer function
and complete() from tasklet.


Thanks,
--
Ming Lei
--
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