[U-Boot] net: fec_mxc: multiple calls to fec_mii_setspeed()

Hello,
I just noticed that in fec_mxc.c, fec_mii_setspeed() is called twice if you are calling fecmxc_initialize_multi(), once from fec_get_miibus(), and the other from fec_probe().
Is this intended? If so, would you mind to elaborate a bit?
Thanks,

On Wed, Mar 14, 2018 at 3:15 AM, Yasushi SHOJI yasushi.shoji@gmail.com wrote:
Hello,
I just noticed that in fec_mxc.c, fec_mii_setspeed() is called twice if you are calling fecmxc_initialize_multi(), once from fec_get_miibus(), and the other from fec_probe().
Is this intended? If so, would you mind to elaborate a bit?
I think this is a question for Troy since it seems he made the change in commit fe428b909b83f0ef83d1fbc7a446bfb60bc4fe01 (net: fec_mxc: get phydev before fec_probe). I'm not sure why that would be intended, but also don't know what it hurts other than execution time.
-Joe

On 3/15/2018 12:49 PM, Joe Hershberger wrote:
On Wed, Mar 14, 2018 at 3:15 AM, Yasushi SHOJI yasushi.shoji@gmail.com wrote:
Hello,
I just noticed that in fec_mxc.c, fec_mii_setspeed() is called twice if you are calling fecmxc_initialize_multi(), once from fec_get_miibus(), and the other from fec_probe().
Is this intended? If so, would you mind to elaborate a bit?
I think this is a question for Troy since it seems he made the change in commit fe428b909b83f0ef83d1fbc7a446bfb60bc4fe01 (net: fec_mxc: get phydev before fec_probe). I'm not sure why that would be intended, but also don't know what it hurts other than execution time.
-Joe
Probably playing it safe that
/* Reset chip. */ writel(readl(&fec->eth->ecntrl) | FEC_ECNTRL_RESET, &fec->eth->ecntrl);
might mess up that register on some chip. A lot of manuals to check before removing from fec_probe
Troy
participants (3)
-
Joe Hershberger
-
Troy Kisky
-
Yasushi SHOJI