Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2416442pxb; Sat, 30 Jan 2021 01:49:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvyaw60gWP5J81WgxzOyd+7mrscTBr9yJ8Y4rTq8hNOkDSyjIQlehEEdDdKPa9jnVQegE4 X-Received: by 2002:a17:906:a8a:: with SMTP id y10mr8396432ejf.139.1612000178228; Sat, 30 Jan 2021 01:49:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612000178; cv=none; d=google.com; s=arc-20160816; b=LsSDPYrJwx/FG2ysg93Gtln83pgh+bn0JSYzLedHXfPb14AsCpdrjtSfIqO+wGXCJC HFtJInnB9ACTEw7KZ9FW/Qrci4AKR/XkFCwAx95LLRrY3wgtUIs7HoOXAqr2TTUyiaxM 91YbTWG87Y5ZF/6u9vN+XIj0vrEj+grytGVV88OQ1yUUSYXrEpNVKqmZK2NZh7UOuQkw Ts5ROg/ghRrLiGZdp0iVovPsKyGHAXB1YuU4zUbiSWYXqiOzpM8oUFHE0QnLMawzz4DL 7+2l/Vovdm6iky2Fe4CuWPyYCm9ZwwpIcjnmsSL1NsPJp8/JGdoYTs9eInh9owApsZ0H uxsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=SpPM7/eoCRvL4FEuXvJvM0pCIR1WAgykbgZje+tfQKo=; b=RPEEoDwUw/sSpzOIzjhNXN3v/UeAd0ZDbQinWtyx9lr+63Kw+9Tm6nTycF9Hesw2rv Bo4qUq/9ikwz46O9pydRx63PyuhXs2+LS7E97NqJPCIpR1i31vXFmEOGGj65pPqtPMMp yJfCEJEJ2l6Q6Kzko8eDRVJrGDxZ8fBmOyRpwK9OU7bhAHyWDpE1kJ9ZfTQ3l/hIxaZg zK8uJIsFpjUOW415yQT0UDdzo11ZqhJwBUfsEMEq+Oh37UbHpC94WyRsDQAtzJ2zJwk+ l8vUdYyrQzDVC71OWwdozfZBdAJXpvjtEkrUTQPmG48BooOV6073CfRijRkbbjsLK8UA 0v4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ttc3Y1c7; 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 yh27si6470377ejb.290.2021.01.30.01.49.14; Sat, 30 Jan 2021 01:49:38 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ttc3Y1c7; 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 S231150AbhA3Jrk (ORCPT + 99 others); Sat, 30 Jan 2021 04:47:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:44688 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230114AbhA3Jqh (ORCPT ); Sat, 30 Jan 2021 04:46:37 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 846CE64DE2 for ; Sat, 30 Jan 2021 09:45:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1611999951; bh=MhQGmFgm/LGG1ligU9jCk3BNvT4EdziFNPpiMLDajrE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ttc3Y1c7ogHDMe1fGfGMNlq8p6ptIklpY7cIqMmFL1YhWivfE7GfWl3xrgyjPCIno BAC/zvnVdviTnfV2EH6VTNE7mg9S0G9iDmaQVOBL9TFX/Dsu/DT2/0MuwkzboHX6G+ KG/OdwPyERud0t44FCFJeyrhCmanu3LGerldZ+acAz5wfhGfX1c8qgo9hfB/kHWSsG XmOQv4uxoPcP6mxfaTnd4y9LP+6zkjyOe4QFJHbpNC2JOWY9LB0E/iSJJq+xe9bmJS jcAPFazowHSASrDTnsdCSlVRkL5RcO3/5BBQzAT+ihDzH/ujDpVvkVfHFWowcJSOGj WlmOZXmoLmaQw== Received: by mail-wr1-f44.google.com with SMTP id v15so11260776wrx.4 for ; Sat, 30 Jan 2021 01:45:51 -0800 (PST) X-Gm-Message-State: AOAM530B3KURtrzeYpE6ERTkcNSEx0nlTShgVF/VISdEmoBf0FF558vf gCK34U3SgUdwuTEidLyyFfvhQKFpXUU3NzQBrg== X-Received: by 2002:adf:f303:: with SMTP id i3mr8763867wro.60.1611999950124; Sat, 30 Jan 2021 01:45:50 -0800 (PST) MIME-Version: 1.0 References: <20201202235856.7652-1-chunkuang.hu@kernel.org> In-Reply-To: From: Chun-Kuang Hu Date: Sat, 30 Jan 2021 17:45:37 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] soc: mediatek: cmdq: Remove cmdq_pkt_flush() To: Chun-Kuang Hu Cc: Matthias Brugger , linux-kernel , DRI Development , "moderated list:ARM/Mediatek SoC support" , Linux ARM Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Matthias: Chun-Kuang Hu =E6=96=BC 2021=E5=B9=B41=E6=9C=8810= =E6=97=A5 =E9=80=B1=E6=97=A5 =E4=B8=8A=E5=8D=886:59=E5=AF=AB=E9=81=93=EF=BC= =9A > > Hi, Matthias: > > Chun-Kuang Hu =E6=96=BC 2020=E5=B9=B412=E6=9C= =883=E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8A=E5=8D=887:59=E5=AF=AB=E9=81=93= =EF=BC=9A > > > > 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. > > How do you think about this patch? This patch is derived from [1] > according to Jassi's suggestion [2]. > > [1] https://patchwork.kernel.org/project/linux-mediatek/patch/20200927230= 422.11610-3-chunkuang.hu@kernel.org/ > [2] https://patchwork.kernel.org/project/linux-mediatek/cover/20200927230= 422.11610-1-chunkuang.hu@kernel.org/ Just a ping. Regards, Chun-Kuang. > > Regards, > Chun-Kuang. > > > > > 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/media= tek/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, cmd= q_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 =3D (struct cmdq_flush_completion *)data.data; > > - if (data.sta !=3D CMDQ_CB_NORMAL) > > - cmplt->err =3D true; > > - else > > - cmplt->err =3D false; > > - complete(&cmplt->cmplt); > > -} > > - > > -int cmdq_pkt_flush(struct cmdq_pkt *pkt) > > -{ > > - struct cmdq_flush_completion cmplt; > > - int err; > > - > > - init_completion(&cmplt.cmplt); > > - err =3D 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 recorde= d > > - * commands have been done. > > - */ > > -int cmdq_pkt_flush(struct cmdq_pkt *pkt); > > - > > #endif /* __MTK_CMDQ_H__ */ > > -- > > 2.17.1 > >