Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp93740pxu; Wed, 2 Dec 2020 16:05:30 -0800 (PST) X-Google-Smtp-Source: ABdhPJz3jcq8/0SwB1D2PO6R+6/FSV0U+PpTXvmBE7gul2uN45sUVrUtemSOhdawJVssEWd7OzTb X-Received: by 2002:a05:6402:714:: with SMTP id w20mr507309edx.252.1606953930642; Wed, 02 Dec 2020 16:05:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606953930; cv=none; d=google.com; s=arc-20160816; b=XwcIlfQXqsLuIQMsPhMjInVUfoDYYR9Ky73KbrZy8kcz597IAzIa7IedjzbJdyU13k Uf1+r0ApVQADqIN1a4MQXigS+f7lyJLFeJSCOyAaFXJts8OYoGxf9vVojqpBJB/asH+y ClokTff1sttsJOxlECwykIGm2CSkstwbDsg57C+MJ1J+Je6AXjPI0Z3bsPVPoa+JGBIr oEJ2mq8SZMDPv7ZBOa+cx1+6X6zbyA30jU6xfalJaN4eJdD8HuLtSvz0E4NZC7fuUcsI GSwIehoTLyW/jbCRGVyB5uLvLedDfjr8m6z6I+vmjVmFFaZ62GiciGKPh78vu6AIx3R/ QwCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=DSsIfG4jilcN3FU1lA8b106XH0CFZmudfik4ABjYYpo=; b=Y/PoRqgyvNiojo8h5B5mUCGspTxto7l3qhuns/cUtoMdkjJvHBwaWMNA20tbmmC1d9 B5lZg336YQ+a6lYsddC5bsVf2vkIdGZ/pIu+ZTPOMduFwxA5+DckFKPVrHdZLYUspwB2 m46iqVYCXGtGTOM7DXC6ZKJ7X3y0FeRt8+N9wbKXTrZmRayJsIlz5co3+jOiBoYTcYO3 qBTXDK6ile6e7zRJIy1CmOFXo0LtPUHyyIpf4aVznJXpU2oIRfZmsCwdVEYFn3h7Wz1w +FTMoOsyNkdjfo4QLk8PvlvA1NNiYNF0jdWXlsYRRkc6sfNa5tnpzitzFob5pMas8gdX TfLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bg24si105923ejb.291.2020.12.02.16.05.06; Wed, 02 Dec 2020 16:05:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728947AbgLCAAB (ORCPT + 99 others); Wed, 2 Dec 2020 19:00:01 -0500 Received: from mail.kernel.org ([198.145.29.99]:47946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726137AbgLCAAB (ORCPT ); Wed, 2 Dec 2020 19:00:01 -0500 From: Chun-Kuang Hu Authentication-Results: mail.kernel.org; dkim=permerror (bad message/signature format) To: Matthias Brugger Cc: linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Chun-Kuang Hu Subject: [PATCH] soc: mediatek: cmdq: Remove cmdq_pkt_flush() Date: Thu, 3 Dec 2020 07:58:55 +0800 Message-Id: <20201202235856.7652-1-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.17.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org rx_callback is a standard mailbox callback mechanism and could cover the function of proprietary cmdq_task_cb, so it is better to use the standard one instead of the proprietary one. But register rx_callback should before mbox_request_channel(), so remove cmdq_pkt_flush() and let client driver implement its own synchronous flush. Signed-off-by: Chun-Kuang Hu --- drivers/soc/mediatek/mtk-cmdq-helper.c | 32 -------------------------- include/linux/soc/mediatek/mtk-cmdq.h | 12 ---------- 2 files changed, 44 deletions(-) diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediatek/mtk-cmdq-helper.c index 505651b0d715..fd3bc39538a1 100644 --- a/drivers/soc/mediatek/mtk-cmdq-helper.c +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c @@ -502,36 +502,4 @@ int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb, } EXPORT_SYMBOL(cmdq_pkt_flush_async); -struct cmdq_flush_completion { - struct completion cmplt; - bool err; -}; - -static void cmdq_pkt_flush_cb(struct cmdq_cb_data data) -{ - struct cmdq_flush_completion *cmplt; - - cmplt = (struct cmdq_flush_completion *)data.data; - if (data.sta != CMDQ_CB_NORMAL) - cmplt->err = true; - else - cmplt->err = false; - complete(&cmplt->cmplt); -} - -int cmdq_pkt_flush(struct cmdq_pkt *pkt) -{ - struct cmdq_flush_completion cmplt; - int err; - - init_completion(&cmplt.cmplt); - err = cmdq_pkt_flush_async(pkt, cmdq_pkt_flush_cb, &cmplt); - if (err < 0) - return err; - wait_for_completion(&cmplt.cmplt); - - return cmplt.err ? -EFAULT : 0; -} -EXPORT_SYMBOL(cmdq_pkt_flush); - MODULE_LICENSE("GPL v2"); diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h index 960704d75994..2c6aa84c0e80 100644 --- a/include/linux/soc/mediatek/mtk-cmdq.h +++ b/include/linux/soc/mediatek/mtk-cmdq.h @@ -288,16 +288,4 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt); int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb, void *data); -/** - * cmdq_pkt_flush() - trigger CMDQ to execute the CMDQ packet - * @pkt: the CMDQ packet - * - * Return: 0 for success; else the error code is returned - * - * Trigger CMDQ to execute the CMDQ packet. Note that this is a - * synchronous flush function. When the function returned, the recorded - * commands have been done. - */ -int cmdq_pkt_flush(struct cmdq_pkt *pkt); - #endif /* __MTK_CMDQ_H__ */ -- 2.17.1