From patchwork Wed Aug 9 08:18:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 133152 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:c44e:0:b0:3f2:4152:657d with SMTP id w14csp2699427vqr; Wed, 9 Aug 2023 03:30:50 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGg6Chbv4ZIwkPdLW2GtKaVKFeNb6eo4TueCYh7nnJK4nvf1SvErezuoCXRXi7oP/oXGcX1 X-Received: by 2002:a17:906:4e:b0:99c:bb4d:f59e with SMTP id 14-20020a170906004e00b0099cbb4df59emr1620333ejg.63.1691577050164; Wed, 09 Aug 2023 03:30:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691577050; cv=none; d=google.com; s=arc-20160816; b=s6+fDGV2w30Jy4tV5CJNcMdCdekU49o6ZTLh38e8a4hDzlcTh/hTeWbi5YWH6+qwyQ sSZF60YTCNMdGfO0RBcQ6BX3W6vYEBM2hHABts12Ym2Z4L8rGcAvJvRU/d7nkWLy6sWC pM68XitmbKrE5KQvB4mnBCw1v+AzsIRnI9x+I4vPH9gItFxQiRhGmhiCGplpj/BM3E0z DfgYajHJQk/ArVbKcrj3sKXMs6WqG7LHNJROFO+Hgfq5yKjXnujoqc4O3E5g8w+TgNaK t0qTNkP1oMv79r0EXTfX1yXmBzgRHjxTz2lonFJdaURhOS3WfcRQ9ZHn4sZmwxmUoMEB scfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=WNWLAG2f+Ji61N9O9iruqbhN25zKAUKlGRr+0g31uuQ=; fh=3Xa+Ca9QE4oHBLojfhmHw+QI2cJx6cXgOgG4DAxRTgs=; b=Qfic2Y5k02KW226jG/QnvGzVO6Csx/WMAbk0JsI9Gp2b1zGZCVJ+ybW0gHW4mofvN2 nozHR8jLnEYP18bikN8ISqkOdqjcLYMkjRxzpnWMfl1WDu9P5eCbHFfXt7BQCNDJUl3n /oEU8iS73QC9E2eDQqTYEdSNDB1e11/lBa1LCRyWK3oL9/lLT+6pX15KJzqb6HzkCj84 uqvmVRk+LWsBuu8vB75SC7FQi0hRR9hQJT+Zh8WuhUmvWMBnaTdQQpUJcJdUBzSRrciL y1Nn9lVK5iYphIlh+wW5Tx5ER/Gkd9l62xnbQ8KEfkD/Ahg+JyiVeSNmoPcq73oJc2hd MAnA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o14-20020a1709061b0e00b0099bc8c11d20si8542613ejg.248.2023.08.09.03.30.25; Wed, 09 Aug 2023 03:30:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231901AbjHIIUp (ORCPT + 99 others); Wed, 9 Aug 2023 04:20:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229783AbjHIIUl (ORCPT ); Wed, 9 Aug 2023 04:20:41 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EC3610FE; Wed, 9 Aug 2023 01:20:41 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.55]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4RLNHS2JX9zVl7M; Wed, 9 Aug 2023 16:18:44 +0800 (CST) Received: from localhost.localdomain (10.50.163.32) by canpemm500009.china.huawei.com (7.192.105.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Wed, 9 Aug 2023 16:20:38 +0800 From: Yicong Yang To: , , , CC: , , , , , , Subject: [PATCH 1/5] hwtracing: hisi_ptt: Disable interrupt after trace end Date: Wed, 9 Aug 2023 16:18:21 +0800 Message-ID: <20230809081825.11518-2-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20230809081825.11518-1-yangyicong@huawei.com> References: <20230809081825.11518-1-yangyicong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1773747097368043868 X-GMAIL-MSGID: 1773747097368043868 From: Yicong Yang On trace end we disable the hardware but leave the interrupt unmasked. Mask the interrupt to make the process reverse to the start. No actual issue since hardware should send no interrupt after disabled. Signed-off-by: Yicong Yang --- drivers/hwtracing/ptt/hisi_ptt.c | 4 ++++ drivers/hwtracing/ptt/hisi_ptt.h | 1 + 2 files changed, 5 insertions(+) diff --git a/drivers/hwtracing/ptt/hisi_ptt.c b/drivers/hwtracing/ptt/hisi_ptt.c index ba081b6d2435..5f0a8e653ae8 100644 --- a/drivers/hwtracing/ptt/hisi_ptt.c +++ b/drivers/hwtracing/ptt/hisi_ptt.c @@ -183,6 +183,10 @@ static void hisi_ptt_wait_dma_reset_done(struct hisi_ptt *hisi_ptt) static void hisi_ptt_trace_end(struct hisi_ptt *hisi_ptt) { writel(0, hisi_ptt->iobase + HISI_PTT_TRACE_CTRL); + + /* Mask the interrupt on the end */ + writel(HISI_PTT_TRACE_INT_MASK_ALL, hisi_ptt->iobase + HISI_PTT_TRACE_INT_MASK); + hisi_ptt->trace_ctrl.started = false; } diff --git a/drivers/hwtracing/ptt/hisi_ptt.h b/drivers/hwtracing/ptt/hisi_ptt.h index e17f045d7e72..46030aa88081 100644 --- a/drivers/hwtracing/ptt/hisi_ptt.h +++ b/drivers/hwtracing/ptt/hisi_ptt.h @@ -47,6 +47,7 @@ #define HISI_PTT_TRACE_INT_STAT 0x0890 #define HISI_PTT_TRACE_INT_STAT_MASK GENMASK(3, 0) #define HISI_PTT_TRACE_INT_MASK 0x0894 +#define HISI_PTT_TRACE_INT_MASK_ALL GENMASK(3, 0) #define HISI_PTT_TUNING_INT_STAT 0x0898 #define HISI_PTT_TUNING_INT_STAT_MASK BIT(0) #define HISI_PTT_TRACE_WR_STS 0x08a0