From 6d66546c313ab308c17e9d00fc7ed3fa9daa72a9 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Wed, 29 Apr 2015 08:32:17 -0600 Subject: [PATCH] USB HUB: Fix a deadlock that can occur if the HCD and the HUB try to share the high priority work queue. Now how work must be done on the low priority work queue. --- arch/arm/src/lpc31xx/lpc31_ehci.c | 6 ++++-- arch/arm/src/sama5/sam_ehci.c | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/lpc31xx/lpc31_ehci.c b/arch/arm/src/lpc31xx/lpc31_ehci.c index 49dc9a615d2..636d97ba2b6 100644 --- a/arch/arm/src/lpc31xx/lpc31_ehci.c +++ b/arch/arm/src/lpc31xx/lpc31_ehci.c @@ -73,8 +73,10 @@ /* Configuration ***************************************************************/ /* Pre-requisites */ -#ifndef CONFIG_SCHED_WORKQUEUE +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required (CONFIG_SCHED_WORKQUEUE) +#elif !defined(CONFIG_SCHED_HPWORK) +# error Hi-priority work queue support is required (CONFIG_SCHED_HPWORK) #endif /* Configurable number of Queue Head (QH) structures. The default is one per @@ -2570,7 +2572,7 @@ static inline int lpc31_asynch_setup(struct lpc31_rhport_s *rhport, int ret = -ENODEV; DEBUGASSERT(rhport && epinfo && !epinfo->iocwait && - epinfo->callback == NULL); + callback != NULL && epinfo->callback == NULL); /* Is the device still connected? */ diff --git a/arch/arm/src/sama5/sam_ehci.c b/arch/arm/src/sama5/sam_ehci.c index 22a12645f8b..6165a029d1e 100644 --- a/arch/arm/src/sama5/sam_ehci.c +++ b/arch/arm/src/sama5/sam_ehci.c @@ -73,8 +73,10 @@ /* Configuration ***************************************************************/ /* Pre-requisites */ -#ifndef CONFIG_SCHED_WORKQUEUE +#if !defined(CONFIG_SCHED_WORKQUEUE) # error Work queue support is required (CONFIG_SCHED_WORKQUEUE) +#elif !defined(CONFIG_SCHED_HPWORK) +# error Hi-priority work queue support is required (CONFIG_SCHED_HPWORK) #endif /* Configurable number of Queue Head (QH) structures. The default is one per