[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DBBPR04MB797907A4C3D7666B867AE2F08BDD0@DBBPR04MB7979.eurprd04.prod.outlook.com>
Date: Thu, 24 Dec 2020 13:15:21 +0000
From: Peter Chen <peter.chen@....com>
To: Pali Rohár <pali@...nel.org>
CC: Mathias Nyman <mathias.nyman@...el.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Gregory CLEMENT <gregory.clement@...tlin.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Tomasz Maciej Nowak <tmn505@...il.com>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] usb: host: xhci: mvebu: make USB 3.0 PHY optional for
Armada 3720
> > > + /* Old bindings miss the PHY handle */
> > > + phy = of_phy_get(dev->of_node, "usb3-phy");
> > > + if (IS_ERR(phy) && PTR_ERR(phy) == -EPROBE_DEFER)
> > > + return -EPROBE_DEFER;
> >
> > Doesn't need to judge IS_ERR(phy).
>
> Ok, I can remove it. I used same condition which is already in SATA and PCIe
> phy code.
>
> > > + else if (IS_ERR(phy))
> > > + goto phy_out;
> > > +
> > > + ret = phy_init(phy);
> > > + if (ret)
> > > + goto phy_put;
> > > +
> > > + ret = phy_set_mode(phy, PHY_MODE_USB_HOST_SS);
> > > + if (ret)
> > > + goto phy_exit;
> > > +
> > > + ret = phy_power_on(phy);
> > > + if (ret == -EOPNOTSUPP) {
> > > + /* Skip initializatin of XHCI PHY when it is unsupported by
> firmware */
> > > + dev_warn(dev, "PHY unsupported by firmware\n");
> > > + xhci->quirks |= XHCI_SKIP_PHY_INIT;
> > > + }
> > > + if (ret)
> > > + goto phy_exit;
> > > +
> > > + phy_power_off(phy);
> > > +phy_exit:
> > > + phy_exit(phy);
> > > +phy_put:
> > > + of_phy_put(phy);
> > > +phy_out:
> > > +
> >
> > You do power on and off again only want to know if PHY has already
> > powered at ATF, right?
>
> I need to know if power on/off procedure is supported by ATF. And if not
> (indicated by -EOPNOTSUPP) then I need to ensure that usb hdc code would not
> try to call phy_power_on() as it would cause failure as described in the commit
> message. You can look at those other two commits for PCIe and SATA. Same
> thing is needed for USB.
If not supported by ATF, then where to power on and off PHY since no other place calls PHY APIs? Is it always on?
Peter
Powered by blists - more mailing lists