Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3057644imm; Mon, 10 Sep 2018 10:18:46 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZA39VzupyrUNskTPKBxQr1IXoJ9yJKG7mbt0h5TUDbUR6M2O/1MsSuJEqmPWMQ15+wsjqN X-Received: by 2002:a17:902:7798:: with SMTP id o24-v6mr22921077pll.93.1536599926167; Mon, 10 Sep 2018 10:18:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536599926; cv=none; d=google.com; s=arc-20160816; b=O+3SIwvVUQS1NyPgOgTNboaZ56p9eWIpYQSH9sz8x0QnXGwKDePhkzNTf9q/ZRgNpU G4sBT78ew7n09P5Zkp1YQUgX155u38xNP8yJzelazTowfYpL4A9YJLSITjOS7dRakOlN 6iC7zYEAKOTN6jqwduZTRei6yEtok/aTcmKwD4t3dcbEYOgxnajP2qlCitE8ZzDRM8Zf 2UiGdYZ1j8mPaL0XhfsUaiDgyM7Wem49MMGo5AvUmmVEuh1UGzcLF/5iVlWkLjct23h3 gE3X1YwuZkFvNnhOuAYUkCqDXSxpCbgXWbg6PcpYb1dO3zkyfL2jBR95sfPVMdT3j1CD /yEg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=XsZIPG+9es+Z2LGqn8eihERQrb6mp4bYCjON2Eoi53M=; b=1GtsnCK1vbNNqc5zvCbNWz05WrrwY2drWOBD6h88FCLvHSilpcOer0zuwa6jP2XKaP Yc0j6y6/Jk8qGE6FFpI/LDYk50t0ZIlPou1oFGEmigW3x4jxYqa/tC/Jtjhjwf6RoJlF x9Jh3rxvgANWB0BrzNAVatgiH09j6v25dBf1w1DVWAGS3WD1CUd4oFpxF/hcy/G96UxU oudIXvonAgiNvmS5d7K83TSbwVvlPhmKiB3j97KBdh6TsakX0jZ1F4UqYimeJZHmQ3tD p/DMAyCm3C5vsIvAHfYJ8rrkDMRMO6yzi65xcfSRGb96VzXriPe/fQJIK4nASqugRiTY 80eg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z73-v6si16640525pgd.471.2018.09.10.10.18.30; Mon, 10 Sep 2018 10:18:46 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728639AbeIJWLf (ORCPT + 99 others); Mon, 10 Sep 2018 18:11:35 -0400 Received: from inva020.nxp.com ([92.121.34.13]:59572 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728296AbeIJWLe (ORCPT ); Mon, 10 Sep 2018 18:11:34 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 723C81A0190; Mon, 10 Sep 2018 19:16:28 +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 661751A011F; Mon, 10 Sep 2018 19:16:28 +0200 (CEST) Received: from enigma.ea.freescale.net (enigma.ea.freescale.net [10.171.81.110]) by inva024.eu-rdc02.nxp.com (Postfix) with ESMTP id D24612060B; Mon, 10 Sep 2018 19:16:27 +0200 (CEST) From: =?UTF-8?q?Horia=20Geant=C4=83?= To: Herbert Xu , Stuart Yoder , Laurentiu Tudor , Li Yang , Roy Pledge , Catalin Marinas , Will Deacon Cc: "David S . Miller" , Aymen Sghaier , linux-crypto@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/11] soc: fsl: dpio: add congestion notification support Date: Mon, 10 Sep 2018 20:15:43 +0300 Message-Id: <20180910171550.5659-5-horia.geanta@nxp.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180910171550.5659-1-horia.geanta@nxp.com> References: <20180910171550.5659-1-horia.geanta@nxp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for Congestion State Change Notifications (CSCN), which allow DPIO users to be notified when a congestion group changes its state (due to hitting the entrance / exit threshold). Signed-off-by: Horia Geantă --- include/soc/fsl/dpaa2-global.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/include/soc/fsl/dpaa2-global.h b/include/soc/fsl/dpaa2-global.h index 9bc0713346a8..2bfc379d3dc9 100644 --- a/include/soc/fsl/dpaa2-global.h +++ b/include/soc/fsl/dpaa2-global.h @@ -174,4 +174,19 @@ static inline const struct dpaa2_fd *dpaa2_dq_fd(const struct dpaa2_dq *dq) return (const struct dpaa2_fd *)&dq->dq.fd[0]; } +#define DPAA2_CSCN_SIZE sizeof(struct dpaa2_dq) +#define DPAA2_CSCN_ALIGN 16 +#define DPAA2_CSCN_STATE_CG BIT(0) + +/** + * dpaa2_cscn_state_congested() - Check congestion state + * @cscn: congestion SCN (delivered to WQ or memory) + * +i * Return true is congested. + */ +static inline bool dpaa2_cscn_state_congested(struct dpaa2_dq *cscn) +{ + return !!(cscn->scn.state & DPAA2_CSCN_STATE_CG); +} + #endif /* __FSL_DPAA2_GLOBAL_H */ -- 2.16.2