mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sam Ravnborg <sam@ravnborg.org>
To: barebox@lists.infradead.org
Subject: Re: [PATCH v1 2/2] phylib: add support for reset-gpios
Date: Wed, 8 Aug 2018 06:51:12 +0200	[thread overview]
Message-ID: <20180808045112.GA16829@ravnborg.org> (raw)
In-Reply-To: <20180807211715.GB24765@ravnborg.org>

Hi.

After sleeping on this I realizrd this patch is buggy.

> @@ -147,9 +189,6 @@ int mdiobus_register(struct mii_bus *bus)
>  		return -EINVAL;
>  	}
>  
> -	if (bus->reset)
> -		bus->reset(bus);
> -
>  	list_add_tail(&bus->list, &mii_bus_list);
>  
>  	pr_info("%s: probed\n", dev_name(&bus->dev));
> @@ -157,6 +196,10 @@ int mdiobus_register(struct mii_bus *bus)
>  	if (bus->dev.device_node)
>  		of_mdiobus_register(bus, bus->dev.device_node);

Within of_mdiobus_register() we call get_phy_device() which read from
the mdio bus. So the reset needs to be performed before we call
of_mdio_register.

So a little restructuring is required since we want to perform
both bus->reset() and mdiobus_reset() before we call get_phy_device().

I will fix this in v2.

	Sam

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2018-08-08  4:51 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-07 21:14 [PATCH v1 0/2] Add Davicom phy + reset-gpios Sam Ravnborg
2018-08-07 21:16 ` [PATCH v1 1/2] phylib: add Davicom support Sam Ravnborg
2018-08-07 21:17 ` [PATCH v1 2/2] phylib: add support for reset-gpios Sam Ravnborg
2018-08-08  4:51   ` Sam Ravnborg [this message]

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=20180808045112.GA16829@ravnborg.org \
    --to=sam@ravnborg.org \
    --cc=barebox@lists.infradead.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