From: Cai Huoqing <hidden> Date: 2021-09-28 13:38:35
The second resource is optional which is only provided on the chipset
IPQ5018. But the blamed commit ignores that and if the resource is
not there it just fails.
the resource is used like this,
if (priv->eth_ldo_rdy) {
val = readl(priv->eth_ldo_rdy);
val |= BIT(0);
writel(val, priv->eth_ldo_rdy);
fsleep(IPQ_PHY_SET_DELAY_US);
}
This patch reverts that to still allow the second resource to be optional
because other SoC have the some MDIO controller and doesn't need to
second resource.
Fix Commit fa14d03e014a ("net: mdio-ipq4019: Make use of
devm_platform_ioremap_resource()")
Signed-off-by: Cai Huoqing <redacted>
---
drivers/net/mdio/mdio-ipq4019.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
@@ -207,6 +207,7 @@ static int ipq4019_mdio_probe(struct platform_device *pdev){structipq4019_mdio_data*priv;structmii_bus*bus;+structresource*res;intret;bus=devm_mdiobus_alloc_size(&pdev->dev,sizeof(*priv));
@@ -224,7 +225,10 @@ static int ipq4019_mdio_probe(struct platform_device *pdev)returnPTR_ERR(priv->mdio_clk);/* The platform resource is provided on the chipset IPQ5018 */-priv->eth_ldo_rdy=devm_platform_ioremap_resource(pdev,1);+/* This resource is optional */+res=platform_get_resource(pdev,IORESOURCE_MEM,1);+if(res)+priv->eth_ldo_rdy=devm_ioremap_resource(&pdev->dev,res);bus->name="ipq4019_mdio";bus->read=ipq4019_mdio_read;
From: Andrew Lunn <andrew@lunn.ch> Date: 2021-09-28 13:31:53
On Tue, Sep 28, 2021 at 09:21:57PM +0800, Cai Huoqing wrote:
The second resource is optional which is only provided on the chipset
IPQ5018. But the blamed commit ignores that and if the resource is
not there it just fails.
the resource is used like this,
if (priv->eth_ldo_rdy) {
val = readl(priv->eth_ldo_rdy);
val |= BIT(0);
writel(val, priv->eth_ldo_rdy);
fsleep(IPQ_PHY_SET_DELAY_US);
}
This patch reverts that to still allow the second resource to be optional
because other SoC have the some MDIO controller and doesn't need to
second resource.
Fix Commit fa14d03e014a ("net: mdio-ipq4019: Make use of
devm_platform_ioremap_resource()")
This is not a valid Fixes: tag.
Add to your ~/.gitconfig and add:
[pretty]
fixes = Fixes: %h (\"%s\")
You can then do
git log --pretty=fixes fa14d03e014a
and get:
Fixes: fa14d03e014a ("net: mdio-ipq4019: Make use of devm_platform_ioremap_resource()")
Which is the correct format. Don't wrap it, if it is long.
Andrew
From: Cai Huoqing <hidden> Date: 2021-09-29 03:11:12
On 28 9月 21 15:31:39, Andrew Lunn wrote:
On Tue, Sep 28, 2021 at 09:21:57PM +0800, Cai Huoqing wrote:
quoted
The second resource is optional which is only provided on the chipset
IPQ5018. But the blamed commit ignores that and if the resource is
not there it just fails.
the resource is used like this,
if (priv->eth_ldo_rdy) {
val = readl(priv->eth_ldo_rdy);
val |= BIT(0);
writel(val, priv->eth_ldo_rdy);
fsleep(IPQ_PHY_SET_DELAY_US);
}
This patch reverts that to still allow the second resource to be optional
because other SoC have the some MDIO controller and doesn't need to
second resource.
Fix Commit fa14d03e014a ("net: mdio-ipq4019: Make use of
devm_platform_ioremap_resource()")
This is not a valid Fixes: tag.
Add to your ~/.gitconfig and add:
[pretty]
fixes = Fixes: %h (\"%s\")
You can then do
git log --pretty=fixes fa14d03e014a
Cool, it is a great help to me:)
Thanks,
Cai
and get:
Fixes: fa14d03e014a ("net: mdio-ipq4019: Make use of devm_platform_ioremap_resource()")
Which is the correct format. Don't wrap it, if it is long.
Andrew