Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3969970ybi; Mon, 29 Jul 2019 16:31:49 -0700 (PDT) X-Google-Smtp-Source: APXvYqycUNQzdru2ZUY9N87F4rYgAfXM8bx/XMv6gupOO4xpMMQr86G2br3ocRDIHXoLE7ASt2ap X-Received: by 2002:a17:90b:8e:: with SMTP id bb14mr114767258pjb.19.1564443109170; Mon, 29 Jul 2019 16:31:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564443109; cv=none; d=google.com; s=arc-20160816; b=cGpStiivuoog9PYUDetgqvTgjQsP7R1uwqeN6np2VXtWK2W6MuwTjdk1+g4Sj4seu6 y4xWiu2IbVWZPcqC8O22SKf/qrk5YePTOyX29IxuRtnbHkz8PpXXT4bkOuXfJh4CztvY qQptvWmtOBsGFhUp+OMJ4m+GqArSEY2cOXed3HLakPe9kf5Ttf34dXcnWBfSDMl/hqp4 zL+oG9q7VIh9Tp0Xij0/GVHEK4w1aGKkbCKvWuEgeV6fq/eOlTdQlUqSp3DWOFHO03Cg altKJeg6GxUVk5lm+YEincUIu8VnYxcVGPWqFQu1vHVMq1qw3Mr07u7FOZOgakPzMtLc 1ghA== 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=sh6nw9FbCeO4VbpWuiIihXEsJMx7voySeMD4dpIot1w=; b=OvZkaL/zCo91zFIk58/NVUISKpi3em/rd9g9PrhrigQet3jVjdYYbVwYoTWMk2zr4d GVKWPHekg/2hwQd5qX3RnjkYRdMqDmpnajQSwCy0EZEjzO2fRGcAc1GIP8GPPhSOUXoH iy/QTK4so6oBvdzox7hYg0wVVm7cQ8dqixV5E3UwmfWteOe3k0RtcOkRLely3NEq7q3/ j8XvbeG7t1duYbZr2zXCvnTg8QAwRqzU+u7I5urGdW1vW+4w/GTAeaWQBzbkprawPSOY S9GbLVrB9HZg8OtuSH2vOj9OD24jsYPUE1Ez1LBW69Vq7+MmXBtf1HJxG0A9vyv0iuQT l21w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Fqb75d/3"; 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 t15si28426474pjr.46.2019.07.29.16.31.34; Mon, 29 Jul 2019 16:31:49 -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="Fqb75d/3"; 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 S1729750AbfG2T0W (ORCPT + 99 others); Mon, 29 Jul 2019 15:26:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:38752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728102AbfG2T0V (ORCPT ); Mon, 29 Jul 2019 15:26:21 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 718C82171F; Mon, 29 Jul 2019 19:26:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564428379; bh=c0QN6XzbHZvWbQ/ngMjX6N5OMm7wXKy0+mCGT6v1Ckw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fqb75d/38+b7zDlHtmOEMGNSoAioFiaDSmcJ27w6eOxvioxGU9RbLQI43f1ozyM1O MeqfEBOmofE7iFfWpPBi2FZHvv2WYMJLh+Q0Dd8O3XUkz2+DMDEt+gEdmFlyAMuaPT sySYWeUYik3hYJOnSVMUstmFq8cbVYpHREuXyds4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ariel Elior , Denis Bolotin , Michal Kalderon , "David S. Miller" , Sasha Levin Subject: [PATCH 4.14 020/293] qed: Set the doorbell address correctly Date: Mon, 29 Jul 2019 21:18:31 +0200 Message-Id: <20190729190822.355531212@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190820.321094988@linuxfoundation.org> References: <20190729190820.321094988@linuxfoundation.org> User-Agent: quilt/0.66 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 [ Upstream commit 8366d520019f366fabd6c7a13032bdcd837e18d4 ] In 100g mode the doorbell bar is united for both engines. Set the correct offset in the hwfn so that the doorbell returned for RoCE is in the affined hwfn. Signed-off-by: Ariel Elior Signed-off-by: Denis Bolotin Signed-off-by: Michal Kalderon Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/net/ethernet/qlogic/qed/qed_dev.c | 29 ++++++++++++++-------- drivers/net/ethernet/qlogic/qed/qed_rdma.c | 2 +- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/drivers/net/ethernet/qlogic/qed/qed_dev.c b/drivers/net/ethernet/qlogic/qed/qed_dev.c index 410528e7d927..c4e8bf0773fe 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c @@ -2947,6 +2947,7 @@ static int qed_get_dev_info(struct qed_hwfn *p_hwfn, struct qed_ptt *p_ptt) static int qed_hw_prepare_single(struct qed_hwfn *p_hwfn, void __iomem *p_regview, void __iomem *p_doorbells, + u64 db_phys_addr, enum qed_pci_personality personality) { int rc = 0; @@ -2954,6 +2955,7 @@ static int qed_hw_prepare_single(struct qed_hwfn *p_hwfn, /* Split PCI bars evenly between hwfns */ p_hwfn->regview = p_regview; p_hwfn->doorbells = p_doorbells; + p_hwfn->db_phys_addr = db_phys_addr; if (IS_VF(p_hwfn->cdev)) return qed_vf_hw_prepare(p_hwfn); @@ -3036,7 +3038,9 @@ int qed_hw_prepare(struct qed_dev *cdev, /* Initialize the first hwfn - will learn number of hwfns */ rc = qed_hw_prepare_single(p_hwfn, cdev->regview, - cdev->doorbells, personality); + cdev->doorbells, + cdev->db_phys_addr, + personality); if (rc) return rc; @@ -3045,22 +3049,25 @@ int qed_hw_prepare(struct qed_dev *cdev, /* Initialize the rest of the hwfns */ if (cdev->num_hwfns > 1) { void __iomem *p_regview, *p_doorbell; - u8 __iomem *addr; + u64 db_phys_addr; + u32 offset; /* adjust bar offset for second engine */ - addr = cdev->regview + - qed_hw_bar_size(p_hwfn, p_hwfn->p_main_ptt, - BAR_ID_0) / 2; - p_regview = addr; + offset = qed_hw_bar_size(p_hwfn, p_hwfn->p_main_ptt, + BAR_ID_0) / 2; + p_regview = cdev->regview + offset; - addr = cdev->doorbells + - qed_hw_bar_size(p_hwfn, p_hwfn->p_main_ptt, - BAR_ID_1) / 2; - p_doorbell = addr; + offset = qed_hw_bar_size(p_hwfn, p_hwfn->p_main_ptt, + BAR_ID_1) / 2; + + p_doorbell = cdev->doorbells + offset; + + db_phys_addr = cdev->db_phys_addr + offset; /* prepare second hw function */ rc = qed_hw_prepare_single(&cdev->hwfns[1], p_regview, - p_doorbell, personality); + p_doorbell, db_phys_addr, + personality); /* in case of error, need to free the previously * initiliazed hwfn 0. diff --git a/drivers/net/ethernet/qlogic/qed/qed_rdma.c b/drivers/net/ethernet/qlogic/qed/qed_rdma.c index 1b6554866138..1e13dea66989 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c +++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c @@ -753,7 +753,7 @@ static int qed_rdma_add_user(void *rdma_cxt, dpi_start_offset + ((out_params->dpi) * p_hwfn->dpi_size)); - out_params->dpi_phys_addr = p_hwfn->cdev->db_phys_addr + + out_params->dpi_phys_addr = p_hwfn->db_phys_addr + dpi_start_offset + ((out_params->dpi) * p_hwfn->dpi_size); -- 2.20.1