Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5611121imb; Thu, 7 Mar 2019 21:06:34 -0800 (PST) X-Google-Smtp-Source: APXvYqxHpMRmLaUtyF2kLCg+Qj5FKtzehAZNWtlrgF60O9qTfjzg2EFoBzeBgim0xsUAEGzbhRoq X-Received: by 2002:a62:e005:: with SMTP id f5mr17070841pfh.64.1552021594678; Thu, 07 Mar 2019 21:06:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552021594; cv=none; d=google.com; s=arc-20160816; b=UUInKc58Ehdj6x9Trg2NfPzkry12HCDLmzRlGqmKBpujoYkkcMeJW70XvszVqagMGa /eKh6ZWukSSrXWn4KkshzdPhYlALjlRCFpauTmyKrB65QVnp0DbtB2fKN/tLinkwm3hq A8pTFy7cPOgyNNclOBIXdgCEEYNrO30GfpEgHqWrIczq8tNhKufTkjrPMcXhBJiGEfzz n57G3VoEQpGGZiixJjFfbolUdb9Fy+ur9nmeYdLOHbJ5DnMvLD+DLu2PMyvwbdnkha1i ZeBcTMF5iSQYMAXyrHDvbkQ0Y2WmOk9snQcOGmA+ixeN92oQc9a9xrGhNONyvBGuoivK /6iA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=mFGjzVLO8ClkDTGIQ64xswGqtkW/zUlZLRGYnwln5eQ=; b=aI+IpbaxfOYiRrVwO/Gg35GYNDiMCGZeKW+Tk2Mpu37xmNkOmMk9K7OOOmRFsgF+tD zcNMOAtt3mIn2xmbNAP5uGauM782w4oq7Bdfc/9DjlvfjnVepU+xZC+u0rfjhfTROnO9 UVDlhxlcR0WrY817FmN3H6zn+jFgWHeyDMovOdtglhhagFmo3XK3y6gBejR23A5aWlPK +ha/abphKg1Qqe4nhxJgp80QbuEoZXjm55azYbp16eMMH42px8plS7iieSjjh9UUApZs 0xuQVz/A43IwJiy2d4o9VQmRKKbctGM7cBoaWkTY8EttVN+u5dGY8jLP3ZWmod81rfrO q0lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r187si6276380pfr.124.2019.03.07.21.06.18; Thu, 07 Mar 2019 21:06:34 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726238AbfCHFGB (ORCPT + 99 others); Fri, 8 Mar 2019 00:06:01 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:56874 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725308AbfCHFGA (ORCPT ); Fri, 8 Mar 2019 00:06:00 -0500 X-UUID: 84d5dc55514c4a3c99afa0f68756a119-20190308 X-UUID: 84d5dc55514c4a3c99afa0f68756a119-20190308 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 600735392; Fri, 08 Mar 2019 13:05:56 +0800 Received: from mtkcas07.mediatek.inc (172.21.101.84) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Fri, 8 Mar 2019 13:05:54 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas07.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Fri, 8 Mar 2019 13:05:53 +0800 Message-ID: <1552021553.2863.18.camel@mtksdaap41> Subject: Re: [PATCH v2 06/10] soc: mediatek: cmdq: clear the event in cmdq initial flow From: CK Hu To: Bibby Hsieh CC: Jassi Brar , Matthias Brugger , Rob Herring , Daniel Kurtz , Sascha Hauer , , , , , , Sascha Hauer , "Philipp Zabel" , Nicolas Boichat , "YT Shen" , Daoyuan Huang , Jiaguang Zhang , Dennis-YC Hsieh , Houlong Wei , , , Frederic Chen Date: Fri, 8 Mar 2019 13:05:53 +0800 In-Reply-To: <1551865835-50974-7-git-send-email-bibby.hsieh@mediatek.com> References: <1551865835-50974-1-git-send-email-bibby.hsieh@mediatek.com> <1551865835-50974-7-git-send-email-bibby.hsieh@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-SNTS-SMTP: 577F4E38EFFC2A64725F701CF5D4118C1E19CAA0CBC8100B71147EA7969D973E2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Bibby: On Wed, 2019-03-06 at 17:50 +0800, Bibby Hsieh wrote: > GCE hardware stored event information in own internal sysram, > if the initial value in those sysram is not zero value > it will cause a situation that gce can wait the event immediately > after client ask gce to wait event but not really trigger the > corresponding hardware. > > In order to make sure that the wait event function is > exactly correct, we need to clear the sysram value in > cmdq initial flow. > > Fixup commit 623a6143a845 ("mailbox: mediatek: Add Mediatek CMDQ driver") Please refer to [1] for the fix tag. [1] https://www.kernel.org/doc/html/v5.0/process/submitting-patches.html Regards, CK > > Signed-off-by: Bibby Hsieh > --- > drivers/mailbox/mtk-cmdq-mailbox.c | 5 +++++ > include/linux/mailbox/mtk-cmdq-mailbox.h | 2 ++ > include/linux/soc/mediatek/mtk-cmdq.h | 3 --- > 3 files changed, 7 insertions(+), 3 deletions(-) > > diff --git a/drivers/mailbox/mtk-cmdq-mailbox.c b/drivers/mailbox/mtk-cmdq-mailbox.c > index 6db1e2d..4e744cf 100644 > --- a/drivers/mailbox/mtk-cmdq-mailbox.c > +++ b/drivers/mailbox/mtk-cmdq-mailbox.c > @@ -33,6 +33,7 @@ > #define CMDQ_THR_END_ADDR 0x24 > #define CMDQ_THR_WAIT_TOKEN 0x30 > #define CMDQ_THR_PRIORITY 0x40 > +#define CMDQ_SYNC_TOKEN_UPDATE 0x68 > > #define CMDQ_THR_ACTIVE_SLOT_CYCLES 0x3200 > #define CMDQ_THR_ENABLED 0x1 > @@ -103,8 +104,12 @@ static void cmdq_thread_resume(struct cmdq_thread *thread) > > static void cmdq_init(struct cmdq *cmdq) > { > + int i; > + > WARN_ON(clk_enable(cmdq->clock) < 0); > writel(CMDQ_THR_ACTIVE_SLOT_CYCLES, cmdq->base + CMDQ_THR_SLOT_CYCLES); > + for (i = 0; i <= CMDQ_MAX_EVENT; i++) > + writel(i, cmdq->base + CMDQ_SYNC_TOKEN_UPDATE); > clk_disable(cmdq->clock); > } > > diff --git a/include/linux/mailbox/mtk-cmdq-mailbox.h b/include/linux/mailbox/mtk-cmdq-mailbox.h > index ccb7342..911475da 100644 > --- a/include/linux/mailbox/mtk-cmdq-mailbox.h > +++ b/include/linux/mailbox/mtk-cmdq-mailbox.h > @@ -19,6 +19,8 @@ > #define CMDQ_WFE_UPDATE BIT(31) > #define CMDQ_WFE_WAIT BIT(15) > #define CMDQ_WFE_WAIT_VALUE 0x1 > +/** cmdq event maximum */ > +#define CMDQ_MAX_EVENT 0x3ff > > /* > * CMDQ_CODE_MASK: > diff --git a/include/linux/soc/mediatek/mtk-cmdq.h b/include/linux/soc/mediatek/mtk-cmdq.h > index 54ade13..4e88999 100644 > --- a/include/linux/soc/mediatek/mtk-cmdq.h > +++ b/include/linux/soc/mediatek/mtk-cmdq.h > @@ -13,9 +13,6 @@ > > #define CMDQ_NO_TIMEOUT 0xffffffffu > > -/** cmdq event maximum */ > -#define CMDQ_MAX_EVENT 0x3ff > - > struct cmdq_pkt; > > struct cmdq_client {