[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110921124423.GI28907@S2100-06.ap.freescale.net>
Date: Wed, 21 Sep 2011 20:44:24 +0800
From: Shawn Guo <shawn.guo@...escale.com>
To: Wolfram Sang <w.sang@...gutronix.de>
CC: Shawn Guo <shawn.guo@...aro.org>,
"David S. Miller" <davem@...emloft.net>, <patches@...aro.org>,
<netdev@...r.kernel.org>,
Troy Kisky <troy.kisky@...ndarydevices.com>,
Francois Romieu <romieu@...zoreil.com>,
<linux-arm-kernel@...ts.infradead.org>,
Lothar Waßmann <LW@...O-electronics.de>
Subject: Re: [PATCH v2 1/3] net/fec: change phy-reset-gpio request warning to
debug message
On Wed, Sep 21, 2011 at 02:11:59PM +0200, Wolfram Sang wrote:
> On Wed, Sep 21, 2011 at 08:03:42PM +0800, Shawn Guo wrote:
> > On Wed, Sep 21, 2011 at 01:25:55PM +0200, Wolfram Sang wrote:
> > > Hi Shawn,
> > >
> > > On Wed, Sep 21, 2011 at 07:10:30PM +0800, Shawn Guo wrote:
> > > > FEC can work without a phy reset on some platforms, which means not
> > > > very platform necessarily have a phy-reset gpio encoded in device tree.
> > > > So it makes more sense to have the phy-reset-gpio request failure as
> > > > a debug message rather than a warning.
> > >
> > > Or remove it entirely?
> > >
> > I would like to keep it. When people want to debug at this point, they
> > do not need to type the debug message.
>
> I just think the message might be confusing in case you don't need the
> gpio, because then failing is expected behaviour. For those platforms,
> it is not even an error then, so you must drop returning the error. To
> be very precise, you should check of_get_named_gpio() and return if no
> gpio is specified. Then, you can distinguish that case from problems
> when getting the GPIO.
>
The whole fec_reset_phy() should not be a show-stopper failure. Even
on platforms that have the gpio, FEC can work without resetting the
phy in FEC driver for some cases, for example, boot loader has done it.
It might be good enough to give a warning message rather than getting
the probe fail.
> > > I also wanted to suggested to drop returning the error code, since it is
> > > not an error anymore, strictly speaking. Then I noticed that the caller
> > > does not check the error code. So, this could be added or turn the
> > > function to void?
> > >
> > To me, keep the return value as integer is more scalable. Someday,
> > someone need to add more stuff in the function, or want to improve
> > the caller to check return value, it plays.
>
> I agree that keeping it int is way better. But why not add it now to
> keep things proper and tested? If this patch gets accepted as it is and
> later someone else will add error checking to the caller, your platform
> will lose FEC support as a regression.
>
Again, fec_reset_phy() failure is not a show-stopper. We might not
want to make the probe fail because of that.
--
Regards,
Shawn
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists