Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp358981rwb; Sat, 14 Jan 2023 01:24:39 -0800 (PST) X-Google-Smtp-Source: AMrXdXsph7h8x6MNQUl1qtAqZWtyM7SXdIVNhbZpR/o3ofiy2mu4Cc27e1C4a0GruPNtc0i2kEq2 X-Received: by 2002:a17:907:2d09:b0:86c:988d:178c with SMTP id gs9-20020a1709072d0900b0086c988d178cmr2619845ejc.52.1673688279005; Sat, 14 Jan 2023 01:24:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673688278; cv=none; d=google.com; s=arc-20160816; b=cFpL9UnHza8LJ0HcnYaAmjzC7/Yj8G0RO3/+bzd8aw6LToKYRog1WAQGaeXJWrJel2 QlZ0T8J/2++4ZdxEs/aqe+IdaQhfOe1Si8aKWSFb2Om3NzJAUb1M3IJforr5b74IgBwL labXy6CSS8cgRagrjAb+WUCgX29x9WGg71Q0EYE+zZOOeo+XfIf1f8VMt5FYEwguc/Ca z1BMP1XJiImfxcURpfUbU7E1erWRCkdl6aqQqzFyCMxMeOcwqyPq5zmk4MbUlUyWxsxh CKvEBhK+C2tjLqIkNOGVSK41w34dB2DHfv3Lk5iGxQku1+FGZ1xa1Tc3wWDq0hykq500 ofWA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=zJkFZrC+nC5mCBm+xBsaWJEaVx+OqndAlr6gulsL+og=; b=b+19FRkNk4A6hH/rkpU6vbbKuKQx6LcRJN4LLywDOcBNzBGAAfh5RCq4cLKcp0CP44 hQzb7UM563OMsjfGukq2fThsSeAK7a2syzx2zQRkTD7WhfPJT6DI2NsBhi6DLFU/EB0u 8Aw/bNFXpOzBk22V5DdA6Cp7+rlge+hxdBDu7MRqCPd7D2PSslWCvPCLx7UsFvh2LA87 1umAlF7Zl+9DxwfihNasDNz0jn2eaxs5zA15HkRbheuxOwZyyFJnHLOElkWhkJ5B3ZD+ C4Fg3WU5e4WzmzejdznmyAAAM6tj/LWeXMOzV8s7sDT4X7fk3ks9R+urwuUfBLRO1Qb2 oCKg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id wt10-20020a170906ee8a00b007c4fb4ee06bsi25932734ejb.534.2023.01.14.01.24.26; Sat, 14 Jan 2023 01:24:38 -0800 (PST) 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 S229758AbjANIu4 (ORCPT + 51 others); Sat, 14 Jan 2023 03:50:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41274 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229520AbjANIuw (ORCPT ); Sat, 14 Jan 2023 03:50:52 -0500 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21B955B90 for ; Sat, 14 Jan 2023 00:50:50 -0800 (PST) Received: from dggpeml500002.china.huawei.com (unknown [172.30.72.54]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4NvBmP6N4lzJrS7; Sat, 14 Jan 2023 16:49:25 +0800 (CST) Received: from [10.67.103.44] (10.67.103.44) by dggpeml500002.china.huawei.com (7.185.36.158) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.34; Sat, 14 Jan 2023 16:50:46 +0800 Subject: Re: [PATCH] coresight: etm4x: Fix accesses to TRCSEQRSTEVR and TRCSEQSTR To: Suzuki K Poulose , , , References: <20230110125101.10533-1-hejunhao3@huawei.com> <4c799bd3-ab24-c0e6-57a4-aa9acc6c46b4@arm.com> CC: , , , , , From: hejunhao Message-ID: <080e64bc-0e7e-a227-0a48-1168ccd1d774@huawei.com> Date: Sat, 14 Jan 2023 16:50:46 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 In-Reply-To: <4c799bd3-ab24-c0e6-57a4-aa9acc6c46b4@arm.com> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.67.103.44] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To dggpeml500002.china.huawei.com (7.185.36.158) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,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 On 2023/1/11 0:15, Suzuki K Poulose wrote: > > On 10/01/2023 12:51, Junhao He wrote: >> The TRCSEQRSTEVR and TRCSEQSTR register is not implemented if the >> TRCIDR5.NUMSEQSTATE == 0. Skip accessing the register in such cases. >> >> Signed-off-by: Junhao He > > This must have : > > Fixes: 2e1cdfe184b5 ("coresight-etm4x: Adding CoreSight ETM4x driver") > > The patch as such looks correct to me. > > I will queue this. > > Thanks > Suzuki Sure, Will fix in next version. Best regards, Junhao. > >> --- >> .../hwtracing/coresight/coresight-etm4x-core.c | 18 ++++++++++++------ >> 1 file changed, 12 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c >> b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> index 80fefaba58ee..c7a65d1524fc 100644 >> --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c >> +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c >> @@ -424,8 +424,10 @@ static int etm4_enable_hw(struct etmv4_drvdata >> *drvdata) >> etm4x_relaxed_write32(csa, config->vipcssctlr, TRCVIPCSSCTLR); >> for (i = 0; i < drvdata->nrseqstate - 1; i++) >> etm4x_relaxed_write32(csa, config->seq_ctrl[i], >> TRCSEQEVRn(i)); >> - etm4x_relaxed_write32(csa, config->seq_rst, TRCSEQRSTEVR); >> - etm4x_relaxed_write32(csa, config->seq_state, TRCSEQSTR); >> + if (drvdata->nrseqstate) { >> + etm4x_relaxed_write32(csa, config->seq_rst, TRCSEQRSTEVR); >> + etm4x_relaxed_write32(csa, config->seq_state, TRCSEQSTR); >> + } >> etm4x_relaxed_write32(csa, config->ext_inp, TRCEXTINSELR); >> for (i = 0; i < drvdata->nr_cntr; i++) { >> etm4x_relaxed_write32(csa, config->cntrldvr[i], >> TRCCNTRLDVRn(i)); >> @@ -1631,8 +1633,10 @@ static int __etm4_cpu_save(struct >> etmv4_drvdata *drvdata) >> for (i = 0; i < drvdata->nrseqstate - 1; i++) >> state->trcseqevr[i] = etm4x_read32(csa, TRCSEQEVRn(i)); >> - state->trcseqrstevr = etm4x_read32(csa, TRCSEQRSTEVR); >> - state->trcseqstr = etm4x_read32(csa, TRCSEQSTR); >> + if (drvdata->nrseqstate) { >> + state->trcseqrstevr = etm4x_read32(csa, TRCSEQRSTEVR); >> + state->trcseqstr = etm4x_read32(csa, TRCSEQSTR); >> + } >> state->trcextinselr = etm4x_read32(csa, TRCEXTINSELR); >> for (i = 0; i < drvdata->nr_cntr; i++) { >> @@ -1760,8 +1764,10 @@ static void __etm4_cpu_restore(struct >> etmv4_drvdata *drvdata) >> for (i = 0; i < drvdata->nrseqstate - 1; i++) >> etm4x_relaxed_write32(csa, state->trcseqevr[i], >> TRCSEQEVRn(i)); >> - etm4x_relaxed_write32(csa, state->trcseqrstevr, TRCSEQRSTEVR); >> - etm4x_relaxed_write32(csa, state->trcseqstr, TRCSEQSTR); >> + if (drvdata->nrseqstate) { >> + etm4x_relaxed_write32(csa, state->trcseqrstevr, TRCSEQRSTEVR); >> + etm4x_relaxed_write32(csa, state->trcseqstr, TRCSEQSTR); >> + } >> etm4x_relaxed_write32(csa, state->trcextinselr, TRCEXTINSELR); >> for (i = 0; i < drvdata->nr_cntr; i++) { > > _______________________________________________ > CoreSight mailing list -- coresight@lists.linaro.org > To unsubscribe send an email to coresight-leave@lists.linaro.org > > . >