From patchwork Tue Sep 4 15:18:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Loic Poulain X-Patchwork-Id: 10587499 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 AA82616B1 for ; Tue, 4 Sep 2018 15:19:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E6FC29BE1 for ; Tue, 4 Sep 2018 15:19:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 92B6A29C87; Tue, 4 Sep 2018 15:19:10 +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 43AB529C80 for ; Tue, 4 Sep 2018 15:19:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727220AbeIDTol (ORCPT ); Tue, 4 Sep 2018 15:44:41 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:32873 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727611AbeIDTok (ORCPT ); Tue, 4 Sep 2018 15:44:40 -0400 Received: by mail-wm0-f66.google.com with SMTP id r1-v6so9443197wmh.0 for ; Tue, 04 Sep 2018 08:19:07 -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=Ie+UuyUnSDYUVvk6e0jmSvyTUxKfj3biwa8t/QSCAiY=; b=RMHttoOjLJnK/rpqgyhXWZKY2L7lwvSApNxb0eKaEyCOG75Dy2tGsmKARwCniiKApS Tze+au1ADXAI8xwxtA2S1vo9pNFEMy9GE1SEIeYt5yJR4MlaETolVl40efOFf7xuQNiC bz7ltheHoqFcfv6qQRhUWXL0cCTekztjCnowY= 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=Ie+UuyUnSDYUVvk6e0jmSvyTUxKfj3biwa8t/QSCAiY=; b=h+X1emgbWmRPZMS3El+m2eAemrylg2ttQ21RtwRcYUa7ZJo6ZKfT4vQkaq5KHnplX5 LCmb8kV6EiF7oYoD59JXQFAYGHQu3WAY+CQaAngYaip427N4BWPhDXVFMGDLSYP7hcyV C+Uaa6tkjidjg4NL22XhqESKNdRTkCANeaJgoE9Zmp3CVxi7PihzgUJ6k6LLVpCRSEfE 5uGl6tiMlmiOcwwIbHOJSVicybmEssHNPO+SOEj3LV332bSIH3C19X6Zwsm08JnEGv1N D6HFGjYAGXi/zoZp7+JSADIXSBg6gTXV0UK/hQl9JRshdhk6pDsAjH1yqOOX93p2FRlo v/Ng== X-Gm-Message-State: APzg51BaJVUxurvXIOIdDQmrSipanolYiV7BSJFFBLkAJta3bxgiKri5 Zj7sKANMUqe3gmZGvZmaATX+tA== X-Google-Smtp-Source: ANB0VdZw/SSz6Q6zU/uFmi43EWFFd/w/L3Yz2Zfgw3628VSkJ2dUYkEiDqdJCqfo+MbDjdP5+yoqEQ== X-Received: by 2002:a1c:f11a:: with SMTP id p26-v6mr8780741wmh.92.1536074347009; Tue, 04 Sep 2018 08:19:07 -0700 (PDT) Received: from lpoulain-ThinkPad-T470p.home (AToulouse-654-1-394-222.w90-55.abo.wanadoo.fr. [90.55.193.222]) by smtp.gmail.com with ESMTPSA id l24-v6sm40255033wrb.65.2018.09.04.08.19.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Sep 2018 08:19:06 -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 v3 3/6] usb: chipidea: Prevent unbalanced IRQ disable Date: Tue, 4 Sep 2018 17:18:57 +0200 Message-Id: <1536074340-14840-3-git-send-email-loic.poulain@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536074340-14840-1-git-send-email-loic.poulain@linaro.org> References: <1536074340-14840-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: v3: 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 7e7428e..4f8b817 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 */