Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1209558

Re: [PATCH 03/13] twl4030_charger: correctly handle -EPROBE_DEFER from devm_usb_get_phy_by_node

From NeilBrown <neil@brown.name>
Newsgroups linux.kernel
Subject Re: [PATCH 03/13] twl4030_charger: correctly handle -EPROBE_DEFER from devm_usb_get_phy_by_node
Date 2015-08-19 02:30 +0200
Message-ID <pYZqp-6ka-1@gated-at.bofh.it> (permalink)
References <pRJTr-7hl-3@gated-at.bofh.it> <pRJTt-7hl-37@gated-at.bofh.it> <pYK83-j8-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, 18 Aug 2015 01:07:58 -0700 Tony Lindgren <tony@atomide.com>
wrote:

> * NeilBrown <neil@brown.name> [150729 17:29]:
> > Now that twl4030_bci_probe can safely return -EPROBE_DEFER,
> > do so when devm_usb_get_phy_by_node returns that error.
> > 
> > Signed-off-by: NeilBrown <neil@brown.name>
> > ---
> >  drivers/power/twl4030_charger.c |    6 +++++-
> >  1 file changed, 5 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c
> > index 045238370d3f..ffc123fb7158 100644
> > --- a/drivers/power/twl4030_charger.c
> > +++ b/drivers/power/twl4030_charger.c
> > @@ -636,9 +636,13 @@ static int twl4030_bci_probe(struct platform_device *pdev)
> >  
> >  		phynode = of_find_compatible_node(bci->dev->of_node->parent,
> >  						  NULL, "ti,twl4030-usb");
> > -		if (phynode)
> > +		if (phynode) {
> >  			bci->transceiver = devm_usb_get_phy_by_node(
> >  				bci->dev, phynode, &bci->usb_nb);
> > +			if (IS_ERR(bci->transceiver) &&
> > +			    PTR_ERR(bci->transceiver) == -EPROBE_DEFER)
> > +				return -EPROBE_DEFER;
> > +		}
> >  	}
> 
> Neil, the return with -EPROBE_DEFER here causes flakeyness booting
> for me somehow at least on my logicpd-torpedo-37xx-devkit using
> omap2plus_defconfig.
> 
> It seems that the twl4030_bci_probe keeps looping or something about
> 1/3 of the boots and that probably prevents the other twl modules
> from loading? Reverting this patch alone seems to fix the issue.
> 
> I don't think I have a battery wired on this board the USB is wired
> the same way as on beagle-xm. So I'd assume also flakeyness on beagle
> xm with this patch.
> 
> Regards,
> 
> Tony

What dts file are you using?
I'm guessing that it doesn't have something like:

&usb_otg_hs {
        interface-type = <0>;
        usb-phy = <&usb2_phy>;
        phys = <&usb2_phy>;
        phy-names = "usb2-phy";
        mode = <3>;
        power = <50>;
};

? i.e. with a usb-phy=<&usb2_phy> ?

What if you add

&usb2_phy {
 status = "disabled";
}

to your dts file?

Should the 'status' be disabled in twl4030.dtsi, and then marked OK in
any dts that uses it?  I'm not at all clear on how 'status' is meant to
be used.

Thanks,
NeilBrown

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH 03/13] twl4030_charger: correctly handle -EPROBE_DEFER  from devm_usb_get_phy_by_node Tony Lindgren <tony@atomide.com> - 2015-08-18 10:10 +0200
  Re: [PATCH 03/13] twl4030_charger: correctly handle -EPROBE_DEFER  from devm_usb_get_phy_by_node NeilBrown <neil@brown.name> - 2015-08-19 02:30 +0200
    Re: [PATCH 03/13] twl4030_charger: correctly handle -EPROBE_DEFER  from devm_usb_get_phy_by_node Tony Lindgren <tony@atomide.com> - 2015-08-19 08:30 +0200

csiph-web