From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id DFFD5C46CD2 for ; Fri, 22 Dec 2023 03:42:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FkHj1jsrh9pKaG3U3wKBZIDsgQGjmt7of7A7O/iuFhI=; b=UFL5YZxra+yD6Z HhNhRI306bjbBDn6V8LwQrMCKsMbYwotz+xuXrkTkjv/L3LQItNAipBjGnIddGfPFpT44Ad6ahLOI wByAF+12Jj28atoF+Lmff9AVPhwtSFIC2pdLCP4AutaDdsarVHmxs8bCrAUo7DumG9Xeu6uG6FCez T0m2xA8DjUDnwSKagCr6KZZMre1g0BUqYgknPPbNE01AUBjjOwD9T0WK1Nq4FOBCjFRoWSEh3TT+V lGMAWNneZehYrhd7C8QAP44aQHvJOe/wezRX78w8mAKhBee9jy+33ynDBIMT94Jf0yZ5JqqgLurZm E41LkKykLOTQUJ6Hwdow==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rGWQM-004mb7-0V; Fri, 22 Dec 2023 03:42:10 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rGWQJ-004mam-23 for linux-arm-kernel@lists.infradead.org; Fri, 22 Dec 2023 03:42:08 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 244BF614DE; Fri, 22 Dec 2023 03:42:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 96FD9C433C7; Fri, 22 Dec 2023 03:42:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703216526; bh=P7h8IFjd6XQxMOmZ4+m88fAgrs2f7/PSu0zBioB9ySw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=obG8Yim+ZWvrs8t2n8tlQNoR9o8KoNsK/m8DtYucDrK+LzOm5b4d0OU0Dhc0uRYwK 8ddIsU69Zo1dDruDStOkyIS4QmSSUo/kkc8Oo0SvdBeexfQtel9vGGFBSLw20pgkV+ xx+DTJfOR+CSMZIW17uSOWeoJLgKiFvbNfWAhGcV2fK30XelyyB1rPQUAYurCCvyLK BCui3zzVAIzHmPAzLv3adguhNyATRpfXy5kfk7Ph69TDgoTCpUwQrcbX1wSQYKAiaN PGTNqWdV0AuPUFjcOlpLgAZXc8XmW0YosY251/uBfrqgEhCv5Jx/9Ox6dO1OUPNVcG TUEXYD+PK3hQQ== Date: Fri, 22 Dec 2023 11:41:55 +0800 From: Peter Chen To: Xu Yang Cc: gregkh@linuxfoundation.org, shawnguo@kernel.org, s.hauer@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, luca.ceresoli@bootlin.com, jun.li@nxp.com, linux-usb@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 2/3] usb: chipidea: wait controller resume finished for wakeup irq Message-ID: <20231222034155.GB1951375@nchen-desktop> References: <20231218061420.3460145-1-xu.yang_2@nxp.com> <20231218061420.3460145-2-xu.yang_2@nxp.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20231218061420.3460145-2-xu.yang_2@nxp.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20231221_194207_718506_756039D2 X-CRM114-Status: GOOD ( 22.60 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 23-12-18 14:14:19, Xu Yang wrote: > After the chipidea driver introduce extcon for id and vbus, it's able > to wakeup from another irq source, in case the system with extcon ID > cable, wakeup from usb ID cable and device removal, the usb device > disconnect irq may come firstly before the extcon notifier while system > resume, so we will get 2 "wakeup" irq, one for usb device disconnect; > and one for extcon ID cable change(real wakeup event), current driver > treat them as 2 successive wakeup irq so can't handle it correctly, then > finally the usb irq can't be enabled. This patch adds a check to bypass > further usb events before controller resume finished to fix it. > > Fixes: 1f874edcb731 ("usb: chipidea: add runtime power management support") > cc: > Signed-off-by: Xu Yang > Signed-off-by: Li Jun Acked-by: Peter Chen > > --- > Changes in v2: > - no changes > --- > drivers/usb/chipidea/core.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c > index 7ac39a281b8c..85e9c3ab66e9 100644 > --- a/drivers/usb/chipidea/core.c > +++ b/drivers/usb/chipidea/core.c > @@ -523,6 +523,13 @@ static irqreturn_t ci_irq_handler(int irq, void *data) > u32 otgsc = 0; > > if (ci->in_lpm) { > + /* > + * If we already have a wakeup irq pending there, > + * let's just return to wait resume finished firstly. > + */ > + if (ci->wakeup_int) > + return IRQ_HANDLED; > + > disable_irq_nosync(irq); > ci->wakeup_int = true; > pm_runtime_get(ci->dev); > -- > 2.34.1 > -- Thanks, Peter Chen _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel