net: mdio: Add mdio_free() and mdio_unregister() API
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.
---
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)
common/miiphyutil.c +19 -0
@@ -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;
include/miiphy.h +2 -0
@@ -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
Signature · 1 line
1.8.2.1
PATCH 1/5 net: mdio: Add mdio_free() and mdio_unregister() API
Hi Joe,
Quoted 51 lines · Bin Meng
Currently there is no API to uninitialize mdio. Add two APIs for this.
Signed-off-by Bin Meng <[email protected]>---
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)common/miiphyutil.c +19
-0@@ -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;include/miiphy.h +0
-0
include/miiphy.h struct phy_device *mdio_phydev_for_ethname(const char *devname);
Quoted 10 lines
include/miiphy.h +2
-1@@ -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
PATCH 2/5 net: designware: Add driver remove support
In reply to Bin MengIn 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.
---
drivers/net/designware.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/designware.c +12 -0
@@ -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),
Signature · 1 line
1.8.2.1
PATCH 2/5 net: designware: Add driver remove support
Quoted 9 lines · Bin Meng
In
designware_eth_probe(), some additional resources are allocated (eg: mdio, phy). We should free these in the driver remove phase. Adddesignware_eth_remove()to clean it up.Signed-off-by Bin Meng <[email protected]>---
drivers/net/designware.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
PATCH 3/5 net: pch_gbe: Add driver remove support
In reply to Bin MengIn 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.
---
drivers/net/pch_gbe.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/net/pch_gbe.c +12 -0
@@ -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),
Signature · 1 line
1.8.2.1
PATCH 3/5 net: pch_gbe: Add driver remove support
Quoted 10 lines · Bin Meng
In
pch_gbe_probe(), some additional resources are allocated (eg: mdio, phy). We should free these in the driver remove phase. Addpch_gbe_remove()to clean it up.Signed-off-by Bin Meng <[email protected]>---
drivers/net/pch_gbe.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
Quoted 2 lines
PATCH 4/5 dm: core: Remove the call to device_free()
In reply to Bin MengWhen something goes wrong during device_probe(), we just need do device_remove() which calls device_free() internally.
---
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)
drivers/core/device.c +2 -7
@@ -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; }
Signature · 1 line
1.8.2.1
PATCH 4/5 dm: core: Remove the call to device_free()
Hi Bin,
Quoted 26 lines · Bin Meng
When something goes wrong during
device_probe(), we just need dodevice_remove()which callsdevice_free()internally.Signed-off-by Bin Meng <[email protected]>---
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/core/device.c +2
-2@@ -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",
drivers/core/device.c int device_probe_child(struct udevice *dev, void *parent_priv) · line 329
Quoted 10 lines
drivers/core/device.c +0
-5__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
Quoted 2 lines
PATCH 4/5 dm: core: Remove the call to device_free()
Hi Simon,
Quoted 37 lines · Simon Glass
Hi Bin,
Quoted 34 lines · Bin Meng
When something goes wrong during
device_probe(), we just need dodevice_remove()which callsdevice_free()internally.Signed-off-by Bin Meng <[email protected]>---
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/core/device.c +2
-7@@ -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);
Quoted 8 lines
drivers/core/device.c int device_probe_child(struct udevice *dev, void *parent_priv) · line 329
Quoted 2 lines
drivers/core/device.c +0
-0return 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 ifuclass_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?
Quoted 4 lines
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
PATCH 4/5 dm: core: Remove the call to device_free()
Hi Bin,
Quoted 49 lines · Bin Meng
Hi Simon,
Quoted 37 lines · Simon Glass
Hi Bin,
Quoted 34 lines · Bin Meng
When something goes wrong during
device_probe(), we just need dodevice_remove()which callsdevice_free()internally.Signed-off-by Bin Meng <[email protected]>---
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/core/device.c +2
-7@@ -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);Quoted 8 lines
drivers/core/device.c int device_probe_child(struct udevice *dev, void *parent_priv) · line 329
Quoted 2 lines
drivers/core/device.c +0
-0return 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 ifuclass_post_probe_device()was not.
Quoted 2 lines
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.
Quoted 4 lines
Quoted 4 lines
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
PATCH 4/5 dm: core: Remove the call to device_free()
Hi Simon,
Quoted 52 lines · Simon Glass
Hi Bin,
Quoted 49 lines · Bin Meng
Hi Simon,
Quoted 45 lines · Simon Glass
Hi Bin,
Quoted 26 lines · Bin Meng
When something goes wrong during
device_probe(), we just need dodevice_remove()which callsdevice_free()internally.Signed-off-by Bin Meng <[email protected]>---
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/core/device.c +2
-2@@ -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",drivers/core/device.c int device_probe_child(struct udevice *dev, void *parent_priv) · line 329
Quoted 10 lines
drivers/core/device.c +0
-5__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 ifuclass_post_probe_device()was not.
Quoted 12 lines
Quoted 2 lines
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_removeuclass state. Here that would not be try, so we are creating an entirely new test case.Quoted 4 lines
Quoted 4 lines
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
PATCH 4/5 dm: core: Remove the call to device_free()
Hi Bin,
Quoted 20 lines · Bin Meng
Hi Simon,
Quoted 16 lines · Simon Glass
Hi Bin,
Quoted 13 lines · Bin Meng
Hi Simon,
Quoted 10 lines · Simon Glass
Hi Bin,
Quoted 7 lines · Bin Meng
When something goes wrong during
device_probe(), we just need dodevice_remove()which callsdevice_free()internally.Signed-off-by Bin Meng <[email protected]>---
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines
drivers/core/device.c int device_probe_child(struct udevice *dev,
Quoted 8 lines
drivers/core/device.c | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-)drivers/core/device.c +0
-0@@ -316,19 +316,14 @@ int device_probe_child(struct udevice *dev,
void *parent_priv)
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
Quoted 11 lines
drivers/core/device.c int device_probe_child(struct udevice *dev, void *parent_priv)
Quoted 11 lines
drivers/core/device.c +2
-2ret =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",
Quoted 25 lines
Quoted 25 lines
Quoted 17 lines
Quoted 8 lines
Quoted 8 lines
drivers/core/device.c +0
-5__func__, dev->name); } -fail: - dev->flags &= ~DM_FLAG_ACTIVATED ; - - dev->seq =-1 ; -device_free (dev);Quoted 8 lines
drivers/core/device.c int device_probe_child(struct udevice *dev, void *parent_priv) · line 329
Quoted 2 lines
drivers/core/device.c +0
-0return 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 ifuclass_post_probe_device()was not.Quoted 2 lines
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_removeuclass state. Here that would not be try, so we are creating an entirely new test case.Quoted 1 line
Quoted 6 lines
Quoted 4 lines
Quoted 3 lines
Quoted 3 lines
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
PATCH 5/5 dm: core: Remove unnecessary codes in uclass_pre_remove_device()
In reply to Bin Mengdev->uclass->uc_drv->per_device_auto_alloc_size is to be freed in device_free(), so is dev->seq. Remove these unnecessary codes.
---
drivers/core/uclass.c | 7 ------- 1 file changed, 7 deletions(-)
drivers/core/uclass.c +0 -7
@@ -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 ; }
Signature · 1 line
1.8.2.1
PATCH 5/5 dm: core: Remove unnecessary codes in uclass_pre_remove_device()
Quoted 9 lines · Bin Meng
dev->uclass->uc_drv->per_device_auto_alloc_sizeis to be freed indevice_free(), so isdev->seq. Remove these unnecessary codes.Signed-off-by Bin Meng <[email protected]>---
drivers/core/uclass.c | 7 ------- 1 file changed, 7 deletions(-)
Looks right to me.
PATCH 1/5 net: mdio: Add mdio_free() and mdio_unregister() API
In reply to Bin MengHi Bin,
Quoted 15 lines · Bin Meng
Currently there is no API to uninitialize mdio. Add two APIs for this.
Signed-off-by Bin Meng <[email protected]>---
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)common/miiphyutil.c +0
-0
common/miiphyutil.c struct mii_dev *mdio_alloc(void) · line 158
Quoted 7 lines
common/miiphyutil.c +4
-0@@ -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()?
Quoted 31 lines
common/miiphyutil.c +15
-0+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;include/miiphy.h +0
-0
include/miiphy.h struct phy_device *mdio_phydev_for_ethname(const char *devname); · line 64
Quoted 6 lines
include/miiphy.h +2
-0@@ -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.
Quoted 7 lines
include/miiphy.h +0
-1void mdio_list_devices (void );#ifdef CONFIG_BITBANGMII --1.8.2.1
Regards,
Simon
PATCH 1/5 net: mdio: Add mdio_free() and mdio_unregister() API
Hi Simon,
Quoted 21 lines · Simon Glass
Hi Bin,
Quoted 18 lines · Bin Meng
Currently there is no API to uninitialize mdio. Add two APIs for this.
Signed-off-by Bin Meng <[email protected]>---
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)common/miiphyutil.c +0
-0@@ -152,6 +152,11 @@ struct mii_dev *mdio_alloc(void)return bus; }
Quoted 8 lines
common/miiphyutil.c struct mii_dev *mdio_alloc(void) · line 158
Quoted 4 lines
common/miiphyutil.c +4
-0+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?
Quoted 33 lines
Quoted 33 lines
common/miiphyutil.c +15
-0+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;include/miiphy.h +0
-0@@ -59,7 +59,9 @@ struct phy_device *mdio_phydev_for_ethname(const char *devname);void miiphy_listdev (void );
Quoted 7 lines
include/miiphy.h struct phy_device *mdio_phydev_for_ethname(const char *devname); · line 64
Quoted 4 lines
include/miiphy.h +2
-0struct 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
Quoted 6 lines
include/miiphy.h struct phy_device *mdio_phydev_for_ethname(const char *devname);
Quoted 6 lines
include/miiphy.h +0
-1void mdio_list_devices (void );#ifdef CONFIG_BITBANGMII --
Regards,
Bin
PATCH 1/5 net: mdio: Add mdio_free() and mdio_unregister() API
In reply to Bin MengHi Bin,
Quoted 1 line · Bin Meng
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
Quoted 65 lines
Signed-off-by Bin Meng <[email protected]>---
common/miiphyutil.c | 19 +++++++++++++++++++ include/miiphy.h | 2 ++ 2 files changed, 21 insertions(+)common/miiphyutil.c +19
-0@@ -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;include/miiphy.h +2
-1@@ -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 at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot
PATCH 1/5 net: mdio: Add mdio_free() and mdio_unregister() API
Hi Joe,
Quoted 9 lines · Joe Hershberger
Hi Bin,
Quoted 1 line · Bin Meng
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.
Quoted 3 lines
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
PATCH 1/5 net: mdio: Add mdio_free() and mdio_unregister() API
In reply to Bin MengQuoted 3 lines · Bin Meng
Currently there is no API to uninitialize mdio. Add two APIs for this.
Signed-off-by Bin Meng <[email protected]>