public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] eth: asix88179: Reset device during probe with DM_ETH enabled
@ 2016-08-30 14:01 Nikolaus Schulz
  2016-08-31 12:33 ` Marek Vasut
  2016-09-06  1:04 ` Simon Glass
  0 siblings, 2 replies; 6+ messages in thread
From: Nikolaus Schulz @ 2016-08-30 14:01 UTC (permalink / raw)
  To: u-boot

With the ethernet driver model enabled, reset the device before reading
the MAC address, just like it's done for the non-device-model code path.
This avoids a timeout when the interface is first used.

Signed-off-by: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>
---
 drivers/usb/eth/asix88179.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
index 7548269..0725940 100644
--- a/drivers/usb/eth/asix88179.c
+++ b/drivers/usb/eth/asix88179.c
@@ -878,6 +878,10 @@ static int ax88179_eth_probe(struct udevice *dev)
 	usb_dev = priv->ueth.pusb_dev;
 	priv->maxpacketsize = usb_dev->epmaxpacketout[AX_ENDPOINT_OUT];
 
+	ret = asix_basic_reset(&priv->ueth, priv);
+	if (ret)
+		return ret;
+
 	/* Get the MAC address */
 	ret = asix_read_mac(&priv->ueth, pdata->enetaddr);
 	if (ret)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] eth: asix88179: Reset device during probe with DM_ETH enabled
  2016-08-30 14:01 [U-Boot] [PATCH] eth: asix88179: Reset device during probe with DM_ETH enabled Nikolaus Schulz
@ 2016-08-31 12:33 ` Marek Vasut
  2016-09-06  1:04 ` Simon Glass
  1 sibling, 0 replies; 6+ messages in thread
From: Marek Vasut @ 2016-08-31 12:33 UTC (permalink / raw)
  To: u-boot

On 08/30/2016 04:01 PM, Nikolaus Schulz wrote:
> With the ethernet driver model enabled, reset the device before reading
> the MAC address, just like it's done for the non-device-model code path.
> This avoids a timeout when the interface is first used.
> 
> Signed-off-by: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>

I'd like some more ACKs on this or Tested-bys before I apply it as I
don't have that hardware. I am fine with the patch itself though.

> ---
>  drivers/usb/eth/asix88179.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
> index 7548269..0725940 100644
> --- a/drivers/usb/eth/asix88179.c
> +++ b/drivers/usb/eth/asix88179.c
> @@ -878,6 +878,10 @@ static int ax88179_eth_probe(struct udevice *dev)
>  	usb_dev = priv->ueth.pusb_dev;
>  	priv->maxpacketsize = usb_dev->epmaxpacketout[AX_ENDPOINT_OUT];
>  
> +	ret = asix_basic_reset(&priv->ueth, priv);
> +	if (ret)
> +		return ret;
> +
>  	/* Get the MAC address */
>  	ret = asix_read_mac(&priv->ueth, pdata->enetaddr);
>  	if (ret)
> 


-- 
Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] eth: asix88179: Reset device during probe with DM_ETH enabled
  2016-08-30 14:01 [U-Boot] [PATCH] eth: asix88179: Reset device during probe with DM_ETH enabled Nikolaus Schulz
  2016-08-31 12:33 ` Marek Vasut
@ 2016-09-06  1:04 ` Simon Glass
  2016-09-06  7:44   ` Alban Bedel
  2016-09-06  9:33   ` Nikolaus Schulz
  1 sibling, 2 replies; 6+ messages in thread
From: Simon Glass @ 2016-09-06  1:04 UTC (permalink / raw)
  To: u-boot

Hi,

On 30 August 2016 at 08:01, Nikolaus Schulz
<nikolaus.schulz@avionic-design.de> wrote:
> With the ethernet driver model enabled, reset the device before reading
> the MAC address, just like it's done for the non-device-model code path.
> This avoids a timeout when the interface is first used.
>
> Signed-off-by: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>
> ---
>  drivers/usb/eth/asix88179.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
> index 7548269..0725940 100644
> --- a/drivers/usb/eth/asix88179.c
> +++ b/drivers/usb/eth/asix88179.c
> @@ -878,6 +878,10 @@ static int ax88179_eth_probe(struct udevice *dev)
>         usb_dev = priv->ueth.pusb_dev;
>         priv->maxpacketsize = usb_dev->epmaxpacketout[AX_ENDPOINT_OUT];
>
> +       ret = asix_basic_reset(&priv->ueth, priv);
> +       if (ret)
> +               return ret;
> +
>         /* Get the MAC address */
>         ret = asix_read_mac(&priv->ueth, pdata->enetaddr);
>         if (ret)

How come this doesn't happen in ax88179_eth_start()?

> --
> 2.1.4
>

