guysoft / RealtimePi

An out-of-the-box raspebrrypi/raspbian distro with a realtime kernel
GNU General Public License v3.0
164 stars 25 forks source link

Disable the IRQ while the FIQ spin lock is held - USB might cause crashes #3

Closed guysoft closed 7 years ago

guysoft commented 7 years ago

There is an known issue reported here: https://www.osadl.org/Single-View.111+M5c03315dc57.0.html

Apart from the workaround there is a permanent solution in a series of patches: https://www.osadl.org/monitoring/patches/rbs3s/usb-dwc_otg-fix-system-lockup-when-interrupts-are-threaded.patch.html

If I patch them a hunk fails: drivers/usb/host/dwc_otg/dwc_otg_hcd.c.rej

I am not sure yet if this patch is necessary, and input/reports would be appreciated.

guysoft commented 7 years ago

ok so https://github.com/guysoft/RealtimePi/commit/6db0673c57ab69d3973f10bc915a34b2eb255ffa was supposed to fix this, however it breaks the build.

Providing for debuging a patch repo so we can figure how it should look: https://github.com/guysoft/linux/tree/rpi-4.9.y-realtime

Not the build says:

In file included from ./arch/arm/include/asm/bitops.h:27:0,
                 from ./include/linux/bitops.h:36,
                 from ./include/linux/kernel.h:10,
                 from ./include/linux/list.h:8,
                 from ./include/linux/kobject.h:20,
                 from ./include/linux/device.h:17,
                 from ./include/linux/usb/ch9.h:35,
                 from ./include/linux/usb.h:5,
                 from drivers/usb/host/dwc_otg/dwc_otg_hcd.c:43:
drivers/usb/host/dwc_otg/dwc_otg_hcd.c: In function 'assign_and_init_hc':
./include/linux/irqflags.h:105:2: error: expected ';' before 'do'
  do {      \
  ^
drivers/usb/host/dwc_otg/dwc_otg_hcd.c:1422:2: note: in expansion of macro 'local_irq_restore'
  local_irq_restore(flags);
  ^~~~~~~~~~~~~~~~~
drivers/usb/host/dwc_otg/dwc_otg_hcd.c: In function 'dwc_otg_hcd_select_transactions':
drivers/usb/host/dwc_otg/dwc_otg_hcd.c:2005:17: warning: unused variable 'flags' [-Wunused-variable]
  dwc_irqflags_t flags;
                 ^~~~~
scripts/Makefile.build:293: recipe for target 'drivers/usb/host/dwc_otg/dwc_otg_hcd.o' failed
make[4]: *** [drivers/usb/host/dwc_otg/dwc_otg_hcd.o] Error 1
scripts/Makefile.build:544: recipe for target 'drivers/usb/host/dwc_otg' failed
make[3]: *** [drivers/usb/host/dwc_otg] Error 2
scripts/Makefile.build:544: recipe for target 'drivers/usb/host' failed
make[2]: *** [drivers/usb/host] Error 2