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

Adrian Chadd adrian at freebsd.org
Sun May 11 06:33:19 UTC 2014


Nah, we fixed it in mips. there's dirty, dirty assembler in the
exception handlr and idle loop calls to skip over the idle loop if an
interrupt comes in.



-a


On 10 May 2014 23:24, Hans Petter Selasky <hps at selasky.org> wrote:
> 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
>
> _______________________________________________
> freebsd-arm at freebsd.org mailing list
> http://lists.freebsd.org/mailman/listinfo/freebsd-arm
> To unsubscribe, send any mail to "freebsd-arm-unsubscribe at freebsd.org"


More information about the freebsd-arm mailing list