Message ID | 20231214074319.11023-2-johan+linaro@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8378155dys; Wed, 13 Dec 2023 23:43:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGOne8TtJfJVpjXQZFSGB4tQUg7/MltPwgLcRJmzCXlJXabFDerKCHf4OZISmPHLcB2E+/M X-Received: by 2002:a17:903:5ce:b0:1d0:812f:e4d1 with SMTP id kf14-20020a17090305ce00b001d0812fe4d1mr7368576plb.55.1702539824415; Wed, 13 Dec 2023 23:43:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702539824; cv=none; d=google.com; s=arc-20160816; b=wJIDsizziJOGejozrmsF+7KfvfvleLTAoa8IJ+28b11OMz+u4UIGc7UvGwUs6Dwdm6 4eY71GvrIcgmA0hV4rGL5O27b1Z+ZoSTIFkpJaiHQWtiol8wjUT0k+eFZhrcpHUo6PLt M89sU2OmpJ1qNEfgi595IVVdiRr2GJuQVkXczHz/npAmLcjxE7RrAS232vsOl+30siJe btYPXyKGQNAhLjB9OLh96PgOtPv4Nw6lZ+A2TPfU+a86NnBMADStHJYpqY3XhmkcewVD xrISSnBGXY1zjN+i1bH4I5wbKTNcXh1m4rRsmm6ILGdaybTrI6Jvz7nUMxf1+sg1yJuL kq8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=U/IXfm7x4kX0FE/gnHAceNlNJ2Df6NKuK6d5ox0Z6Go=; fh=I1kaHB1Az6JEot5mARpFNYfGD91T7IobljvseBhdfeE=; b=oEpTX6ZqwbvP3JLamg2U1lXkcZrWyu6mhQJV/mLcejPjWvGDFV5spDgv7QNelPLsj9 UB+c/QYnM9GmzU40E/TVbB4fd1XxCI3YssLwOJDRskTF7dHWl4dF+v7e97Xm89K7WFg5 nEgKRASXj0zuOxF1eXrqtmANeXe6R86D5IKOyIL4No4xtZN/KKgndDj2NnNoKXXPUay+ 8+kYK/6qZQVIQMdypFsvdo66Azs+WJu4FLc70tBU6Vpn2HA5hSGJj3LeMPOJXT/VRGW7 c38h473ay+n6k7aPz1Jdoqvo4enpkBOsZEuFw+EpXVdYKIRJmq2pSygivEiPIzHkrIl1 ZWdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SsqxBolG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u2-20020a170902e80200b001cc4770b9aesi11019698plg.419.2023.12.13.23.43.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 23:43:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SsqxBolG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 28B2080941D3; Wed, 13 Dec 2023 23:43:43 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443300AbjLNHne (ORCPT <rfc822;dexuan.linux@gmail.com> + 99 others); Thu, 14 Dec 2023 02:43:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234348AbjLNHnd (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 14 Dec 2023 02:43:33 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 296BDB9 for <linux-kernel@vger.kernel.org>; Wed, 13 Dec 2023 23:43:40 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B7EAEC433C7; Thu, 14 Dec 2023 07:43:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1702539819; bh=Yl2x7eLhM78aBJkayHAzBhB3fDnzcX22imLrs5W4058=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SsqxBolGwNn2WnFESjwwmEsD54cH3Z9K77vTR8cTgI2DXnvMZ1nALvvOulJJJtnNe ikisnu2cwX6pz4NPDFO8vXhVYy0ilA52gzBMjmB+fwLq89tvqfZPARYPxzdKU5c4Km SjjmWGErk0sq4lAGnMSphoGYi3pPcYMRyXFnhVNYffJzKavKW48yMlVVHVg0Dt+pPF apzjFgtMtMTYHfNy6vl3YC1zFif9FhfJreUf95DCvX7sff2JNHXRM6WkwYEPWBg23o ffKecZ70VB9xsgpSzvDf4MeF4MXiGZidX4d/Hei6+UQt3+rTPfhLyqjBQiu8Qh4Aku hMh3I0+qGy6eg== Received: from johan by xi.lan with local (Exim 4.96.2) (envelope-from <johan+linaro@kernel.org>) id 1rDgNf-0002s6-0Y; Thu, 14 Dec 2023 08:43:39 +0100 From: Johan Hovold <johan+linaro@kernel.org> To: Bjorn Andersson <andersson@kernel.org> Cc: Andy Gross <agross@kernel.org>, Konrad Dybcio <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, Conor Dooley <conor+dt@kernel.org>, Krishna Kurapati PSSNV <quic_kriskura@quicinc.com>, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold <johan+linaro@kernel.org>, stable@vger.kernel.org, Richard Acayan <mailingradian@gmail.com> Subject: [PATCH 1/3] arm64: dts: qcom: sdm670: fix USB DP/DM HS PHY interrupts Date: Thu, 14 Dec 2023 08:43:17 +0100 Message-ID: <20231214074319.11023-2-johan+linaro@kernel.org> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231214074319.11023-1-johan+linaro@kernel.org> References: <20231214074319.11023-1-johan+linaro@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 23:43:43 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785242398789311897 X-GMAIL-MSGID: 1785242398789311897 |
Series |
arm64: dts: qcom: fix USB wakeup interrupts again (pt 2)
|
|
Commit Message
Johan Hovold
Dec. 14, 2023, 7:43 a.m. UTC
The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt
controller in order to be able to wake the system up from low-power
states and to be able to detect disconnect events, which requires
triggering on falling edges.
A recent commit updated the trigger type but failed to change the
interrupt provider as required. This leads to the current Linux driver
failing to probe instead of printing an error during suspend and USB
wakeup not working as intended.
Fixes: de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types")
Fixes: 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees")
Cc: stable@vger.kernel.org # 6.2
Cc: Richard Acayan <mailingradian@gmail.com>
Signed-off-by: Johan Hovold <johan+linaro@kernel.org>
---
arch/arm64/boot/dts/qcom/sdm670.dtsi | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Comments
On 12/14/23 08:43, Johan Hovold wrote: > The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt > controller in order to be able to wake the system up from low-power > states and to be able to detect disconnect events, which requires > triggering on falling edges. > > A recent commit updated the trigger type but failed to change the > interrupt provider as required. This leads to the current Linux driver > failing to probe instead of printing an error during suspend and USB > wakeup not working as intended. > > Fixes: de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types") > Fixes: 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees") > Cc: stable@vger.kernel.org # 6.2 > Cc: Richard Acayan <mailingradian@gmail.com> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > --- Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Konrad
On Thu, Dec 14, 2023 at 08:43:17AM +0100, Johan Hovold wrote: > The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt > controller in order to be able to wake the system up from low-power > states and to be able to detect disconnect events, which requires > triggering on falling edges. > > A recent commit updated the trigger type but failed to change the > interrupt provider as required. This leads to the current Linux driver > failing to probe instead of printing an error during suspend and USB > wakeup not working as intended. > > Fixes: de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types") > Fixes: 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees") > Cc: stable@vger.kernel.org # 6.2 > Cc: Richard Acayan <mailingradian@gmail.com> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > --- Tested-by: Richard Acayan <mailingradian@gmail.com> On a Pixel 3a, plugging in a USB cable doesn't wake up the device (presumably because there is no wakeup-source property) but this gets USB working again on linux-next.
On Thu, Dec 14, 2023 at 08:46:27PM -0500, Richard Acayan wrote: > On Thu, Dec 14, 2023 at 08:43:17AM +0100, Johan Hovold wrote: > > The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt > > controller in order to be able to wake the system up from low-power > > states and to be able to detect disconnect events, which requires > > triggering on falling edges. > > > > A recent commit updated the trigger type but failed to change the > > interrupt provider as required. This leads to the current Linux driver > > failing to probe instead of printing an error during suspend and USB > > wakeup not working as intended. > > > > Fixes: de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types") > > Fixes: 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees") > > Cc: stable@vger.kernel.org # 6.2 > > Cc: Richard Acayan <mailingradian@gmail.com> > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > > --- > > Tested-by: Richard Acayan <mailingradian@gmail.com> > > On a Pixel 3a, plugging in a USB cable doesn't wake up the device > (presumably because there is no wakeup-source property) but this gets > USB working again on linux-next. Thanks for testing. And yes, the wakeup interrupts will indeed not be enabled at system suspend unless the wakeup-source property is there. Did you try adding it? Johan
On Fri, Dec 15, 2023 at 08:34:39AM +0100, Johan Hovold wrote: > On Thu, Dec 14, 2023 at 08:46:27PM -0500, Richard Acayan wrote: > > On Thu, Dec 14, 2023 at 08:43:17AM +0100, Johan Hovold wrote: > > > The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt > > > controller in order to be able to wake the system up from low-power > > > states and to be able to detect disconnect events, which requires > > > triggering on falling edges. > > > > > > A recent commit updated the trigger type but failed to change the > > > interrupt provider as required. This leads to the current Linux driver > > > failing to probe instead of printing an error during suspend and USB > > > wakeup not working as intended. > > > > > > Fixes: de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types") > > > Fixes: 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees") > > > Cc: stable@vger.kernel.org # 6.2 > > > Cc: Richard Acayan <mailingradian@gmail.com> > > > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > > > --- > > > > Tested-by: Richard Acayan <mailingradian@gmail.com> > > > > On a Pixel 3a, plugging in a USB cable doesn't wake up the device > > (presumably because there is no wakeup-source property) but this gets > > USB working again on linux-next. > > Thanks for testing. And yes, the wakeup interrupts will indeed not be > enabled at system suspend unless the wakeup-source property is there. > Did you try adding it? Just tested today. Adding it does not cause the system to wake up when plugging in a laptop on the Pixel 3a, but that might just be because USB wakeups are disabled when the adapter is configured for peripheral mode. drivers/usb/dwc3/dwc3-qcom.c (dwc3_qcom_suspend): /* * The role is stable during suspend as role switching is done from a * freezable workqueue. */ if (dwc3_qcom_is_host(qcom) && wakeup) { qcom->usb2_speed = dwc3_qcom_read_usb2_speed(qcom); dwc3_qcom_enable_interrupts(qcom); }
On Thu, Dec 14, 2023 at 08:43:17AM +0100, Johan Hovold wrote: > The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt > controller in order to be able to wake the system up from low-power > states and to be able to detect disconnect events, which requires > triggering on falling edges. > > A recent commit updated the trigger type but failed to change the > interrupt provider as required. This leads to the current Linux driver > failing to probe instead of printing an error during suspend and USB > wakeup not working as intended. > > Fixes: de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types") > Fixes: 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees") > Cc: stable@vger.kernel.org # 6.2 I almost forgot to mention, both SDM670 patches seem to depend on b51ee205dc4f ("arm64: dts: qcom: sdm670: Add PDC") in 6.6 to compile properly. > Cc: Richard Acayan <mailingradian@gmail.com> > Signed-off-by: Johan Hovold <johan+linaro@kernel.org> > --- > arch/arm64/boot/dts/qcom/sdm670.dtsi | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/arch/arm64/boot/dts/qcom/sdm670.dtsi b/arch/arm64/boot/dts/qcom/sdm670.dtsi > index c873560ae9d5..fe4067c012a0 100644 > --- a/arch/arm64/boot/dts/qcom/sdm670.dtsi > +++ b/arch/arm64/boot/dts/qcom/sdm670.dtsi > @@ -1295,10 +1295,10 @@ usb_1: usb@a6f8800 { > <&gcc GCC_USB30_PRIM_MASTER_CLK>; > assigned-clock-rates = <19200000>, <150000000>; > > - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, > - <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, > - <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, > - <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; > + interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, > + <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, > + <&pdc 8 IRQ_TYPE_EDGE_BOTH>, > + <&pdc 9 IRQ_TYPE_EDGE_BOTH>; > interrupt-names = "hs_phy_irq", "ss_phy_irq", > "dm_hs_phy_irq", "dp_hs_phy_irq"; > > -- > 2.41.0 >
On Fri, Dec 15, 2023 at 07:04:23PM -0500, Richard Acayan wrote: > On Fri, Dec 15, 2023 at 08:34:39AM +0100, Johan Hovold wrote: > > On Thu, Dec 14, 2023 at 08:46:27PM -0500, Richard Acayan wrote: > > > Tested-by: Richard Acayan <mailingradian@gmail.com> > > > > > > On a Pixel 3a, plugging in a USB cable doesn't wake up the device > > > (presumably because there is no wakeup-source property) but this gets > > > USB working again on linux-next. > > > > Thanks for testing. And yes, the wakeup interrupts will indeed not be > > enabled at system suspend unless the wakeup-source property is there. > > Did you try adding it? > > Just tested today. Adding it does not cause the system to wake up when > plugging in a laptop on the Pixel 3a, but that might just be because > USB wakeups are disabled when the adapter is configured for peripheral > mode. Right, wake up is currently only implemented for host mode. Johan
On Fri, Dec 15, 2023 at 09:34:53PM -0500, Richard Acayan wrote: > On Thu, Dec 14, 2023 at 08:43:17AM +0100, Johan Hovold wrote: > > The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt > > controller in order to be able to wake the system up from low-power > > states and to be able to detect disconnect events, which requires > > triggering on falling edges. > > > > A recent commit updated the trigger type but failed to change the > > interrupt provider as required. This leads to the current Linux driver > > failing to probe instead of printing an error during suspend and USB > > wakeup not working as intended. > > > > Fixes: de3b3de30999 ("arm64: dts: qcom: sdm670: fix USB wakeup interrupt types") > > Fixes: 07c8ded6e373 ("arm64: dts: qcom: add sdm670 and pixel 3a device trees") > > Cc: stable@vger.kernel.org # 6.2 > > I almost forgot to mention, both SDM670 patches seem to depend on > b51ee205dc4f ("arm64: dts: qcom: sdm670: Add PDC") in 6.6 to compile > properly. Thanks for spotting that. The 6.5 stable tree is EOL now so this will fortunately not be an issue in practice. Johan
diff --git a/arch/arm64/boot/dts/qcom/sdm670.dtsi b/arch/arm64/boot/dts/qcom/sdm670.dtsi index c873560ae9d5..fe4067c012a0 100644 --- a/arch/arm64/boot/dts/qcom/sdm670.dtsi +++ b/arch/arm64/boot/dts/qcom/sdm670.dtsi @@ -1295,10 +1295,10 @@ usb_1: usb@a6f8800 { <&gcc GCC_USB30_PRIM_MASTER_CLK>; assigned-clock-rates = <19200000>, <150000000>; - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 488 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 489 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 486 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 8 IRQ_TYPE_EDGE_BOTH>, + <&pdc 9 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";