Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5167297imm; Wed, 12 Sep 2018 02:02:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaETdB3kteLIpGEGaBgVWp7zC34O7p6RCCtV/MsQPCukUymC/QyyfNxdSs0swT8jirVn8oc X-Received: by 2002:a62:9645:: with SMTP id c66-v6mr1103440pfe.56.1536742921290; Wed, 12 Sep 2018 02:02:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536742921; cv=none; d=google.com; s=arc-20160816; b=ttwEG8TBvOAfn1mN7FYQ3xKB5ZNiD0i4cD6w97QyMf3wHhVZ2xhm+uy9DbrPc0mg1E mSFqkN+WQ2F6uXOjRkYX8nzmzl//IwBMZmlQXKN44I+3tyPNRL6+VgI++pggP/bmx8va 7g2SiNrkRJQJFxpooYl6d94dgs4jfA2bhJVKaABOZs3geZkyxbpSV7ip80RwmFQjqUd5 ZiuZFW4PxDfeb6NSMrL+hAQ6Nu0FB0Rh+y0tIt3GAeLirQwkMnJTUZ9kWgEv19wJI8Jx C9JNc/1AMv/IP4RdvD5XwLNDMYAANMbeyRLcfxrDeMM95+ohc4WFseOt0TJLnbw8EcAX rWAQ== 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=cZT3W5FpSJkwBuirdO2cJ7E3n3P0hINeS+GKMsI/BUw=; b=aiVLkMgRv0oIGLFKawWzl17T2eS7WZLHRE8ZJ1HWO3DB9qCScdplpa+CUwiumVlPFW VdXjSQzZl+bZX138SefKiCDSDRcxsgKP8FnTG8c/g3AHa3T9nxyRiNNCzmCrQGXthMjk opgxCXKpYJ4GQCY13NDe8L122DKxHdWCfFVh1EQ0aWrbX8H2nzr3ryyzf4dfP/O4rWMH x0aA0x2rmJgz75KDQkOeBVxeJxUiy+T3GtS6RUtzqSB+jwAS9em97uVMxUwQwW/fM0R6 A+pFYhOIIa4MR2DoRtWXUazFNmei/zBewtPrOFlqlOkdwy/kw8T/q/CVAM6ZE4/hjiN0 OsBA== 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 bh12-v6si389822plb.425.2018.09.12.02.01.46; Wed, 12 Sep 2018 02:02:01 -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 S1728015AbeILODc (ORCPT + 99 others); Wed, 12 Sep 2018 10:03:32 -0400 Received: from inva021.nxp.com ([92.121.34.21]:47216 "EHLO inva021.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726640AbeILODb (ORCPT ); Wed, 12 Sep 2018 10:03:31 -0400 Received: from inva021.nxp.com (localhost [127.0.0.1]) by inva021.eu-rdc02.nxp.com (Postfix) with ESMTP id 0694120009E; Wed, 12 Sep 2018 10:59:56 +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 ED653200034; Wed, 12 Sep 2018 10:59:55 +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 65ED2205F0; Wed, 12 Sep 2018 10:59:55 +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 v2 04/12] soc: fsl: dpio: add congestion notification support Date: Wed, 12 Sep 2018 11:59:29 +0300 Message-Id: <20180912085937.22489-5-horia.geanta@nxp.com> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180912085937.22489-1-horia.geanta@nxp.com> References: <20180912085937.22489-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). Acked-by: Li Yang 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