Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3434422imu; Sun, 11 Nov 2018 15:02:10 -0800 (PST) X-Google-Smtp-Source: AJdET5daITYK4N6P9ZpwSI7cn1aP4MuHMeJHb0g22n8vgPdM5a1ATkwSbCzSLmSbPTb1zdSBtaSX X-Received: by 2002:a63:f65:: with SMTP id 37mr15290266pgp.238.1541977330159; Sun, 11 Nov 2018 15:02:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977330; cv=none; d=google.com; s=arc-20160816; b=I3GCinE1MVwc2iz2tPqXDCvfec5RrEftC3FORD9oO3o/wOTDSQgGfzuqsV7TNuA/KZ 0upY8kvQjiRNqhzvZ6IqmTodQwdknaVhyiIOoxOvxQC9jCjM382D0kE2eJTt3pfOi3L7 XLTnPb+Q54/Vp7f8Z5U8cpSYJCdmYuUc1SXP1TmamLaGVzlW6daS6+J6c9MJR15VH/gz 9PtF5xyhboEpy22yBJSUykN6hSAhrlsAS5GDIHq0Xbqrfmsi1MGgFSkz0BQfStFeTazj BuFvXjvIJXIisZ5nArY1dh2BPEuenUSucC8RHZRxXj7E2P4mwkJRAkH6tobU2Ux0bfUM W94A== 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=Zu+9C22QuUhESBmHxpwl3ov6ppjhyPX9tEQsdQKchO4=; b=DOUNUvAu5TRq2uTObYF50W24omQ68x4TUdFSkoGuhiheraDeRfENr/DsTj11ZV7CEh I+VedrwvXgOMVYhFWL0bZcOHaFrZikKblAOeXu2TAaa6vA+qTdkEQlcbvDRvq/Ol2g3A mH5QjgkI9BrG7GO8VezdIEvdR0wcDDsRynKOC7xI1mtjeiNI/JyzLaeN+blob2FTYkHX sNu4ke+prbDDtt6ciZeT7XdHvLkTe4CA/EGkn9gKF1f64nH0AHPGoalP2Gp/9G557KIt ZwA+BG1sevQd6Xq3s6nwGUTETFHF5rvRpO33XvCKFqAcmFawu4xZrJzM3+uKxMMSvIkg UAfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WHZCTygi; 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 v69si14383350pgd.284.2018.11.11.15.01.55; Sun, 11 Nov 2018 15:02:10 -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=WHZCTygi; 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 S2389369AbeKLIvm (ORCPT + 99 others); Mon, 12 Nov 2018 03:51:42 -0500 Received: from mail.kernel.org ([198.145.29.99]:51248 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390655AbeKLIWa (ORCPT ); Mon, 12 Nov 2018 03:22:30 -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 47EF1223C6; Sun, 11 Nov 2018 22:32:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975553; bh=UzGhMHVxC67UEAZ/QVnVHV310Hd77ZN7/y9hlc+mQDU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WHZCTygiyGq36BqNO9An4jqzJrrAu9bj0VaDGhwj8AK8kqjRw+I8VV9aBFKk68J8a TDuw9VLaIjlcJFQSklENkQ5hY7u671iO7jYu53PHD5WsjwzKABZfHfaZoBAp5OS9FK g2zRZsRdn8eeubdRzJooey2qAGQ2AIcXLzQBm5vY= 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.14 098/222] usb: chipidea: Prevent unbalanced IRQ disable Date: Sun, 11 Nov 2018 14:23:15 -0800 Message-Id: <20181111221656.695572410@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-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 @@ -20,7 +20,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 */