Re: [PATCH v2 net-next 2/2] net: phy: mdio-gpio: Add phy_ignore_ta_mask to platform data

2018-12-08 Thread Florian Fainelli
Le 12/8/18 à 7:12 AM, Andrew Lunn a écrit :
> The Marvell 6390 Ethernet switch family does not perform MDIO
> turnaround correctly. Many hardware MDIO bus masters don't care about
> this, but the bitbangging implementation in Linux does by default. Add
> phy_ignore_ta_mask to the platform data so that the bitbangging code
> can be told which devices are known to get TA wrong.
> 
> v2
> --
> int -> u32 in platform data structure
> 
> Signed-off-by: Andrew Lunn 

Reviewed-by: Florian Fainelli 
-- 
Florian


[PATCH v2 net-next 2/2] net: phy: mdio-gpio: Add phy_ignore_ta_mask to platform data

2018-12-08 Thread Andrew Lunn
The Marvell 6390 Ethernet switch family does not perform MDIO
turnaround correctly. Many hardware MDIO bus masters don't care about
this, but the bitbangging implementation in Linux does by default. Add
phy_ignore_ta_mask to the platform data so that the bitbangging code
can be told which devices are known to get TA wrong.

v2
--
int -> u32 in platform data structure

Signed-off-by: Andrew Lunn 
---
 drivers/net/phy/mdio-gpio.c | 4 +++-
 include/linux/platform_data/mdio-gpio.h | 1 +
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/net/phy/mdio-gpio.c b/drivers/net/phy/mdio-gpio.c
index 1e296dd4067a..ea9a0e339778 100644
--- a/drivers/net/phy/mdio-gpio.c
+++ b/drivers/net/phy/mdio-gpio.c
@@ -130,8 +130,10 @@ static struct mii_bus *mdio_gpio_bus_init(struct device 
*dev,
else
strncpy(new_bus->id, "gpio", MII_BUS_ID_SIZE);
 
-   if (pdata)
+   if (pdata) {
new_bus->phy_mask = pdata->phy_mask;
+   new_bus->phy_ignore_ta_mask = pdata->phy_ignore_ta_mask;
+   }
 
dev_set_drvdata(dev, new_bus);
 
diff --git a/include/linux/platform_data/mdio-gpio.h 
b/include/linux/platform_data/mdio-gpio.h
index a5d5ff5e174c..13874fa6e767 100644
--- a/include/linux/platform_data/mdio-gpio.h
+++ b/include/linux/platform_data/mdio-gpio.h
@@ -8,6 +8,7 @@
 
 struct mdio_gpio_platform_data {
u32 phy_mask;
+   u32 phy_ignore_ta_mask;
 };
 
 #endif /* __LINUX_MDIO_GPIO_PDATA_H */
-- 
2.19.1