Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp169625imd; Wed, 31 Oct 2018 16:43:26 -0700 (PDT) X-Google-Smtp-Source: AJdET5dC39CtlG8oOj8tRgJ32jI78u2LZ0O9J0/HwMDexot3a0AixOBvO7IimVDm0TySGvi2cA/M X-Received: by 2002:a17:902:61:: with SMTP id 88-v6mr5402024pla.189.1541029406805; Wed, 31 Oct 2018 16:43:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029406; cv=none; d=google.com; s=arc-20160816; b=MRaHVbyXA239il1m9hrZATIYNuuAACL2gLUnMaXb+5ssdEg0RuRjq20JfXc8zyKLA6 1q0KbqVn4Zu8BTGlX/FBTGoYnLeQjJ70OHsacYbPmMZB0RuV7rkSLTQ9nJeMPWFqARxk c26LFcBlsdlHI8YA+6x1pqXzdaYugfF75QzwKZrIn+pB/D//PXIMD5hmHMGdcXPVUVET UCD2Z00icNkuOM4fH8OJSqmAtsjaDpovU/qKK95uhrWi+mAkSNT7nbEX+daCQhl8Cye9 eMKkHju5A9RBVMh3xC/uYuILLztntQlBaw15yGi74M0wVnrbJnFoJxbowC739kk4luJ1 U/wg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=yMlD8LXwbhIs2GJ7LmL1+bQOw7qO2HPgxcRlJjJOW4A=; b=XMdG5BAmaKr0cqRxfPycYn3mmpq5bzi5AG5pi7cFBPtyq0kOmTM+WlK9xSqo3NUSSl GuXqUXFzm2tFgwUfzTXNt9WMECxtoR5H23V3g8Lt4HqTsux6NXgHuW23PvHH1DCtd7LG uTk6ylqVCAP4sTyzFtLkxvVgS/ORHEb0o18TVuqyQpoT9DS2nGyyh+eFTpKELyJ9VFbE Dtm0DJ9rGir+vMceoGlI+EeSFq9kgnFuZwTmKfHaNl55SgDRos4mpHxhRB9Ui21krALZ GxGlhVPMXC8vpLqlz4pwE+3cY/GoG++Dy++oJedR/zhjVf/FGmc6Dkl4QCepd9MxE8UE Lgnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yqGot5v2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l68-v6si28016017pfl.268.2018.10.31.16.43.12; Wed, 31 Oct 2018 16:43:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=yqGot5v2; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729217AbeKAIHu (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:55980 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729150AbeKAIHs (ORCPT ); Thu, 1 Nov 2018 04:07:48 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id BC8D520830; Wed, 31 Oct 2018 23:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027258; bh=8YA0vWFhpY+Sn68jT8xm6ghQKKZys++ILysgTsBS9rE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yqGot5v2fHi4nTUaHEyg1SHYxD91jCt8nrTNewbBmZhmC0sTnjl7Whg/clZg7Hw3V 19chwncKgQOi6j0Hmqry3YdTZ1NZsgRLlW/zKU3z2zEQx7wAQmUXCg1QpP+VEopeFT Bp+t6VkMrmZYi/95Go8KYp6OfV8u4ymIbWLWYWtw= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Loic Poulain , Peter Chen , Sasha Levin Subject: [PATCH AUTOSEL 4.19 129/146] usb: chipidea: Prevent unbalanced IRQ disable Date: Wed, 31 Oct 2018 19:05:24 -0400 Message-Id: <20181031230541.28822-129-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Loic Poulain [ Upstream commit 8b97d73c4d72a2abf58f8e49062a7ee1e5f1334e ] The ChipIdea IRQ is disabled before scheduling the otg work and re-enabled on otg work completion. However if the job is already scheduled we have to undo the effect of disable_irq int order to balance the IRQ disable-depth value. Fixes: be6b0c1bd0be ("usb: chipidea: using one inline function to cover queue work operations") Signed-off-by: Loic Poulain Signed-off-by: Peter Chen Signed-off-by: Sasha Levin --- drivers/usb/chipidea/otg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h index 7e7428e48bfa..4f8b8179ec96 100644 --- a/drivers/usb/chipidea/otg.h +++ b/drivers/usb/chipidea/otg.h @@ -17,7 +17,8 @@ void ci_handle_vbus_change(struct ci_hdrc *ci); static inline void ci_otg_queue_work(struct ci_hdrc *ci) { disable_irq_nosync(ci->irq); - queue_work(ci->wq, &ci->work); + if (queue_work(ci->wq, &ci->work) == false) + enable_irq(ci->irq); } #endif /* __DRIVERS_USB_CHIPIDEA_OTG_H */ -- 2.17.1