Regards,
Simon

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] eth: asix88179: Reset device during probe with DM_ETH enabled
  2016-09-06  1:04 ` Simon Glass
@ 2016-09-06  7:44   ` Alban Bedel
  2016-09-06  9:33   ` Nikolaus Schulz
  1 sibling, 0 replies; 6+ messages in thread
From: Alban Bedel @ 2016-09-06  7:44 UTC (permalink / raw)
  To: u-boot

On Mon, 5 Sep 2016 19:04:49 -0600
Simon Glass <sjg@chromium.org> wrote:

> Hi,
> 
> On 30 August 2016 at 08:01, Nikolaus Schulz
> <nikolaus.schulz@avionic-design.de> wrote:
> > With the ethernet driver model enabled, reset the device before reading
> > the MAC address, just like it's done for the non-device-model code path.
> > This avoids a timeout when the interface is first used.
> >
> > Signed-off-by: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>
> > ---
> >  drivers/usb/eth/asix88179.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
> > index 7548269..0725940 100644
> > --- a/drivers/usb/eth/asix88179.c
> > +++ b/drivers/usb/eth/asix88179.c
> > @@ -878,6 +878,10 @@ static int ax88179_eth_probe(struct udevice *dev)
> >         usb_dev = priv->ueth.pusb_dev;
> >         priv->maxpacketsize = usb_dev->epmaxpacketout[AX_ENDPOINT_OUT];
> >
> > +       ret = asix_basic_reset(&priv->ueth, priv);
> > +       if (ret)
> > +               return ret;
> > +
> >         /* Get the MAC address */
> >         ret = asix_read_mac(&priv->ueth, pdata->enetaddr);
> >         if (ret)  
> 
> How come this doesn't happen in ax88179_eth_start()?

It happen in ax88179_eth_get_info() in the non DM case, that's why it
was overseen when adding DM support.

Alban
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: OpenPGP digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20160906/9befde4f/attachment.sig>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] eth: asix88179: Reset device during probe with DM_ETH enabled
  2016-09-06  1:04 ` Simon Glass
  2016-09-06  7:44   ` Alban Bedel
@ 2016-09-06  9:33   ` Nikolaus Schulz
  2016-09-06 12:46     ` Simon Glass
  1 sibling, 1 reply; 6+ messages in thread
From: Nikolaus Schulz @ 2016-09-06  9:33 UTC (permalink / raw)
  To: u-boot

On Mon, Sep 05, 2016 at 07:04:49PM -0600, Simon Glass wrote:
> On 30 August 2016 at 08:01, Nikolaus Schulz
> <nikolaus.schulz@avionic-design.de> wrote:
> > With the ethernet driver model enabled, reset the device before reading
> > the MAC address, just like it's done for the non-device-model code path.
> > This avoids a timeout when the interface is first used.
> >
> > Signed-off-by: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>
> > ---
> >  drivers/usb/eth/asix88179.c | 4 ++++
> >  1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
> > index 7548269..0725940 100644
> > --- a/drivers/usb/eth/asix88179.c
> > +++ b/drivers/usb/eth/asix88179.c
> > @@ -878,6 +878,10 @@ static int ax88179_eth_probe(struct udevice *dev)
> >         usb_dev = priv->ueth.pusb_dev;
> >         priv->maxpacketsize = usb_dev->epmaxpacketout[AX_ENDPOINT_OUT];
> >
> > +       ret = asix_basic_reset(&priv->ueth, priv);
> > +       if (ret)
> > +               return ret;
> > +
> >         /* Get the MAC address */
> >         ret = asix_read_mac(&priv->ueth, pdata->enetaddr);
> >         if (ret)
> 
> How come this doesn't happen in ax88179_eth_start()?

In fact I first had put it there, but that was basically killing the
ethernet. And having it in the probe function matches the non-DM code
path, which has it in ax88179_eth_get_info.

Nikolaus

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [U-Boot] [PATCH] eth: asix88179: Reset device during probe with DM_ETH enabled
  2016-09-06  9:33   ` Nikolaus Schulz
@ 2016-09-06 12:46     ` Simon Glass
  0 siblings, 0 replies; 6+ messages in thread
From: Simon Glass @ 2016-09-06 12:46 UTC (permalink / raw)
  To: u-boot

Hi,

On 6 September 2016 at 03:33, Nikolaus Schulz
<nikolaus.schulz@avionic-design.de> wrote:
> On Mon, Sep 05, 2016 at 07:04:49PM -0600, Simon Glass wrote:
>> On 30 August 2016 at 08:01, Nikolaus Schulz
>> <nikolaus.schulz@avionic-design.de> wrote:
>> > With the ethernet driver model enabled, reset the device before reading
>> > the MAC address, just like it's done for the non-device-model code path.
>> > This avoids a timeout when the interface is first used.
>> >
>> > Signed-off-by: Nikolaus Schulz <nikolaus.schulz@avionic-design.de>
>> > ---
>> >  drivers/usb/eth/asix88179.c | 4 ++++
>> >  1 file changed, 4 insertions(+)
>> >
>> > diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c
>> > index 7548269..0725940 100644
>> > --- a/drivers/usb/eth/asix88179.c
>> > +++ b/drivers/usb/eth/asix88179.c
>> > @@ -878,6 +878,10 @@ static int ax88179_eth_probe(struct udevice *dev)
>> >         usb_dev = priv->ueth.pusb_dev;
>> >         priv->maxpacketsize = usb_dev->epmaxpacketout[AX_ENDPOINT_OUT];
>> >
>> > +       ret = asix_basic_reset(&priv->ueth, priv);
>> > +       if (ret)
>> > +               return ret;
>> > +
>> >         /* Get the MAC address */
>> >         ret = asix_read_mac(&priv->ueth, pdata->enetaddr);
>> >         if (ret)
>>
>> How come this doesn't happen in ax88179_eth_start()?
>
> In fact I first had put it there, but that was basically killing the
> ethernet. And having it in the probe function matches the non-DM code
> path, which has it in ax88179_eth_get_info.

OK thanks.

Reviewed-by: Simon Glass <sjg@chromium.org>

>
> Nikolaus

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2016-09-06 12:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-30 14:01 [U-Boot] [PATCH] eth: asix88179: Reset device during probe with DM_ETH enabled Nikolaus Schulz
2016-08-31 12:33 ` Marek Vasut
2016-09-06  1:04 ` Simon Glass
2016-09-06  7:44   ` Alban Bedel
2016-09-06  9:33   ` Nikolaus Schulz
2016-09-06 12:46     ` Simon Glass

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox