[U-Boot] [PATCH 1/5] net: mdio: Add mdio_free() and mdio_unregister() API

Currently there is no API to uninitialize mdio. Add two APIs for this.
Signed-off-by: Bin Meng bmeng.cn@gmail.com ---
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)
diff --git a/common/miiphyutil.c b/common/miiphyutil.c index c88c28a..e499b58 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -152,6 +152,11 @@ struct mii_dev *mdio_alloc(void) return bus; }
+void mdio_free(struct mii_dev *bus) +{ + free(bus); +} + int mdio_register(struct mii_dev *bus) { if (!bus || !bus->name || !bus->read || !bus->write) @@ -173,6 +178,20 @@ int mdio_register(struct mii_dev *bus) return 0; }
+int mdio_unregister(struct mii_dev *bus) +{ + if (!bus) + return 0; + + /* delete it from the list */ + list_del(&bus->link); + + if (current_mii == bus) + current_mii = NULL; + + return 0; +} + void mdio_list_devices(void) { struct list_head *entry; diff --git a/include/miiphy.h b/include/miiphy.h index 088797e..af12274 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -59,7 +59,9 @@ struct phy_device *mdio_phydev_for_ethname(const char *devname); void miiphy_listdev(void);
struct mii_dev *mdio_alloc(void); +void mdio_free(struct mii_dev *bus); int mdio_register(struct mii_dev *bus); +int mdio_unregister(struct mii_dev *bus); void mdio_list_devices(void);
#ifdef CONFIG_BITBANGMII

In designware_eth_probe(), some additional resources are allocated (eg: mdio, phy). We should free these in the driver remove phase. Add designware_eth_remove() to clean it up.
Signed-off-by: Bin Meng bmeng.cn@gmail.com ---
drivers/net/designware.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/drivers/net/designware.c b/drivers/net/designware.c index d45340c..d2aedb0 100644 --- a/drivers/net/designware.c +++ b/drivers/net/designware.c @@ -609,6 +609,17 @@ static int designware_eth_probe(struct udevice *dev) return ret; }
+static int designware_eth_remove(struct udevice *dev) +{ + struct dw_eth_dev *priv = dev_get_priv(dev); + + free(priv->phydev); + mdio_unregister(priv->bus); + mdio_free(priv->bus); + + return 0; +} + static const struct eth_ops designware_eth_ops = { .start = designware_eth_start, .send = designware_eth_send, @@ -649,6 +660,7 @@ U_BOOT_DRIVER(eth_designware) = { .ofdata_to_platdata = designware_eth_ofdata_to_platdata, .bind = designware_eth_bind, .probe = designware_eth_probe, + .remove = designware_eth_remove, .ops = &designware_eth_ops, .priv_auto_alloc_size = sizeof(struct dw_eth_dev), .platdata_auto_alloc_size = sizeof(struct eth_pdata),

On 4 September 2015 at 08:53, Bin Meng bmeng.cn@gmail.com wrote:
In designware_eth_probe(), some additional resources are allocated (eg: mdio, phy). We should free these in the driver remove phase. Add designware_eth_remove() to clean it up.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
drivers/net/designware.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Acked-by: Simon Glass sjg@chromium.org

In pch_gbe_probe(), some additional resources are allocated (eg: mdio, phy). We should free these in the driver remove phase. Add pch_gbe_remove() to clean it up.
Signed-off-by: Bin Meng bmeng.cn@gmail.com ---
drivers/net/pch_gbe.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
diff --git a/drivers/net/pch_gbe.c b/drivers/net/pch_gbe.c index 004fcf8..dfc0100 100644 --- a/drivers/net/pch_gbe.c +++ b/drivers/net/pch_gbe.c @@ -452,6 +452,17 @@ int pch_gbe_probe(struct udevice *dev) return pch_gbe_phy_init(dev); }
+int pch_gbe_remove(struct udevice *dev) +{ + struct pch_gbe_priv *priv = dev_get_priv(dev); + + free(priv->phydev); + mdio_unregister(priv->bus); + mdio_free(priv->bus); + + return 0; +} + static const struct eth_ops pch_gbe_ops = { .start = pch_gbe_start, .send = pch_gbe_send, @@ -470,6 +481,7 @@ U_BOOT_DRIVER(eth_pch_gbe) = { .id = UCLASS_ETH, .of_match = pch_gbe_ids, .probe = pch_gbe_probe, + .remove = pch_gbe_remove, .ops = &pch_gbe_ops, .priv_auto_alloc_size = sizeof(struct pch_gbe_priv), .platdata_auto_alloc_size = sizeof(struct eth_pdata),

On Friday, 4 September 2015, Bin Meng bmeng.cn@gmail.com wrote:
In pch_gbe_probe(), some additional resources are allocated (eg: mdio, phy). We should free these in the driver remove phase. Add pch_gbe_remove() to clean it up.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
drivers/net/pch_gbe.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Reviewed-by: Simon Glass sjg@chromium.org

When something goes wrong during device_probe(), we just need do device_remove() which calls device_free() internally.
Signed-off-by: Bin Meng bmeng.cn@gmail.com ---
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/core/device.c b/drivers/core/device.c index a6cd936..061a7ef 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -316,19 +316,14 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
ret = uclass_post_probe_device(dev); if (ret) - goto fail_uclass; + goto fail;
return 0; -fail_uclass: +fail: if (device_remove(dev)) { dm_warn("%s: Device '%s' failed to remove on error path\n", __func__, dev->name); } -fail: - dev->flags &= ~DM_FLAG_ACTIVATED; - - dev->seq = -1; - device_free(dev);
return ret; }

Hi Bin,
On Friday, 4 September 2015, Bin Meng bmeng.cn@gmail.com wrote:
When something goes wrong during device_probe(), we just need do device_remove() which calls device_free() internally.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/core/device.c b/drivers/core/device.c index a6cd936..061a7ef 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -316,19 +316,14 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
ret = uclass_post_probe_device(dev); if (ret)
goto fail_uclass;
goto fail; return 0;
-fail_uclass: +fail: if (device_remove(dev)) { dm_warn("%s: Device '%s' failed to remove on error path\n", __func__, dev->name); } -fail:
dev->flags &= ~DM_FLAG_ACTIVATED;
dev->seq = -1;
device_free(dev); return ret;
}
The problem is that in this case you end up calling functions that should not be called. For example uclass_pre_remove_device() will be called even if uclass_post_probe_device() was not.
There is definitely room for improvement here - we could/should call only those 'remove' functions that mirror the 'probe' ones we called. But that is quite a lot of code for little benefit.
Regards, Simon

Hi Simon,
On Thu, Sep 10, 2015 at 2:07 AM, Simon Glass sjg@chromium.org wrote:
Hi Bin,
On Friday, 4 September 2015, Bin Meng bmeng.cn@gmail.com wrote:
When something goes wrong during device_probe(), we just need do device_remove() which calls device_free() internally.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/core/device.c b/drivers/core/device.c index a6cd936..061a7ef 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -316,19 +316,14 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
ret = uclass_post_probe_device(dev); if (ret)
goto fail_uclass;
goto fail; return 0;
-fail_uclass: +fail: if (device_remove(dev)) { dm_warn("%s: Device '%s' failed to remove on error path\n", __func__, dev->name); } -fail:
dev->flags &= ~DM_FLAG_ACTIVATED;
dev->seq = -1;
device_free(dev); return ret;
}
The problem is that in this case you end up calling functions that should not be called. For example uclass_pre_remove_device() will be called even if uclass_post_probe_device() was not.
Yes, but doing uclass_pre_remove_device() should not bring any harm, given we already want to remove this device, right?
There is definitely room for improvement here - we could/should call only those 'remove' functions that mirror the 'probe' ones we called. But that is quite a lot of code for little benefit.
Regards, Bin

