Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3056154imm; Mon, 10 Sep 2018 10:17:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZX8fll0VCfkqwyj7/t38mEZ3iA/5FXD6V6+42RessVFVT/2KR6OjZGjXedZRc62tY9Aby0 X-Received: by 2002:a63:9244:: with SMTP id s4-v6mr23463602pgn.141.1536599848350; Mon, 10 Sep 2018 10:17:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536599848; cv=none; d=google.com; s=arc-20160816; b=DukEYVw12bkcpkX8mvZPA/QICbBTNGI1BeHkGbRxH2XH0G9ZeOIZgerzQnp5ATnsch BBtd5iLqy2yQwTJvOlrs9AXA7poBmV5SxRAMkESymndTjI3q3oI6noKM4v1xS37OVjZx zpZB21vZGU1jis3aA/eqQcWxeIbZQPgQ9KWTcLNQH76dEGAyulIN7toxxN/qaHMNk14a 2QKCn0D2uHxlo7RvGh1G1DSnpNYeVYOAi6EUrqoXPD12ONIK+vd+A7mYofjiTXwvowRA RoETO6XkY+Koe7EGxg0NjPjckGX5NEEk6J/MMr6TW1bjp41ESLQK870osq4jjn+s20UN soqg== 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=obWXTQrroy29lYQ2qlQSU1xG/8Z1Own51vOSujvXptg=; b=bF1T/pvjpkCjZj6hZhDppY+dfe5lpKuaoygAKF7+lwf/EV4nTnjmoGgwC9IPGK9Buv vACf0WqFnDfU1T7YzH3bqnyZr3TN9kLxaMeGHTM9W1zD6ALS0p78t6rYt/jQhUvX0f// /vdeCH1eiLZe2cdeiY6I4q5WQCi4i7xxCaPqo5rlQY1zEColRbWk0gh7V9BxVeivjlxu tLxmmJbmzd7DBICo0kz5L5GztDY3q0Op1l6j0eJiR1FWuTjs2/kqqPKZuohMyrYkXNPc qBpzGIKoL4vcynUFg8PWVDhhVW70kx/rJwUtaVgI/yOCyDJ7EDu8jLEBq7Ql25+jzZxz puJw== 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 y9-v6si18473853pgs.521.2018.09.10.10.17.12; Mon, 10 Sep 2018 10:17:28 -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 S1728806AbeIJWLg (ORCPT + 99 others); Mon, 10 Sep 2018 18:11:36 -0400 Received: from inva020.nxp.com ([92.121.34.13]:59522 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728092AbeIJWLd (ORCPT ); Mon, 10 Sep 2018 18:11:33 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 437721A00C2; Mon, 10 Sep 2018 19:16:27 +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 36EEF1A003C; Mon, 10 Sep 2018 19:16:27 +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 AD3E62060B; Mon, 10 Sep 2018 19:16:26 +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 02/11] Revert "staging: fsl-mc/dpio: remove couple of unused functions" Date: Mon, 10 Sep 2018 20:15:41 +0300 Message-Id: <20180910171550.5659-3-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 This reverts commit a211c8170b3c348353decb6e175c58a7814f218c. (+ updated to account for driver being moved out of staging) dpseci object will make use of these functions, thus it's time to add them back. Signed-off-by: Horia Geantă --- drivers/soc/fsl/dpio/dpio-service.c | 58 +++++++++++++++++++++++++++++++++++++ include/soc/fsl/dpaa2-io.h | 4 +++ 2 files changed, 62 insertions(+) diff --git a/drivers/soc/fsl/dpio/dpio-service.c b/drivers/soc/fsl/dpio/dpio-service.c index 9b17f72349ed..321a92613a7e 100644 --- a/drivers/soc/fsl/dpio/dpio-service.c +++ b/drivers/soc/fsl/dpio/dpio-service.c @@ -309,6 +309,37 @@ int dpaa2_io_service_rearm(struct dpaa2_io *d, } EXPORT_SYMBOL_GPL(dpaa2_io_service_rearm); +/** + * dpaa2_io_service_pull_fq() - pull dequeue functions from a fq. + * @d: the given DPIO service. + * @fqid: the given frame queue id. + * @s: the dpaa2_io_store object for the result. + * + * Return 0 for success, or error code for failure. + */ +int dpaa2_io_service_pull_fq(struct dpaa2_io *d, u32 fqid, + struct dpaa2_io_store *s) +{ + struct qbman_pull_desc pd; + int err; + + qbman_pull_desc_clear(&pd); + qbman_pull_desc_set_storage(&pd, s->vaddr, s->paddr, 1); + qbman_pull_desc_set_numframes(&pd, (u8)s->max); + qbman_pull_desc_set_fq(&pd, fqid); + + d = service_select(d); + if (!d) + return -ENODEV; + s->swp = d->swp; + err = qbman_swp_pull(d->swp, &pd); + if (err) + s->swp = NULL; + + return err; +} +EXPORT_SYMBOL(dpaa2_io_service_pull_fq); + /** * dpaa2_io_service_pull_channel() - pull dequeue functions from a channel. * @d: the given DPIO service. @@ -341,6 +372,33 @@ int dpaa2_io_service_pull_channel(struct dpaa2_io *d, u32 channelid, } EXPORT_SYMBOL_GPL(dpaa2_io_service_pull_channel); +/** + * dpaa2_io_service_enqueue_fq() - Enqueue a frame to a frame queue. + * @d: the given DPIO service. + * @fqid: the given frame queue id. + * @fd: the frame descriptor which is enqueued. + * + * Return 0 for successful enqueue, -EBUSY if the enqueue ring is not ready, + * or -ENODEV if there is no dpio service. + */ +int dpaa2_io_service_enqueue_fq(struct dpaa2_io *d, + u32 fqid, + const struct dpaa2_fd *fd) +{ + struct qbman_eq_desc ed; + + d = service_select(d); + if (!d) + return -ENODEV; + + qbman_eq_desc_clear(&ed); + qbman_eq_desc_set_no_orp(&ed, 0); + qbman_eq_desc_set_fq(&ed, fqid); + + return qbman_swp_enqueue(d->swp, &ed, fd); +} +EXPORT_SYMBOL(dpaa2_io_service_enqueue_fq); + /** * dpaa2_io_service_enqueue_qd() - Enqueue a frame to a QD. * @d: the given DPIO service. diff --git a/include/soc/fsl/dpaa2-io.h b/include/soc/fsl/dpaa2-io.h index ab51e40d11db..70997ab2146c 100644 --- a/include/soc/fsl/dpaa2-io.h +++ b/include/soc/fsl/dpaa2-io.h @@ -97,9 +97,13 @@ void dpaa2_io_service_deregister(struct dpaa2_io *service, int dpaa2_io_service_rearm(struct dpaa2_io *service, struct dpaa2_io_notification_ctx *ctx); +int dpaa2_io_service_pull_fq(struct dpaa2_io *d, u32 fqid, + struct dpaa2_io_store *s); int dpaa2_io_service_pull_channel(struct dpaa2_io *d, u32 channelid, struct dpaa2_io_store *s); +int dpaa2_io_service_enqueue_fq(struct dpaa2_io *d, u32 fqid, + const struct dpaa2_fd *fd); int dpaa2_io_service_enqueue_qd(struct dpaa2_io *d, u32 qdid, u8 prio, u16 qdbin, const struct dpaa2_fd *fd); int dpaa2_io_service_release(struct dpaa2_io *d, u32 bpid, -- 2.16.2