Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp2411906pxb; Fri, 8 Oct 2021 07:18:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxUjTHf6OJhkCLFv89+SEfQ3CrkkBUr/P34zQ8LcLpHbz/PKlEsxdG52AYqEWUp3/BAsNqZ X-Received: by 2002:a17:906:4895:: with SMTP id v21mr4682047ejq.299.1633702704741; Fri, 08 Oct 2021 07:18:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633702704; cv=none; d=google.com; s=arc-20160816; b=ZqBe+4jZsdZho1SvV5Rk9kNjteDYNNIFu9mbjYTEr/pf1rcD5ojNgzpF88eROlVbNv V7ac+0e6B9h0Zeny3xjryVYgGFA3SS91FFXWkh/+rziEN6nhE30VeWdiHpxRsBcO61nz mgDswM5yc93bI2WL23bFj0zKdMyiVVw0ON+R7HupxLsVML1dx2ssVtaOFyatWOgDmMNa pdEtzWFcxsLYNGe+jNWKQqVglqKoZ3pUAqBiOQg7mlTWf7iaHH8G7KMz4Ra+FiQ0Rmgz f6N/0ybRDNWQncz5anw2+viwo5H7XkB7wzRy8DWUcFAzqARQHff2J+7SVH1ZWfwZh95T Pfyw== 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=GA6TvVIKev9ichP70Stds9bReuY+VWVIhOJ+vqqDwYU=; b=iEERtsMpQ9ZNHqeAapOfqSWksWod8Y1ACDDXbx/YtGnnKqAeZGWlc1/o0HyT5urcJZ b5rMw3CV7FkGQH44IP7k8rzfSlo+4l2ABI+6yMBwc/Jx07mK8VHG59VzNeZ9YuYAu+8D D1W5hlob9dNyC5hFviRWi8QZ2MsDfN//Ppqd8g3dGpfDca2Qvmy6vjMgVlRROSUwwvcv gmDPJFj7VNdwOQ1WzW3CYLmrBeAUC+E7H6VNojpSuRZ4/TV8uHGQchfOhPc5KN+o7/OX 8aZZjg+B2keRnqX8QOYA1YK6uo/nSMtADjs6bo7fyt5J6HMmcvTtaH1+/YQBUDrJe0S0 X2JQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=SmAbaTP4; 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 y26si3652280edm.490.2021.10.08.07.18.00; Fri, 08 Oct 2021 07:18:24 -0700 (PDT) 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=SmAbaTP4; 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 S230287AbhJHOSG (ORCPT + 99 others); Fri, 8 Oct 2021 10:18:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:37088 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229789AbhJHOSE (ORCPT ); Fri, 8 Oct 2021 10:18:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id A7F1961039 for ; Fri, 8 Oct 2021 14:16:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633702569; bh=gfnYmiYx+3dkf2QkxY+VQ8BWqcH+BG2yBzByLC0yQFQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=SmAbaTP49xnbbJwvMEkONUKVqObtjfRfY4b2SYkUBQ5vTgXDpMb3PGhpQt3W5eSk1 mp8IohvNPiPK5jMzq83lgDsmoLnO8OqkzHU+sZU8xkd0Uw4yOVq88mYuJ/bfe8DoDf ZRXk6SyP1WzCx4TDisbU9PFgMLe2A/mzv5k1bplEkzX+qf2WMeXOXEMLGsvfX1r/qv 0iWyTJdDYdkXwqBj60/BcoYFtRWHzyjSXLmBvm1MiCkdfjVlRLCpWcIieHGUGyPsWH UFP23LUNAr6tA4Rno/a8pQaxnIFOOH3NARZK3bM3Cp3B4WcwAEydHTOpPs8OxhmzOf GR18fC/1FkIVA== Received: by mail-ed1-f52.google.com with SMTP id z20so36785134edc.13 for ; Fri, 08 Oct 2021 07:16:09 -0700 (PDT) X-Gm-Message-State: AOAM5312a3DMxOBKQrkBTaL8r3fLpTNmDRiCXpGF0G5NKnLcNdPOfTnt F4Sq/7Axan1+KVlzcsn8T43YIOpya7a5rWUQ4A== X-Received: by 2002:a17:906:c7c1:: with SMTP id dc1mr4791596ejb.6.1633702568065; Fri, 08 Oct 2021 07:16:08 -0700 (PDT) MIME-Version: 1.0 References: <20210915232722.10031-1-chunkuang.hu@kernel.org> In-Reply-To: <20210915232722.10031-1-chunkuang.hu@kernel.org> From: Chun-Kuang Hu Date: Fri, 8 Oct 2021 22:15:57 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] soc: mediatek: cmdq: Use mailbox rx_callback instead of cmdq_task_cb To: Chun-Kuang Hu Cc: Matthias Brugger , Houlong Wei , Bibby Hsieh , Dennis YC Hsieh , linux-kernel , Linux ARM , "moderated list:ARM/Mediatek SoC support" 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: Please ignore this patch because this patch depend on [1] which would cause numerous warning message. So I would revert that patch in [2]. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/comm= it/drivers/gpu/drm/mediatek?h=3Dv5.15-rc4&id=3Dc1ec54b7b5af25c779192253f5a9= f05e95cb43d7 [2] https://patchwork.kernel.org/project/linux-mediatek/patch/2021100723531= 0.14626-6-chunkuang.hu@kernel.org/ Regards, Chun-Kuang. Chun-Kuang Hu =E6=96=BC 2021=E5=B9=B49=E6=9C=8816= =E6=97=A5 =E9=80=B1=E5=9B=9B =E4=B8=8A=E5=8D=887:27=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 use the standard one instead of > the proprietary one. Client has changed to use the standard callback > machanism and sync dma buffer in client driver, so remove the proprietary > callback in cmdq helper. > > Signed-off-by: Chun-Kuang Hu > --- > drivers/soc/mediatek/mtk-cmdq-helper.c | 25 +------------------------ > include/linux/soc/mediatek/mtk-cmdq.h | 5 +---- > 2 files changed, 2 insertions(+), 28 deletions(-) > > diff --git a/drivers/soc/mediatek/mtk-cmdq-helper.c b/drivers/soc/mediate= k/mtk-cmdq-helper.c > index 3c8e4212d941..c1837a468267 100644 > --- a/drivers/soc/mediatek/mtk-cmdq-helper.c > +++ b/drivers/soc/mediatek/mtk-cmdq-helper.c > @@ -425,34 +425,11 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt) > } > EXPORT_SYMBOL(cmdq_pkt_finalize); > > -static void cmdq_pkt_flush_async_cb(struct cmdq_cb_data data) > -{ > - struct cmdq_pkt *pkt =3D (struct cmdq_pkt *)data.data; > - struct cmdq_task_cb *cb =3D &pkt->cb; > - struct cmdq_client *client =3D (struct cmdq_client *)pkt->cl; > - > - dma_sync_single_for_cpu(client->chan->mbox->dev, pkt->pa_base, > - pkt->cmd_buf_size, DMA_TO_DEVICE); > - if (cb->cb) { > - data.data =3D cb->data; > - cb->cb(data); > - } > -} > - > -int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb, > - void *data) > +int cmdq_pkt_flush_async(struct cmdq_pkt *pkt) > { > int err; > struct cmdq_client *client =3D (struct cmdq_client *)pkt->cl; > > - pkt->cb.cb =3D cb; > - pkt->cb.data =3D data; > - pkt->async_cb.cb =3D cmdq_pkt_flush_async_cb; > - pkt->async_cb.data =3D pkt; > - > - dma_sync_single_for_device(client->chan->mbox->dev, pkt->pa_base, > - pkt->cmd_buf_size, DMA_TO_DEVICE); > - > err =3D mbox_send_message(client->chan, pkt); > if (err < 0) > return err; > diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/me= diatek/mtk-cmdq.h > index ac6b5f3cba95..2b498f4f3946 100644 > --- a/include/linux/soc/mediatek/mtk-cmdq.h > +++ b/include/linux/soc/mediatek/mtk-cmdq.h > @@ -268,8 +268,6 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt); > * cmdq_pkt_flush_async() - trigger CMDQ to asynchronously execute the C= MDQ > * packet and call back at the end of done pack= et > * @pkt: the CMDQ packet > - * @cb: called at the end of done packet > - * @data: this data will pass back to cb > * > * Return: 0 for success; else the error code is returned > * > @@ -277,7 +275,6 @@ int cmdq_pkt_finalize(struct cmdq_pkt *pkt); > * at the end of done packet. Note that this is an ASYNC function. When = the > * function returned, it may or may not be finished. > */ > -int cmdq_pkt_flush_async(struct cmdq_pkt *pkt, cmdq_async_flush_cb cb, > - void *data); > +int cmdq_pkt_flush_async(struct cmdq_pkt *pkt); > > #endif /* __MTK_CMDQ_H__ */ > -- > 2.25.1 >