Hi Bin,
On 10 September 2015 at 00:07, Bin Meng bmeng.cn@gmail.com wrote:
Hi Simon,
On Thu, Sep 10, 2015 at 2:07 AM, Simon Glass sjg@chromium.org wrote:
Hi Bin,
On Friday, 4 September 2015, Bin Meng bmeng.cn@gmail.com wrote:
When something goes wrong during device_probe(), we just need do device_remove() which calls device_free() internally.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/core/device.c b/drivers/core/device.c index a6cd936..061a7ef 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -316,19 +316,14 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
ret = uclass_post_probe_device(dev); if (ret)
goto fail_uclass;
goto fail; return 0;
-fail_uclass: +fail: if (device_remove(dev)) { dm_warn("%s: Device '%s' failed to remove on error path\n", __func__, dev->name); } -fail:
dev->flags &= ~DM_FLAG_ACTIVATED;
dev->seq = -1;
device_free(dev); return ret;
}
The problem is that in this case you end up calling functions that should not be called. For example uclass_pre_remove_device() will be called even if uclass_post_probe_device() was not.
Yes, but doing uclass_pre_remove_device() should not bring any harm, given we already want to remove this device, right?
That function is entitled to assume that the device was set up at least to the post_remove uclass state. Here that would not be try, so we are creating an entirely new test case.
There is definitely room for improvement here - we could/should call only those 'remove' functions that mirror the 'probe' ones we called. But that is quite a lot of code for little benefit.
Regards, Simon

