From patchwork Wed Aug 23 15:13:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?U2hhd24gU3VuZyAo5a6L5a2d6KyZKQ==?= X-Patchwork-Id: 13362724 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF4DAEE4993 for ; Wed, 23 Aug 2023 15:14:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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=6adWBzPDoeLKs7M5mlzz3ZRpIHp0ni+OrWcBJcvtGmQ=; b=B6KVCakeX+Eoj9 W1ebNT6t/Pm//43G2pvXG6hgI0k0XJn8Lt6viwYAtqGXK4/bRwf2n/2uSeJj595jzd3Jvm6VuMUbd YRpZ/c8Zy8NfT+/SZbHP4O0zQmkhGiZIFMtxzdHjQBntVTaQ6RJ7k/z16vHXMes6scl/7yI0GTr72 HzsMxakgxnS66L/Q+H5cbbH/Kg2S3RO6m/lEJTffEg43bbWTjPOQZ0rsqnIV5e2KmVjn2mRTsoBbg K3Hamhg+jM4pUHV7cmWxv4MtfdmYIrwP4rapB9ii7z985VWIL7fvdUH9stBOKo5/5Dj9rnNV/Sw+0 jDEZxT6qilZHvGQ1TSmg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qYpYh-000w4w-2q; Wed, 23 Aug 2023 15:14:11 +0000 Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qYpYb-000vyx-28; Wed, 23 Aug 2023 15:14:07 +0000 X-UUID: adb3918241c711ee912e1518a6540028-20230823 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=vjHuAJtTxIQICn+XE23r+luFt5cxy+hHcBNHmzHlyYE=; b=DDgYc9n/xAvvDAUdioDFCXUKq2dw8cqegi0XG+pB3Y12d0T5qP/SzdN834r61ownZ4fqrfw0KZ6q9Jq4EuYwSZuckdnRBFSpW8vOLMQILu8Tq1PFDRelYbwsG6uIXh6ljhQUtkp5Ld7lzTKCIhgcwXxpvX8ZFSQB4L06HoBAGfU=; X-CID-P-RULE: Spam_GS6885AD X-CID-O-INFO: VERSION:1.1.31,REQID:00207b1c-ad8e-41db-bfcc-89e09ccea0d7,IP:0,U RL:0,TC:0,Content:100,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_GS6885AD,AC TION:quarantine,TS:195 X-CID-INFO: VERSION:1.1.31,REQID:00207b1c-ad8e-41db-bfcc-89e09ccea0d7,IP:0,URL :0,TC:0,Content:100,EDM:0,RT:0,SF:95,FILE:0,BULK:0,RULE:Spam_US65DF41,ACTI ON:quarantine,TS:195 X-CID-META: VersionHash:0ad78a4,CLOUDID:aa04ab1f-33fd-4aaa-bb43-d3fd68d9d5ae,B ulkID:230823231355BXHISX8G,BulkQuantity:1,Recheck:0,SF:19|48|38|29|28|17|8 01,TC:nil,Content:3,EDM:-3,IP:nil,URL:0,File:nil,Bulk:40,QS:nil,BEC:nil,CO L:0,OSI:0,OSA:0,AV:0,LES:1,SPR:NO,DKR:0,DKP:0,BRR:0,BRE:0 X-CID-BVR: 0 X-CID-BAS: 0,_,0,_ X-CID-FACTOR: TF_CID_SPAM_SNR,TF_CID_SPAM_SDM,TF_CID_SPAM_ASC,TF_CID_SPAM_FAS, TF_CID_SPAM_FSD X-UUID: adb3918241c711ee912e1518a6540028-20230823 Received: from mtkmbs14n2.mediatek.inc [(172.21.101.76)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-GCM-SHA384 256/256) with ESMTP id 1710288749; Wed, 23 Aug 2023 08:13:56 -0700 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by MTKMBS14N1.mediatek.inc (172.21.101.75) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.26; Wed, 23 Aug 2023 23:13:53 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.1118.26 via Frontend Transport; Wed, 23 Aug 2023 23:13:52 +0800 From: Hsiao Chien Sung To: Chun-Kuang Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger , AngeloGioacchino Del Regno , Jassi Brar CC: , , , , Singo Chang , Nancy Lin , Jason-JH Lin , Hsiao Chien Sung Subject: [PATCH 04/15] mailbox: mtk-cmdq: Support GCE thread loop Date: Wed, 23 Aug 2023 23:13:21 +0800 Message-ID: <20230823151332.28811-5-shawn.sung@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20230823151332.28811-1-shawn.sung@mediatek.com> References: <20230823151332.28811-1-shawn.sung@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230823_081405_730337_8443BE30 X-CRM114-Status: GOOD ( 12.46 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Do not disable CMDQ thread if it is a loop. Signed-off-by: Hsiao Chien Sung --- drivers/mailbox/mtk-cmdq-mailbox.c | 5 +++++ include/linux/mailbox/mtk-cmdq-mailbox.h | 1 + 2 files changed, 6 insertions(+) diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c index b18d47ea13a0..88ff39a28415 100644 --- a/drivers/mailbox/mtk-cmdq-mailbox.c +++ b/drivers/mailbox/mtk-cmdq-mailbox.c @@ -264,6 +264,11 @@ static void cmdq_thread_irq_handler(struct cmdq *cmdq, curr_pa = readl(thread->base + CMDQ_THR_CURR_ADDR) << cmdq->pdata->shift; + task = list_first_entry_or_null(&thread->task_busy_list, + struct cmdq_task, list_entry); + if (task && task->pkt->loop) + return; + list_for_each_entry_safe(task, tmp, &thread->task_busy_list, list_entry) { task_end_pa = task->pa_base + task->pkt->cmd_buf_size; diff --git a/include/linux/mailbox/mtk-cmdq-mailbox.h b/include/linux/mailbox/mtk-cmdq-mailbox.h index a8f0070c7aa9..f78a08e7c6ed 100644 --- a/include/linux/mailbox/mtk-cmdq-mailbox.h +++ b/include/linux/mailbox/mtk-cmdq-mailbox.h @@ -76,6 +76,7 @@ struct cmdq_pkt { size_t cmd_buf_size; /* command occupied size */ size_t buf_size; /* real buffer size */ void *cl; + bool loop; }; u8 cmdq_get_shift_pa(struct mbox_chan *chan);