From mboxrd@z Thu Jan 1 00:00:00 1970 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 7C2BEECAAD5 for ; Mon, 12 Sep 2022 17:14:47 +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-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To:Subject: MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ZtoZDhIfTkrF3J4AgsZ2ByzE2UKBB1MTUnoC0hCuSPM=; b=JjshNgjAGEqkgo kAZ0ezx5L/Y9S4gkuAK1WjnPsfig0JrhpFT9X7mpcyYqfUQIfoxVimqBEALTt9nz/owd5Jl/Bu0+s txNP5ymLgjf88/6DW2mV4mYFXlRWNYEfrv0lxnx/aVpEDDiTaxBar4alff9+qvPVVBlyiGrIwDgBK uAFSaiqvR105xLtPGB5RcaUyStk9ninWWlbBwR/3fI2fvVDMwjXIMAOoyqe1AAwLChdkofBwBFzHO g+Gy7OGASr2jFd86hM8qlsJfd39AEGpyL54TM43DG5iKMlgs5PmNWrRnCDrl5tJq57BsXvmh6cXw4 Zv9XQuJqgVy1IHCvmEbg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oXmzo-00Buzn-BS; Mon, 12 Sep 2022 17:13:20 +0000 Received: from mail-pf1-x42a.google.com ([2607:f8b0:4864:20::42a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oXmzl-00Buqk-08 for linux-arm-kernel@lists.infradead.org; Mon, 12 Sep 2022 17:13:18 +0000 Received: by mail-pf1-x42a.google.com with SMTP id u132so9244228pfc.6 for ; Mon, 12 Sep 2022 10:13:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=K3SFvwuZhRXAUmXX0eEHznvbncqQ04UQY6UICCI5u4c=; b=gE3UsfG4ll+bqVJrq7lvgGZWHJ2G8kxgraF/3yFnbAFv1A4uCW2Krqjxrzh0EkWPg1 zzwKW3p50+ConsKX/1ftQP6U80T3nU40Ox/6tNTM8NoN6QTb/o1Sp203x3fwHR5++t3n NXS4oqz7H/8jaE2GinQ4xuHPGZZDrnZPAf/ax4xr68RKdYeZ/rFGx2IIXqWGir1rpjVF 93b3Ct4yRwMIjlo786VV02EpGSOYWlk8D+jAep0rBtyFQ2u3VCfOPOluUB9OvMCBfsJN m/BzjsqACDJ+6f12+fOAt49qphCncVE9XM7qpgMpFKT7alRpw8Fl3dI7M5vA5jEct7YV 6JuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=K3SFvwuZhRXAUmXX0eEHznvbncqQ04UQY6UICCI5u4c=; b=h+fCS5WAqlwPLtrjgUoskf9YNMkJTb7hE09bPuqr8cbkLmH1K/aa7phSDisgyWiVkM M9n5WialD/UUZSJb+2CVZEVYqhhymUv0LyHRzE1RIMI6Njg/vo0fGFWZ0n9/nQ9TgFvy p2ha9B1FtgtL8G++Tev16KtZLPM5dsNSCWSQjIrWxDOAo1h7+W+7cFfUNhDMmFert6vg mycuGF9YvSy39sEnjzEs3+LRviLm8IHhVvjxmqDpRFNdQhBhbeZ456jKP7iDJBIHK7Df IpL/zzahwJOGJbUXL5OUX8X3hyKM/OZnamD9Y3fFStuNwn8b+yuEQOtz+fA0k1dYu1cl s1sg== X-Gm-Message-State: ACgBeo0e8EIxA2IibeFk5/I4nnuPgqAROd/znraoFiSLDhcQbGiDPoxL FJs3uXU6XZJ3X38K1xrQY7XxbQ== X-Google-Smtp-Source: AA6agR6g4r7l39YGa4rkP++m24fwHukkSZ7FKqzoPtc9Ocwp5jEGOGLVBHKKh5t5oVfX8DAWnKcc6Q== X-Received: by 2002:a63:6c88:0:b0:430:662:e24c with SMTP id h130-20020a636c88000000b004300662e24cmr24656585pgc.318.1663002781496; Mon, 12 Sep 2022 10:13:01 -0700 (PDT) Received: from ?IPV6:2401:4900:1c60:5362:9d7f:2354:1d0a:78e3? ([2401:4900:1c60:5362:9d7f:2354:1d0a:78e3]) by smtp.gmail.com with ESMTPSA id 4-20020a630304000000b00428c216467csm5925486pgd.32.2022.09.12.10.12.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 12 Sep 2022 10:13:01 -0700 (PDT) Message-ID: Date: Mon, 12 Sep 2022 22:42:56 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v2] coresight: etm4x: Fix crash observed on Qcom ETM parts with 'Low power override' Content-Language: en-US To: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org Cc: mathieu.poirier@linaro.org, suzuki.poulose@arm.com, mike.leach@linaro.org, leo.yan@linaro.org, alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org, bhupesh.linux@gmail.com, Greg Kroah-Hartman References: <20220825052232.11013-1-bhupesh.sharma@linaro.org> From: Bhupesh Sharma In-Reply-To: <20220825052232.11013-1-bhupesh.sharma@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220912_101317_146696_3A3C2726 X-CRM114-Status: GOOD ( 25.55 ) 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: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 8/25/22 10:52 AM, Bhupesh Sharma wrote: > Some Qualcomm ETM implementations require skipping powering up > the trace unit, as the ETMs are in the same power domain as > their CPU cores. > > Via commit 5214b563588e ("coresight: etm4x: Add support for > sysreg only devices"), the setting of 'skip_power_up' flag was > moved after the 'etm4_init_arch_data' function is called, whereas > the flag value is itself used inside the function. This causes > a crash when ETM mode 'Low-power state behavior override' is set > on some Qualcomm parts. > > Fix the same. > > Fixes: 5214b563588e ("coresight: etm4x: Add support for sysreg only devices") > Cc: Mike Leach > Cc: Suzuki K Poulose > Cc: Mathieu Poirier > Cc: Greg Kroah-Hartman > Signed-off-by: Bhupesh Sharma > --- > - v1 can be seen here: https://lore.kernel.org/lkml/20220803191236.3037591-1-bhupesh.sharma@linaro.org/ > - Addressed the review comments from Suzuki. > - Rebased on linux-next. > > drivers/hwtracing/coresight/coresight-etm4x-core.c | 13 +++++++++++-- > 1 file changed, 11 insertions(+), 2 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > index d39660a3e50c..14c1c7869795 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > @@ -977,6 +977,16 @@ static bool etm4_init_sysreg_access(struct etmv4_drvdata *drvdata, > if (!cpu_supports_sysreg_trace()) > return false; > > + /* > + * Some Qualcomm implementations require skipping powering up the trace unit, > + * as the ETMs are in the same power domain as their CPU cores. > + * > + * Since the 'skip_power_up' flag is used inside 'etm4_init_arch_data' function, > + * initialize it before the function is called. > + */ > + if (fwnode_property_present(dev_fwnode(dev), "qcom,skip-power-up")) > + drvdata->skip_power_up = true; > + > /* > * ETMs implementing sysreg access must implement TRCDEVARCH. > */ > @@ -1951,8 +1961,7 @@ static int etm4_probe(struct device *dev, void __iomem *base, u32 etm_pid) > return -EINVAL; > > /* TRCPDCR is not accessible with system instructions. */ > - if (!desc.access.io_mem || > - fwnode_property_present(dev_fwnode(dev), "qcom,skip-power-up")) > + if (!desc.access.io_mem) > drvdata->skip_power_up = true; > > major = ETM_ARCH_MAJOR_VERSION(drvdata->arch); Gentle ping. Any review comments on the v2? Thanks, Bhupesh _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel