Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp100283pxb; Mon, 2 Nov 2020 15:17:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJy+TwCfVzpy3z/Wc10DRbLAgC4mH1eD1F0thXoD0GyIxILuSoVgFRP8W6P6o96sH6k1JfN/ X-Received: by 2002:a50:ee97:: with SMTP id f23mr12213911edr.333.1604359035329; Mon, 02 Nov 2020 15:17:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604359035; cv=none; d=google.com; s=arc-20160816; b=u4hKUmBi8rwcGpDtorQU4ajJgeYNDwJdwkBhBylJXzPyI1MVb9McyLldIdh8mzjbNk 8yBvzA23GdvDqmePSEKvzwHamJAbBvMN2lK8Ls0MIOiuEwt4tThWUW6xdbzGyn16L2vr 249hujD5BXBRYJMSmZE88FrtR2q7Bt2YPi/V5DPcn1vcFc4pRI2gGN0iXUN8mHmA7GRh sb6D1R/K7L9KhIHmdqamr5es90LWom/jBY+dMvmkQ1e0oIC8NfYD7A7GqqXrNId858EB Bd+Yv6DOoofX2xR4YwnSsBSKJvOpxMZ8QOKo2D7ZZADcM1ixHydiJoph+Sk9GhQ6cRxj wG9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=dEUUwrooyxOK9n82V8qISeFmTr0xJmmLL5NOgOoRYYk=; b=d2XK5+P9dkIAaaCZNvaC+PxpmUmEHrbKYgebNcRINrdsgQOXQqLqtAnFtzn6NbK8Xi ABE4yrEPcbI+8vFB4ZsBeBpY3zfezKzh63inmvNNAuL/wFvxp2ghdDOkAb0HyVcIUl8Z igZcYY2+j6KW5xW+DfsflZQyQBE6b7P3T57Q+zr9Ye1dFNPhaMfrRpoQt0hz4NNfMqRx b98xTat9qJ1jZR8HBPUhlMQb1gWgWqE2auFS6DbSVE3nSEUNqhR40l4VMYR+Vthw+OR+ AapzDPrcxLCRPPcVxTnHvke7O7TJSMDnV43Zu+dX6YxMOUHMgbVQGXwV7LWW+GF8RNRA h+tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w26si2270680edt.596.2020.11.02.15.16.52; Mon, 02 Nov 2020 15:17:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726754AbgKBXN0 (ORCPT + 99 others); Mon, 2 Nov 2020 18:13:26 -0500 Received: from mx3.molgen.mpg.de ([141.14.17.11]:54589 "EHLO mx1.molgen.mpg.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725841AbgKBXNZ (ORCPT ); Mon, 2 Nov 2020 18:13:25 -0500 Received: from localhost.localdomain (ip5f5af1d0.dynamic.kabel-deutschland.de [95.90.241.208]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: pmenzel) by mx.molgen.mpg.de (Postfix) with ESMTPSA id 571FE2064712B; Tue, 3 Nov 2020 00:13:23 +0100 (CET) From: Paul Menzel To: Jesse Brandeburg , Tony Nguyen Cc: Jeffrey Townsend , "David S . Miller" , Jakub Kicinski , intel-wired-lan@lists.osuosl.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, John W Linville , Paul Menzel Subject: [PATCH 2/2] ethernet: igb: e1000_phy: Check for ops.force_speed_duplex existence Date: Tue, 3 Nov 2020 00:13:07 +0100 Message-Id: <20201102231307.13021-3-pmenzel@molgen.mpg.de> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201102231307.13021-1-pmenzel@molgen.mpg.de> References: <20201102231307.13021-1-pmenzel@molgen.mpg.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeffrey Townsend The ops field might no be defined, so add a check. The patch is taken from Open Network Linux (ONL), and it was added there as part of the patch packages/base/any/kernels/3.16+deb8/patches/driver-support-intel-igb-bcm5461X-phy.patch in ONL commit f32316c63c (Support the BCM54616 and BCM5461S.) [1]. Part of this commit was already upstreamed in Linux commit eeb0149660 (igb: support BCM54616 PHY) in 2017. I applied the forward-ported packages/base/any/kernels/5.4-lts/patches/0002-driver-support-intel-igb-bcm5461S-phy.patch added in ONL commit 5ace6bcdb3 (Add 5.4 LTS kernel build.) [2]. [1]: https://github.com/opencomputeproject/OpenNetworkLinux/commit/f32316c63ce3a64de125b7429115c6d45e942bd1 [2]: https://github.com/opencomputeproject/OpenNetworkLinux/commit/5ace6bcdb37cb8065dcd1d4404b3dcb6424f6331 Cc: Jeffrey Townsend Cc: John W Linville Signed-off-by: Paul Menzel --- drivers/net/ethernet/intel/igb/e1000_phy.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/net/ethernet/intel/igb/e1000_phy.c b/drivers/net/ethernet/intel/igb/e1000_phy.c index 4e0b4ba09a00..4151e55a6d2a 100644 --- a/drivers/net/ethernet/intel/igb/e1000_phy.c +++ b/drivers/net/ethernet/intel/igb/e1000_phy.c @@ -1107,11 +1107,13 @@ s32 igb_setup_copper_link(struct e1000_hw *hw) /* PHY will be set to 10H, 10F, 100H or 100F * depending on user settings. */ - hw_dbg("Forcing Speed and Duplex\n"); - ret_val = hw->phy.ops.force_speed_duplex(hw); - if (ret_val) { - hw_dbg("Error Forcing Speed and Duplex\n"); - goto out; + if (hw->phy.ops.force_speed_duplex) { + hw_dbg("Forcing Speed and Duplex\n"); + ret_val = hw->phy.ops.force_speed_duplex(hw); + if (ret_val) { + hw_dbg("Error Forcing Speed and Duplex\n"); + goto out; + } } } -- 2.29.1