Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5615092img; Wed, 27 Mar 2019 11:45:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqyolz9WHSAQp9a6Xa2eqjJYRZFlHD7ZbsLUkX4/ng56p3fh3PFXNt9DKBSwI/c1mcQvXHQn X-Received: by 2002:a63:e050:: with SMTP id n16mr35471890pgj.210.1553712344740; Wed, 27 Mar 2019 11:45:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553712344; cv=none; d=google.com; s=arc-20160816; b=uCFSdFa5j9UMO9HDVn2MbQcO42snduB2aJjUYiTT9Pa5jNMqPBA9b9bUxtKUY784RD JQimtWAqiWrOoF5FYWTZheCQhnuY537ncLDcfT9YqXQoi2XelBJwOji2EJEf8Xy7nyG5 1+A7t3RiQu8Sf+3nO8kJAKHEo3lgZR+4Yv5I/m/s/YLM9QNOYa5CO2jfHBm5tBbD8Gor H9DdcZtMeFOnvckFVkj2BbJFYA03c9E4gtVBxbJ8dgoaSKgDs1KaFW1VxNjNXImZ3j8O Uluq13u9C/KH7wkMNtEZTxPbMQ9jbm6QclwoGMaVy5ZngzWGxOmHgDkSPUvEnxCsUtSj DffA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Fs1dU/HLBArjfR2BGJr5vyjDDKBxHYT/ond/vsyD+oU=; b=0+e40449fGI8B0CSBcHrPsZIkW5h4Z4BReHq9qcXY44ltHe5TXXQP9K3TxMofVx2UI Gll4yus2BW7HE6EYx6oRpYnuvDsbS0sj3Z8mit9mjh0Se1AydIfp5sivbFJMUaUBJiGI tAU4dXxmKyt+uwFsKVK2b0+LQnSJApHyEDngrJxfYCybUFqSaD+UXpd0q4lSK6NdTkt0 1X1DNJhk3CCLmufKRqNvxr3lV+g37u+zgCx40V/OfDz8Jq0L1IKzRD5d8qc3bKlk4ZGU rDUqtcqcFK6DmuygKIdACm+k1C9zkREEyOnFo9EzsysBiU6A1znqUeQ5xXycOv4GJL9+ rrBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u+QibimY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si15566122pll.207.2019.03.27.11.45.29; Wed, 27 Mar 2019 11:45:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=u+QibimY; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391442AbfC0Sn7 (ORCPT + 99 others); Wed, 27 Mar 2019 14:43:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:39350 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390317AbfC0SV2 (ORCPT ); Wed, 27 Mar 2019 14:21:28 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9EC2C217F5; Wed, 27 Mar 2019 18:21:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553710887; bh=CjKiHWI05/x76D+X94vuHkBAJqJ087B+MN6AGMLLp54=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u+QibimYujqxwsL92d182sPcydRK+XOOKoHMqxFRZSekBzSqR+mxwSP9p25Wu60TB Xxdga3KPZ9p9+Ja4Zdb6dhSPgwMyVIIyYDlIAjypHqvqeDgf3+kn8KJQb9hgJU5WBM ZOwK0Xm4ew4OpEl5El9odPjQmPFdihYijCMQN7H8= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Sai Prakash Ranjan , Mathieu Poirier , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.9 28/87] coresight: etm4x: Add support to enable ETMv4.2 Date: Wed, 27 Mar 2019 14:19:41 -0400 Message-Id: <20190327182040.17444-28-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327182040.17444-1-sashal@kernel.org> References: <20190327182040.17444-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sai Prakash Ranjan [ Upstream commit 5666dfd1d8a45a167f0d8b4ef47ea7f780b1f24a ] SDM845 has ETMv4.2 and can use the existing etm4x driver. But the current etm driver checks only for ETMv4.0 and errors out for other etm4x versions. This patch adds this missing support to enable SoC's with ETMv4x to use same driver by checking only the ETM architecture major version number. Without this change, we get below error during etm probe: / # dmesg | grep etm [ 6.660093] coresight-etm4x: probe of 7040000.etm failed with error -22 [ 6.666902] coresight-etm4x: probe of 7140000.etm failed with error -22 [ 6.673708] coresight-etm4x: probe of 7240000.etm failed with error -22 [ 6.680511] coresight-etm4x: probe of 7340000.etm failed with error -22 [ 6.687313] coresight-etm4x: probe of 7440000.etm failed with error -22 [ 6.694113] coresight-etm4x: probe of 7540000.etm failed with error -22 [ 6.700914] coresight-etm4x: probe of 7640000.etm failed with error -22 [ 6.707717] coresight-etm4x: probe of 7740000.etm failed with error -22 With this change, etm probe is successful: / # dmesg | grep etm [ 6.659198] coresight-etm4x 7040000.etm: CPU0: ETM v4.2 initialized [ 6.665848] coresight-etm4x 7140000.etm: CPU1: ETM v4.2 initialized [ 6.672493] coresight-etm4x 7240000.etm: CPU2: ETM v4.2 initialized [ 6.679129] coresight-etm4x 7340000.etm: CPU3: ETM v4.2 initialized [ 6.685770] coresight-etm4x 7440000.etm: CPU4: ETM v4.2 initialized [ 6.692403] coresight-etm4x 7540000.etm: CPU5: ETM v4.2 initialized [ 6.699024] coresight-etm4x 7640000.etm: CPU6: ETM v4.2 initialized [ 6.705646] coresight-etm4x 7740000.etm: CPU7: ETM v4.2 initialized Signed-off-by: Sai Prakash Ranjan Reviewed-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/hwtracing/coresight/coresight-etm4x.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 4db8d6a4d0cb..da27f8edba50 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -61,7 +61,8 @@ static void etm4_os_unlock(struct etmv4_drvdata *drvdata) static bool etm4_arch_supported(u8 arch) { - switch (arch) { + /* Mask out the minor version number */ + switch (arch & 0xf0) { case ETM_ARCH_V4: break; default: -- 2.19.1