From patchwork Mon Aug 27 09:33:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10576789 X-Patchwork-Delegate: agross@codeaurora.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9940313B8 for ; Mon, 27 Aug 2018 09:33:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CE022847D for ; Mon, 27 Aug 2018 09:33:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 80A06297A9; Mon, 27 Aug 2018 09:33:56 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 320112847D for ; Mon, 27 Aug 2018 09:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727273AbeH0NTr (ORCPT ); Mon, 27 Aug 2018 09:19:47 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:44584 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727098AbeH0NTh (ORCPT ); Mon, 27 Aug 2018 09:19:37 -0400 Received: by mail-wr1-f67.google.com with SMTP id v16-v6so12953690wro.11 for ; Mon, 27 Aug 2018 02:33:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=w0SISw5b9iFA4GoR2xVxw/w2+Ij5SPyf9tqQwIA9cgc=; b=Nngwsn0WRiyiamsxTbhvVfQ5snPb8IwluoRd3vFNjb8/bUSXQ81DnSznEQFo5Afeug NGlpq7oacOrz4R695noRyoAYgDlvl0kQVfm4KBDVA3YKTzL9A63C0Sb+Yaak0zQxl6f4 RgXs+ItSn6+L47Z4XDk23wdhKtz1M+A/49Y2Y= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=w0SISw5b9iFA4GoR2xVxw/w2+Ij5SPyf9tqQwIA9cgc=; b=nQ7Mh5EZnEb5IxqJYVDzWYDWldujIQjP4gbnf4wUAThgyM6uKR5enbsmn6kVMDDjAG kAHSFkeBelDIMQfIYsqTVr+nCl/GaPAxTbmVeSu5TXPnwIjSeGCx+NC5kfuP6eRy13Sy Rht1hvFqFRIBcKO8LMLodEM4nka5IkMxpp5L0EvvVC3WuTzpJeEG7so7k6iJ11gHGKKF mEKLd4AA/LPAwD44dDlVX+nLLJ4WCTPdc/Kwfsre71HTwY8z7FUtka10xQkgBybC0toc yCGcYF1C6G2dpdk64gzV3z90ruarykZE3kFEqFrnqR9djthcGFvSEvxp2oOlW3Nm6auW QSUA== X-Gm-Message-State: APzg51AifrUI47qtvHHw0UGu8znznhNFs+ZPQdx1a1nn+yhMEMEQnByv xOQSAXpJn8CV0m32042okGqkYg== X-Google-Smtp-Source: ANB0VdapV8vz0YBbwvoaycNfLIxkWoER6FHQnOzOt8g+na1h3GgNTV/5CMulm1W1plZ6nil6QbjVYQ== X-Received: by 2002:adf:c38e:: with SMTP id p14-v6mr8516615wrf.68.1535362422994; Mon, 27 Aug 2018 02:33:42 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-655-1-762-165.w109-220.abo.wanadoo.fr. [109.220.142.165]) by smtp.gmail.com with ESMTPSA id y203-v6sm8022828wmd.1.2018.08.27.02.33.41 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 27 Aug 2018 02:33:42 -0700 (PDT) From: Loic Poulain To: Peter.Chen@nxp.com Cc: linux-usb@vger.kernel.org, linux-arm-msm@vger.kernel.org, david.brown@linaro.org, robh+dt@kernel.org, bjorn.andersson@linaro.org, andy.gross@linaro.org, andy.shevchenko@gmail.com, Loic Poulain Subject: [PATCH v2 4/7] usb: chipidea: Prevent unbalanced IRQ disable Date: Mon, 27 Aug 2018 11:33:32 +0200 Message-Id: <1535362415-16559-4-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535362415-16559-1-git-send-email-loic.poulain@linaro.org> References: <1535362415-16559-1-git-send-email-loic.poulain@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- v2: no change 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 9ecb598..a5557c7 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 */