Received: by 10.213.65.68 with SMTP id h4csp37812imn; Mon, 19 Mar 2018 18:46:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELsNGD6PwZ7pU3yLbH1Pi529zJpAqUmlitwuviFxRNaXd1vDzUQUNYp0GWLqUGG4c5re+J3q X-Received: by 2002:a17:902:700b:: with SMTP id y11-v6mr3129559plk.177.1521510396903; Mon, 19 Mar 2018 18:46:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521510396; cv=none; d=google.com; s=arc-20160816; b=Piw+yBklWIypKA9389vL2YxWi6R1pAe7rU4XclRd3TPC8R7sbpFVY8EgwRRQskHmlB q1HAZCNovLMqGz/4lCTDUYfhS3JKK8W5k40fRSuCdTUZzAMizlrYIlLahu2+R1Im6FZu 3pueIf6/TzqYKRMqRNNU1ySdFqLADh3/fmmH5DgiD8tScQKfzWbVpxicc/Gv1NYdF4di lrrpTwl9QXNZ1UTeToCDXYnza4e/eXL9pUaDg1rYSUrtYkTGi2BUll/I3a7fQkByLl92 eyEXKYEAAFl3+0o5vR4QnA8t9Qaw2R0s6hP63oXhFEhPxFJZsu0NVckHRnEFx2SngI6Y YEMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=q4EVk2RoOBOKo0/V7Jv1sofeI83J1BGVe2ANd6LIzFQ=; b=sUvnnHpmNBhK8x2zPTfpbCKz6W/k3HyQM9yCrncV4S1WqeDo5csR99NCVUY5CxyWI2 mdLp3NGvqgNLRvowcH6cSA9r4H9Hx7HX4JCrkdBYE4E2zVtiRqfaYsnCSKfs3rbI0eIc yD1ap2d7Sfe9uVlDl3rLKekLnLZsfYSuysOS7PtXSd+ZjHdxXswnP9kF89hhZ2HAXjZl 3fq/tq3XJSohDW5nNt/PnHeX983KR0Px2HzdA3+rEETlO1uQIZr3FFZNk43mndNvC49u z1bA3MWsFTgnnKP6fpQRWkK8wqH0L+4tOrqboMJSMiDaeciTJ3qQbCCLpqunvlUTq+uW 8crQ== ARC-Authentication-Results: i=1; mx.google.com; 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 k6-v6si563371pln.103.2018.03.19.18.46.23; Mon, 19 Mar 2018 18:46:36 -0700 (PDT) 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; 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 S969188AbeCSTcB (ORCPT + 99 others); Mon, 19 Mar 2018 15:32:01 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:49486 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1031421AbeCSSX2 (ORCPT ); Mon, 19 Mar 2018 14:23:28 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 58897D77; Mon, 19 Mar 2018 18:23:27 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mitch Williams , Stefan Assmann , Andrew Bowers , Jeff Kirsher , Sasha Levin Subject: [PATCH 4.9 124/241] i40e: only register client on iWarp-capable devices Date: Mon, 19 Mar 2018 19:06:29 +0100 Message-Id: <20180319180756.334934447@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180319180751.172155436@linuxfoundation.org> References: <20180319180751.172155436@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mitch Williams [ Upstream commit 004eb614c4d2fcc12a98714fd887a860582f203a ] The client interface is only intended for use on devices that support iWarp. Only register with the client if this is the case. This fixes a panic when loading i40iw on X710 devices. Signed-off-by: Mitch Williams Reported-by: Stefan Assmann Tested-by: Andrew Bowers Signed-off-by: Jeff Kirsher Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/intel/i40e/i40e_main.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) --- a/drivers/net/ethernet/intel/i40e/i40e_main.c +++ b/drivers/net/ethernet/intel/i40e/i40e_main.c @@ -11142,10 +11142,12 @@ static int i40e_probe(struct pci_dev *pd round_jiffies(jiffies + pf->service_timer_period)); /* add this PF to client device list and launch a client service task */ - err = i40e_lan_add_device(pf); - if (err) - dev_info(&pdev->dev, "Failed to add PF to client API service list: %d\n", - err); + if (pf->flags & I40E_FLAG_IWARP_ENABLED) { + err = i40e_lan_add_device(pf); + if (err) + dev_info(&pdev->dev, "Failed to add PF to client API service list: %d\n", + err); + } #ifdef I40E_FCOE /* create FCoE interface */ @@ -11323,10 +11325,11 @@ static void i40e_remove(struct pci_dev * i40e_vsi_release(pf->vsi[pf->lan_vsi]); /* remove attached clients */ - ret_code = i40e_lan_del_device(pf); - if (ret_code) { - dev_warn(&pdev->dev, "Failed to delete client device: %d\n", - ret_code); + if (pf->flags & I40E_FLAG_IWARP_ENABLED) { + ret_code = i40e_lan_del_device(pf); + if (ret_code) + dev_warn(&pdev->dev, "Failed to delete client device: %d\n", + ret_code); } /* shutdown and destroy the HMC */