net: cpsw: fix obtaining mac address for am3517
Subsystems (3)
PATCH RESEND 1/1 net: cpsw: fix obtaining mac address for am3517
From: Jeroen Hofstee <[email protected]>
Commit b6745f6e4e63 ("drivers: net: cpsw: davinci_emac: move reading mac id to common file") did not only move the code for an am3517, it also added the slave parameter, resulting in an invalid (all zero) mac address being returned for an am3517, since it only has a single emac and the slave parameter is pointing to the second. So simply always read the first and valid mac-address.
--- drivers/net/ethernet/ti/cpsw-common.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/net/ethernet/ti/cpsw-common.c +5 -1
@@ -74,8 +74,12 @@ int ti_cm_get_macid(struct device *dev, int slave, u8 *mac_addr)if (of_machine_is_compatible ("ti,am33xx" ))return cpsw_am33xx_cm_get_macid (dev,0x630 , slave, mac_addr); +/* +* There is only one emac / mac address on an am3517 so ignore the +* slave = 1 and always get the macid from slave 0. +*/ if (of_device_is_compatible (dev->of_node,"ti,am3517-emac" )) -return davinci_emac_3517_get_macid (dev,0x110 , slave, mac_addr); +return davinci_emac_3517_get_macid (dev,0x110 ,0 , mac_addr);if (of_device_is_compatible (dev->of_node,"ti,dm816-emac" ))return cpsw_am33xx_cm_get_macid (dev,0x30 , slave, mac_addr);
Signature · 1 line
2.41.0
Quoted 6 lines · Mans Rullgard
From: Jeroen Hofstee <[email protected]>
Commit
b6745f6e4e63("drivers: net: cpsw:davinci_emac: move reading mac id to common file") did not only move the code for an am3517, it also added the slave parameter, resulting in an invalid (all zero) mac address being returned for an am3517, since it only has a single emac
Hi Mans
If there is only a single emac, why is the function being called with slave=1? Given the description, it seems like you are fixing the wrong problem.
Andrew
Quoted 8 lines · Andrew Lunn
Quoted 6 lines · Mans Rullgard
From: Jeroen Hofstee <[email protected]>
Commit
b6745f6e4e63("drivers: net: cpsw:davinci_emac: move reading mac id to common file") did not only move the code for an am3517, it also added the slave parameter, resulting in an invalid (all zero) mac address being returned for an am3517, since it only has a single emac
Quoted 5 lines
Hi Mans
If there is only a single emac, why is the function being called with slave=1? Given the description, it seems like you are fixing the wrong problem.
See previous discussion:
https://lore.kernel.org/lkml/[email protected]/
Signature · 1 line
Måns Rullgård
Quoted 10 lines · Måns Rullgård
Quoted 8 lines · Andrew Lunn
Quoted 6 lines · Mans Rullgard
From: Jeroen Hofstee <[email protected]>
Commit
b6745f6e4e63("drivers: net: cpsw:davinci_emac: move reading mac id to common file") did not only move the code for an am3517, it also added the slave parameter, resulting in an invalid (all zero) mac address being returned for an am3517, since it only has a single emac
Quoted 8 lines
Quoted 5 lines
Hi Mans
If there is only a single emac, why is the function being called with slave=1? Given the description, it seems like you are fixing the wrong problem.
See previous discussion:
https://lore.kernel.org/lkml/[email protected]/
Hi Måns
O.K. did i mention memory of a goldfish?
This is the sort of detail that should be in the commit message. Otherwise reviewers are going to ask for an explanation, even if it has been explained once, 6 years ago.
I assume you also want this back ported to stable? Please add a Fixed:
tag, and a Cc: [email protected] tag. And set the patch subject to [PATCH net v3] to indicate this is for the net tree, not net-next.
Thanks
Andrew
Quoted 24 lines · Andrew Lunn
Quoted 10 lines · Måns Rullgård
Quoted 8 lines · Andrew Lunn
Quoted 6 lines · Mans Rullgard
From: Jeroen Hofstee <[email protected]>
Commit
b6745f6e4e63("drivers: net: cpsw:davinci_emac: move reading mac id to common file") did not only move the code for an am3517, it also added the slave parameter, resulting in an invalid (all zero) mac address being returned for an am3517, since it only has a single emacQuoted 8 lines
Quoted 5 lines
Hi Mans
If there is only a single emac, why is the function being called with slave=1? Given the description, it seems like you are fixing the wrong problem.
See previous discussion:
https://lore.kernel.org/lkml/[email protected]/Hi Måns
O.K. did i mention memory of a goldfish?
Quoted 7 lines
This is the sort of detail that should be in the commit message. Otherwise reviewers are going to ask for an explanation, even if it has been explained once, 6 years ago.
I assume you also want this back ported to stable? Please add a Fixed:
tag, and a Cc: [email protected] tag. And set the patch subject to [PATCH net v3] to indicate this is for the net tree, not net-next.
I give up. It's not worth my time. This is why people hoard patches rather than sending them upstream.
Signature · 1 line
Måns Rullgård
Hi,
Quoted 7 lines · Måns Rullgård
Quoted 3 lines · Andrew Lunn
I assume you also want this back ported to stable? Please add a Fixed:
tag, and a Cc: [email protected] tag. And set the patch subject to [PATCH net v3] to indicate this is for the net tree, not net-next.I give up. It's not worth my time. This is why people hoard patches rather than sending them upstream.
Maybe just give it one more go filing the proper paperwork :) It would be nice to have it in stable too so IMO it's worth the few more hoops to addthe tags for automating picking it to stable kernels.
Regards,
Tony