Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2497219imm; Mon, 24 Sep 2018 05:29:14 -0700 (PDT) X-Google-Smtp-Source: ACcGV61P3A31+UrMmGpMUUaS58ePC9BV4cVSjidAK/K6RMIjsqnrGnaSfm5Tsp9tqxH5ZKekC+H/ X-Received: by 2002:a63:91c9:: with SMTP id l192-v6mr9427821pge.433.1537792154000; Mon, 24 Sep 2018 05:29:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537792153; cv=none; d=google.com; s=arc-20160816; b=IcmdddyFAzyJdPty8kZZv06ucJCADGpBMPBlJ0B6K/sqrXlWTneu1zRlOKLJV7lUFC sF9s3MVohvbRUfwKE3Y9IIom/QiRKKTFnzDv1UETVkYlR39+cXauYd9UDWiIt+UPTP9A uIkChBrBtwqUA8jjEFn1DsXs4imlBMDmkur4qhXGy9mQI/ehcGHOYeKUbOsK8DPj5M6h dMw5/fcG3qu05apliCylh5dXPa3zwGsD87gSC0U4S4nCj8Emg4DIO/uJfy1hx9jbogHG 10pTe0XpCjWEsyAlJj4bySlC+YBZDvttxXKt4gOnZfdcjUJ29+2Zc9DAERG4igfgRnma +NgQ== 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; bh=+tIlk32z2kW3bkER3OiNmY3qM4JPqbyKTAHqQJWdqm4=; b=xV0mnujNF8+RQ53GrCTFI0jMbEMAKyfKZ9IiNujeVVHN74xH7sBbZGzQ7SWhscj+y6 gKl60baNBgQmQE7S7hD4lx7MqNG8rFW2+cbBccWxKzZu6dUZ+nQcGdrDSRrVqb82YLMe 7ZEMYa57mXgbcYwzE381uRAet2Oi5ZSc4donPSVKT4SWX9cVSVXyW6qxpZD3dmsyT75O ji485f3pcsyXJCoquwlBWyqLqDBbcvWKKO7S/HWzggLy67qTcfg/1v0+4Kl53D9jMjs1 8f6Pl/yIA4wbW8tyaO1O+xXFirDp3fK+fNnVuMFnmDNelyAOfZEdX7046fi+Aw/5EUyj +A5g== 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 h6-v6si32472918pls.150.2018.09.24.05.28.58; Mon, 24 Sep 2018 05:29:13 -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 S1732807AbeIXS3z (ORCPT + 99 others); Mon, 24 Sep 2018 14:29:55 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:57378 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730233AbeIXS3y (ORCPT ); Mon, 24 Sep 2018 14:29:54 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 8E7B81018; Mon, 24 Sep 2018 12:27:59 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jakub Kicinski , Dirk van der Merwe , "David S. Miller" , Sasha Levin Subject: [PATCH 4.18 025/235] nfp: dont fail probe on pci_sriov_set_totalvfs() errors Date: Mon, 24 Sep 2018 13:50:11 +0200 Message-Id: <20180924113107.241756604@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180924113103.999624566@linuxfoundation.org> References: <20180924113103.999624566@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.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Jakub Kicinski [ Upstream commit 5b0ced17edc5710d4e946392d0f2934a9e07b37f ] On machines with buggy ACPI tables or when SR-IOV is already enabled we may not be able to set the SR-IOV VF limit in sysfs, it's not fatal because the limit is imposed by the driver anyway. Only the sysfs 'sriov_totalvfs' attribute will be too high. Print an error to inform user about the failure but allow probe to continue. Signed-off-by: Jakub Kicinski Reviewed-by: Dirk van der Merwe Signed-off-by: David S. Miller Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/netronome/nfp/nfp_main.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) --- a/drivers/net/ethernet/netronome/nfp/nfp_main.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_main.c @@ -236,16 +236,20 @@ static int nfp_pcie_sriov_read_nfd_limit int err; pf->limit_vfs = nfp_rtsym_read_le(pf->rtbl, "nfd_vf_cfg_max_vfs", &err); - if (!err) - return pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs); + if (err) { + /* For backwards compatibility if symbol not found allow all */ + pf->limit_vfs = ~0; + if (err == -ENOENT) + return 0; - pf->limit_vfs = ~0; - /* Allow any setting for backwards compatibility if symbol not found */ - if (err == -ENOENT) - return 0; + nfp_warn(pf->cpp, "Warning: VF limit read failed: %d\n", err); + return err; + } - nfp_warn(pf->cpp, "Warning: VF limit read failed: %d\n", err); - return err; + err = pci_sriov_set_totalvfs(pf->pdev, pf->limit_vfs); + if (err) + nfp_warn(pf->cpp, "Failed to set VF count in sysfs: %d\n", err); + return 0; } static int nfp_pcie_sriov_enable(struct pci_dev *pdev, int num_vfs)