Message ID | 1652379802-8318-1-git-send-email-quic_kriskura@quicinc.com |
---|---|
Headers | show |
Series | USB DWC3 host wake up support from system suspend | expand |
On Thu, May 12, 2022 at 11:53:22PM +0530, Krishna Kurapati wrote: > From: Sandeep Maheswaram <quic_c_sanm@quicinc.com> > > Keep the power domain always on during runtime suspend or if the > controller supports wakeup in order to retain controller status > and to support wakeup from devices. > > Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com> > Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> > --- > drivers/usb/dwc3/dwc3-qcom.c | 23 ++++++++++++++++------- > 1 file changed, 16 insertions(+), 7 deletions(-) > > diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c > index 9804a19..1f9589a 100644 > --- a/drivers/usb/dwc3/dwc3-qcom.c > +++ b/drivers/usb/dwc3/dwc3-qcom.c > @@ -17,6 +17,7 @@ > #include <linux/of_platform.h> > #include <linux/platform_device.h> > #include <linux/phy/phy.h> > +#include <linux/pm_domain.h> > #include <linux/usb/of.h> > #include <linux/reset.h> > #include <linux/iopoll.h> > @@ -718,12 +719,13 @@ dwc3_qcom_create_urs_usb_platdev(struct device *dev) > > static int dwc3_qcom_probe(struct platform_device *pdev) > { > - struct device_node *np = pdev->dev.of_node; > - struct device *dev = &pdev->dev; > - struct dwc3_qcom *qcom; > - struct resource *res, *parent_res = NULL; > - int ret, i; > - bool ignore_pipe_clk; > + struct device_node *np = pdev->dev.of_node; > + struct device *dev = &pdev->dev; > + struct dwc3_qcom *qcom; > + struct resource *res, *parent_res = NULL; > + int ret, i; > + bool ignore_pipe_clk; > + struct generic_pm_domain *genpd; > > qcom = devm_kzalloc(&pdev->dev, sizeof(*qcom), GFP_KERNEL); > if (!qcom) > @@ -732,6 +734,8 @@ static int dwc3_qcom_probe(struct platform_device *pdev) > platform_set_drvdata(pdev, qcom); > qcom->dev = &pdev->dev; > > + genpd = pd_to_genpd(qcom->dev->pm_domain); > + > if (has_acpi_companion(dev)) { > qcom->acpi_pdata = acpi_device_get_match_data(dev); > if (!qcom->acpi_pdata) { > @@ -839,7 +843,12 @@ static int dwc3_qcom_probe(struct platform_device *pdev) > if (ret) > goto interconnect_exit; > > - device_init_wakeup(&pdev->dev, 1); > + genpd->flags |= GENPD_FLAG_RPM_ALWAYS_ON; > + > + if (device_may_wakeup(&qcom->dwc3->dev)) { This should probably be device_can_wakeup(), otherwise you'll have to set/clear the flag before suspending (the wakeup policy might change after the device is probed). Also I'm not sure if switching the domain off can impact the power consumption of some connected peripherals, as is observed when the PHYs are powered off (I could confirm this if needed). > + genpd->flags |= GENPD_FLAG_ALWAYS_ON; > + device_init_wakeup(&pdev->dev, true); > + } > qcom->is_suspended = false; > pm_runtime_set_active(dev); > pm_runtime_enable(dev); > -- > 2.7.4 >
On Thu, 12 May 2022 23:53:18 +0530, Krishna Kurapati wrote: > From: Sandeep Maheswaram <quic_c_sanm@quicinc.com> > > Added support for wakeup-source property. This property can be > used to check and power down the phy during system suspend if > wake up is not supported. > > Signed-off-by: Sandeep Maheswaram <quic_c_sanm@quicinc.com> > Reviewed-by: Matthias Kaehlcke <mka@chromium.org> > Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> > Signed-off-by: Krishna Kurapati <quic_kriskura@quicinc.com> > --- > Documentation/devicetree/bindings/usb/snps,dwc3.yaml | 5 +++++ > 1 file changed, 5 insertions(+) > Running 'make dtbs_check' with the schema in this patch gives the following warnings. Consider if they are expected or the schema is incorrect. These may not be new warnings. Note that it is not yet a requirement to have 0 warnings for dtbs_check. This will change in the future. Full log is available here: https://patchwork.ozlabs.org/patch/ dwc3@10000000: $nodename:0: 'dwc3@10000000' does not match '^usb(@.*)?' arch/arm/boot/dts/qcom-ipq8064-ap148.dtb arch/arm/boot/dts/qcom-ipq8064-rb3011.dtb dwc3@11000000: $nodename:0: 'dwc3@11000000' does not match '^usb(@.*)?' arch/arm/boot/dts/qcom-ipq8064-ap148.dtb arch/arm/boot/dts/qcom-ipq8064-rb3011.dtb dwc3@6000000: $nodename:0: 'dwc3@6000000' does not match '^usb(@.*)?' arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dtb arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dtb arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1-c1.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1-c3.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c2.dtb dwc3@6a00000: $nodename:0: 'dwc3@6a00000' does not match '^usb(@.*)?' arch/arm64/boot/dts/qcom/apq8096-db820c.dtb arch/arm64/boot/dts/qcom/apq8096-ifc6640.dtb arch/arm64/boot/dts/qcom/msm8996-mtp.dtb arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dtb arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dtb arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dtb arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dtb arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dtb arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dtb arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dtb arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dtb dwc3@7580000: $nodename:0: 'dwc3@7580000' does not match '^usb(@.*)?' arch/arm64/boot/dts/qcom/qcs404-evb-1000.dtb arch/arm64/boot/dts/qcom/qcs404-evb-4000.dtb dwc3@7600000: $nodename:0: 'dwc3@7600000' does not match '^usb(@.*)?' arch/arm64/boot/dts/qcom/apq8096-db820c.dtb arch/arm64/boot/dts/qcom/apq8096-ifc6640.dtb arch/arm64/boot/dts/qcom/msm8996-mtp.dtb arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-dora.dtb arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-kagura.dtb arch/arm64/boot/dts/qcom/msm8996-pmi8996-sony-xperia-tone-keyaki.dtb arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-dora.dtb arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-kagura.dtb arch/arm64/boot/dts/qcom/msm8996-sony-xperia-tone-keyaki.dtb arch/arm64/boot/dts/qcom/msm8996-xiaomi-gemini.dtb arch/arm64/boot/dts/qcom/msm8996-xiaomi-scorpio.dtb dwc3@78c0000: $nodename:0: 'dwc3@78c0000' does not match '^usb(@.*)?' arch/arm64/boot/dts/qcom/qcs404-evb-1000.dtb arch/arm64/boot/dts/qcom/qcs404-evb-4000.dtb dwc3@8a00000: $nodename:0: 'dwc3@8a00000' does not match '^usb(@.*)?' arch/arm64/boot/dts/qcom/ipq8074-hk01.dtb arch/arm64/boot/dts/qcom/ipq8074-hk10-c1.dtb arch/arm64/boot/dts/qcom/ipq8074-hk10-c2.dtb arch/arm/boot/dts/qcom-ipq4018-ap120c-ac-bit.dtb arch/arm/boot/dts/qcom-ipq4018-ap120c-ac.dtb arch/arm/boot/dts/qcom-ipq4018-jalapeno.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk01.1-c1.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1-c1.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk04.1-c3.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c1.dtb arch/arm/boot/dts/qcom-ipq4019-ap.dk07.1-c2.dtb dwc3@8c00000: $nodename:0: 'dwc3@8c00000' does not match '^usb(@.*)?' arch/arm64/boot/dts/qcom/ipq8074-hk01.dtb arch/arm64/boot/dts/qcom/ipq8074-hk10-c1.dtb arch/arm64/boot/dts/qcom/ipq8074-hk10-c2.dtb dwc3@9900000: $nodename:0: 'dwc3@9900000' does not match '^usb(@.*)?' arch/arm/boot/dts/stih407-b2120.dtb arch/arm/boot/dts/stih410-b2120.dtb arch/arm/boot/dts/stih410-b2260.dtb arch/arm/boot/dts/stih418-b2199.dtb arch/arm/boot/dts/stih418-b2264.dtb dwc3@a600000: $nodename:0: 'dwc3@a600000' does not match '^usb(@.*)?' arch/arm64/boot/dts/qcom/sa8155p-adp.dtb arch/arm64/boot/dts/qcom/sc7180-idp.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz-r1.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz-r1-lte.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz-r3.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-coachz-r3-lte.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar-r2.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar-r3.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-homestar-r4.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r4.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r5.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r9.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-r4.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-r9.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r0.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r1.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r1-kb.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r1-lte.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r3.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r3-kb.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r3-lte.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r9.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r9-kb.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-r9-lte.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom-r1.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom-r1-lte.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom-r2.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom-r2-lte.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom-r3.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-pompom-r3-lte.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-r1.dtb arch/arm64/boot/dts/qcom/sc7180-trogdor-r1-lte.dtb arch/arm64/boot/dts/qcom/sdm845-cheza-r1.dtb arch/arm64/boot/dts/qcom/sdm845-cheza-r2.dtb arch/arm64/boot/dts/qcom/sdm845-cheza-r3.dtb arch/arm64/boot/dts/qcom/sdm845-db845c.dtb arch/arm64/boot/dts/qcom/sdm845-mtp.dtb arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dtb arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dtb arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dtb arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dtb arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dtb arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dtb arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dtb arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dtb arch/arm64/boot/dts/qcom/sm8150-hdk.dtb arch/arm64/boot/dts/qcom/sm8150-microsoft-surface-duo.dtb arch/arm64/boot/dts/qcom/sm8150-mtp.dtb arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano-bahamut.dtb arch/arm64/boot/dts/qcom/sm8150-sony-xperia-kumano-griffin.dtb arch/arm/boot/dts/qcom-sdx55-mtp.dtb arch/arm/boot/dts/qcom-sdx55-t55.dtb arch/arm/boot/dts/qcom-sdx55-telit-fn980-tlb.dtb dwc3@a800000: $nodename:0: 'dwc3@a800000' does not match '^usb(@.*)?' arch/arm64/boot/dts/qcom/msm8998-asus-novago-tp370ql.dtb arch/arm64/boot/dts/qcom/msm8998-fxtec-pro1.dtb arch/arm64/boot/dts/qcom/msm8998-hp-envy-x2.dtb arch/arm64/boot/dts/qcom/msm8998-lenovo-miix-630.dtb arch/arm64/boot/dts/qcom/msm8998-mtp.dtb arch/arm64/boot/dts/qcom/msm8998-oneplus-cheeseburger.dtb arch/arm64/boot/dts/qcom/msm8998-oneplus-dumpling.dtb arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-lilac.dtb arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-maple.dtb arch/arm64/boot/dts/qcom/msm8998-sony-xperia-yoshino-poplar.dtb arch/arm64/boot/dts/qcom/sdm845-cheza-r1.dtb arch/arm64/boot/dts/qcom/sdm845-cheza-r2.dtb arch/arm64/boot/dts/qcom/sdm845-cheza-r3.dtb arch/arm64/boot/dts/qcom/sdm845-db845c.dtb arch/arm64/boot/dts/qcom/sdm845-mtp.dtb arch/arm64/boot/dts/qcom/sdm845-oneplus-enchilada.dtb arch/arm64/boot/dts/qcom/sdm845-oneplus-fajita.dtb arch/arm64/boot/dts/qcom/sdm845-shift-axolotl.dtb arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akari.dtb arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-akatsuki.dtb arch/arm64/boot/dts/qcom/sdm845-sony-xperia-tama-apollo.dtb arch/arm64/boot/dts/qcom/sdm845-xiaomi-beryllium.dtb arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dtb arch/arm64/boot/dts/qcom/sdm850-samsung-w737.dtb dwusb@19000000: $nodename:0: 'dwusb@19000000' does not match '^usb(@.*)?' arch/arm64/boot/dts/apm/apm-merlin.dtb arch/arm64/boot/dts/apm/apm-mustang.dtb dwusb@19800000: $nodename:0: 'dwusb@19800000' does not match '^usb(@.*)?' arch/arm64/boot/dts/apm/apm-mustang.dtb usb@38100000: port@0: 'compatible' is a required property arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dtb arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dtb arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtb arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dtb usb@38100000: port@1: 'compatible' is a required property arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dtb arch/arm64/boot/dts/freescale/imx8mq-librem5-r2.dtb arch/arm64/boot/dts/freescale/imx8mq-librem5-r3.dtb arch/arm64/boot/dts/freescale/imx8mq-librem5-r4.dtb usb@65a00000: phys: [[41], [42], [43], [44]] is too long arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dtb usb@65a00000: phys: [[47], [48], [49], [50]] is too long arch/arm/boot/dts/uniphier-ld6b-ref.dtb usb@65a00000: phys: [[48], [49], [50], [51]] is too long arch/arm/boot/dts/uniphier-pxs2-gentil.dtb arch/arm/boot/dts/uniphier-pxs2-vodka.dtb usb@65a00000: phys: [[50], [51], [52], [53], [54], [55]] is too long arch/arm64/boot/dts/socionext/uniphier-ld20-ref.dtb usb@65a00000: phys: [[52], [53], [54], [55], [56], [57]] is too long arch/arm64/boot/dts/socionext/uniphier-ld20-akebi96.dtb usb@65a00000: phys: [[55], [56], [57], [58], [59], [60]] is too long arch/arm64/boot/dts/socionext/uniphier-ld20-global.dtb usb@65c00000: phys: [[55], [56], [57]] is too long arch/arm64/boot/dts/socionext/uniphier-pxs3-ref.dtb usb@65c00000: phys: [[56], [57], [58]] is too long arch/arm/boot/dts/uniphier-ld6b-ref.dtb usb@65c00000: phys: [[57], [58], [59]] is too long arch/arm/boot/dts/uniphier-pxs2-gentil.dtb arch/arm/boot/dts/uniphier-pxs2-vodka.dtb usb@fe200000: interrupt-names: 'oneOf' conditional failed, one must be fixed: arch/arm64/boot/dts/xilinx/avnet-ultra96-rev1.dtb arch/arm64/boot/dts/xilinx/zynqmp-sm-k26-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-smk-k26-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1232-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1254-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1275-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm015-dc1.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm017-dc3.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm018-dc4.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm019-dc5.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.1.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revB.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revC.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dtb usb@fe300000: interrupt-names: 'oneOf' conditional failed, one must be fixed: arch/arm64/boot/dts/xilinx/avnet-ultra96-rev1.dtb arch/arm64/boot/dts/xilinx/zynqmp-sm-k26-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-smk-k26-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1232-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1254-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1275-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm015-dc1.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm016-dc2.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm017-dc3.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm018-dc4.dtb arch/arm64/boot/dts/xilinx/zynqmp-zc1751-xm019-dc5.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu100-revC.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.0.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu102-rev1.1.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu102-revB.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu104-revC.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu106-revA.dtb arch/arm64/boot/dts/xilinx/zynqmp-zcu111-revA.dtb usb@ff100000: resets: [[31, 144, 8], [31, 144, 7], [31, 144, 6], [31, 144, 5]] is too long arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb usb@ff100000: snps,tx_de_emphasis:0: [0, 0, 0, 1] is too long arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb arch/arm64/boot/dts/hisilicon/hi3660-hikey960.dtb