Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 7a4934d6 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "USB: gadget: Fix Bug in to disable interrupts usecase"

parents 233c478f 278de69d
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -516,7 +516,10 @@ void msm_usb_irq_disable(bool disable)
	spin_lock_irqsave(udc->lock, flags);

	if (_udc_ctxt.irq_disabled == disable) {
		mod_timer(&_udc_ctxt.irq_enable_timer, IRQ_ENABLE_DELAY);
		pr_debug("Interrupt state already disable = %d\n", disable);
		if (disable)
			mod_timer(&_udc_ctxt.irq_enable_timer,
					IRQ_ENABLE_DELAY);
		spin_unlock_irqrestore(udc->lock, flags);
		return;
	}
@@ -524,10 +527,12 @@ void msm_usb_irq_disable(bool disable)
	if (disable) {
		disable_irq_nosync(_udc_ctxt.irq);
		/* start timer here */
		pr_debug("%s: Disabling interrupts\n", __func__);
		mod_timer(&_udc_ctxt.irq_enable_timer, IRQ_ENABLE_DELAY);
		_udc_ctxt.irq_disabled = true;

	} else {
		pr_debug("%s: Enabling interrupts\n", __func__);
		del_timer(&_udc_ctxt.irq_enable_timer);
		enable_irq(_udc_ctxt.irq);
		_udc_ctxt.irq_disabled = false;
@@ -538,6 +543,7 @@ void msm_usb_irq_disable(bool disable)

static void enable_usb_irq_timer_func(unsigned long data)
{
	pr_debug("enabling interrupt from timer\n");
	msm_usb_irq_disable(false);
}