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 X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89750C43461 for ; Tue, 15 Sep 2020 16:47:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2377F20809 for ; Tue, 15 Sep 2020 16:47:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ISbE+aEM"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="XFvRUD1v" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2377F20809 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=nBxA+aqXeYDvDvsN79a17fzWKAmmGF9UgOsLaQJy1hE=; b=ISbE+aEMic2GhVNZXT/rErhme 34caz412bhaOszX6WznJmhMmR0Oe0G28H3qenMHd1fw8N3pY9xqVtEc7kYvLjk6oEHfYZRmTE9dWG Cdg1JAE5GQs+qwhYb4LM/tVmjIU1JWk/w9AlvDQt/spRlbsoFMCmkdntIl/vDSoHHoahBFN4Ek5jk wfK0hXaoNEzefCy72Kkf1GsRazI5g1uYfrt1kddTBAVMIIpBMEoXJ/O6AbBCO0gI+tgGwWgNfXFyC AeAZogLYDrdwQSppctKBv8Pr5PW0Z5XYUI4dJzEfvX2uSWRLk6j35VJd9+++smWm188bXpD9mKhJI 2c6yYDA/g==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIE53-0006Ae-Gj; Tue, 15 Sep 2020 16:45:21 +0000 Received: from mail-pf1-x444.google.com ([2607:f8b0:4864:20::444]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kIE50-00069y-RD for linux-arm-kernel@lists.infradead.org; Tue, 15 Sep 2020 16:45:20 +0000 Received: by mail-pf1-x444.google.com with SMTP id d6so2259250pfn.9 for ; Tue, 15 Sep 2020 09:45:18 -0700 (PDT) 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=AyC8dXFI+cXflY60SGBZ7hE/t8t6JouMQFZSAAbJ8b8=; b=XFvRUD1vd0PW4taOae9lp8OM6KM+M7LtImZYwCnlw1ZfZRLpn9krXSV3inUhVvDkhw 9ZntNZlYuJRgm5sbk+K3X6A2+x8g8CVqb2sm3guL6rl2OUsZuR1klYlVAaA2J4zk4msF B/yTOifo9VQqIqz9Y3gfgTR+adpxB9QRubtXjmoqEh9rOsHEx1tPQ/L3NPyvOBgS0FjK QN+qyYkjAFSzktDvmokQuI8QeBFkSC0WJM6MBbO/mtPCWZV63vrMkc3Nl2pVg6CBiv8v K6wpDco9ZxQd0w5Zchq59k+506ZUTIeJLvVOsQSw90CfqiiGz2GSl+48IeGDEPA0Sq7C gM2A== 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=AyC8dXFI+cXflY60SGBZ7hE/t8t6JouMQFZSAAbJ8b8=; b=bADXhQw4q6q+tERo8CEBvhN1Ann9awCJ/jGBIYQHcfjyJZ103CjHxdvA8aM74aKh/k UQ8MTtA227/VDd6Yx9F4261uV2pMfCSpLx/HFkAPnoOAPfrRhD46Mvwp7fPa3wjTpe18 2BOLbCUItiMyAbHg2ht/aR+4cpTRGJecGOZbaRe5D3Emz0Vmaz1brbioxk1MfoQZeLFI jcxP0/hkNJoyCw3aAf9t5zJsYwsgBN9I4x2W314NkSgB+SA0JWYBT9p9IRGxEaB7t6fu fScfTjkEHVLOQBkjq6jnDnyFDFy4eg7egNfbDutiUbKRrkTjJHSrRnGhiii4Nyhuoksg 3AxA== X-Gm-Message-State: AOAM532zaFDoE4+M9HeT8+ceqTfZdMsqIscfOc7cT8h81cFg4Ngaj5xk yife6omtzTbJJZhEQvURptsFng== X-Google-Smtp-Source: ABdhPJyK4QiYUMePxA95skwPygeJz94qQicN34VhbNuxwjEmnd7visc/73LNbQJsN3QzcU2V+ERk/A== X-Received: by 2002:a63:4a43:: with SMTP id j3mr15732183pgl.42.1600188316548; Tue, 15 Sep 2020 09:45:16 -0700 (PDT) Received: from xps15 (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id s22sm15134934pfd.90.2020.09.15.09.45.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 09:45:15 -0700 (PDT) Date: Tue, 15 Sep 2020 10:45:14 -0600 From: Mathieu Poirier To: Mike Leach Subject: Re: [PATCH] coresight: etm4x: Fix number of resources check for ETM 4.3 and above. Message-ID: <20200915164514.GB3641338@xps15> References: <20200915113621.10838-1-mike.leach@linaro.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200915113621.10838-1-mike.leach@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200915_124519_175437_2F830ADD X-CRM114-Status: GOOD ( 23.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: coresight@lists.linaro.org, linux-arm-kernel@lists.infradead.org, suzuki.poulose@arm.com Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Mike, On Tue, Sep 15, 2020 at 12:36:21PM +0100, Mike Leach wrote: > The initialisation code checks TRCIDR4 to determine the number of resource > selectors available on the system. Since ETM v 4.3, the value 0 has a > different meaning. This patch takes into account this change. > > Signed-off-by: Mike Leach > --- > drivers/hwtracing/coresight/coresight-etm4x.c | 8 +++++++- > drivers/hwtracing/coresight/coresight-etm4x.h | 3 +++ > 2 files changed, 10 insertions(+), 1 deletion(-) > > diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c > index 00c9f0bb8b1a..be687276704c 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x.c > +++ b/drivers/hwtracing/coresight/coresight-etm4x.c > @@ -742,8 +742,14 @@ static void etm4_init_arch_data(void *info) > * The number of resource pairs conveyed by the HW starts at 0, i.e a > * value of 0x0 indicate 1 resource pair, 0x1 indicate two and so on. > * As such add 1 to the value of NUMRSPAIR for a better representation. > + * > + * For ETM v4.3 and later, 0x0 means 0, and no pairs are available - > + * the default TRUE and FALSE resource selectors are omitted. > + * Otherwise for values 0x1 and above the number is N + 1 as per v4.2. > */ That's a weird implementation... I had to double check the documentation to convince me that your comment was correct before applying the patch. Thanks, Mathieu > - drvdata->nr_resource = BMVAL(etmidr4, 16, 19) + 1; > + drvdata->nr_resource = BMVAL(etmidr4, 16, 19); > + if ((drvdata->arch < ETM4X_ARCH_4V3) || (drvdata->nr_resource > 0)) > + drvdata->nr_resource += 1; > /* > * NUMSSCC, bits[23:20] the number of single-shot > * comparator control for tracing. Read any status regs as these > diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h > index 5259f96fd28a..eefc7371c6c4 100644 > --- a/drivers/hwtracing/coresight/coresight-etm4x.h > +++ b/drivers/hwtracing/coresight/coresight-etm4x.h > @@ -200,6 +200,9 @@ > /* NS MON (EL3) mode never implemented */ > #define ETM_EXLEVEL_NS_VICTLR_MASK GENMASK(22, 20) > > +/* Interpretation of resource numbers change at ETM v4.3 architecture */ > +#define ETM4X_ARCH_4V3 0x43 > + > /** > * struct etmv4_config - configuration information related to an ETMv4 > * @mode: Controls various modes supported by this ETM. > -- > 2.17.1 > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel