summaryrefslogtreecommitdiff
path: root/drivers/usb/dwc2/core.c
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2014-10-02 17:32:16 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-11-14 09:00:05 -0800
commitbe7cabe556695e136f983623e22c3c52de25dc1b (patch)
tree2601e8664b34df6a29c214332f7dc02dfa751c98 /drivers/usb/dwc2/core.c
parentb8edc5dc0ae741cba4b094b220cf8721db5192ec (diff)
downloadlwn-be7cabe556695e136f983623e22c3c52de25dc1b.tar.gz
lwn-be7cabe556695e136f983623e22c3c52de25dc1b.zip
usb: musb: cppi41: restart hrtimer only if not yet done
commit d2e6d62c9cbbc2da4211f672dbeea08960e29a80 upstream. commit c58d80f52 ("usb: musb: Ensure that cppi41 timer gets armed on premature DMA TX irq") fixed hrtimer scheduling bug. There is one left which does not trigger that often. The following scenario is still possible: lock(&x->lock); hrtimer_start(&x->t); unlock(&x->lock); expires: t->function(); lock(&x->lock); lock(&x->lock); if (!hrtimer_queued(&x->t)) hrtimer_start(&x->t); unlock(&x->lock); if (!list_empty(x->early_tx_list)) ret = HRTIMER_RESTART; -> hrtimer_forward_now(...) } else ret = HRTIMER_NORESTART; unlock(&x->lock); and the timer callback returns HRTIMER_RESTART for an armed timer. This is wrong and we run into the BUG_ON() in __run_hrtimer(). This can happens on SMP or PREEMPT-RT. The patch fixes the problem by only starting the timer if the timer is not yet queued. Reported-by: Torben Hohn <torbenh@linutronix.de> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> [bigeasy: collected information and created a patch + description based on it] Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Felipe Balbi <balbi@ti.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/dwc2/core.c')
0 files changed, 0 insertions, 0 deletions