Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2587983imn; Tue, 2 Aug 2022 08:32:39 -0700 (PDT) X-Google-Smtp-Source: AGRyM1v3T8xAfZPo4zZYoBQbK11c0XZkiu/LmPYOcn0tkK3QTrqckdJepFPfB2IviXHF24acTCGA X-Received: by 2002:a05:6402:2d1:b0:43c:bb20:71bf with SMTP id b17-20020a05640202d100b0043cbb2071bfmr21416409edx.59.1659454358802; Tue, 02 Aug 2022 08:32:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659454358; cv=none; d=google.com; s=arc-20160816; b=pyuYraQw1gS2eNMn6uDH17B8fG17e5S9jrX+0jU/EFcwCNvTZ0bWdbm4qJAMbu67WS yD3/m+vKGIUQ5e9+Rlzym0niTCuGBCjyJXZMOVpkiD4fm931Fy+7l+eD4ksUdO9k8LpQ EWDGrrAq8Us4ftzX0zKUrN1VKjpaTofSPssM+YIO+0WMCNmmmYFtPVmAsUSxnv1v4EDk 4mRSUtt7Lusby0LEoyu+GexZkk7ZN4ncxqmY8wkJTRJB5VgXukGQEggK/Rt4XVrIJiTf ddV/Z/ROoJ5GmopjJZWODiZUiPi90F85ciXsRgaBh3rlRKj5h6jlMICEEolJKFw6tIlq +05A== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=lFJwdRYHGal+fJGxRGPUSF9pL4jsdwjBOfTcVNAhLVA=; b=CsU61/tVLppOp8TCVfAyL130VrwrRRvr9lRCz8zWPYzet0kKQb7X0zUkh/hEEtnRYy FkaIWlv+es73DrAKZEi5M15v20fhJDDHE1cQwhuLxso/RXlL0TeUZkw0IGABZBpi0Xu3 L1Tp/cuwpc9tktprY/mGOTJNQrRq4fjV+n+45plu6cgYImSGGu/YxluGV3OpNBcFRx9J JQaFkKaFkeZvOn9F5p0Y6zlBZq6h6HIgpcj7hBGvuRbyx/aM6MuvUVceXGKLajqXE70T Er/amxIfJ752sCKrDnDn4C1yVjCu3+XW+H9kI5foOZEb9XrD4TQ0Wa/YkSukjT6U/988 KZqg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AJ3gtmLW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa36-20020a17090786a400b0072b4791e326si2540471ejc.181.2022.08.02.08.32.13; Tue, 02 Aug 2022 08:32:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=AJ3gtmLW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237458AbiHBPO4 (ORCPT + 99 others); Tue, 2 Aug 2022 11:14:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53280 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236413AbiHBPOU (ORCPT ); Tue, 2 Aug 2022 11:14:20 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D6BDA18377; Tue, 2 Aug 2022 08:14:18 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6C832B81F28; Tue, 2 Aug 2022 15:14:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F67EC433B5; Tue, 2 Aug 2022 15:14:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659453256; bh=cSnYDdbYYVYdVsk3aJiMwJvB5rQjfNvI8+yuGIb4rRU=; h=From:To:Cc:Subject:Date:From; b=AJ3gtmLWjQqdU4RHtf7Bc6sdpfr/+l7ocKCelqbGWo2WtnSZRpLI5cDBdLILMLomE TSMME2eaKZgiR3pFtlVOwKBegj/Qh8efQyf7qOkd/xRwpXIkvaYbN8TOcKys9YMIpq GpbLo/QBhQheVXZhTPD0HdRix+hVtTI9FjUb7ei5E9bZyX5s0gHHL+H+e0W3Etra64 j8i7iT/bJ2kFDFMo8csmAMaw+1cH4OCMnq6jvBeMGQmEWsJfsoYKdLz7oglxZ7ZwxZ FbINpR/1bj09R57cOPBGDpBHNGz83aE3QPGtwxdAtLiXZM9USQrupFH1Cx+9WChlIT +UURyypvlqY1A== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1oItbL-0000TS-Vg; Tue, 02 Aug 2022 17:14:32 +0200 From: Johan Hovold To: Greg Kroah-Hartman , Felipe Balbi Cc: Rob Herring , Krzysztof Kozlowski , Andy Gross , Bjorn Andersson , Manivannan Sadhasivam , Konrad Dybcio , Krishna Kurapati , Stephen Boyd , Doug Anderson , "Matthias Kaehlcke" , Pavankumar Kondeti , quic_ppratap@quicinc.com, quic_vpulyala@quicinc.com, linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 0/8] usb: dwc3: qcom: fix wakeup implementation Date: Tue, 2 Aug 2022 17:13:56 +0200 Message-Id: <20220802151404.1797-1-johan+linaro@kernel.org> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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: X-Mailing-List: linux-kernel@vger.kernel.org This series fixes some of the fallout after the recently merged series that added wakeup support to the Qualcomm dwc3 driver: https://lore.kernel.org/all/1655094654-24052-1-git-send-email-quic_kriskura@quicinc.com/ The first patch fixes a long standing PHY power sequencing issue in dwc3 core. The second patch reverts a power-domain hack that was added by the above series. There are other ways to implement this which doesn't violate the genpd interface, and if for some reason those are not sufficient, the genpd implementation needs to be extended, not hacked around. The third patch fixes a couple of NULL-pointer dereferences when suspending controllers in peripheral or OTG mode due to a hack that was added to suspend path. Unfortunately, it seems the hack needs to stay for now if we want functioning suspend on some Qualcomm platforms. The fourth patch fixes another issue in the Qualcomm dwc3 implementation that has been added a while back and which breaks runtime PM. The remaining patches moves the wakeup-source property over from the core node to the glue node in the binding and instead propagates the wakeup capability to the former during probe. Note that this incidentally also avoids adding probe-deferral hacks to the driver as was recently proposed to deal with another problem with the current implementation: https://lore.kernel.org/all/1657891312-21748-1-git-send-email-quic_kriskura@quicinc.com/ With this series I have functioning USB system suspend and wakeup as well as somewhat functioning runtime PM in host mode on sc8280xp. Note that the PHYs apparently do not need to be shutdown for wakeup on this platform. Some issues remain such as that the controller needs to be suspended to handle remote wakeup during runtime PM (the wakeup interrupts probably needs to be enabled whenever there's a wakeup-capable device connected to the bus) and that root hub connect/disconnect events cannot selectively be disabled. And of course, the suspend speed hack needs to be replaced at some point but that likely requires some more heavy lifting in the dwc3 implementation. Johan Johan Hovold (8): usb: dwc3: fix PHY disable sequence Revert "usb: dwc3: qcom: Keep power domain on to retain controller status" usb: dwc3: qcom: fix broken non-host-mode suspend usb: dwc3: qcom: fix runtime PM wakeup Revert "dt-bindings: usb: dwc3: Add wakeup-source property support" dt-bindings: usb: qcom,dwc3: add wakeup-source property usb: dwc3: qcom: fix wakeup implementation usb: dwc3: qcom: clean up suspend callbacks .../devicetree/bindings/usb/qcom,dwc3.yaml | 2 + .../devicetree/bindings/usb/snps,dwc3.yaml | 5 -- drivers/usb/dwc3/core.c | 24 +++--- drivers/usb/dwc3/dwc3-qcom.c | 77 ++++++++++--------- 4 files changed, 55 insertions(+), 53 deletions(-) -- 2.35.1