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: 145932 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3791532ljw; Tue, 4 Sep 2018 08:19:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYh6tHjdhvb/yV3waxBmz7LrT1Jhtzoc7PTFEZ3f75jx7bYZmjcodqEUBBc7yyCB0qk86oO X-Received: by 2002:a17:902:b7c5:: with SMTP id v5-v6mr34628667plz.49.1536074350181; Tue, 04 Sep 2018 08:19:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536074350; cv=none; d=google.com; s=arc-20160816; b=noEB3SQwgZu36+mB84NUhsCxab27ggKDR8M6seSt4LetSvP8eXIoWFt73B3CP7AWyf DFOCn9stbgJ0wAJr9PVokTf6ySmqcxYL72boVMH2r9aDyzqcCU/1Klol2wfW3+J0AJFD /w5IEEIfPqOnC/GoaiHCKWftfiFJSXGxzWR9GrDuxz9O9NdD7hvD0ckijYDyn4V4t5q/ l3i8wk0M4eSs+X+D33qLDyNYJ2YrMa48gQvgi8N7wWaK6e32uHD2Mo1hK+soSjXZ7TVX v9aBux1YoEYWFwtWN203hT0xp3qVFAzNl/W2ZkzBLSHk/F89BDQuNx+1HXtZp2tvzmBl C0Kw== 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=Ie+UuyUnSDYUVvk6e0jmSvyTUxKfj3biwa8t/QSCAiY=; b=L/iUstPIfUnDnIDajMeV5MwjvhIVMqbWGPi760x2dcVLnXSKyweX03abhMlhBm3MMO xglBHysgUMWrAFmBxR80laLm9L7hAW/oStXtGIw93N5/dg7uaWeyb7kvH58Sl+3zEJDx JbzkmA3wvqkZxjiJTftu22ytPh68waVy/bE3mOVgU+5VBxARiu3deSk95DmOWvjBBfZG w9+05m/w3K9vhRCyrRBR1a3k26F3CjPIzhDYHatchVMA9mqjOCa9jEAzyqgFDkyMgseG X8CkmdteVNQ33yB5fGEWUiBzd1pwNW0N/3cw8IOV3/ar+ffgYeAaxHaWCR+jMCP88ObI tdUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=RMHttoOj; 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 n15-v6si23319017pgc.309.2018.09.04.08.19.09; Tue, 04 Sep 2018 08:19:10 -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=RMHttoOj; 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 S1727620AbeIDTol (ORCPT + 5 others); Tue, 4 Sep 2018 15:44:41 -0400 Received: from mail-wm0-f65.google.com ([74.125.82.65]:53919 "EHLO mail-wm0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727220AbeIDTol (ORCPT ); Tue, 4 Sep 2018 15:44:41 -0400 Received: by mail-wm0-f65.google.com with SMTP id b19-v6so4872357wme.3 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=ptK8xSBd0uFiDcEkD4BaIxdw9CWKl0cgpWT1Esm0C0/vXQIkHDh9oV70bgqOFBXCnY Gtjp6ulZh/3Bbh8eAit+09QqlxNRgYB+70YVHTz1gThfiACRwiN/c3DIO0VexVEUeWzz k/gubCT3JXHjcvgB1Eyy8dZhJxB6EWEzq+AKLlZhf7UV5l5+o+EAI+H3vyFH0MOlkMQM UE5ci7iLn9JuRNDhETGCpg+98KRD5m48IrrLl4OTKqPvPgd3vZeLUGXf7cChS7o2qclr IDokmw0QoxMHbGb5P2pRTqysMRjuJEbXuAewQp9k6oGZ1H+jPpX6bbq7u3Sz9MtW6it9 FQJA== X-Gm-Message-State: APzg51CGj9vQKsSsvdCHCCLEnXAFdzpSXBaC9iBD0lFBaZnn6pCu6oFl c23JiPMl0HOP8FoYNkcqzQ94eQ== 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-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: v3: 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 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 */