Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp5651810img; Wed, 27 Mar 2019 12:28:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqyHY2J66KLg3bOIDne7Dkmuu42Xgv+t1N1Fix4kxpVSjxT83mVVik4v79mnT5jrahj9L2Sa X-Received: by 2002:a65:62c2:: with SMTP id m2mr35415596pgv.348.1553714927469; Wed, 27 Mar 2019 12:28:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553714927; cv=none; d=google.com; s=arc-20160816; b=aZa4Pg+HdE2KaGiVzFZPz4fbn5nbCfDIrdPdpSd8ssMFJcechYa3UPdh0+jMQFWaGB +JoVtiK5pGNhv73dTksXH4MKg3uhVEHoeh7zNC0eaHNttQ8Acj4uwzamy7smsznNtLaM G4RFgvSbf0/O7Vp0naZ6BxibuJydgfAMIxY4F3Vp7h1BVWiFMfU9yM5BtWFelpqCK5Dh 74rSN+fzTsjxb1ECT5UuY/Q5mUBkdZrpspeYJlmYiNJnu8fQIW3CKU/9gmg/cHzVrfFZ BH5uZ7nfpdD7Bc2LtOlYwbJRZXdSNxtiGLVXy93NZzFiKAnf5BgljSAj/2yKwfRb13Is SdPQ== 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=WQUZOrMrvA5w4DRZEljLmYmynwqXn+gKvmhdsJewI/o=; b=loBRwDKCxb9upFNxQQa/9xndBvvveXya5NU04rBcMtLF75m15KTSRKGl80SB2cA/ow 1rn4tcpZ45RJAJC/aDY/Alok5Qigdzy08AWk8deHL7OTiMFG+YH+Kave5FWlFyOjlWfb Bn0Hj/qQY8LFYvhRtOVvlo96XTorYfP8pQNfSQC6+wLN1USp/C/9Rjt7xhA0B13fmqGS CJKdrEk4gv9PbJf+f2EQaA2OFEwatnco1qThmEI11HEjZbwsEKntFzilD2+wZIr5YFPJ crPgKWmC3OqJ9UocwGL9r5EPJoSAqLgp6IMbILfyXtrJ+NbVOZr0ETQaEPkcwNSQHGoA 6VIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dpYelAGm; 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 z8si11118847pgc.79.2019.03.27.12.28.31; Wed, 27 Mar 2019 12:28:47 -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=dpYelAGm; 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 S2387653AbfC0T17 (ORCPT + 99 others); Wed, 27 Mar 2019 15:27:59 -0400 Received: from mail.kernel.org ([198.145.29.99]:45200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733270AbfC0SEa (ORCPT ); Wed, 27 Mar 2019 14:04:30 -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 DD8B9217F9; Wed, 27 Mar 2019 18:04:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553709869; bh=e18Kwa6lcRZV897UrfI1Epi5G+4cyPYQubDOBb14SmI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dpYelAGmg2yx3qthsOtGUPkX/V8ezohTD9Uq4WANdq53KsenZpF+AlVlMaO4s4T4w OcTG4vUttMTNX5enuoz8Fg4E2pEi0a2mfbZ+yRbsrwVrMmlM16a64c1i3MTNMTp78V G1cf8ycvIBskK5ls/ZzQpTb/HM8TCwWrXFV3YIKE= 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 5.0 081/262] coresight: etm4x: Add support to enable ETMv4.2 Date: Wed, 27 Mar 2019 13:58:56 -0400 Message-Id: <20190327180158.10245-81-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190327180158.10245-1-sashal@kernel.org> References: <20190327180158.10245-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 53e2fb6e86f6..fe76b176974a 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -55,7 +55,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