Hi Simon,
On Fri, Sep 11, 2015 at 8:38 AM, Simon Glass sjg@chromium.org wrote:
Hi Bin,
On 10 September 2015 at 00:07, Bin Meng bmeng.cn@gmail.com wrote:
Hi Simon,
On Thu, Sep 10, 2015 at 2:07 AM, Simon Glass sjg@chromium.org wrote:
Hi Bin,
On Friday, 4 September 2015, Bin Meng bmeng.cn@gmail.com wrote:
When something goes wrong during device_probe(), we just need do device_remove() which calls device_free() internally.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/core/device.c b/drivers/core/device.c index a6cd936..061a7ef 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -316,19 +316,14 @@ int device_probe_child(struct udevice *dev, void *parent_priv)
ret = uclass_post_probe_device(dev); if (ret)
goto fail_uclass;
goto fail; return 0;
-fail_uclass: +fail: if (device_remove(dev)) { dm_warn("%s: Device '%s' failed to remove on error path\n", __func__, dev->name); } -fail:
dev->flags &= ~DM_FLAG_ACTIVATED;
dev->seq = -1;
device_free(dev); return ret;
}
The problem is that in this case you end up calling functions that should not be called. For example uclass_pre_remove_device() will be called even if uclass_post_probe_device() was not.
Yes, but doing uclass_pre_remove_device() should not bring any harm, given we already want to remove this device, right?
That function is entitled to assume that the device was set up at least to the post_remove uclass state. Here that would not be try, so we are creating an entirely new test case.
There is definitely room for improvement here - we could/should call only those 'remove' functions that mirror the 'probe' ones we called. But that is quite a lot of code for little benefit.
OK, will drop this.
Regards, Bin

Hi Bin,
On Sep 10, 2015 5:47 PM, "Bin Meng" bmeng.cn@gmail.com wrote:
Hi Simon,
On Fri, Sep 11, 2015 at 8:38 AM, Simon Glass sjg@chromium.org wrote:
Hi Bin,
On 10 September 2015 at 00:07, Bin Meng bmeng.cn@gmail.com wrote:
Hi Simon,
On Thu, Sep 10, 2015 at 2:07 AM, Simon Glass sjg@chromium.org wrote:
Hi Bin,
On Friday, 4 September 2015, Bin Meng bmeng.cn@gmail.com wrote:
When something goes wrong during device_probe(), we just need do device_remove() which calls device_free() internally.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
diff --git a/drivers/core/device.c b/drivers/core/device.c index a6cd936..061a7ef 100644 --- a/drivers/core/device.c +++ b/drivers/core/device.c @@ -316,19 +316,14 @@ int device_probe_child(struct udevice *dev,
void *parent_priv)
ret = uclass_post_probe_device(dev); if (ret)
goto fail_uclass;
goto fail; return 0;
-fail_uclass: +fail: if (device_remove(dev)) { dm_warn("%s: Device '%s' failed to remove on error
path\n",
__func__, dev->name); }
-fail:
dev->flags &= ~DM_FLAG_ACTIVATED;
dev->seq = -1;
device_free(dev); return ret;
}
The problem is that in this case you end up calling functions that should not be called. For example uclass_pre_remove_device() will be called even if uclass_post_probe_device() was not.
Yes, but doing uclass_pre_remove_device() should not bring any harm, given we already want to remove this device, right?
That function is entitled to assume that the device was set up at least to the post_remove uclass state. Here that would not be try, so we are creating an entirely new test case.
There is definitely room for improvement here - we could/should call only those 'remove' functions that mirror the 'probe' ones we called. But that is quite a lot of code for little benefit.
OK, will drop this.
Sorry, that was complete gibberish.
That function is entitled to assume that the device was set up at least to the post_probe uclass state. Here that would not be true, so we are creating an entirely new test case.
Regards, Simon

