Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9986920ybi; Wed, 24 Jul 2019 13:36:17 -0700 (PDT) X-Google-Smtp-Source: APXvYqy1go1rkEZw8J9+o9IktoFKdBbwertpmCM5xd2s0ySvgEnL3nN5qTA/YjK9WUvwWCzlsaex X-Received: by 2002:a65:6850:: with SMTP id q16mr46426872pgt.423.1564000577046; Wed, 24 Jul 2019 13:36:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564000577; cv=none; d=google.com; s=arc-20160816; b=NLQVOcOCnHe/EsjLrhKLdJOnrvnISEPwxBfRQMfcBzXKvyGXHajFCjKzKtVXSQT1oD 1C88KF8iOhRhk+8BZl9hDmLrCwzQzhoRCnnpgXQs3wi9tWEvFzF1zhuuqIZsziz66cS6 e84H5NYv9gczHDzMGJleKpucIwhUlnA3ijXMNLAmWBibxpizgFSj3i9N1W6GcG838lRV mH6KXOMiBdnpTmNmAaFD0JJ3akZ2TMeVAQ7/j3KYBbu1HqTko0dk19PKygaPtvRj5zy4 3SKqHZfXgq6wVIcY7ygayjW0ogSG3T9OQKgK5QXnFB4SImNwLflkKojUBK4WNuN1afMQ +2Rg== 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=+71DDJUsrGoZRFOomZDaSsbqqWGij3E7PrQGzQF3x0Y=; b=J8YNM5TSuK2giKl3HaKJYwjpaBdDkmrgajrOVyfF3VRA9dmw8fPajKhy8L+8lnYEq0 9Ed1MLx43geQdGYwuAAgYKBlnylPk76RexV837NUNvQiGrqGPeU2EgYF0B7FvIYudbYq XgjF0oCW7ewwyjIsMNHHARLWJiEGk1vdQVfU9oqtzS8O3wPEv0g7a6r1Avwz8D5e1yzl vBDnOPUMFyE7NqsOZomaMXDwiUXzKZpGPZnmiZnNEsTOaHKAb8ym8oLZ4VE3tHYQiVeC Y7QQ0FbOtD75+aYqzXZnPm3reWPTR5ekWuUKkXezPgK0Dwhn0N6j8ceUZJagUgF8e7xy NR5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=DAKPxmtq; 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 i8si12873204pju.32.2019.07.24.13.36.02; Wed, 24 Jul 2019 13:36:17 -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=DAKPxmtq; 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 S2388092AbfGXT0W (ORCPT + 99 others); Wed, 24 Jul 2019 15:26:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:43370 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729239AbfGXT0V (ORCPT ); Wed, 24 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 90757218EA; Wed, 24 Jul 2019 19:26:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563996381; bh=G8ZzqByk5C6VfeVvnonFakvbAuQMGMSo714V6d3WMa0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DAKPxmtqQeEGUdRULwcw2/XQvE6X3LjRpHqWaBc/gOA0tzqh4NW8MF8zeMNTdON3R /OPBZDjQ9EBUfbYbUxRRjoQ7Ss1+sQhko34C0UyIq1UfSjPrZeOsnyTILJX4xOEOAB +CBrthvCQ90B1auytiEzVVuXDblyH98g0cShaGf4= 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 5.2 036/413] qed: Set the doorbell address correctly Date: Wed, 24 Jul 2019 21:15:27 +0200 Message-Id: <20190724191738.201049416@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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 fccdb06fc5c5..8c40739e0d1b 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_dev.c +++ b/drivers/net/ethernet/qlogic/qed/qed_dev.c @@ -3443,6 +3443,7 @@ static void qed_nvm_info_free(struct qed_hwfn *p_hwfn) 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) { struct qed_dev *cdev = p_hwfn->cdev; @@ -3451,6 +3452,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); @@ -3546,7 +3548,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; @@ -3555,22 +3559,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 7873d6dfd91f..13802b825d65 100644 --- a/drivers/net/ethernet/qlogic/qed/qed_rdma.c +++ b/drivers/net/ethernet/qlogic/qed/qed_rdma.c @@ -803,7 +803,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