Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp3728967imm; Mon, 8 Oct 2018 08:36:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Zk79bnRsFZNGlLcdb+UVWqVihgf2ylr/B/Z9XXW8UfPgBm5Qm8xRnEydzKsJD04v8U31J X-Received: by 2002:a63:1919:: with SMTP id z25-v6mr16369582pgl.135.1539012993737; Mon, 08 Oct 2018 08:36:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539012993; cv=none; d=google.com; s=arc-20160816; b=0+TsMS/lddr3GQHnhCPrwTj4rANws/UaLFOxhZ7lwWSbKxH8VkFWvgRnFjze2Ao8v9 KEeG50hwzx1SCeZtU5Bo91obE+dwHK38JoPmX1BvCqwqMuSCF6cf8Pi504ybfINsG4TJ 0TeA6tgRrujedw+BbXXhMm0VqehGnqLqbB8ydA7bl3//sa0V5fo8hhFM/DUlWsoLsoRk mQNDik+cxRW8/08Vj1bTOpaxIQZDYtC+6rgjN4LP91hvrj4karKbXNSK3iUb+fmyaYdw rW/rk/jEjPj2ww7mpkf6EaAHx8NqBMjkIf0M16M/BbXMX/g7lfdXKZuBuBa3l2H4CFQW OR7w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=GvTe0Dl/ytw1SqP71w/qoXajnBBu2pYZCH3F3FYNZDs=; b=AWcQuro+GePsbpbZEajhmQlPGxzGxJwJ/6qSiRzRI0AuuThHXF9joTZALj9RWjDXrt jX/rz0oGBXozcuN2a4d+iyDAFK440uItzH/YLsV5DzP89jGS2fAXKvHOzBmPYGL8Gi4t 78OCHI2DV7zifvW3QepQo1nI0iymtFI2EeB4AH+0c87LARz229Ab4nANBdngkCgvGSae qHNAelR+TJJEEnaWgIc0kXvKenI+SZdcEZoLnOo6RQXpK4iWlhi4BwanDYMo2I/ntMCM ZNN+uYgZ82+uaZsL/H1wHuIIK6+C1uF97UbPTPUalvUkhWLD3gBIwoPfFtyCPTNvecty Vvdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XwurOQXj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d17-v6si15934924pgp.549.2018.10.08.08.36.18; Mon, 08 Oct 2018 08:36:33 -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=XwurOQXj; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727650AbeJHWiP (ORCPT + 99 others); Mon, 8 Oct 2018 18:38:15 -0400 Received: from mail.kernel.org ([198.145.29.99]:56606 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727524AbeJHWiP (ORCPT ); Mon, 8 Oct 2018 18:38:15 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D90012075E; Mon, 8 Oct 2018 15:25:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1539012359; bh=kcGU+jBFSSQSgN2MACNzmTHjv3YqU2D0GMbrRiKLCRY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XwurOQXjccludyk6tyuvbsBatGPpAPCjCZN5voB7WiOgyYKocFKRMPth+hukZxw6P kKoeiyRP/dv48YDJCUTBia96f19ALGv6OtiZkZwvYPkqgOf2m3j3iqqFEMXZ5CWI0r OR+BRzkn3yz5uZuJtPZSN9UwSjGVomAhhaqYHevM= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Sudarsana Reddy Kalluru , Sudarsana Reddy Kalluru , Tomer Tayar , "David S . Miller" , Sasha Levin Subject: [PATCH AUTOSEL 4.18 34/58] qed: Fix populating the invalid stag value in multi function mode. Date: Mon, 8 Oct 2018 11:24:59 -0400 Message-Id: <20181008152523.70705-34-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181008152523.70705-1-sashal@kernel.org> References: <20181008152523.70705-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sudarsana Reddy Kalluru [ Upstream commit 50fdf60181b01b7383b85d4b9acbb842263d96a2 ] In multi-function mode, driver receives the stag value (outer vlan) for a PF from management FW (MFW). If the stag value is negotiated prior to the driver load, then the stag is not notified to the driver and hence driver will have the invalid stag value. The fix is to request the MFW for STAG value during the driver load time. Fixes: cac6f691 ("qed: Add support for Unified Fabric Port") Signed-off-by: Sudarsana Reddy Kalluru Signed-off-by: Tomer Tayar Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed_dev.c | 15 ++++++++++++++- drivers/net/ethernet/qlogic/qed/qed_hsi.h | 4 ++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index e5249b4741d0..194f4dbe57d3 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c @@ -1636,7 +1636,7 @@ static int qed_vf_start(struct qed_hwfn *p_hwfn, int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) { struct qed_load_req_params load_req_params; - u32 load_code, param, drv_mb_param; + u32 load_code, resp, param, drv_mb_param; bool b_default_mtu = true; struct qed_hwfn *p_hwfn; int rc = 0, mfw_rc, i; @@ -1782,6 +1782,19 @@ int qed_hw_init(struct qed_dev *cdev, struct qed_hw_init_params *p_params) if (IS_PF(cdev)) { p_hwfn = QED_LEADING_HWFN(cdev); + + /* Get pre-negotiated values for stag, bandwidth etc. */ + DP_VERBOSE(p_hwfn, + QED_MSG_SPQ, + "Sending GET_OEM_UPDATES command to trigger stag/bandwidth attention handling\n"); + drv_mb_param = 1 << DRV_MB_PARAM_DUMMY_OEM_UPDATES_OFFSET; + rc = qed_mcp_cmd(p_hwfn, p_hwfn->p_main_ptt, + DRV_MSG_CODE_GET_OEM_UPDATES, + drv_mb_param, &resp, ¶m); + if (rc) + DP_NOTICE(p_hwfn, + "Failed to send GET_OEM_UPDATES attention request\n"); + drv_mb_param = STORM_FW_VERSION; rc = qed_mcp_cmd(p_hwfn, p_hwfn->p_main_ptt, DRV_MSG_CODE_OV_UPDATE_STORM_FW_VER, diff --git a/drivers/net/ethernet/qlogic/qed/qed_hsi.h b/drivers/net/ethernet/qlogic/qed/qed_hsi.h index bee10c1781fb..baa8a795c551 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_hsi.h +++ b/drivers/net/ethernet/qlogic/qed/qed_hsi.h @@ -12414,6 +12414,7 @@ struct public_drv_mb { #define DRV_MSG_SET_RESOURCE_VALUE_MSG 0x35000000 #define DRV_MSG_CODE_OV_UPDATE_WOL 0x38000000 #define DRV_MSG_CODE_OV_UPDATE_ESWITCH_MODE 0x39000000 +#define DRV_MSG_CODE_GET_OEM_UPDATES 0x41000000 #define DRV_MSG_CODE_BW_UPDATE_ACK 0x32000000 #define DRV_MSG_CODE_NIG_DRAIN 0x30000000 @@ -12539,6 +12540,9 @@ struct public_drv_mb { #define DRV_MB_PARAM_ESWITCH_MODE_VEB 0x1 #define DRV_MB_PARAM_ESWITCH_MODE_VEPA 0x2 +#define DRV_MB_PARAM_DUMMY_OEM_UPDATES_MASK 0x1 +#define DRV_MB_PARAM_DUMMY_OEM_UPDATES_OFFSET 0 + #define DRV_MB_PARAM_SET_LED_MODE_OPER 0x0 #define DRV_MB_PARAM_SET_LED_MODE_ON 0x1 #define DRV_MB_PARAM_SET_LED_MODE_OFF 0x2 -- 2.17.1