Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp597808pxb; Wed, 27 Jan 2021 16:16:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwzEbAhsRs1YvyRIZb6LWHDy/RH+TLHcLaMnHxPzNKxiEYNfsfeGVUskonLTazf6a55KLdp X-Received: by 2002:a17:907:94d4:: with SMTP id dn20mr8804221ejc.397.1611792960716; Wed, 27 Jan 2021 16:16:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611792960; cv=none; d=google.com; s=arc-20160816; b=LOpCmMOb9+bFCHDVw+RS6F/Z/cAJPY9ui5esCexlxq/A0fKnHt6ppfvl0oc4IA1/Ai ojGlgjp+x1GCdg1NosQj0NIQRlhFXmy8fWCZEoTcLn2SMHvAaJ07KhANkgZwl51fMXTz ZKfmX36LmbDMg2ygEceYXch5WIb93N+/IYq55+7ibK7tnnJs8b9qorDQca3M1n+Kn5mn 3sPuhIjuwNykgAcGfav1n5RqDelrPRbmpS1bTmSwHavGlsQFzVikFDMexO6ypBm3L08f VOw/3MVkFhGGMPXx5Rr8KzoOhm0e9AtzCqOEYqRFogegjQhp0KghXC0j358c99KkZ3Bi EBKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=COxofTr0kJgJ0XrTolT3iIHzQatztoojR6wHC+Fzy74=; b=QHBm80MmB/HooTd/UNlX/63jq0wJeC5OPKZXGOiB7q1fybUKZ9Oz6D6viGDjIVMMHr TnvO4a9ndAANEmdm70aYWdTpq3xIN3lKcMoRMJHL+J3yZW2Y81aY0B6bNsXvwRMZZ9LP G61DNe1Jkxi73prSEBURLRowUnHmWaXyZKo44e4s2RgOvFEK3fhTjTJ5M8OfcKqlO9j4 9lAfGq3Y6YESJ/eMt2EGtZcW5IDBL8/9T9/SGBv/Mw2PbCvn3rETuldLeLbnAHXja2N1 AC9eJ503IwxNzkAZuorHHOcHDcCE2K3b4pn/9s1bVT4EmKFUFUJT1RXg5vmY+CwUuhnH Ynug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fAEyChm6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n16si1785915edt.539.2021.01.27.16.15.36; Wed, 27 Jan 2021 16:16:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fAEyChm6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231804AbhA0TBg (ORCPT + 99 others); Wed, 27 Jan 2021 14:01:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231267AbhA0TB3 (ORCPT ); Wed, 27 Jan 2021 14:01:29 -0500 Received: from mail-pg1-x52c.google.com (mail-pg1-x52c.google.com [IPv6:2607:f8b0:4864:20::52c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BD75DC06174A for ; Wed, 27 Jan 2021 11:00:48 -0800 (PST) Received: by mail-pg1-x52c.google.com with SMTP id o16so2224578pgg.5 for ; Wed, 27 Jan 2021 11:00:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=COxofTr0kJgJ0XrTolT3iIHzQatztoojR6wHC+Fzy74=; b=fAEyChm6iRnVQn8MSzpwlHcYJVpgFidFFtuGRvFiIMb4hbXkSaewAhYjNVWmVkSTDm NE8p0RbxFsvC/DMHSSNM2F/CpybpBihBHF/aJnya5uuIEIEtJY7DDrBxmR0LHHkWj2Fa SbrOzL71GL+X6gl4/k2SmPr+jQ/yoBn/l69Ed+UmZABqOfyEwuj9kRkg7fWPygO5I62j CxQxw39JsWFyUJybP3ez6HVSVB2ZPVBx7Uzo8MYZ2zBCiX0Af43rHAm8kFIq+P3Orky9 Kjs2eeExdXLTMRD1ZbYoIJw1VbNUrJjjlZ/OCLIiCTWGTR5bxUl47FqQrpiKN//HqIiN n/FA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=COxofTr0kJgJ0XrTolT3iIHzQatztoojR6wHC+Fzy74=; b=Bhwct+i4Ty3/nYiMcDXUylkkBl+clkksHRHdP5LO5ZjOXQczd4TZ0FdYFeaKvTFQcX 3ZLasMl4bVNl5K8KyqVAk8PZgG9PEqlyNmL95praBJumbfT95ELNmRwn6WjMnUlTGKEE i3pTs/SqcdK0PfcKZq7wuXM38A5RnJZRjxcZFu9Bdq9QKeifVFbmLEcu7lOCqQORVYKv q8OIqOqIzWn8otuFWuzhaymeoOn1gX6sUVuwzrOtxvoZsqhgr09oGSnIdPwEmCrWoWTf YvtY0NSyQ7Xc4LwvTxvf00LQ//8cR0E0tt8Vk43j5jy34Apm/D9lXFutLmPvAPYm4ogd Pxnw== X-Gm-Message-State: AOAM5305326pcTGJExUz0cWgyUk9//yc0HsxH0BmMVbkKKjW8RmFSSYB 1xm/6DXEkzAuA248u6RUP1ksvQ== X-Received: by 2002:a63:2d3:: with SMTP id 202mr12522670pgc.438.1611774048289; Wed, 27 Jan 2021 11:00:48 -0800 (PST) Received: from xps15 (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id c5sm2738594pjo.4.2021.01.27.11.00.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Jan 2021 11:00:47 -0800 (PST) Date: Wed, 27 Jan 2021 12:00:45 -0700 From: Mathieu Poirier To: Suzuki K Poulose Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, coresight@lists.linaro.org, anshuman.khandual@arm.com, stable@vger.kernel.org, Mike Leach , Leo Yan Subject: Re: [PATCH v3] coresight: etm4x: Handle accesses to TRCSTALLCTLR Message-ID: <20210127190045.GA1165637@xps15> References: <20210127184617.3684379-1-suzuki.poulose@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210127184617.3684379-1-suzuki.poulose@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 27, 2021 at 06:46:17PM +0000, Suzuki K Poulose wrote: > TRCSTALLCTLR register is only implemented if > > TRCIDR3.STALLCTL == 0b1 > > Make sure the driver touches the register only it is implemented. > > Cc: stable@vger.kernel.org > Cc: Mathieu Poirier > Cc: Mike Leach > Cc: Leo Yan > Signed-off-by: Suzuki K Poulose > --- > Changes since v2: > - Ignore STALLCTL for sysfs mode > --- > drivers/hwtracing/coresight/coresight-etm4x-core.c | 9 ++++++--- > drivers/hwtracing/coresight/coresight-etm4x-sysfs.c | 2 +- > 2 files changed, 7 insertions(+), 4 deletions(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c > index 473ab7480a36..5017d33ba4f5 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c > @@ -306,7 +306,8 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) > etm4x_relaxed_write32(csa, 0x0, TRCAUXCTLR); > etm4x_relaxed_write32(csa, config->eventctrl0, TRCEVENTCTL0R); > etm4x_relaxed_write32(csa, config->eventctrl1, TRCEVENTCTL1R); > - etm4x_relaxed_write32(csa, config->stall_ctrl, TRCSTALLCTLR); > + if (drvdata->stallctl) > + etm4x_relaxed_write32(csa, config->stall_ctrl, TRCSTALLCTLR); > etm4x_relaxed_write32(csa, config->ts_ctrl, TRCTSCTLR); > etm4x_relaxed_write32(csa, config->syncfreq, TRCSYNCPR); > etm4x_relaxed_write32(csa, config->ccctlr, TRCCCCTLR); > @@ -1463,7 +1464,8 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) > state->trcauxctlr = etm4x_read32(csa, TRCAUXCTLR); > state->trceventctl0r = etm4x_read32(csa, TRCEVENTCTL0R); > state->trceventctl1r = etm4x_read32(csa, TRCEVENTCTL1R); > - state->trcstallctlr = etm4x_read32(csa, TRCSTALLCTLR); > + if (drvdata->stallctl) > + state->trcstallctlr = etm4x_read32(csa, TRCSTALLCTLR); > state->trctsctlr = etm4x_read32(csa, TRCTSCTLR); > state->trcsyncpr = etm4x_read32(csa, TRCSYNCPR); > state->trcccctlr = etm4x_read32(csa, TRCCCCTLR); > @@ -1575,7 +1577,8 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) > etm4x_relaxed_write32(csa, state->trcauxctlr, TRCAUXCTLR); > etm4x_relaxed_write32(csa, state->trceventctl0r, TRCEVENTCTL0R); > etm4x_relaxed_write32(csa, state->trceventctl1r, TRCEVENTCTL1R); > - etm4x_relaxed_write32(csa, state->trcstallctlr, TRCSTALLCTLR); > + if (drvdata->stallctl) > + etm4x_relaxed_write32(csa, state->trcstallctlr, TRCSTALLCTLR); > etm4x_relaxed_write32(csa, state->trctsctlr, TRCTSCTLR); > etm4x_relaxed_write32(csa, state->trcsyncpr, TRCSYNCPR); > etm4x_relaxed_write32(csa, state->trcccctlr, TRCCCCTLR); > diff --git a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > index b646d53a3133..0995a10790f4 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x-sysfs.c > @@ -389,7 +389,7 @@ static ssize_t mode_store(struct device *dev, > config->eventctrl1 &= ~BIT(12); > > /* bit[8], Instruction stall bit */ > - if (config->mode & ETM_MODE_ISTALL_EN) > + if ((config->mode & ETM_MODE_ISTALL_EN) && (drvdata->stallctl == true)) I have applied this patch. > config->stall_ctrl |= BIT(8); > else > config->stall_ctrl &= ~BIT(8); > -- > 2.24.1 >