dev->uclass->uc_drv->per_device_auto_alloc_size is to be freed in device_free(), so is dev->seq. Remove these unnecessary codes.
Signed-off-by: Bin Meng bmeng.cn@gmail.com ---
drivers/core/uclass.c | 7 ------- 1 file changed, 7 deletions(-)
diff --git a/drivers/core/uclass.c b/drivers/core/uclass.c index f63ff59..8b0fb88 100644 --- a/drivers/core/uclass.c +++ b/drivers/core/uclass.c @@ -518,22 +518,15 @@ int uclass_post_probe_device(struct udevice *dev) #if CONFIG_IS_ENABLED(DM_DEVICE_REMOVE) int uclass_pre_remove_device(struct udevice *dev) { - struct uclass_driver *uc_drv; struct uclass *uc; int ret;
uc = dev->uclass; - uc_drv = uc->uc_drv; if (uc->uc_drv->pre_remove) { ret = uc->uc_drv->pre_remove(dev); if (ret) return ret; } - if (uc_drv->per_device_auto_alloc_size) { - free(dev->uclass_priv); - dev->uclass_priv = NULL; - } - dev->seq = -1;
return 0; }

On Friday, 4 September 2015, Bin Meng bmeng.cn@gmail.com wrote:
dev->uclass->uc_drv->per_device_auto_alloc_size is to be freed in device_free(), so is dev->seq. Remove these unnecessary codes.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
drivers/core/uclass.c | 7 ------- 1 file changed, 7 deletions(-)
Looks right to me.
Acked-by: Simon Glass sjg@chromium.org

