mbox series

[00/11] phy: qcom-qmp: more fixes and cleanups

Message ID 20220914162545.6289-1-johan+linaro@kernel.org
Headers show
Series phy: qcom-qmp: more fixes and cleanups | expand

Message

Johan Hovold Sept. 14, 2022, 4:25 p.m. UTC
Here's the next set of QMP PHY cleanups including some non-critical
fixes of tiny memory leaks on probe deferral (I didn't add a stable tag
for any of them on purpose).

Note that the UFS PHY driver does not use the pcs_misc region either
currently, but I decided to leave the register mapping code in as,
unlike for msm8996, the bindings do include this region.

These apply on top of the previous clean up series, which has been
reviewed by Dmitry and is ready to be merged (apart from possibly a tiny
fixup of the last patch):

	https://lore.kernel.org/all/20220907110728.19092-1-johan+linaro@kernel.org/

Johan


Johan Hovold (11):
  phy: qcom-qmp-pcie: add pcs_misc sanity check
  phy: qcom-qmp-pcie: fix memleak on probe deferral
  phy: qcom-qmp-pcie-msm8996: fix memleak on probe deferral
  phy: qcom-qmp-combo: fix memleak on probe deferral
  phy: qcom-qmp-ufs: fix memleak on probe deferral
  phy: qcom-qmp-usb: fix memleak on probe deferral
  phy: qcom-qmp-pcie-msm8996: drop unused pcs_misc handling
  phy: qcom-qmp-pcie: drop unused legacy DT workaround
  phy: qcom-qmp-combo: drop unused legacy DT workaround
  phy: qcom-qmp-ufs: drop legacy DT workaround
  phy: qcom-qmp-usb: drop legacy DT workaround

 drivers/phy/qualcomm/phy-qcom-qmp-combo.c     | 53 +++++++----------
 .../phy/qualcomm/phy-qcom-qmp-pcie-msm8996.c  | 33 +++--------
 drivers/phy/qualcomm/phy-qcom-qmp-pcie.c      | 59 ++++++++-----------
 drivers/phy/qualcomm/phy-qcom-qmp-ufs.c       | 53 ++++++-----------
 drivers/phy/qualcomm/phy-qcom-qmp-usb.c       | 55 +++++++----------
 5 files changed, 92 insertions(+), 161 deletions(-)

Comments

Johan Hovold Sept. 15, 2022, 2:33 p.m. UTC | #1
On Wed, Sep 14, 2022 at 06:25:34PM +0200, Johan Hovold wrote:
> Here's the next set of QMP PHY cleanups including some non-critical
> fixes of tiny memory leaks on probe deferral (I didn't add a stable tag
> for any of them on purpose).

> Johan Hovold (11):
>   phy: qcom-qmp-pcie: add pcs_misc sanity check
>   phy: qcom-qmp-pcie: fix memleak on probe deferral
>   phy: qcom-qmp-pcie-msm8996: fix memleak on probe deferral
>   phy: qcom-qmp-combo: fix memleak on probe deferral
>   phy: qcom-qmp-ufs: fix memleak on probe deferral
>   phy: qcom-qmp-usb: fix memleak on probe deferral
>   phy: qcom-qmp-pcie-msm8996: drop unused pcs_misc handling
>   phy: qcom-qmp-pcie: drop unused legacy DT workaround
>   phy: qcom-qmp-combo: drop unused legacy DT workaround
>   phy: qcom-qmp-ufs: drop legacy DT workaround
>   phy: qcom-qmp-usb: drop legacy DT workaround

Please hold off with applying this series. I realised that we have a
couple devicetrees in mainline with overlapping register regions for
which the drivers would fail to bind if we start checking checking for
that.

I'll see to fixing those up and look into how to handle backward
compatibility first.

Johan
Johan Hovold Sept. 16, 2022, 10:02 a.m. UTC | #2
On Thu, Sep 15, 2022 at 04:33:08PM +0200, Johan Hovold wrote:
> On Wed, Sep 14, 2022 at 06:25:34PM +0200, Johan Hovold wrote:
> > Here's the next set of QMP PHY cleanups including some non-critical
> > fixes of tiny memory leaks on probe deferral (I didn't add a stable tag
> > for any of them on purpose).
> 
> > Johan Hovold (11):
> >   phy: qcom-qmp-pcie: add pcs_misc sanity check
> >   phy: qcom-qmp-pcie: fix memleak on probe deferral
> >   phy: qcom-qmp-pcie-msm8996: fix memleak on probe deferral
> >   phy: qcom-qmp-combo: fix memleak on probe deferral
> >   phy: qcom-qmp-ufs: fix memleak on probe deferral
> >   phy: qcom-qmp-usb: fix memleak on probe deferral
> >   phy: qcom-qmp-pcie-msm8996: drop unused pcs_misc handling
> >   phy: qcom-qmp-pcie: drop unused legacy DT workaround
> >   phy: qcom-qmp-combo: drop unused legacy DT workaround
> >   phy: qcom-qmp-ufs: drop legacy DT workaround
> >   phy: qcom-qmp-usb: drop legacy DT workaround
> 
> Please hold off with applying this series. I realised that we have a
> couple devicetrees in mainline with overlapping register regions for
> which the drivers would fail to bind if we start checking checking for
> that.
> 
> I'll see to fixing those up and look into how to handle backward
> compatibility first.

So we had four devicetrees (one is new in 6.0) with incorrect serdes
region sizes that included the adjacent regions. I've sent fixes for
those now, and I don't think we need to add workarounds for booting
older malformed dtbs in this case, at least not until someone complains.

We do however have two USB PHY bindings that currently rely on
overlapping regions which would require some more work to be fixed up.

Specifically, the USB PHY driver uses two separate PCS regions but the
binding treats them as one and the driver ends up mapping everything in
between. This sort of works on all platforms but two where the TX and RX
regions lie in between.

The binding and driver should probably be fixed up to define this
PCS_USB region explicitly, but that work is left for another day.

Meanwhile, I've implemented a workaround that fall back to using
non-exclusive mappings for these platforms. I'll send a v2 with this.

Finally, note that new sc8280xp USB4/USB3/DP binding is also broken,
but that's really a separate issue and we're working on fixing that up.

Johan