From: Albert ARIBAUD <albert.aribaud@3adev.fr>
To: Fabio Estevam <festevam@gmail.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
Jiri Kosina <trivial@kernel.org>,
Fugang Duan <fugang.duan@nxp.com>
Subject: Re: [PATCH] net: trivial: fix fsl fec_main mdio write return value
Date: Mon, 26 Sep 2016 23:10:41 +0200 [thread overview]
Message-ID: <20160926231041.41091069.albert.aribaud@3adev.fr> (raw)
In-Reply-To: <CAOMZO5BikGA9e6goMs0wqNVHvWW9Mf3SpykA=DWfD4Q2gBbkag@mail.gmail.com>
Hi Fabio,
You are correct -- I'd rebased my patch as part of a series, and I did
not notice that the fix was already there. Apologies and thanks for
pointing it out.
Le Mon, 26 Sep 2016 18:00:32 -0300, Fabio Estevam <festevam@gmail.com>
a écrit :
> Hi Albert,
>
> On Mon, Sep 26, 2016 at 4:11 PM, Albert ARIBAUD (3ADEV)
> <albert.aribaud@3adev.fr> wrote:
> > If the MDIO enf-of-transfer wait loop does not time out,
> > 0 should be returned to the caller through ret, but ret
> > was not reset to 0 after receiving the return value of
> > pm_runtime_get_sync(). Reset ret when no time out occurred.Is this really needed?
>
> Commit 42ea4457 ("net: fec: normalize return value of
> pm_runtime_get_sync() in MDIO write") does the following:
>
> diff --git a/drivers/net/ethernet/freescale/fec_main.c
> b/drivers/net/ethernet/freescale/fec_main.c
> index 91925e3..6cc3340 100644
> --- a/drivers/net/ethernet/freescale/fec_main.c
> +++ b/drivers/net/ethernet/freescale/fec_main.c
> @@ -1816,11 +1816,13 @@ static int fec_enet_mdio_write(struct mii_bus
> *bus, int mii_id, int regnum,
> struct fec_enet_private *fep = bus->priv;
> struct device *dev = &fep->pdev->dev;
> unsigned long time_left;
> - int ret = 0;
> + int ret;
>
> ret = pm_runtime_get_sync(dev);
> if (ret < 0)
> return ret;
> + else
> + ret = 0;
>
> > diff --git a/drivers/net/ethernet/freescale/fec_main.c
> > b/drivers/net/ethernet/freescale/fec_main.c index 01f7e81..0413c05
> > 100644 --- a/drivers/net/ethernet/freescale/fec_main.c
> > +++ b/drivers/net/ethernet/freescale/fec_main.c
> > @@ -1818,6 +1818,8 @@ static int fec_enet_mdio_write(struct mii_bus
> > *bus, int mii_id, int regnum, netdev_err(fep->netdev, "MDIO write
> > timeout\n"); ret = -ETIMEDOUT;
> > }
> > + else
> > + ret = 0;
>
> , so is this really needed? ret should be 0 at this point.
Cordialement,
Albert ARIBAUD
3ADEV
next prev parent reply other threads:[~2016-09-26 21:10 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-26 19:11 [PATCH] net: trivial: fix fsl fec_main mdio write return value Albert ARIBAUD (3ADEV)
2016-09-26 19:15 ` Albert ARIBAUD
2016-09-26 21:00 ` Fabio Estevam
2016-09-26 21:10 ` Albert ARIBAUD [this message]
2016-09-26 22:10 ` Sergei Shtylyov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160926231041.41091069.albert.aribaud@3adev.fr \
--to=albert.aribaud@3adev.fr \
--cc=festevam@gmail.com \
--cc=fugang.duan@nxp.com \
--cc=netdev@vger.kernel.org \
--cc=trivial@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox