All of lore.kernel.org
 help / color / mirror / Atom feed
From: Johan Hovold <johan+linaro@kernel.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Felipe Balbi <balbi@kernel.org>
Cc: Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Andy Gross <agross@kernel.org>,
	Bjorn Andersson <bjorn.andersson@linaro.org>,
	Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>,
	Konrad Dybcio <konrad.dybcio@somainline.org>,
	Krishna Kurapati <quic_kriskura@quicinc.com>,
	Stephen Boyd <swboyd@chromium.org>,
	Doug Anderson <dianders@chromium.org>,
	"Matthias Kaehlcke" <mka@chromium.org>,
	Pavankumar Kondeti <quic_pkondeti@quicinc.com>,
	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 <johan+linaro@kernel.org>
Subject: [PATCH v2 0/9] usb: dwc3: qcom: fix wakeup implementation
Date: Thu,  4 Aug 2022 17:09:52 +0200	[thread overview]
Message-ID: <20220804151001.23612-1-johan+linaro@kernel.org> (raw)

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 build breakage caused by the same series. (new
in v2)

The fourth patch fixes another long-standing bug which could lead to a
use-after-free when using runtime PM. (new in v2)

The next patch fixes another issue in the Qualcomm dwc3 implementation
that has been added a while back and which breaks runtime PM.

The sixt patch fixes a NULL-pointer dereference or use-after-free 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 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 not to be left enabled for wakeup on
this platform.

Some issues remain such as 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

Changes in v2
 - add review and ack tags
 - fix a gadget-only build breakage (new patch)
 - fix a use-after-free on wakeup from runtime suspend (new patch)
 - disable wakeup completely instead of falling back to the
   "disconnected" host configuration when not acting as host
 - disallow 'wakeup-source' in child node in the binding


Johan Hovold (9):
  usb: dwc3: fix PHY disable sequence
  Revert "usb: dwc3: qcom: Keep power domain on to retain controller
    status"
  usb: dwc3: qcom: fix gadget-only builds
  usb: dwc3: qcom: fix use-after-free on runtime-PM wakeup
  usb: dwc3: qcom: fix runtime PM wakeup
  usb: dwc3: qcom: fix peripheral and OTG suspend
  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    |  5 +
 drivers/usb/dwc3/core.c                       | 24 ++---
 drivers/usb/dwc3/dwc3-qcom.c                  | 96 +++++++++++--------
 drivers/usb/dwc3/host.c                       |  1 +
 4 files changed, 76 insertions(+), 50 deletions(-)

-- 
2.35.1


             reply	other threads:[~2022-08-04 15:10 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-04 15:09 Johan Hovold [this message]
2022-08-04 15:09 ` [PATCH v2 1/9] usb: dwc3: fix PHY disable sequence Johan Hovold
2022-08-06 13:48   ` Manivannan Sadhasivam
2022-08-04 15:09 ` [PATCH v2 2/9] Revert "usb: dwc3: qcom: Keep power domain on to retain controller status" Johan Hovold
2022-08-06 13:52   ` Manivannan Sadhasivam
2022-08-04 15:09 ` [PATCH v2 3/9] usb: dwc3: qcom: fix gadget-only builds Johan Hovold
2022-08-04 18:18   ` Randy Dunlap
2022-08-06 14:15   ` Manivannan Sadhasivam
2022-08-06 16:04     ` Johan Hovold
2022-08-06 16:42       ` Manivannan Sadhasivam
2022-08-06 16:51         ` Johan Hovold
2022-08-08 13:05   ` Greg Kroah-Hartman
2022-08-08 13:34     ` Johan Hovold
2022-08-18 17:44       ` Greg Kroah-Hartman
2022-08-04 15:09 ` [PATCH v2 4/9] usb: dwc3: qcom: fix use-after-free on runtime-PM wakeup Johan Hovold
2022-08-04 15:53   ` Matthias Kaehlcke
2022-08-06 14:33   ` Manivannan Sadhasivam
2022-08-06 16:08     ` Johan Hovold
2022-08-06 16:44       ` Manivannan Sadhasivam
2022-08-04 15:09 ` [PATCH v2 5/9] usb: dwc3: qcom: fix runtime PM wakeup Johan Hovold
2022-08-04 20:00   ` Matthias Kaehlcke
2022-08-06 14:35   ` Manivannan Sadhasivam
2022-08-04 15:09 ` [PATCH v2 6/9] usb: dwc3: qcom: fix peripheral and OTG suspend Johan Hovold
2022-08-04 21:38   ` kernel test robot
2022-08-05  6:58     ` Johan Hovold
2022-08-05  6:58       ` Johan Hovold
2022-08-05  7:10       ` Johan Hovold
2022-08-05  7:10         ` Johan Hovold
2022-08-04 15:09 ` [PATCH v2 7/9] dt-bindings: usb: qcom,dwc3: add wakeup-source property Johan Hovold
2022-08-06 15:08   ` Manivannan Sadhasivam
2022-08-06 16:41     ` Johan Hovold
2022-08-06 16:52       ` Manivannan Sadhasivam
2022-08-06 17:09         ` Johan Hovold
2022-08-08  8:05           ` Manivannan Sadhasivam
2022-08-04 15:10 ` [PATCH v2 8/9] usb: dwc3: qcom: fix wakeup implementation Johan Hovold
2022-08-04 16:59   ` Matthias Kaehlcke
2022-08-05 16:58     ` Matthias Kaehlcke
2022-08-06 16:22       ` Johan Hovold
2022-08-08 17:22         ` Matthias Kaehlcke
2022-08-06 14:57   ` Manivannan Sadhasivam
2022-08-06 16:33     ` Johan Hovold
2022-08-04 15:10 ` [PATCH v2 9/9] usb: dwc3: qcom: clean up suspend callbacks Johan Hovold
2022-08-04 17:08   ` Matthias Kaehlcke
2022-08-04 15:15 ` [PATCH v2 0/9] usb: dwc3: qcom: fix wakeup implementation Johan Hovold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220804151001.23612-1-johan+linaro@kernel.org \
    --to=johan+linaro@kernel.org \
    --cc=agross@kernel.org \
    --cc=balbi@kernel.org \
    --cc=bjorn.andersson@linaro.org \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=konrad.dybcio@somainline.org \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=manivannan.sadhasivam@linaro.org \
    --cc=mka@chromium.org \
    --cc=quic_kriskura@quicinc.com \
    --cc=quic_pkondeti@quicinc.com \
    --cc=quic_ppratap@quicinc.com \
    --cc=quic_vpulyala@quicinc.com \
    --cc=robh+dt@kernel.org \
    --cc=swboyd@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.