On 03/02/2014 06:26 PM, Gregory Dymarek wrote:
> So I started from scratch, have not used any xenomai/ipipe patches. But
> used the same .config.
> As a result all worked fine. The USB device is getting initialized
> correctly.
>
> So the current situation is that xenomai does work on 3.2 but does not on
> 3.8 because of some USB driver issues.
> I diff'ed the code for dwc_otg_hcd_handle_intr and this has changed.
> What is intriguing:
> https://github.com/raspberrypi/linux/blob/rpi-3.8.y/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c#L530
>
> // We should be OK doing this because the common interrupts should already
> have been serviced
>
> So I removed all the DEBUG code from this function, but this did not help
> either. Not sure if my test is valid in here.
If the driver relies on FIQ to work (which is a bad idea with Xenomai,
as it will cause an increase in latencies), the following construction:
local_irq_save(flags);
local_fiq_disable();
/* do something */
local_irq_restore(flags);
Will mask the FIQ with CONFIG_IPIPE whereas local_irq_restore unmasks
both the IRQ and FIQ without CONFIG_IPIPE.
So, as a last try before giving up, could you try the following patch?
diff --git a/drivers/usb/host/dwc_common_port/dwc_common_linux.c
b/drivers/usb/host/dwc_common_port/dwc_common_linux.c
index 0812d3a..6d01261 100644
--- a/drivers/usb/host/dwc_common_port/dwc_common_linux.c
+++ b/drivers/usb/host/dwc_common_port/dwc_common_linux.c
@@ -585,6 +585,7 @@ void DWC_MODIFY_REG32(uint32_t volatile *reg, uint32_t
clear_mask, uint32_t set_
local_irq_save(flags);
local_fiq_disable();
writel((readl(reg) & ~clear_mask) | set_mask, reg);
+ local_fiq_enable();
local_irq_restore(flags);
}
diff --git a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
index b5a007d..10eead2 100644
--- a/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
+++ b/drivers/usb/host/dwc_otg/dwc_otg_cil_intr.c
@@ -1354,6 +1354,7 @@ static inline uint32_t
dwc_otg_read_common_intr(dwc_otg_core_if_t * core_if, gin
gintmsk.d32 |= gintmsk_common.d32;
gintsts_saved.d32 &= ~gintmsk_common.d32;
reenable_gintmsk->d32 = gintmsk.d32;
+ local_fiq_enable();
local_irq_restore(flags);
}
diff --git a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
index 7d521d9..86d9cbe 100644
--- a/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
+++ b/drivers/usb/host/dwc_otg/dwc_otg_hcd_intr.c
@@ -97,6 +97,7 @@ void notrace _fiq_print(FIQDBG_T dbg_lvl, char *fmt, ...)
memcpy(buffer + wptr, text, 16);
wptr = (wptr + 16) % sizeof(buffer);
}
+ local_fiq_enable();
local_irq_restore(flags);
}
#endif
--
Gilles.
_______________________________________________
Xenomai mailing list
[email protected]
http://www.xenomai.org/mailman/listinfo/xenomai