USB isochronous traffic with Rasberry Pi [WAS: Re: USB audio device on Raspberry Pi]

Hans Petter Selasky hps at selasky.org
Sun May 11 06:23:45 UTC 2014


On 05/11/14 01:23, Ian Lepore wrote:
> On Sun, 2014-05-11 at 00:25 +0200, Hans Petter Selasky wrote:
>> Hi,
>>
>> This patch fixes the problem too:
>>
>> diff --git a/sys/arm/arm/machdep.c b/sys/arm/arm/machdep.c
>> index 0490be7..8d53fab 100644
>> --- a/sys/arm/arm/machdep.c
>> +++ b/sys/arm/arm/machdep.c
>> @@ -432,8 +432,12 @@ cpu_idle(int busy)
>>                   cpu_idleclock();
>>           }
>>    #endif
>> +       register_t s;
>> +       s = intr_disable();
>>           if (!sched_runnable())
>>                   cpu_sleep(0);
>> +       intr_restore(s);
>> +
>>    #ifndef NO_EVENTTIMERS
>>           if (!busy) {
>>                   cpu_activeclock();
>>
>> It appears some IRQ is happening when sched_runnable() is running, and
>> then cpu_sleep(0) is executed even though sched_runnable() is no longer
>> true.
>>
>> --HPS
>
> Aha!  Now I think you're on to something.  Even after explaining why
> interrupts should be disabled for WFI I didn't notice that we don't
> disable interrupts before WFI.  (I wonder if this is why I sometimes see
> a lost timer interrupt and have to hit a key to un-wedge things.)
>
> Can you try the attached?  The spinlock_enter/exit calls are essentially
> a combination of disabling interrupts and doing a critical_enter().
>
> -- Ian

Hi Ian,

Your patch works!

BTW: I see the "mips" platform might have a similar issue.

--HPS



More information about the freebsd-arm mailing list