From patchwork Tue Oct 10 08:47:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yicong Yang X-Patchwork-Id: 150580 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2908:b0:403:3b70:6f57 with SMTP id ib8csp50723vqb; Tue, 10 Oct 2023 01:50:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IF6vGSOwiJw3i8zAo9wZ4HCpy09bLN9LJ0azDsdkPC+YlXN4BtEcmGJzAz25riYryb3QEiJ X-Received: by 2002:a17:903:32d0:b0:1be:f37f:a8d5 with SMTP id i16-20020a17090332d000b001bef37fa8d5mr16376301plr.10.1696927849255; Tue, 10 Oct 2023 01:50:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696927849; cv=none; d=google.com; s=arc-20160816; b=kOuZpKqUfaAOp7GWz6C2TAzZ/zfNAhyQ2HKVtirFsIa+7ai6U1NaxqU1+kpHNL0yI9 q6sGPXgk2csvHMrfxf0tJCv5ylshzuaV26VpTSmBJGK6ihi+5Hz+6lu21URIcvFsQnof 3k1n0u7MD2O6f9UWPcJDoeAf3DU/kIkVU3ofN/I49eSuG4Xzp6xjzGOS256OO8bx2C+y eNiVQWudKaT+OHGobPHrIe/9tVfKS4x54GreHNZD1qwyOcArovzKd9kz0AddRdY6Dmqu UU0IeEFZ/tW9K/Mvu4JMTFrf7eZJe/eyG7paDS1WnHYbUSACvgjaoasHlVrVna2IUFJa 7pSQ== 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=Pon1DH8YjPwpUznUaBirt67Q9d2DiKYSm1z4iqDnCaA=; fh=ko8w2iEBByNlWLnAg6bNI5pex73wZFG+4jwxERcD8TA=; b=yKAOi6iyhdXE+v9T3CZYyXn2bh1rhejbXyTntsgGaPLMyUBx3k+wKxGXbJhYj7l+55 Z4+PM8+ju7ejmo8vUDz8hXGGYdOA4RejMfkZKmA60aXRSc0BAg965l3EbA4u7bFCn1AS UQhtjTUiviYrhvGPo8ACuqliBWyuA6fxeIjPYhKp6H0N1nnGlz2IDQdM4ErESu2v/C5A yEcV6YzBObPCBc1JyQZP8kEapsQoGl4s4yQDXK2w9jX4/kIDEm1ToDWDNmI+qPWOJ+Zu d5hDaBReHkJ2Rn5z8/UYEt1Ip5kxm5kHxbDlo0MSeon4VPgJveWO3AEmfyFCxnhHBPQt pQqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id iw21-20020a170903045500b001c386f8dd0asi11129361plb.179.2023.10.10.01.50.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Oct 2023 01:50:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 34BFE810EC35; Tue, 10 Oct 2023 01:50:43 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229699AbjJJIu1 (ORCPT + 20 others); Tue, 10 Oct 2023 04:50:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48536 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjJJIuY (ORCPT ); Tue, 10 Oct 2023 04:50:24 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59D3297; Tue, 10 Oct 2023 01:50:22 -0700 (PDT) Received: from canpemm500009.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4S4V0M57CwzrTLL; Tue, 10 Oct 2023 16:47:47 +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.31; Tue, 10 Oct 2023 16:50:20 +0800 From: Yicong Yang To: , , , CC: , , , , , , Subject: [PATCH v3 1/5] hwtracing: hisi_ptt: Disable interrupt after trace end Date: Tue, 10 Oct 2023 16:47:27 +0800 Message-ID: <20231010084731.30450-2-yangyicong@huawei.com> X-Mailer: git-send-email 2.31.0 In-Reply-To: <20231010084731.30450-1-yangyicong@huawei.com> References: <20231010084731.30450-1-yangyicong@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.50.163.32] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500009.china.huawei.com (7.192.105.203) X-CFilter-Loop: Reflected X-Spam-Status: No, score=2.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Tue, 10 Oct 2023 01:50:43 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779357816593908079 X-GMAIL-MSGID: 1779357816593908079 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 Acked-by: Jonathan Cameron --- 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 49ea1b0f7489..428cca54217e 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