nvethernet : defer probe for reset gpio

nvethernet comes up before gpio and hence reset gpio error below
seen in galen boot log:
###
[    2.252546] nvethernet 2490000.ethernet: Adding to iommu group 0
[    2.257577] nvethernet 2490000.ethernet: failed to get phy reset gpio
[    2.265533] nvethernet 2490000.ethernet: Ethernet MAC address: 00:04:4b:af:62:37
[    2.271764] libphy: nvethernet_mdio_bus: probed
[    2.275940] mdio_bus 2490000.ethernet: MDIO device at address 0 is missing.
[    2.284469] nvethernet 2490000.ethernet: eth0 (HW ver: 50) created with 1 DMA channels

[    2.548104] GPIO line 510 (gpio_default) hogged as output/high
[    2.553598] GPIO line 511 (gpio_default) hogged as output/high
[    2.558156] gpiochip_setup_dev: registered GPIOs 504 to 511 on device: gpiochip0 (max77620-gpio)
##

Returning -EPROBE_DEFER allows the driver initialization once gpio is initialized.
Ethernet works fine in probe retry call once gpio is up. Hence, the defer probe
is needed.

bug 200617764

Change-Id: Icdcf0d7f0b69c564ecb0b142634b504287db3ea1
Signed-off-by: Bitan Biswas <bbiswas@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvidia/+/2348758
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Bitan Biswas
2020-05-21 22:45:53 -07:00
committed by Revanth Kumar Uppala
parent 0e7b230bab
commit 0b46274d42

View File

@@ -3430,8 +3430,13 @@ static int ether_configure_car(struct platform_device *pdev,
/* get PHY reset */
pdata->phy_reset = of_get_named_gpio(np, "nvidia,phy-reset-gpio", 0);
if (pdata->phy_reset < 0)
dev_info(dev, "failed to get phy reset gpio\n");
if (pdata->phy_reset < 0) {
if (pdata->phy_reset == -EPROBE_DEFER)
return pdata->phy_reset;
else
dev_info(dev, "failed to get phy reset gpio error: %d\n",
pdata->phy_reset);
}
if (gpio_is_valid(pdata->phy_reset)) {
ret = devm_gpio_request_one(dev, (unsigned int)pdata->phy_reset,