Index: rkpciephy.c =================================================================== RCS file: /cvs/src/sys/dev/fdt/rkpciephy.c,v retrieving revision 1.1 diff -u -p -r1.1 rkpciephy.c --- rkpciephy.c 19 Mar 2023 11:17:16 -0000 1.1 +++ rkpciephy.c 27 Mar 2023 06:56:03 -0000 @@ -48,6 +48,7 @@ struct rkpciephy_softc { bus_space_handle_t sc_ioh; struct phy_device sc_pd; + unsigned int sc_pd_enabled; }; int rkpciephy_match(struct device *, void *, void *); @@ -95,6 +96,11 @@ rkpciephy_enable(void *cookie, uint32_t uint32_t grf, stat; int timo; + if (sc->sc_pd_enabled) { + /* turn this into a refcnt when we can disable phys */ + return (0); + } + grf = OF_getpropint(node, "rockchip,phy-grf", 0); rm = regmap_byphandle(grf); if (rm == NULL) @@ -133,5 +139,6 @@ rkpciephy_enable(void *cookie, uint32_t return ETIMEDOUT; } + sc->sc_pd_enabled = 1; return 0; }