diff mbox series

[net,1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init()

Message ID 20210304010649.1858916-2-anthony.l.nguyen@intel.com (mailing list archive)
State Accepted
Delegated to: Netdev Maintainers
Headers show
Series Intel Wired LAN Driver Updates 2021-03-03 | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net
netdev/subject_prefix success Link
netdev/cc_maintainers warning 2 maintainers not CCed: jesse.brandeburg@intel.com intel-wired-lan@lists.osuosl.org
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/kdoc success Errors and warnings before: 2 this patch: 2
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 8 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Tony Nguyen March 4, 2021, 1:06 a.m. UTC
From: Bartosz Golaszewski <bgolaszewski@baylibre.com>

It's a valid use-case for ixgbe_mii_bus_init() to return -ENODEV - we
still want to finalize the registration of the ixgbe device. Check the
error code and don't bail out if err == -ENODEV.

This fixes an issue on C3000 family of SoCs where four ixgbe devices
share a single MDIO bus and ixgbe_mii_bus_init() returns -ENODEV for
three of them but we still want to register them.

Fixes: 09ef193fef7e ("net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()")
Reported-by: Yongxin Liu <yongxin.liu@windriver.com>
Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
---
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski March 4, 2021, 6:50 p.m. UTC | #1
On Wed,  3 Mar 2021 17:06:47 -0800 Tony Nguyen wrote:
> From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> 
> It's a valid use-case for ixgbe_mii_bus_init() to return -ENODEV - we
> still want to finalize the registration of the ixgbe device. Check the
> error code and don't bail out if err == -ENODEV.
> 
> This fixes an issue on C3000 family of SoCs where four ixgbe devices
> share a single MDIO bus and ixgbe_mii_bus_init() returns -ENODEV for
> three of them but we still want to register them.
> 
> Fixes: 09ef193fef7e ("net: ethernet: ixgbe: check the return value of ixgbe_mii_bus_init()")
> Reported-by: Yongxin Liu <yongxin.liu@windriver.com>
> Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
> Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

Are you sure this is not already fixed upstream by:

bd7f14df9492 ("ixgbe: fix probing of multi-port devices with one MDIO")

?
Tony Nguyen March 4, 2021, 7 p.m. UTC | #2
On Thu, 2021-03-04 at 10:50 -0800, Jakub Kicinski wrote:
> On Wed,  3 Mar 2021 17:06:47 -0800 Tony Nguyen wrote:
> > From: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > 
> > It's a valid use-case for ixgbe_mii_bus_init() to return -ENODEV -
> > we
> > still want to finalize the registration of the ixgbe device. Check
> > the
> > error code and don't bail out if err == -ENODEV.
> > 
> > This fixes an issue on C3000 family of SoCs where four ixgbe
> > devices
> > share a single MDIO bus and ixgbe_mii_bus_init() returns -ENODEV
> > for
> > three of them but we still want to register them.
> > 
> > Fixes: 09ef193fef7e ("net: ethernet: ixgbe: check the return value
> > of ixgbe_mii_bus_init()")
> > Reported-by: Yongxin Liu <yongxin.liu@windriver.com>
> > Signed-off-by: Bartosz Golaszewski <bgolaszewski@baylibre.com>
> > Tested-by: Tony Brelinski <tonyx.brelinski@intel.com>
> > Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>
> 
> Are you sure this is not already fixed upstream by:
> 
> bd7f14df9492 ("ixgbe: fix probing of multi-port devices with one
> MDIO")
> 
> ?

That looks to solve this issue. I'll drop this patch and resend the
series.

Thanks,
Tony
diff mbox series

Patch

diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index fae84202d870..aa3b0a7ab786 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -11033,7 +11033,7 @@  static int ixgbe_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 			true);
 
 	err = ixgbe_mii_bus_init(hw);
-	if (err)
+	if (err && err != -ENODEV)
 		goto err_netdev;
 
 	return 0;