From patchwork Sun Mar 14 23:33:21 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Kuang Hu X-Patchwork-Id: 12138131 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7E4BFC433E6 for ; Sun, 14 Mar 2021 23:34:22 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 26EA664E77 for ; Sun, 14 Mar 2021 23:34:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26EA664E77 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=68HhIyyiRGoK7+O/GwdDXz6E3xg0yNmWSfmQ/gpfo0o=; b=QB0nj46jbsAc/dLnyWQh/W7REv VXUgIcWrprHVnbmuBXYMFc18HV58pLsqIlbXyF7CqOjgLiWPTppoUZwunGBKymkjP1wdqMJVour/u 2VJ3UunMfS93gIu+WVfOhWWDCZJ9pDHlwpToBz4iLR2BNJS9yvMSWnrEUVBlRTpSQcDL1+3ORIKnz CPCVawdEIRKVCpwqTzHwMpPmAyBWlCHz/KZ5AZ62VnFQCVFgHkgsbgwx6DNYywcVYIMMNoDsJsBtm tiMuFzWxOU662LoQJoFw44vJ+l7qkBZkOkclgDW6JVPZE8GXQ9da91JprTu20QLw32ANuHwb2zS7a HVFgtkng==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLaFO-00EdvU-2a; Sun, 14 Mar 2021 23:34:10 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLaEr-00EdsA-Nn; Sun, 14 Mar 2021 23:33:40 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id DF80964E7C; Sun, 14 Mar 2021 23:33:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615764814; bh=i8JUe2VjLZUuVjVLi3BHMdhFn1Aqxj0nLCJrxMeGiq8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iPb1J5P5E4HfJeHHqzfPqdE1juViiKpEUpd4NCazAJvWyy9zRda+iEUj+NOhAm3IN mM3eXeORFg406wmSbWp4PNzaFF5tyFKiQrp0lastogEzPQhn2R91NS4zl69fqgw5g5 BxtDPMAit3XYtVVYRNlLtR9AkvxbUcOXN0zvtRE3mZYQwEklR115jmM1ldxN99FqCU IRI+wSMwuFXN8+3a4jFo8UnLnabnI1Myp8v1yh854E+EQkEBIprJR6TiNI5fdni3rz SFEhIQ593THRhGdYMXWR6Xhk7x5LnPs/ohqvw+F8MLcL2eEGIqR1QHeBjyfTFI+lJV k7jaYs6U6OS4w== From: Chun-Kuang Hu To: Jassi Brar , Matthias Brugger Cc: Houlong Wei , Bibby Hsieh , Dennis YC Hsieh , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Chun-Kuang Hu Subject: [PATCH 1/3] mailbox: mtk-cmdq: Remove cmdq_cb_status Date: Mon, 15 Mar 2021 07:33:21 +0800 Message-Id: <20210314233323.23377-2-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210314233323.23377-1-chunkuang.hu@kernel.org> References: <20210314233323.23377-1-chunkuang.hu@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210314_233338_367823_32D89B24 X-CRM114-Status: GOOD ( 10.39 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org cmdq_cb_status is an error status. Use the standard error number instead of cmdq_cb_status to prevent status duplication. Cc: Jassi Brar Cc: Matthias Brugger Cc: Houlong Wei Cc: Bibby Hsieh Cc: Dennis YC Hsieh Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Chun-Kuang Hu Reviewed-by: Yongqiang Niu --- drivers/mailbox/mtk-cmdq-mailbox.c | 10 +++++----- include/linux/mailbox/mtk-cmdq-mailbox.h | 7 +------ 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index 5665b6ea8119..3d37c1cd40f1 100644 --- a/drivers/mailbox/mtk-cmdq-mailbox.c +++ b/drivers/mailbox/mtk-cmdq-mailbox.c @@ -180,7 +180,7 @@ static bool cmdq_thread_is_in_wfe(struct cmdq_thread *thread) return readl(thread->base + CMDQ_THR_WAIT_TOKEN) & CMDQ_THR_IS_WAITING; } -static void cmdq_task_exec_done(struct cmdq_task *task, enum cmdq_cb_status sta) +static void cmdq_task_exec_done(struct cmdq_task *task, int sta) { struct cmdq_task_cb *cb = &task->pkt->async_cb; struct cmdq_cb_data data; @@ -244,10 +244,10 @@ static void cmdq_thread_irq_handler(struct cmdq *cmdq, curr_task = task; if (!curr_task || curr_pa == task_end_pa - CMDQ_INST_SIZE) { - cmdq_task_exec_done(task, CMDQ_CB_NORMAL); + cmdq_task_exec_done(task, 0); kfree(task); } else if (err) { - cmdq_task_exec_done(task, CMDQ_CB_ERROR); + cmdq_task_exec_done(task, -ENOEXEC); cmdq_task_handle_error(curr_task); kfree(task); } @@ -415,7 +415,7 @@ static void cmdq_mbox_shutdown(struct mbox_chan *chan) list_for_each_entry_safe(task, tmp, &thread->task_busy_list, list_entry) { - cmdq_task_exec_done(task, CMDQ_CB_ERROR); + cmdq_task_exec_done(task, -ECONNABORTED); kfree(task); } @@ -453,7 +453,7 @@ static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout) list_entry) { cb = &task->pkt->async_cb; if (cb->cb) { - data.sta = CMDQ_CB_ERROR; + data.sta = -ECONNABORTED; data.data = cb->data; cb->cb(data); } diff --git a/include/linux/mailbox/mtk-cmdq-mailbox.h b/include/linux/mailbox/mtk-cmdq-mailbox.h index d5a983d65f05..2f7d9a37d611 100644 --- a/include/linux/mailbox/mtk-cmdq-mailbox.h +++ b/include/linux/mailbox/mtk-cmdq-mailbox.h @@ -65,13 +65,8 @@ enum cmdq_code { CMDQ_CODE_LOGIC = 0xa0, }; -enum cmdq_cb_status { - CMDQ_CB_NORMAL = 0, - CMDQ_CB_ERROR -}; - struct cmdq_cb_data { - enum cmdq_cb_status sta; + int sta; void *data; }; From patchwork Sun Mar 14 23:33:22 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Kuang Hu X-Patchwork-Id: 12138129 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A7D05C433E0 for ; Sun, 14 Mar 2021 23:34:21 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3ED8564E77 for ; Sun, 14 Mar 2021 23:34:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3ED8564E77 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=4Io7Ib8mK7MYnKBbSygUGbMkGvnYZsmD0vNR7/tYBgM=; b=Alhc3xOHh1Kez0vy/iP57lUo3R 2Pua6BiCfFuP9auv1igCWKYGDYeJONYHhozvZJFrK0R7DMhRMav//Chx1lp1RQe+wet5ilhDUhwsm 8bqhXAZMGl29YpouWim+rFyz3pzi4kcUa5FmgseEVj+/iAWCBXN1iP5iiNhgwuEI3BQyjI3oSbTbh L2WWYx5Ke38ySX0GAd2uYIFbJ7B8km4+r+KKNFsquw8HYPCY9C9e+C8vWfI9iyJrOPVTffDHAxZIu nSAJuboyVIb97ZHMkHIwMN9DGDXoHv5/e0xt807dnjsUl5O1dMC3YirvqzShdpyQpsavxQhGaNKrB VtIc2R0w==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLaFL-00EdvG-TA; Sun, 14 Mar 2021 23:34:08 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLaEr-00EdsC-Vd; Sun, 14 Mar 2021 23:33:40 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 0190364E86; Sun, 14 Mar 2021 23:33:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615764816; bh=Sb/aUOEVrGZsj+WwC31AWifEfTb5okFWSJJBDazvLWM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=p8X8+nqsqw3JfWwp699qB+lHkbMabIqGvdJeOa5nuVwh/jwA7jE6Ch/7ySN6gEjY5 3gLG+M74VYgoeN4uUOuVaydTi5hbhy4rkIUzLoHO3N3nxqGMMLRKcUwP1PKEVsvfPI ZU+hvNi9npXXQ+eqxenxZsCNpZuNiJBVNq3kBl5SpV2G9ecEnZfpxovZ3815tu9UF5 gis0mNTn47sgx6DK+wdKF1crbA99YXRd1/TO5zGFxMOGa4zOc6vpWejIu/XKMPc2+N 8b/kIU4I11skDc6E6mALf1yuCghY7jnfrb7fQMbj4j+kK9AX9EtesoHbfUwNpZuvTd 2ROg1Zm/OW74w== From: Chun-Kuang Hu To: Jassi Brar , Matthias Brugger Cc: Houlong Wei , Bibby Hsieh , Dennis YC Hsieh , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Chun-Kuang Hu Subject: [PATCH 2/3] mailbox: mtk-cmdq: Use mailbox rx_callback Date: Mon, 15 Mar 2021 07:33:22 +0800 Message-Id: <20210314233323.23377-3-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210314233323.23377-1-chunkuang.hu@kernel.org> References: <20210314233323.23377-1-chunkuang.hu@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210314_233338_358969_A041E110 X-CRM114-Status: GOOD ( 10.07 ) X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org 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. But the client driver has already used cmdq_task_cb, so keep cmdq_task_cb until all client driver use rx_callback instead of cmdq_task_cb. Cc: Jassi Brar Cc: Matthias Brugger Cc: Houlong Wei Cc: Bibby Hsieh Cc: Dennis YC Hsieh Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Chun-Kuang Hu Reviewed-by: Yongqiang Niu --- drivers/mailbox/mtk-cmdq-mailbox.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index 3d37c1cd40f1..ef59e2234f22 100644 --- a/drivers/mailbox/mtk-cmdq-mailbox.c +++ b/drivers/mailbox/mtk-cmdq-mailbox.c @@ -188,7 +188,10 @@ static void cmdq_task_exec_done(struct cmdq_task *task, int sta) WARN_ON(cb->cb == (cmdq_async_flush_cb)NULL); data.sta = sta; data.data = cb->data; - cb->cb(data); + if (cb->cb) + cb->cb(data); + + mbox_chan_received_data(task->thread->chan, &data); list_del(&task->list_entry); } @@ -451,12 +454,13 @@ static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout) list_for_each_entry_safe(task, tmp, &thread->task_busy_list, list_entry) { + data.sta = -ECONNABORTED; + data.data = cb->data; cb = &task->pkt->async_cb; - if (cb->cb) { - data.sta = -ECONNABORTED; - data.data = cb->data; + if (cb->cb) cb->cb(data); - } + + mbox_chan_received_data(task->thread->chan, &data); list_del(&task->list_entry); kfree(task); } From patchwork Sun Mar 14 23:33:23 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chun-Kuang Hu X-Patchwork-Id: 12138133 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7939EC433E0 for ; Sun, 14 Mar 2021 23:34:33 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1AC5064E7C for ; Sun, 14 Mar 2021 23:34:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1AC5064E7C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:MIME-Version:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:References:In-Reply-To:Message-Id:Date:Subject:Cc:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=6Brzi9EJwmxKI46nmpbC7rOwC4k+bWnkcr3PnuHjNYU=; b=Y9sdz/+q8srKibAiWz2PelwmP4 R7xto8o53Mc0i+1TS+IdFzlCBXl3f+/19eujnI5+fNf8NEnp903JzgjcT5mH4sjOvxMS7+22uYXVR tCeZHTwP5LuwdSviHKwlEncJ17f9BsBm3oJsLRJ1DyowunqW9CRtLwY+v5VTMtV/87Zlce0Scn+EJ /Sv82U1KIRIB+Iaa/AvWn8LowPaFk2MeeZOaVj10MAmbgrdWnToME6C7f21F//kRS56RnthD7WOFJ +YnoGUL9SoiPjaAnHSldi6+Zfwkpn0mDg7cagGUuDHUnsUCGRYUv6prWYz1C0agSv1kjlDrghTaZB lZqc/3hg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lLaFW-00Edwx-W8; Sun, 14 Mar 2021 23:34:19 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lLaEu-00Edss-4F; Sun, 14 Mar 2021 23:33:43 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 18CA464E87; Sun, 14 Mar 2021 23:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615764818; bh=p+OvM6cie0qKQc+LIUuhfUzqA36ufYyQPLO73t0gzik=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fPgXTYCzqM4a6K7sWlMCn+e2ClGBUFDx9R3DVzYsJI3kkx4WQ9CTdOL4MIaqcL2UE VPbuUj0r37ECiNlAZkveEHUxbjynmYxcxhqXPLzVf0Ngd3fqaHaKu0CJw8E0vjoBgu jOPy1ws/Pi7f73G0Tky3T0ZMbdaXag7EzdRcMofnp8BAoEWpo/TIcf/y/fYEP2M5tX Kij42ZYVDCUULnTRZwp1feySZjLShJoCLBnmLr3v8gikKSfUJJwlaWuRdE9GqRSqmA 5i4+ki+II70EcGxlWhKTsNour1xm8dZaivwEeIH9gjxNT9kb0X2BqqJPqbCXu2nwN0 h2wWIoKfri+Sg== From: Chun-Kuang Hu To: Jassi Brar , Matthias Brugger Cc: Houlong Wei , Bibby Hsieh , Dennis YC Hsieh , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, Chun-Kuang Hu Subject: [PATCH 3/3] mailbox: mtk-cmdq: Add struct cmdq_pkt in struct cmdq_cb_data Date: Mon, 15 Mar 2021 07:33:23 +0800 Message-Id: <20210314233323.23377-4-chunkuang.hu@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210314233323.23377-1-chunkuang.hu@kernel.org> References: <20210314233323.23377-1-chunkuang.hu@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210314_233341_945050_D97A05BD X-CRM114-Status: UNSURE ( 8.59 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org Current client use 'struct cmdq_pkt' as callback data, so change 'void *data' to 'struct cmdq_pkt *pkt'. Keep data until client use pkt instead of data. Cc: Jassi Brar Cc: Matthias Brugger Cc: Houlong Wei Cc: Bibby Hsieh Cc: Dennis YC Hsieh Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-mediatek@lists.infradead.org Signed-off-by: Chun-Kuang Hu Reviewed-by: Yongqiang Niu --- drivers/mailbox/mtk-cmdq-mailbox.c | 2 ++ include/linux/mailbox/mtk-cmdq-mailbox.h | 1 + 2 files changed, 3 insertions(+) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index ef59e2234f22..99a9e0787501 100644 --- a/drivers/mailbox/mtk-cmdq-mailbox.c +++ b/drivers/mailbox/mtk-cmdq-mailbox.c @@ -188,6 +188,7 @@ static void cmdq_task_exec_done(struct cmdq_task *task, int sta) WARN_ON(cb->cb == (cmdq_async_flush_cb)NULL); data.sta = sta; data.data = cb->data; + data.pkt = task->pkt; if (cb->cb) cb->cb(data); @@ -456,6 +457,7 @@ static int cmdq_mbox_flush(struct mbox_chan *chan, unsigned long timeout) list_entry) { data.sta = -ECONNABORTED; data.data = cb->data; + data.pkt = task->pkt; cb = &task->pkt->async_cb; if (cb->cb) cb->cb(data); diff --git a/include/linux/mailbox/mtk-cmdq-mailbox.h b/include/linux/mailbox/mtk-cmdq-mailbox.h index 2f7d9a37d611..44365aab043c 100644 --- a/include/linux/mailbox/mtk-cmdq-mailbox.h +++ b/include/linux/mailbox/mtk-cmdq-mailbox.h @@ -68,6 +68,7 @@ enum cmdq_code { struct cmdq_cb_data { int sta; void *data; + struct cmdq_pkt *pkt; }; typedef void (*cmdq_async_flush_cb)(struct cmdq_cb_data data);