Hi Joe,
On Fri, Sep 4, 2015 at 10:53 PM, Bin Meng bmeng.cn@gmail.com wrote:
Currently there is no API to uninitialize mdio. Add two APIs for this.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)
diff --git a/common/miiphyutil.c b/common/miiphyutil.c index c88c28a..e499b58 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -152,6 +152,11 @@ struct mii_dev *mdio_alloc(void) return bus; }
+void mdio_free(struct mii_dev *bus) +{
free(bus);
+}
int mdio_register(struct mii_dev *bus) { if (!bus || !bus->name || !bus->read || !bus->write) @@ -173,6 +178,20 @@ int mdio_register(struct mii_dev *bus) return 0; }
+int mdio_unregister(struct mii_dev *bus) +{
if (!bus)
return 0;
/* delete it from the list */
list_del(&bus->link);
if (current_mii == bus)
current_mii = NULL;
return 0;
+}
void mdio_list_devices(void) { struct list_head *entry; diff --git a/include/miiphy.h b/include/miiphy.h index 088797e..af12274 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -59,7 +59,9 @@ struct phy_device *mdio_phydev_for_ethname(const char *devname); void miiphy_listdev(void);
struct mii_dev *mdio_alloc(void); +void mdio_free(struct mii_dev *bus); int mdio_register(struct mii_dev *bus); +int mdio_unregister(struct mii_dev *bus); void mdio_list_devices(void);
#ifdef CONFIG_BITBANGMII
Ping?
Regards, Bin

Hi Bin,
On Friday, 4 September 2015, Bin Meng bmeng.cn@gmail.com wrote:
Currently there is no API to uninitialize mdio. Add two APIs for this.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)
diff --git a/common/miiphyutil.c b/common/miiphyutil.c index c88c28a..e499b58 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -152,6 +152,11 @@ struct mii_dev *mdio_alloc(void) return bus; }
+void mdio_free(struct mii_dev *bus) +{
free(bus);
+}
Should this function be exported, or just called from mdio_unregister()?
int mdio_register(struct mii_dev *bus) { if (!bus || !bus->name || !bus->read || !bus->write) @@ -173,6 +178,20 @@ int mdio_register(struct mii_dev *bus) return 0; }
+int mdio_unregister(struct mii_dev *bus) +{
if (!bus)
return 0;
/* delete it from the list */
list_del(&bus->link);
if (current_mii == bus)
current_mii = NULL;
return 0;
+}
void mdio_list_devices(void) { struct list_head *entry; diff --git a/include/miiphy.h b/include/miiphy.h index 088797e..af12274 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -59,7 +59,9 @@ struct phy_device *mdio_phydev_for_ethname(const char *devname); void miiphy_listdev(void);
struct mii_dev *mdio_alloc(void); +void mdio_free(struct mii_dev *bus); int mdio_register(struct mii_dev *bus); +int mdio_unregister(struct mii_dev *bus);
Function comments.
void mdio_list_devices(void);
#ifdef CONFIG_BITBANGMII
1.8.2.1
Regards, Simon

Hi Simon,
On Thu, Sep 10, 2015 at 2:07 AM, Simon Glass sjg@chromium.org wrote:
Hi Bin,
On Friday, 4 September 2015, Bin Meng bmeng.cn@gmail.com wrote:
Currently there is no API to uninitialize mdio. Add two APIs for this.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)
diff --git a/common/miiphyutil.c b/common/miiphyutil.c index c88c28a..e499b58 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -152,6 +152,11 @@ struct mii_dev *mdio_alloc(void) return bus; }
+void mdio_free(struct mii_dev *bus) +{
free(bus);
+}
Should this function be exported, or just called from mdio_unregister()?
I created mdio_free() to keep API symmetry - there is an mdio_alloc() API already. IMHO we should remove mdio_alloc() API and move mdio_alloc() to inside mdio_register(), but did not do that way as that change is quite big (a bunch of ethernet drivers need update). What do you think?
int mdio_register(struct mii_dev *bus) { if (!bus || !bus->name || !bus->read || !bus->write) @@ -173,6 +178,20 @@ int mdio_register(struct mii_dev *bus) return 0; }
+int mdio_unregister(struct mii_dev *bus) +{
if (!bus)
return 0;
/* delete it from the list */
list_del(&bus->link);
if (current_mii == bus)
current_mii = NULL;
return 0;
+}
void mdio_list_devices(void) { struct list_head *entry; diff --git a/include/miiphy.h b/include/miiphy.h index 088797e..af12274 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -59,7 +59,9 @@ struct phy_device *mdio_phydev_for_ethname(const char *devname); void miiphy_listdev(void);
struct mii_dev *mdio_alloc(void); +void mdio_free(struct mii_dev *bus); int mdio_register(struct mii_dev *bus); +int mdio_unregister(struct mii_dev *bus);
Function comments.
OK
void mdio_list_devices(void);
#ifdef CONFIG_BITBANGMII
Regards, Bin

Hi Bin,
On Fri, Sep 4, 2015 at 9:53 AM, Bin Meng bmeng.cn@gmail.com wrote:
Currently there is no API to uninitialize mdio. Add two APIs for this.
Is this causing some failure in the short term? The plan is to move eth phy support to driver model in the next year. If it is not needed for a device to function then it would be nice to not spend effort on this API.
If it is needed short term, then the approach looks fine.
Cheers, -Joe
Signed-off-by: Bin Meng bmeng.cn@gmail.com
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)
diff --git a/common/miiphyutil.c b/common/miiphyutil.c index c88c28a..e499b58 100644 --- a/common/miiphyutil.c +++ b/common/miiphyutil.c @@ -152,6 +152,11 @@ struct mii_dev *mdio_alloc(void) return bus; }
+void mdio_free(struct mii_dev *bus) +{
free(bus);
+}
int mdio_register(struct mii_dev *bus) { if (!bus || !bus->name || !bus->read || !bus->write) @@ -173,6 +178,20 @@ int mdio_register(struct mii_dev *bus) return 0; }
+int mdio_unregister(struct mii_dev *bus) +{
if (!bus)
return 0;
/* delete it from the list */
list_del(&bus->link);
if (current_mii == bus)
current_mii = NULL;
return 0;
+}
void mdio_list_devices(void) { struct list_head *entry; diff --git a/include/miiphy.h b/include/miiphy.h index 088797e..af12274 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -59,7 +59,9 @@ struct phy_device *mdio_phydev_for_ethname(const char *devname); void miiphy_listdev(void);
struct mii_dev *mdio_alloc(void); +void mdio_free(struct mii_dev *bus); int mdio_register(struct mii_dev *bus); +int mdio_unregister(struct mii_dev *bus); void mdio_list_devices(void);
#ifdef CONFIG_BITBANGMII
1.8.2.1
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

Hi Joe,
On Fri, Sep 11, 2015 at 6:30 AM, Joe Hershberger joe.hershberger@gmail.com wrote:
Hi Bin,
On Fri, Sep 4, 2015 at 9:53 AM, Bin Meng bmeng.cn@gmail.com wrote:
Currently there is no API to uninitialize mdio. Add two APIs for this.
Is this causing some failure in the short term? The plan is to move eth phy support to driver model in the next year. If it is not needed for a device to function then it would be nice to not spend effort on this API.
Good to know we have plan to convert PHY support to driver model.
If it is needed short term, then the approach looks fine.
Yes, it is needed, otherwise for ethernet device which depends on this PHY support it will fail to probe() for the 2nd time as the MDIO resource are not cleaned up. In the future when we convert PHY support to driver model, we won't miss this part if these are added now.
[snip]
Regards, Bin

On Fri, Sep 4, 2015 at 9:53 AM, Bin Meng bmeng.cn@gmail.com wrote:
Currently there is no API to uninitialize mdio. Add two APIs for this.
Signed-off-by: Bin Meng bmeng.cn@gmail.com
Acked-by: Joe Hershberger joe.hershberger@ni.com
participants (3)
-
Bin Meng
-
Joe Hershberger
-
Simon Glass