altos: reorder stm USB state stores to avoid races
authorKeith Packard <keithp@keithp.com>
Wed, 27 Jun 2012 21:35:56 +0000 (14:35 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 27 Jun 2012 21:35:56 +0000 (14:35 -0700)
commite63d624f9670b5e2e002fcd5f24b80cf7f1effdf
tree2a8b65d119e340643e463ad9873186502646823d
parent08a4ed8fe794a2b2b52147bd5535fe0954822e95
altos: reorder stm USB state stores to avoid races

Must set ao_usb_in_pending before telling USB about new data or an
interrupt could arrive at the wrong time to clear it.

Same for ao_usb_in_flushed.

Without these changes, I've seen the USB bus lock up on occasion,
waiting for an IN packet to consume data, but with no IN data pending
in the hardware.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/stm/ao_usb_stm.c