From patchwork Wed Oct 31 23:11:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sasha Levin X-Patchwork-Id: 149908 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp105010ljp; Wed, 31 Oct 2018 16:14:58 -0700 (PDT) X-Google-Smtp-Source: AJdET5eh5pFyrHmebm6Ei3fKOJbnb7U4/rTifa7SWxDVSXF7E2vviEG86op7xlUKEPugnva5Can2 X-Received: by 2002:a63:6643:: with SMTP id a64-v6mr2207203pgc.15.1541027698205; Wed, 31 Oct 2018 16:14:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541027698; cv=none; d=google.com; s=arc-20160816; b=Ns+M6qFaFEUbecqklnnhfi3dRVegec2j3SeZ7KW1m5BBwHIVh8kkaGUR1Y0P8SCE/Q gT6aYlxXX6pR7sBzuGujMUR25lESXAu263m9sRZfMSX8HKPGRuWAsaXbMVl4KjNo8WEn kKs/mQFRsPjszA2Qs5buneKfCEdWHa1uAQk537XbtFQf7BtstpP+HbJ+8BXGE2vE3ZHs WpY4FM3YVuYHkTotLUXOr8jj/rGJgdVcO/pG6bW/U8NrgN9XMCpnd2CoYvnUVld9F5sC 8dIX+7NM2KSUxR9pji/s/4UslhFVbf42cgWCzIQ8oQ5QMEoB3nF1pKd2kI43cj2skb8+ zolQ== 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=A1rTQmK1rP5vv4JYcvZrwuri1jehBXkusafKaa1smZI=; b=E0y5SWEU1LHAXIMJGLCx8br5/9m39bj+DN736sE41SS0lb9tB4xsVXXX1LTVBdUO6R H9tqHhGZwC/unqIVDXebcgll+M+RSrzxo8W+BKNKijXd4GLbOycWi7hkiDIq4mjZI+IM 5Y0Ki1U097lvJ2iwpVN9g+nzshwIyNG+TDRcaZ4ecCzn48y3vqtppfKckVzR+oYJ5iwK G8JhcrLTiSn4kFaFsn6Vr/byBB3h8McVQ4wvYtiO89roAMHlL3JAL5VR9k/1zRQa3mkJ vEjBCK5O9fkaAtBjM31BeIbMDUP8Kqw7k86HoGIm7QXQA8jEtk07gpDPg0vYsXASTpZS Z4+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=AlVxFqsw; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 f62-v6si28719246plf.288.2018.10.31.16.14.57; Wed, 31 Oct 2018 16:14:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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=AlVxFqsw; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 S1732002AbeKAIPJ (ORCPT + 15 others); Thu, 1 Nov 2018 04:15:09 -0400 Received: from mail.kernel.org ([198.145.29.99]:36852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732118AbeKAIMN (ORCPT ); Thu, 1 Nov 2018 04:12:13 -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 B317B204FD; Wed, 31 Oct 2018 23:12:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027521; bh=v47CDGbxOENzAMPOKoeJKAp11j0bzEXJHNMmoo5kuG8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AlVxFqsw/f9Rvya7iMOV4y4FG7hkmRe1CqJ3DAMX4Zi1JcjmeD9V1a0BHSrBkCP10 U11jfj2PgUh5JeKqAdx0gGI1d64rKfvqdBAbDhHN6ueNtOWEmr9KBSstM47q91BbI2 twoATeU7GGaJLhjjf4NLfA97FP9e4Qnp3qkpP1NA= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Loic Poulain , Peter Chen , Sasha Levin Subject: [PATCH AUTOSEL 4.4 26/32] usb: chipidea: Prevent unbalanced IRQ disable Date: Wed, 31 Oct 2018 19:11:31 -0400 Message-Id: <20181031231137.29429-26-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031231137.29429-1-sashal@kernel.org> References: <20181031231137.29429-1-sashal@kernel.org> Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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(-) -- 2.17.1 diff --git a/drivers/usb/chipidea/otg.h b/drivers/usb/chipidea/otg.h index 9ecb598e48f0..a5557c70034a 100644 --- a/drivers/usb/chipidea/otg.h +++ b/drivers/usb/chipidea/otg.h @@ -20,7 +20,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 */