Received: by 2002:ac0:950c:0:0:0:0:0 with SMTP id f12csp2314645imc; Tue, 12 Mar 2019 11:11:39 -0700 (PDT) X-Google-Smtp-Source: APXvYqynuoVSOHCTs6AimYtceyFOvyQzMgwLkC6Tup9ZZUkbseiNpwzxlBgpyJN32sqSTvoKUVGB X-Received: by 2002:a17:902:bf0c:: with SMTP id bi12mr21412829plb.340.1552414299652; Tue, 12 Mar 2019 11:11:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552414299; cv=none; d=google.com; s=arc-20160816; b=V0ESNllyFUOr30i12PHzdEri0q7TWRBeH8aWF3RYZ5sshNXm8Jm4tGh9hsGGzT63tO V+51YF6CahnEAEgnnuPv0lanQwvHHqf/4A7Ls3/Ct50qu6cD4Ce2s4sAsojWS530FkVE 5ORXq91nG07wkz3AOQAFKS1AyJeK6xf44+ZTs0qaRUYLOYIYO/jayCpxAuHhE41Mtn0L gpuq2hDCUwt+m7BFCBwN5LfpM4bRapm26uRMUir9wxeK14zk2u+Rl1hA4ZR5VDCu6vHI vj46u2FH34Hu6Dm1T0631YVfBkTP/Nr0/cDLaLceFV6woaGhr1hFq0ORPwpXl6TMcqn8 Nb4A== 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=5COKHN0l58Q85pzwKINDAtsxwdCg8xTes4ngM8t3vNA=; b=hWRmW8iR7XqvRlTiCVCZ6XTyd7yKegadQudBOtJi7ppmeI6iS2tdUa4JniNYpIqkGX ItZKjzWb9leAFW2FVjaGBmEgq21PZxrgMWwQ8XMuxC+HyPrI7h5o08Bv1WsPlQDqlDWy 9oFqkrkQSOgqrIuA+eDJ3EvwORLBxkgSVBAct1vbEyTMxD60MxLewNeCNJQ2FP07Jran ZTnzhNMjMzFXoQddx7HUhUm3ena2GrlVTkUF2k1VseinILeP3QzDZz/PaaTNK3Br8e0Y MK7f+v+VDDqFw/+Zy/aBc9ebEYUXen54mtO/954b2jlo27WjwfS21qOL/lfFNQ6Ga6+C cgAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=z8ROuXDU; 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 y11si8078579pfm.119.2019.03.12.11.11.22; Tue, 12 Mar 2019 11:11:39 -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; dkim=pass header.i=@kernel.org header.s=default header.b=z8ROuXDU; 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 S1727599AbfCLSHg (ORCPT + 99 others); Tue, 12 Mar 2019 14:07:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:47302 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727394AbfCLRMU (ORCPT ); Tue, 12 Mar 2019 13:12:20 -0400 Received: from localhost (unknown [104.133.8.98]) (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 8B9412177E; Tue, 12 Mar 2019 17:12:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1552410739; bh=4BluRIqSIzUm4xHbDoh4fjdn2BL1H1b29RBrrSLG+Ec=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=z8ROuXDU0TUyeTG0AvAxIi2AfmtM5om0Msa3O/B/tzEOmcLb1GHRBHl66rQId9GAk I0RYtqYGC7bkRV26f+bB1MuA3n77npjf6Ckfpuu2m03YzRTFAUH1bBZOmjvmCpyxmP 47zSZH5kxY8uhz7Sci/gJZgy5F565DxPvl+DeElo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Manish Chopra , Ariel Elior , "David S. Miller" , Sasha Levin Subject: [PATCH 4.20 043/171] qed: Fix VF probe failure while FLR Date: Tue, 12 Mar 2019 10:07:03 -0700 Message-Id: <20190312170351.831277041@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190312170347.868927101@linuxfoundation.org> References: <20190312170347.868927101@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore 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.20-stable review patch. If anyone has any objections, please let me know. ------------------ [ Upstream commit 327852ec64205bb651be391a069784872098a3b2 ] VFs may hit VF-PF channel timeout while probing, as in some cases it was observed that VF FLR and VF "acquire" message transaction (i.e first message from VF to PF in VF's probe flow) could occur simultaneously which could lead VF to fail sending "acquire" message to PF as VF is marked disabled from HW perspective due to FLR, which will result into channel timeout and VF probe failure. In such cases, try retrying VF "acquire" message so that in later attempts it could be successful to pass message to PF after the VF FLR is completed and can be probed successfully. Signed-off-by: Manish Chopra Signed-off-by: Ariel Elior Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed_vf.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/net/ethernet/qlogic/qed/qed_vf.c b/drivers/net/ethernet/qlogic/qed/qed_vf.c index b6cccf44bf40..5dda547772c1 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_vf.c +++ b/drivers/net/ethernet/qlogic/qed/qed_vf.c @@ -261,6 +261,7 @@ static int qed_vf_pf_acquire(struct qed_hwfn *p_hwfn) struct pfvf_acquire_resp_tlv *resp = &p_iov->pf2vf_reply->acquire_resp; struct pf_vf_pfdev_info *pfdev_info = &resp->pfdev_info; struct vf_pf_resc_request *p_resc; + u8 retry_cnt = VF_ACQUIRE_THRESH; bool resources_acquired = false; struct vfpf_acquire_tlv *req; int rc = 0, attempts = 0; @@ -314,6 +315,15 @@ static int qed_vf_pf_acquire(struct qed_hwfn *p_hwfn) /* send acquire request */ rc = qed_send_msg2pf(p_hwfn, &resp->hdr.status, sizeof(*resp)); + + /* Re-try acquire in case of vf-pf hw channel timeout */ + if (retry_cnt && rc == -EBUSY) { + DP_VERBOSE(p_hwfn, QED_MSG_IOV, + "VF retrying to acquire due to VPC timeout\n"); + retry_cnt--; + continue; + } + if (rc) goto exit; -- 2.19.1