Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp49254imu; Thu, 8 Nov 2018 14:33:50 -0800 (PST) X-Google-Smtp-Source: AJdET5flCuxvOEwipEMLIisjR8Xqpm4Lg7tuiXAV2NYtVX44pbsogoEJOjSkAzzYb6RIgNveepkb X-Received: by 2002:a63:981:: with SMTP id 123mr5364485pgj.444.1541716430419; Thu, 08 Nov 2018 14:33:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541716430; cv=none; d=google.com; s=arc-20160816; b=HIDl6+TBs1kCGDDwNkz1pvzJhINX2HwK4a7Nfrm2AJDaiI9spxwQOXOu+CSodcKXef ZfZ9xnxyopAD5t1BPKdAjyh6YhiUo3dYgSEuByVWpIJvDKDTCM6W5lYo+JaVuqTRAn5p HKQnU26NsqESIeoydvJIu0ZNEIqgblcuZtpSqRYdMU4bowUZY97zNV11EeCZOKiX2occ o++ftPZed1rkpXmyPqGLBm65j6IHzMoQcjM6BRYU8YQH0bB6RdsP68ABpQv8oPMqsjVB 1lR0PjUzb2PgA7vn0ydN6PVeBUx3c5gdK7rjzD9PyPmif9cCJmTsUvBdpa+Z/Z6RjNRG 6HQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uW3Ixsgg4NOPfFCfRMNBCjgbkk4jfimZ0emjewQdRQI=; b=VnD67wf5WPS1BvR9H4F2SpMqMx1+X1eF0EAF1pEHjtdi1bPWXGC7L+sPDcoHD2tgtI ouvmk505cuh8ksVoC8bihiArkuF+gvImFMi0Zja05EwG5snFkSwL7fnVvn7YMGcQBUF8 6dqJ1vqhFeCXUDAe+Wms6Lm45M8Kfun/YBfsU6vYHh1wzzDugJ0sZZUazxuKWeM7/pZV MnQnr13/W6xTTr2OWfJXVDlfhPjLwGT4nSxzG+l10Gnvqt8MR8obzIlC/dxAQv6YtwlU jCdZ+mFkR4/yxS3XefOs5Gjip3Yg19Uas9bpXsYtQWjtwHgAqZIgKd2gcAdHesQOvDk1 FP9A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SAbSMFt7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j191si4924023pgc.15.2018.11.08.14.33.34; Thu, 08 Nov 2018 14:33:50 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=SAbSMFt7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730277AbeKIHh1 (ORCPT + 99 others); Fri, 9 Nov 2018 02:37:27 -0500 Received: from mail.kernel.org ([198.145.29.99]:55672 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728100AbeKIHh1 (ORCPT ); Fri, 9 Nov 2018 02:37:27 -0500 Received: from localhost (unknown [208.72.13.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id A72722147A; Thu, 8 Nov 2018 21:59:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541714398; bh=ZtMDOTuDGnMVsAFdDQ07K4NQz2w2uQcscC42rGfIoyc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=SAbSMFt7c8mPY+KbRqcIT7OJzdlar3LLBjyMFFJLVzEP3Of4ZqmXkqh1UvvGvlPBM wmLtNLqbd0EQ1lyg1iujtZ0B39+EYMLo7jzy6RknAaMjvpH647EHtYgzREA3u1RMqm aYG0GFQqmx6qixS5GG2X9y8pTMrH4i/Q4fDcrTJQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mark Rustad , Phil Schmitt , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.4 058/114] ixgbe: Correct X550EM_x revision check Date: Thu, 8 Nov 2018 13:51:13 -0800 Message-Id: <20181108215106.363357833@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181108215059.051093652@linuxfoundation.org> References: <20181108215059.051093652@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 3ca2b2506ec9a3b1615930a6810d30ec9aba10a1 ] The X550EM_x revision check needs to check a value, not just a bit. Use a mask and check the value. Also remove the redundant check inside the ixgbe_enter_lplu_t_x550em, because it can only be called when both the mac type and revision check pass. Signed-off-by: Mark Rustad Tested-by: Phil Schmitt Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin --- drivers/net/ethernet/intel/ixgbe/ixgbe_type.h | 2 +- drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c | 9 +++------ 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h index 995f03107eac..04bc4df82fa7 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h @@ -3508,7 +3508,7 @@ struct ixgbe_info { #define IXGBE_FUSES0_GROUP(_i) (0x11158 + ((_i) * 4)) #define IXGBE_FUSES0_300MHZ BIT(5) -#define IXGBE_FUSES0_REV1 BIT(6) +#define IXGBE_FUSES0_REV_MASK (3 << 6) #define IXGBE_KRM_PORT_CAR_GEN_CTRL(P) ((P) ? 0x8010 : 0x4010) #define IXGBE_KRM_LINK_CTRL_1(P) ((P) ? 0x820C : 0x420C) diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c index a75f2e3ce86f..ffd2e74e5638 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c @@ -1873,10 +1873,6 @@ static s32 ixgbe_enter_lplu_t_x550em(struct ixgbe_hw *hw) u32 save_autoneg; bool link_up; - /* SW LPLU not required on later HW revisions. */ - if (IXGBE_FUSES0_REV1 & IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0))) - return 0; - /* If blocked by MNG FW, then don't restart AN */ if (ixgbe_check_reset_blocked(hw)) return 0; @@ -2030,8 +2026,9 @@ static s32 ixgbe_init_phy_ops_X550em(struct ixgbe_hw *hw) } /* setup SW LPLU only for first revision */ - if (!(IXGBE_FUSES0_REV1 & IXGBE_READ_REG(hw, - IXGBE_FUSES0_GROUP(0)))) + if (hw->mac.type == ixgbe_mac_X550EM_x && + !(IXGBE_READ_REG(hw, IXGBE_FUSES0_GROUP(0)) & + IXGBE_FUSES0_REV_MASK)) phy->ops.enter_lplu = ixgbe_enter_lplu_t_x550em; phy->ops.handle_lasi = ixgbe_handle_lasi_ext_t_x550em; -- 2.17.1