From patchwork Fri Sep 28 08:43:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madalin Bucur X-Patchwork-Id: 10619201 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9C8D014BD for ; Fri, 28 Sep 2018 08:44:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FCC3284E8 for ; Fri, 28 Sep 2018 08:44:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 832A62ABBD; Fri, 28 Sep 2018 08:44:30 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 00F8E284E8 for ; Fri, 28 Sep 2018 08:44:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:Reply-To: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: References:In-Reply-To:Message-Id:Date:Subject:To:From:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=cAZL7meibFemyA9FTnk6RQpKS3Ium0C67ItkyqhskSw=; b=nlBwXi2BT0k5CX2Wsn8NugCxjb S77RValguwxWwaJK2QSUspZZWxR6Zz1G2CQTqCwr2nx5jgZPXD0l7jTLCl7y2B+pnRVdb7C6q/fMl IAV+ZAqIz/NQrbhp1J+c/oIKfx1SGzDxcso8a580SVs5hgdOqglUs77U9AXW7X4t1F6qfm6LWsDmt ggSOSE1oEb9J8XmSbsfBk48iT/OVQKygPv+SNxrpEL7FsuDkweuIOZx/AyA0MLI+B+Z7JIjqVPEgM EFdFddKEH4T6dT/tFEvQ8ickmpzX9cN2Dkh7NBpiiDW0Hob1cHke9wJBJZD8gwVf4HPM28pBZdXR7 ssJWZk0w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oNt-0002jP-OU; Fri, 28 Sep 2018 08:44:25 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oNp-0002ho-M8 for linux-arm-kernel@bombadil.infradead.org; Fri, 28 Sep 2018 08:44:21 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Reply-to:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=/UiPoCpPmSI+oFkZfGiiyv3umTUCKqIDPmKEHfMC0pg=; b=tq4SGds0ob5NMDN8urSc6uuc9 m6pZ2QI20XojvemXp3fbUmSKLwQWLtkRLpSy0iIW84D6/WFYpKpHHcpFDwS/Zv+ps/eieIvwT7gxN jF3kWJrP4V3+fOLqcGFE35WxMmGqgmgurYldSGkRhAYpSsrlw2A46gpuKYTHM2zm2eiHfCeQvQ1a9 zFiCaYGh6FhfJTKNiUq3dh7kYtk4pJM6FbpRbtF/qqo7Z0eRyXz8vMrbzpbly8bXwBvaWQ2fKcjVO aM7kguBf/QKk33LzL6rZ4oZzfgt3ZjR3FDo9cU4GX5Vhh3nKKEQOU5DENJacfKEwYMB2xqeZtZtS3 8oS/lmvcw==; Received: from inva021.nxp.com ([92.121.34.21]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oNm-0003sD-L8 for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2018 08:44:19 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0844320010E; Fri, 28 Sep 2018 10:43:40 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id EF1D5200007; Fri, 28 Sep 2018 10:43:39 +0200 (CEST) Received: from fsr-fed2164-101.ea.freescale.net (fsr-fed2164-101.ea.freescale.net [10.171.82.91]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 8AE6B2039E; Fri, 28 Sep 2018 10:43:39 +0200 (CEST) From: Madalin Bucur To: leoyang.li@nxp.com Subject: [PATCH v2 1/5] soc/fsl/qbman: Check if CPU is offline when initializing portals Date: Fri, 28 Sep 2018 11:43:20 +0300 Message-Id: <1538124204-31406-2-git-send-email-madalin.bucur@nxp.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> References: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180928_044418_878441_590AA0E4 X-CRM114-Status: GOOD ( 13.86 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: madalin.bucur@nxp.com Cc: Madalin Bucur , catalin.marinas@arm.com, roy.pledge@nxp.com, linux-kernel@vger.kernel.org, oss@buserror.net, claudiu.manoil@nxp.com, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roy Pledge If the CPU to affine the portal interrupt is offline at boot time affine the portal interrupt to another online CPU. If the CPU is later brought online the hotplug handler will correctly adjust the affinity. Moved common code in a function. Signed-off-by: Roy Pledge Signed-off-by: Madalin Bucur --- drivers/soc/fsl/qbman/bman.c | 6 ++---- drivers/soc/fsl/qbman/dpaa_sys.h | 20 ++++++++++++++++++++ drivers/soc/fsl/qbman/qman.c | 6 ++---- 3 files changed, 24 insertions(+), 8 deletions(-) diff --git a/drivers/soc/fsl/qbman/bman.c b/drivers/soc/fsl/qbman/bman.c index f9485cedc648..f84ab596bde8 100644 --- a/drivers/soc/fsl/qbman/bman.c +++ b/drivers/soc/fsl/qbman/bman.c @@ -562,11 +562,9 @@ static int bman_create_portal(struct bman_portal *portal, dev_err(c->dev, "request_irq() failed\n"); goto fail_irq; } - if (c->cpu != -1 && irq_can_set_affinity(c->irq) && - irq_set_affinity(c->irq, cpumask_of(c->cpu))) { - dev_err(c->dev, "irq_set_affinity() failed\n"); + + if (dpaa_set_portal_irq_affinity(c->dev, c->irq, c->cpu)) goto fail_affinity; - } /* Need RCR to be empty before continuing */ ret = bm_rcr_get_fill(p); diff --git a/drivers/soc/fsl/qbman/dpaa_sys.h b/drivers/soc/fsl/qbman/dpaa_sys.h index 9f379000da85..ae8afa552b1e 100644 --- a/drivers/soc/fsl/qbman/dpaa_sys.h +++ b/drivers/soc/fsl/qbman/dpaa_sys.h @@ -111,4 +111,24 @@ int qbman_init_private_mem(struct device *dev, int idx, dma_addr_t *addr, #define QBMAN_MEMREMAP_ATTR MEMREMAP_WC #endif +static inline int dpaa_set_portal_irq_affinity(struct device *dev, + int irq, int cpu) +{ + int ret = 0; + + if (!irq_can_set_affinity(irq)) { + dev_err(dev, "unable to set IRQ affinity\n"); + return -EINVAL; + } + + if (cpu == -1 || !cpu_online(cpu)) + cpu = cpumask_any(cpu_online_mask); + + ret = irq_set_affinity(irq, cpumask_of(cpu)); + if (ret) + dev_err(dev, "irq_set_affinity() on CPU %d failed\n", cpu); + + return ret; +} + #endif /* __DPAA_SYS_H */ diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index ecb22749df0b..0ffe7a1d0eae 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -1210,11 +1210,9 @@ static int qman_create_portal(struct qman_portal *portal, dev_err(c->dev, "request_irq() failed\n"); goto fail_irq; } - if (c->cpu != -1 && irq_can_set_affinity(c->irq) && - irq_set_affinity(c->irq, cpumask_of(c->cpu))) { - dev_err(c->dev, "irq_set_affinity() failed\n"); + + if (dpaa_set_portal_irq_affinity(c->dev, c->irq, c->cpu)) goto fail_affinity; - } /* Need EQCR to be empty before continuing */ isdr &= ~QM_PIRQ_EQCI; From patchwork Fri Sep 28 08:43:21 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madalin Bucur X-Patchwork-Id: 10619207 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 518F815A7 for ; Fri, 28 Sep 2018 08:54:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0B009283C9 for ; Fri, 28 Sep 2018 08:54:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F15E02AE73; Fri, 28 Sep 2018 08:54:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 751E7283C9 for ; Fri, 28 Sep 2018 08:54:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:Reply-To: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: References:In-Reply-To:Message-Id:Date:Subject:To:From:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=Tu6oLFMohu+CknfLGYFjvzq8eaoPvyHSVMKrmz5jtoA=; b=OGWXwSaYRvlS1RkHwbkPVgbT/Y KLY7xVKzE3agmTO9Js7ItxZqzP/mRKa3JFtw+gsUfF9MzFsIvG88onO9DLSLJBgybfdC2cvguJq2G inaJmbPba8XnmFzW7a8sUtSRG0EA0x9ATN0lNsrOBcKfRv5Kbd3PIBvvqGNnmC4Ir21AdG0Q0Yy/R F0jeU6wihDlNvQI8imAkvZMdzChbWGybm8/F5y+b6c6I99r6NrBHgi1IiUalfI8JHhsGGWqJ4vAGP AZuIS0O6N//DBbXDc9bBQ66WuJfYUay4ZMduZgDcFqJ73QVWtITronaFo8Q+2OBgKWhVycSgc10C3 Mxk9JIaw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oXe-0007GW-Rv; Fri, 28 Sep 2018 08:54:30 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oXc-0007BM-VF for linux-arm-kernel@bombadil.infradead.org; Fri, 28 Sep 2018 08:54:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Reply-to:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=LFg6EEf38hQa04pwWMJLnpEJvq/e95fsLM+0nPOGCBQ=; b=VopfkQW/P0RNLIPCTqJwkfite 2yoWDHMUC5b2R8yzE7wp/ZdWFrxOPnsJrPHykBW3+0vg7zYBkhhQtXO6C1GGFswej18pQO9UAA/nV 0HjgZlSd86m5M1bmeqGkbDA3RXCxLgFCes/P4RclpCM1OMkgDIyzcwXWcuoiJGnhBHfTYH6UQzpiw VLTOKwmJxdwYXTWD32jPyICmY17/Tru8zgT7g3zcvVS/8pyzwVeY6Jdwf+d3AM7qlMw+E/mH61/Mu 6XPImH1GIgrTnEgYjo+u8vG46V4NJ6WhfDcZniq7fwyAlCUOZgf9/MFsa8m/wD7iuMgr4YbqmvObA GyLN5lCBQ==; Received: from inva021.nxp.com ([92.121.34.21]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oNp-0002CQ-Cd for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2018 08:44:23 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 7A430200077; Fri, 28 Sep 2018 10:43:40 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 6E3972000BC; Fri, 28 Sep 2018 10:43:40 +0200 (CEST) Received: from fsr-fed2164-101.ea.freescale.net (fsr-fed2164-101.ea.freescale.net [10.171.82.91]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 0A0092039E; Fri, 28 Sep 2018 10:43:40 +0200 (CEST) From: Madalin Bucur To: leoyang.li@nxp.com Subject: [PATCH v2 2/5] soc/fsl/qbman: replace CPU 0 with any online CPU in hotplug handlers Date: Fri, 28 Sep 2018 11:43:21 +0300 Message-Id: <1538124204-31406-3-git-send-email-madalin.bucur@nxp.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> References: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180928_094421_542672_A95C17F2 X-CRM114-Status: GOOD ( 10.01 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: madalin.bucur@nxp.com Cc: Madalin Bucur , catalin.marinas@arm.com, roy.pledge@nxp.com, linux-kernel@vger.kernel.org, oss@buserror.net, claudiu.manoil@nxp.com, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The existing code sets portal IRQ affinity to CPU 0 in the offline hotplug handler. If CPU 0 is offline this is invalid. Use a different online CPU instead. Signed-off-by: Madalin Bucur --- drivers/soc/fsl/qbman/bman_portal.c | 4 +++- drivers/soc/fsl/qbman/qman_portal.c | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/soc/fsl/qbman/bman_portal.c b/drivers/soc/fsl/qbman/bman_portal.c index 2f71f7df3465..088cdfa7c034 100644 --- a/drivers/soc/fsl/qbman/bman_portal.c +++ b/drivers/soc/fsl/qbman/bman_portal.c @@ -65,7 +65,9 @@ static int bman_offline_cpu(unsigned int cpu) if (!pcfg) return 0; - irq_set_affinity(pcfg->irq, cpumask_of(0)); + /* use any other online CPU */ + cpu = cpumask_any_but(cpu_online_mask, cpu); + irq_set_affinity(pcfg->irq, cpumask_of(cpu)); return 0; } diff --git a/drivers/soc/fsl/qbman/qman_portal.c b/drivers/soc/fsl/qbman/qman_portal.c index a120002b630e..4efd6ea598b1 100644 --- a/drivers/soc/fsl/qbman/qman_portal.c +++ b/drivers/soc/fsl/qbman/qman_portal.c @@ -195,8 +195,10 @@ static int qman_offline_cpu(unsigned int cpu) if (p) { pcfg = qman_get_qm_portal_config(p); if (pcfg) { - irq_set_affinity(pcfg->irq, cpumask_of(0)); - qman_portal_update_sdest(pcfg, 0); + /* select any other online CPU */ + cpu = cpumask_any_but(cpu_online_mask, cpu); + irq_set_affinity(pcfg->irq, cpumask_of(cpu)); + qman_portal_update_sdest(pcfg, cpu); } } return 0; From patchwork Fri Sep 28 08:43:22 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madalin Bucur X-Patchwork-Id: 10619209 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BCE2715A7 for ; Fri, 28 Sep 2018 08:55:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AF5EA283C9 for ; Fri, 28 Sep 2018 08:55:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A33632AE73; Fri, 28 Sep 2018 08:55:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 57B2E283C9 for ; Fri, 28 Sep 2018 08:55:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:Reply-To: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: References:In-Reply-To:Message-Id:Date:Subject:To:From:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=RtQH5TYU80AMXmWjVhZpuhd4Xn7ByfcxWeTiKNeeK4s=; b=AzQnTDr9iJyuigmIMEzQLhjsU2 3Cl5drfNo6dGCmhz+I90NebOX82RHVttW7KYFxw9h+jFDiZ5ksyrKYCWNDUGgC+jJBCYImPPyUypX ikCVOSx4sGBtPwP48N9Idx7vXfwBRrIkZF1mEwJtJMvgj7ckm2yIrAW8+q+/eDVGcg79ggpNs8Dt7 KBA8Pu9X+H4pXCiZw1va6kJgEQEK5jzjct6F3ziVrvkkibCvN3tJK4/bwojWc/3LV/868GUQvCWqJ OH8SZlwvEXAHT/XAXHuL3ly3tE5jEvWX3NZSKwOoSwMukrh+DdRnl8lHdoXzVZdkX1eLorXudBVjt cb7UgKBw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oYR-000821-UZ; Fri, 28 Sep 2018 08:55:19 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oXd-0007BM-Vc for linux-arm-kernel@bombadil.infradead.org; Fri, 28 Sep 2018 08:54:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Reply-to:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=JI3Fty+gaALLpNnF2OYSCX0ppfwbLoOsbeTgrBHnyRE=; b=UQ6jNcp7d2zP8dWb3E030Tg0O EaZuNUgJFwQls/P4jUKLsWCzLH+WF5Omclo42RNJD0qJbb4VQUtFHihIKV/ev/ZptveryvHPTOS4V I+5ajvyZkM35hcI89/DX/g+v7arXmI05oRWW+2i0FW2PHM7U0bIqyNl5V2H59vpFfE/s4/fY6iz5f nzt8l9gbKvduAXpmHKjCu/hTrL/8F0o9xsbwvQ2bQPhbuimgGrQCLt74LC1suoV9gbNavaQkEPBt2 wK4rusuOPYKOdfLFYJjW7oSGKTyiH5hL+W5/oQlQ3b2qJU2EQ8vj6EkrhrAIenREY0Uhc1blEUvXv y2CbsN5cg==; Received: from inva020.nxp.com ([92.121.34.13]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oNM-0002A8-PH for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2018 08:43:54 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 069081A0104; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id EEE091A00F4; Fri, 28 Sep 2018 10:43:40 +0200 (CEST) Received: from fsr-fed2164-101.ea.freescale.net (fsr-fed2164-101.ea.freescale.net [10.171.82.91]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 7ED362064C; Fri, 28 Sep 2018 10:43:40 +0200 (CEST) From: Madalin Bucur To: leoyang.li@nxp.com Subject: [PATCH v2 3/5] soc/fsl/qbman: Add 64 bit DMA addressing requirement to QBMan Date: Fri, 28 Sep 2018 11:43:22 +0300 Message-Id: <1538124204-31406-4-git-send-email-madalin.bucur@nxp.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> References: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180928_094352_834508_F3548E98 X-CRM114-Status: GOOD ( 10.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: madalin.bucur@nxp.com Cc: Madalin Bucur , catalin.marinas@arm.com, roy.pledge@nxp.com, linux-kernel@vger.kernel.org, oss@buserror.net, claudiu.manoil@nxp.com, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roy Pledge The QBMan block is memory mapped on SoCs above a 32 bit (4 Gigabyte) boundary so enabling 64 bit DMA addressing is needed for QBMan to be usuable. Signed-off-by: Roy Pledge Signed-off-by: Madalin Bucur --- drivers/soc/fsl/qbman/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/soc/fsl/qbman/Kconfig b/drivers/soc/fsl/qbman/Kconfig index d570cb5fd381..b0943e541796 100644 --- a/drivers/soc/fsl/qbman/Kconfig +++ b/drivers/soc/fsl/qbman/Kconfig @@ -1,6 +1,6 @@ menuconfig FSL_DPAA bool "QorIQ DPAA1 framework support" - depends on (FSL_SOC_BOOKE || ARCH_LAYERSCAPE) + depends on ((FSL_SOC_BOOKE || ARCH_LAYERSCAPE) && ARCH_DMA_ADDR_T_64BIT) select GENERIC_ALLOCATOR help The Freescale Data Path Acceleration Architecture (DPAA) is a set of From patchwork Fri Sep 28 08:43:23 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madalin Bucur X-Patchwork-Id: 10619213 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E262F6CB for ; Fri, 28 Sep 2018 09:08:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D62782AD70 for ; Fri, 28 Sep 2018 09:08:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C8F4F2ADC0; Fri, 28 Sep 2018 09:08:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 7AE5B2AD70 for ; Fri, 28 Sep 2018 09:08:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:Reply-To: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: References:In-Reply-To:Message-Id:Date:Subject:To:From:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=8nxKJ2wx77heH5Eh/9g96WgEfB3O/8GQZcBEBaS3vGA=; b=HPTkNERG1YCs83AiQ7reXOKyoZ Rn2d1rQmC3QWXuSYRUUc61i6AgNH3WO2+a+eUy5YbfH1HsssmRaaCY9fSw0buSnOGmv4vX0xW9xGq +NM9Wq7iMvLxsjP5qQajrqJk2JijImM4IB7tRYWKs26cV2TbhhNiwVK0ek0KWoNgn+pvZjvxoQvVL f1ReGgHv+r0QyK1A/drqBJiqefGm5tyteziugI+Jqzmxepk1bwmZmb6jbZU1kDueUsDvBNsBJ2ZDO J2bN54ibjMiSg6UqPpY4f2WCDS5BNqr9D5sq0lOozw8vdNzDpZfa5dZAe0uO8+BYEL+NytQoqTJFn Qj+NV7ng==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5olN-0005jk-BN; Fri, 28 Sep 2018 09:08:41 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oXe-0007CX-Se for linux-arm-kernel@bombadil.infradead.org; Fri, 28 Sep 2018 08:54:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Reply-to:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=2/+ZNLd1GQzOZJ0V59LJ0lNOfzSmbZuey268zuA9LFo=; b=Oga467Lie1uycBAK0zWf4phl3 bED6BgN8HHe9FLYAKDxxIx3ncO4xQzU6vKOmPkDRGa0Q7HG7449WLAFhY1PF/b5j9bcXMqPAg7ENQ VD/QTTwO3aNEVWMtJAy1nveJr0Orvy3ZmkQjE9XMs7nBu/1T9w6LXyUsiZKZezZzM1Xo8gWmROBf5 1B2D7tarvGj6Leq2zDMAGl4/gCMJyTDZQdTowTgW3aet59rFzQKlvbb5/XLd9xvrSxhc8W3OVjc+R DVXs3UyXqt/0P2Zyk85z7g1qYOSt9mr2YfM15vDF/LhdJ9HfXbM59udyyjMd7MS/6NtlRK3iIQ3Qn B1y+31j1w==; Received: from inva020.nxp.com ([92.121.34.13]) by casper.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oNM-0002A9-PG for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2018 08:43:54 +0000 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 7A2341A0070; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 6DC691A006D; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) Received: from fsr-fed2164-101.ea.freescale.net (fsr-fed2164-101.ea.freescale.net [10.171.82.91]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 09A852039E; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) From: Madalin Bucur To: leoyang.li@nxp.com Subject: [PATCH v2 4/5] soc/fsl/qbman: Use last response to determine valid bit Date: Fri, 28 Sep 2018 11:43:23 +0300 Message-Id: <1538124204-31406-5-git-send-email-madalin.bucur@nxp.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> References: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180928_094352_833667_98A56924 X-CRM114-Status: GOOD ( 15.66 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: madalin.bucur@nxp.com Cc: Madalin Bucur , catalin.marinas@arm.com, roy.pledge@nxp.com, linux-kernel@vger.kernel.org, oss@buserror.net, claudiu.manoil@nxp.com, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Roy Pledge Use the last valid response when determining what valid bit to use next for management commands. This is needed in the case that the portal was previously used by other software like a bootloader or if the kernel is restarted without a hardware reset. Signed-off-by: Roy Pledge Signed-off-by: Madalin Bucur --- drivers/soc/fsl/qbman/qman.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 0ffe7a1d0eae..99d0f87889b8 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -850,12 +850,24 @@ static inline void qm_mr_set_ithresh(struct qm_portal *portal, u8 ithresh) static inline int qm_mc_init(struct qm_portal *portal) { + u8 rr0, rr1; struct qm_mc *mc = &portal->mc; mc->cr = portal->addr.ce + QM_CL_CR; mc->rr = portal->addr.ce + QM_CL_RR0; - mc->rridx = (mc->cr->_ncw_verb & QM_MCC_VERB_VBIT) - ? 0 : 1; + /* + * The expected valid bit polarity for the next CR command is 0 + * if RR1 contains a valid response, and is 1 if RR0 contains a + * valid response. If both RR contain all 0, this indicates either + * that no command has been executed since reset (in which case the + * expected valid bit polarity is 1) + */ + rr0 = mc->rr->verb; + rr1 = (mc->rr+1)->verb; + if ((rr0 == 0 && rr1 == 0) || rr0 != 0) + mc->rridx = 1; + else + mc->rridx = 0; mc->vbit = mc->rridx ? QM_MCC_VERB_VBIT : 0; #ifdef CONFIG_FSL_DPAA_CHECKING mc->state = qman_mc_idle; From patchwork Fri Sep 28 08:43:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Madalin Bucur X-Patchwork-Id: 10619205 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3C43D15A7 for ; Fri, 28 Sep 2018 08:46:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FA732ABC2 for ; Fri, 28 Sep 2018 08:46:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 21C942ABDE; Fri, 28 Sep 2018 08:46:08 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4902F2ABC2 for ; Fri, 28 Sep 2018 08:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:Reply-To: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: References:In-Reply-To:Message-Id:Date:Subject:To:From:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=OC4HUVcjRHkGfjeK3w7Np3BICBv/L5kWQJ2keqc/efs=; b=ZS2iUZM2CbvYGoSCQWRmIy2oiY SiVCAmbDY5b1if4xSBsKm3bZgp1Cn5VpWkjFLBrSOI4shhdopE94yJ7mTsSjQ16/0VQCy3tMKr8vA wm4z4daS/x4IqOUH/YnJ4LILzCTCB+OlF837xckkMWCSSEASqFTZI2AZyz6GNLbKn08nC4vD09Qog Tn6pTs/AW52zaz4NBAeq3ZHDNphZbfuf36cZubn/KNAvnjNjYvElnsAEg4zVl+82QWPEqnczzoKqM d+eFKNpu1PCcuzGWhTKDq2K7yYvJd/buE9gHnY/BSN/ZGy2e1mqzLkgdESnz5zpN1+Bq/2yCUvqaq lelCCEGw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oPI-0004Tk-MM; Fri, 28 Sep 2018 08:45:52 +0000 Received: from merlin.infradead.org ([2001:8b0:10b:1231::1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oNs-0002ho-IF for linux-arm-kernel@bombadil.infradead.org; Fri, 28 Sep 2018 08:44:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=Reply-to:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Sender:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=jELQq5E6010RkAMszVMPaEFko1c0IsUoD0i0akAfttM=; b=N9Y6SI0YZDyY7oFgvPoTCdxIs BAhglk5kkWkY21+i0llmEuALQjnlp6lYuX1C5ZYquQURuHaNxuaW7P5thdf/VUW6XuNgfcMZhHAvM 2fbHcbuHovhA+SySVYgI75qAmEKaJBxykyiqHulEjO2Da7LVuHen0XjOXWQXzEYSJKWwgpKF2GHfu lWPRPBz16yn72ZKdmHVatSbp+TbmquIc8TsQjIXtQeYDwfM4nx1sfWcCDuIb3lKjMyOynlrY+Bb3L Pp1dB9CR1XTJ0YiLsOTAFc+t8gls3s9o3X5a5Yy+uuO8LZbm4ITNMc9WpvbMj8qp+EgPql3Qp1Of6 JypCLiwSw==; Received: from inva021.nxp.com ([92.121.34.21]) by merlin.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5oNm-0003sE-Kh for linux-arm-kernel@lists.infradead.org; Fri, 28 Sep 2018 08:44:19 +0000 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id E534B200071; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) Received: from inva024.eu-rdc02.nxp.com (inva024.eu-rdc02.nxp.com [134.27.226.22]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id D901520000A; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) Received: from fsr-fed2164-101.ea.freescale.net (fsr-fed2164-101.ea.freescale.net [10.171.82.91]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id 7CC352039E; Fri, 28 Sep 2018 10:43:41 +0200 (CEST) From: Madalin Bucur To: leoyang.li@nxp.com Subject: [PATCH v2 5/5] soc/fsl_qbman: export coalesce change API Date: Fri, 28 Sep 2018 11:43:24 +0300 Message-Id: <1538124204-31406-6-git-send-email-madalin.bucur@nxp.com> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> References: <1538124204-31406-1-git-send-email-madalin.bucur@nxp.com> X-Virus-Scanned: ClamAV using ClamSMTP X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180928_044418_776244_6488BDFA X-CRM114-Status: UNSURE ( 9.46 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: madalin.bucur@nxp.com Cc: Madalin Bucur , catalin.marinas@arm.com, roy.pledge@nxp.com, linux-kernel@vger.kernel.org, oss@buserror.net, claudiu.manoil@nxp.com, linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Export the API required to control the QMan portal interrupt coalescing settings. Signed-off-by: Madalin Bucur --- drivers/soc/fsl/qbman/qman.c | 31 +++++++++++++++++++++++++++++++ include/soc/fsl/qman.h | 27 +++++++++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c index 99d0f87889b8..8ab75bb44c4d 100644 --- a/drivers/soc/fsl/qbman/qman.c +++ b/drivers/soc/fsl/qbman/qman.c @@ -1012,6 +1012,37 @@ static inline void put_affine_portal(void) static struct workqueue_struct *qm_portal_wq; +void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh) +{ + if (!portal) + return; + + qm_dqrr_set_ithresh(&portal->p, ithresh); + portal->p.dqrr.ithresh = ithresh; +} +EXPORT_SYMBOL(qman_dqrr_set_ithresh); + +void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh) +{ + if (portal && ithresh) + *ithresh = portal->p.dqrr.ithresh; +} +EXPORT_SYMBOL(qman_dqrr_get_ithresh); + +void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod) +{ + if (portal && iperiod) + *iperiod = qm_in(&portal->p, QM_REG_ITPR); +} +EXPORT_SYMBOL(qman_portal_get_iperiod); + +void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod) +{ + if (portal) + qm_out(&portal->p, QM_REG_ITPR, iperiod); +} +EXPORT_SYMBOL(qman_portal_set_iperiod); + int qman_wq_alloc(void) { qm_portal_wq = alloc_workqueue("qman_portal_wq", 0, 1); diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h index d4dfefdee6c1..42f50eb51529 100644 --- a/include/soc/fsl/qman.h +++ b/include/soc/fsl/qman.h @@ -1186,4 +1186,31 @@ int qman_alloc_cgrid_range(u32 *result, u32 count); */ int qman_release_cgrid(u32 id); +/** + * qman_dqrr_get_ithresh - Get coalesce interrupt threshold + * @portal: portal to get the value for + * @ithresh: threshold pointer + */ +void qman_dqrr_get_ithresh(struct qman_portal *portal, u8 *ithresh); + +/** + * qman_dqrr_set_ithresh - Set coalesce interrupt threshold + * @portal: portal to set the new value on + * @ithresh: new threshold value + */ +void qman_dqrr_set_ithresh(struct qman_portal *portal, u8 ithresh); + +/** + * qman_dqrr_get_iperiod - Get coalesce interrupt period + * @portal: portal to get the value for + * @iperiod: period pointer + */ +void qman_portal_get_iperiod(struct qman_portal *portal, u32 *iperiod); +/* + * qman_dqrr_set_iperiod - Set coalesce interrupt period + * @portal: portal to set the new value on + * @ithresh: new period value + */ +void qman_portal_set_iperiod(struct qman_portal *portal, u32 iperiod); + #endif /* __FSL_QMAN_H */