Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3480468imu; Sun, 11 Nov 2018 16:04:18 -0800 (PST) X-Google-Smtp-Source: AJdET5fC1rTTlQBge5HKR1tBGyOpxRcXysfAwDUpLDN3/uPxeCJCQWlTzHHKyZ1szVos+7YFRm5P X-Received: by 2002:a17:902:714e:: with SMTP id u14-v6mr12240550plm.8.1541981058369; Sun, 11 Nov 2018 16:04:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981058; cv=none; d=google.com; s=arc-20160816; b=fDDIuD0cAqDVmM5DnegJ/Xuc3bP406yCd5xt258JLIBaJv9DZ4RgpKllWrr3aZbrHv OaSCpweWBHKgT9WASka0P5uWjn7IJAO5aysPhxz3kljc1l3MInPXjxwmUXqUyBG8uxO3 ZJJsnw/3BEIfStZhlJWXhw6kIdr2FzsXxJ0fuchXWjdW3noQpEpiSktXWQIMMzEm1xLm x72+UO/6SgmDuiGcjPkAPwNYKXCaHwIkLeNPILe+LWmyeNp6IulWpyjmbqcbPsNoZE/I Lpe+l8f1NECXgH6Phzz6B+4a8d+DBCEPZ6jlXoIdvCdSspxthiERzUUpVrz7GgnHAzuu FDYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=pCeHkT/ItqouIzumC1HyGrgZVNon33H2Dcp/eAtnwxA=; b=K3jdiN8CWIciewLYy4KsbYmTF+UPICY4UgMdhAzc7WHl2cYwd7x0AL3eHwrVd226CB 32yUnfchpkMwgNArkp/+fmGfLGms4Tw8Yna4F0ilJYHKdfxExko1VYT0ZuTAMX8c0fiV sdGVb9YCiJEWBKwAK/C/+s794+eYut2tQHfJkaRgjVZptA1hxBXsujegT22jFvN4aDYw FQkkcWL6vzSGGyYI2/Ql1hXOnptDp24yxPq1btJPaqKPdOWqV/OZSKYSjRaG8P5O9aLT y8RrugvVecSVAr5J0Fsjf+E9Aa5uQfkyR3e8Z5Dxkgnr9SzrUjC0IRrbbcaw+0g7Auw6 0Udw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="wvI/Z262"; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 186-v6si16903440pfc.95.2018.11.11.16.04.03; Sun, 11 Nov 2018 16:04:18 -0800 (PST) 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="wvI/Z262"; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732278AbeKLJyK (ORCPT + 99 others); Mon, 12 Nov 2018 04:54:10 -0500 Received: from mail.kernel.org ([198.145.29.99]:34452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732082AbeKLIRt (ORCPT ); Mon, 12 Nov 2018 03:17:49 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3D396223AE; Sun, 11 Nov 2018 22:27:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975274; bh=LEb6Lpn1q6SaswwvXp40D9vSB4vCCdD405LpThQVvsg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wvI/Z262+9AYYj1noomqkd91R/9Yei4kUy4bPfiFA7t2EEliRg/halQfdr0JamHPL s2YCN+9f1de5HAZEjgWpNdtpXzU61Vak2JhQIwnySzBRoiKzcA6NuCVEFkhmML2ATg 4eCQZr0/TaD/Rr67bqZ0qhd3Wq/D2pdhrDaUzrhU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Loic Poulain , Peter Chen , Sasha Levin Subject: [PATCH 4.19 173/361] usb: chipidea: Prevent unbalanced IRQ disable Date: Sun, 11 Nov 2018 14:18:40 -0800 Message-Id: <20181111221644.558158912@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ 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 Signed-off-by: Greg Kroah-Hartman --- drivers/usb/chipidea/otg.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/drivers/usb/chipidea/otg.h +++ b/drivers/usb/chipidea/otg.h @@ -17,7 +17,8 @@ void ci_handle_vbus_change(struct ci_hdr 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 */