Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3230978imm; Mon, 10 Sep 2018 13:14:08 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYQVrB3Wkk8iGO+/M1cNjVLkYathjoN/Y2/YEbmp0P/+W+vjswKWbF060EtXDpWsU+QIJm5 X-Received: by 2002:a17:902:8e86:: with SMTP id bg6-v6mr23780362plb.108.1536610448622; Mon, 10 Sep 2018 13:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536610448; cv=none; d=google.com; s=arc-20160816; b=E7xlwf5ehkcybt3nAYuVcw5pcTO44gvhTyTSP3M8FWIasKihBodNtEu4eD9R0JEx/+ wHkMQpwzvo0pVv7rml0JuSFw9fvySQFyJWuqTrmK3v/ojq9z505YGjBhONuqjxVuhAU7 ykJTSGgB8qh7KJDki52wOl/tDgV4rH1bQJRgMEKJumTPyiZJjIfws7Po497DBTDAN765 h1XLmFFAOO7fs1GlXpGV5dp6b4+OcLxI4qsm9YcK1lvKrPSOcQmoYQYenpBnXQZyqA37 KvQC3Uh1xyc9auLKTpI789YuaqskCqDe6bw+wLm+RLj/eMXO7P20RNbWCxOcz2gbwF6j wsQg== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=iLfr0nBYzF6yYxzaeS66sm7+WOhq6WDD6HftZXu2NkE=; b=hN1hcTt266+0GGNggiIipBS2V1conP5ZwBAhnNI0C+743KXNFtUK+FnZr0gahmKNPO CHXOvtXDMCISY5rlKb1GYkRYjutt3SfBHJUuit+VntneLn9QbEqF9VuDlRZWVCtT0tV0 Z0qunqlxyJBCeGeiJDajpfY5K6coHOROEvQKts2ATMChqFh3cCbfH0r6l3tWXrHPxRsh t/acYTb1D0cWL8l0vE8ivDehInXFwI1M1MCvHfJhE5suu0SVfxrI8I7oY/p0rBHotlj7 ck0jxUAFR8S82bTrF9e/TpF00QJYZTd/nMJAfJgwCyq6sbEIwqsCrIRbmodwU47nzNz9 HCxQ== 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 z6-v6si16661985plo.503.2018.09.10.13.13.51; Mon, 10 Sep 2018 13:14:08 -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 S1726816AbeIKBHr convert rfc822-to-8bit (ORCPT + 99 others); Mon, 10 Sep 2018 21:07:47 -0400 Received: from mail-oi0-f67.google.com ([209.85.218.67]:36422 "EHLO mail-oi0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726701AbeIKBHq (ORCPT ); Mon, 10 Sep 2018 21:07:46 -0400 Received: by mail-oi0-f67.google.com with SMTP id r69-v6so42735710oie.3; Mon, 10 Sep 2018 13:12:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=sT20PZ54dCACcQWX92l1lSp48amw5UL+mgbW0oqM/z8=; b=iENkUjjz5g3At8MlLfgU3rHXtdQD5HiLNvWZVaYE8LUm7FUq5XogTa38IPAE86KSC2 Yn2Dr3qNHZnqMeCKdhvivMPl+F4vh4sqvpLiwjZviGou+XALdG8Qv+zOLjaC/kCyoE9p tlYgzu4VEqw5EtAl3/2ApEkNYbRD1BoKjFBvjLlKPjnuKx2cymH0Dz4ypyiP3SgMmBfn eXxkFRBT8h8ObU7ARsB/7aLINxdszshZcT39g/3yyPx8W2avWdw9j0AqgamGjsoIa+1/ hD4CFtQJ1my8LeVhMS1HfKmY+RbXz0Psuf3H7lWvUZ1BrNrRA45ZhRdwEgrnZOt3gQqc jPmw== X-Gm-Message-State: APzg51AADHNHrc/fQa78z3xM0XPidgjVb7H0KfRdXthZj4jYWJAHUqlr 1XIwF17qDdEIHIeM0rHmjratL5jWVb0= X-Received: by 2002:aca:bcc1:: with SMTP id m184-v6mr22519370oif.19.1536610321242; Mon, 10 Sep 2018 13:12:01 -0700 (PDT) Received: from mail-oi0-f46.google.com (mail-oi0-f46.google.com. [209.85.218.46]) by smtp.gmail.com with ESMTPSA id o206-v6sm19902813oif.7.2018.09.10.13.12.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Sep 2018 13:12:00 -0700 (PDT) Received: by mail-oi0-f46.google.com with SMTP id b15-v6so42691838oib.10; Mon, 10 Sep 2018 13:12:00 -0700 (PDT) X-Received: by 2002:a54:4d9d:: with SMTP id y29-v6mr24430959oix.273.1536610320134; Mon, 10 Sep 2018 13:12:00 -0700 (PDT) MIME-Version: 1.0 References: <20180910171550.5659-1-horia.geanta@nxp.com> <20180910171550.5659-5-horia.geanta@nxp.com> In-Reply-To: <20180910171550.5659-5-horia.geanta@nxp.com> From: Li Yang Date: Mon, 10 Sep 2018 15:11:48 -0500 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 04/11] soc: fsl: dpio: add congestion notification support To: Horia Geanta Cc: Herbert Xu , Stuart Yoder , Laurentiu Tudor , Roy Pledge , Catalin Marinas , Will Deacon , David Miller , aymen.sghaier@nxp.com, linux-crypto@vger.kernel.org, "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" , lkml 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 On Mon, Sep 10, 2018 at 12:19 PM Horia Geantă wrote: > > 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ă Acked-by: Li Yang > --- > 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 >