From patchwork Thu Mar 4 01:06:47 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Nguyen X-Patchwork-Id: 393379 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86946C4361A for ; Thu, 4 Mar 2021 01:14:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 632AB64F44 for ; Thu, 4 Mar 2021 01:14:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343598AbhCDBMl (ORCPT ); Wed, 3 Mar 2021 20:12:41 -0500 Received: from mga11.intel.com ([192.55.52.93]:44723 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1450449AbhCDBHQ (ORCPT ); Wed, 3 Mar 2021 20:07:16 -0500 IronPort-SDR: RORb8fj7cSGaYTNl9FEw8fPi7k3jbgDgDxJcuhMyWrLcM23yY6o5ON3EZqyFMExBjAw8ZxERy6 OydBru8CPKwQ== X-IronPort-AV: E=McAfee;i="6000,8403,9912"; a="183934478" X-IronPort-AV: E=Sophos;i="5.81,221,1610438400"; d="scan'208";a="183934478" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Mar 2021 17:05:38 -0800 IronPort-SDR: m19F1jb32BPsO2CoT7qvMLuy6UlrwuBQiseHlu7TsBYwfM5J+SW94MOu5jrF9XEIxQ3+aaHBbd ULuzqmVA4jSg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,221,1610438400"; d="scan'208";a="367809986" Received: from anguy11-desk2.jf.intel.com ([10.166.244.147]) by orsmga003.jf.intel.com with ESMTP; 03 Mar 2021 17:05:38 -0800 From: Tony Nguyen To: davem@davemloft.net, kuba@kernel.org Cc: Bartosz Golaszewski , netdev@vger.kernel.org, sassmann@redhat.com, anthony.l.nguyen@intel.com, Yongxin Liu , Tony Brelinski Subject: [PATCH net 1/3] net: ethernet: ixgbe: don't propagate -ENODEV from ixgbe_mii_bus_init() Date: Wed, 3 Mar 2021 17:06:47 -0800 Message-Id: <20210304010649.1858916-2-anthony.l.nguyen@intel.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20210304010649.1858916-1-anthony.l.nguyen@intel.com> References: <20210304010649.1858916-1-anthony.l.nguyen@intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Bartosz Golaszewski 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 Signed-off-by: Bartosz Golaszewski Tested-by: Tony Brelinski Signed-off-by: Tony Nguyen --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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;