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: 145165 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3975649ljw; Mon, 27 Aug 2018 02:33:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYhdV445dHT01bl/F1aR3pjn8t1RFhJTi7+TTTQcTrZ3/DhTPCyIVlpwSxWAeZ002oh3h1h X-Received: by 2002:a17:902:47:: with SMTP id 65-v6mr12365901pla.35.1535362428436; Mon, 27 Aug 2018 02:33:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535362428; cv=none; d=google.com; s=arc-20160816; b=hkZqFRLTb6Te6xZh9xKr7VxvMJbH1WZ7LKlHTrndtQ6n0x9tcM5MJc46GjhcHEOcp6 NH1AWevhY2bMMbiJenVqQNVos4otY/ZF71JexgDSRrNxw//pDVPpDjfo31N5/1lcJF+d G09KHRINvToU7eg8so89uNvWB2fPARQDhFPztV7bmFcV0tmwo+cYK36TU7Z93t6XtRQT 6D6ZGIjoPcoVh0Nc/0haOyLGYqAgfmEbU7347gZDHjQ7V7jrEIZDZC89USgUXoXHrMOJ EFBN56RlVNQ4kKYPwxMOSSi3MFMhTl7NXyDAEJ34QyFMiRbptMUP7dHUZGjtQ4UPbSxF 9oeA== 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:arc-authentication-results; bh=w0SISw5b9iFA4GoR2xVxw/w2+Ij5SPyf9tqQwIA9cgc=; b=kCxCNVbZmh1iJxD+BTtfV/AgFugJs3JTRatc0USyE3FztQzB0SrSmn19I5KL0sKzH6 6+S/PbyqG/uBkT0K/h7/Pndp78nxKyC03CmRvmiRfTjTtmDZ78GVVCE5CVBmwyP9QLwO tQm0zN0bvdMuo4CjbPrexBHoQJZMALGqL0GiK9gl6wUSPU5dn7mTGLG9QgxgRUIKqs3m gRy52ArSJXu2VQ32LnMkyKLhnwcFKARjWj1KvFiWsfuhimz6nYV7D74U1PD54XTJyDoP aS6xha77gY3gHDW2Yks8U6ejYSSzq5IlMp1Ey6HyoqIGXH6xljbDzh1lYfelm5y626ww pcbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Nngwsn0W; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 35-v6si13216871pla.453.2018.08.27.02.33.48; Mon, 27 Aug 2018 02:33:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-usb-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=@linaro.org header.s=google header.b=Nngwsn0W; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727474AbeH0NTh (ORCPT + 5 others); Mon, 27 Aug 2018 09:19:37 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:33241 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727356AbeH0NTh (ORCPT ); Mon, 27 Aug 2018 09:19:37 -0400 Received: by mail-wr1-f65.google.com with SMTP id v90-v6so12980781wrc.0 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=QyCWsmtmlNwRxsq13drZX1+oaghsFYaOne1swI0BSq1G0nyD+CW7bFBaKgDxRuRe9B uKgE8vz/tRjbMdrR0PojbhihaKZvh26SMMsv45utx0gr5B90be9/zflfl1T3599cWr4B oiKknJmye+Z5xWz1ZeQtOjowy8qATsfHmt26sGpxb/EQWOcXa0tf7XVM5RcKHyTiDZCo vgJhAyvpRi2GOP9ZXZOv12WIJCTsvwez5FdKTGfP9T81mWxcqJLMMFj7y6Nv/j/HL6dK QfOKsObBDvaSdfUlYuT3aqUFepD4CCkt8L39hjhYNmx+ZX8RQSt0VCgj8rCJbQp8E/jh 4R+w== X-Gm-Message-State: APzg51B/hupMXaKjRabbkNaww6dog1dhxIqIv65E7wXq/AmWBDWLsWuo R4zqq32QFoMLXpjrviOXDMXPAA== 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-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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(-) -- 2.7.4 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 */