From patchwork Sun Sep 26 10:35:50 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tao Zhang X-Patchwork-Id: 12518233 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E2043C433EF for ; Sun, 26 Sep 2021 10:38:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 96EF76103B for ; Sun, 26 Sep 2021 10:38:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 96EF76103B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=quicinc.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=aEOFKF6Hn49CXkZU0n3VwRkJBohyq2IuK4N52CLbfcA=; b=IUujp+uOh0a+AD WOOJZh6eIdZvl8swmICTgQ/vyY9HHiLY+0T1WHma1iltlHfa9Y0TxbE5ri4T8r/WpJXMRUAp2DqEq 9LwCBDzX5jKFlmCS/7Cq2erZEMEz6g/c8iTGcmAe7fs2rVX6q+aP/wFj+Sw0CuroGgWOmhftvYl5/ L2+AL1On8BY2s3hj72497fuZFrDccMvXU/6s+sen3uPsCghKfdfnKiCpRjPnXEQkI3fAxoEdPycb4 PPYkpTUdjVs9Om7WUsp1t6RENZ2HbYXSQ81YZNuyX16xZkrGebWWzi4ZrgOp7VDohUhwKy80aB0e/ iw6T7LPKPut5oxn+txcQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mURWD-000P5s-VH; Sun, 26 Sep 2021 10:36:26 +0000 Received: from alexa-out.qualcomm.com ([129.46.98.28]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mURWA-000P5M-QF for linux-arm-kernel@lists.infradead.org; Sun, 26 Sep 2021 10:36:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632652583; x=1664188583; h=from:to:cc:subject:date:message-id:mime-version; bh=xjIlH6huUBUtPHOqwVDeMhWoi9SPzuIyzYgqU2usCVw=; b=B6j9fViuv38Za1qILt+V6AnRxwa4368U7Y/6e5ZXuXxr/nK/k5cQ/9si nm8fuos9Vx1MGit3hhKHanUcGOJjHil9yGXf0Hg5gFiERnuU5Y/cZs61H Ho1sQ0IqFG5gA/TPgHdI0c3o0D/NhLEGYRhk+GLsMzHlayuOwZXhLzgdv Y=; Received: from ironmsg08-lv.qualcomm.com ([10.47.202.152]) by alexa-out.qualcomm.com with ESMTP; 26 Sep 2021 03:36:18 -0700 X-QCInternal: smtphost Received: from nalasex01c.na.qualcomm.com ([10.47.97.35]) by ironmsg08-lv.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2021 03:36:17 -0700 Received: from taozha-gv.qualcomm.com (10.80.80.8) by nalasex01c.na.qualcomm.com (10.47.97.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.922.7; Sun, 26 Sep 2021 03:36:13 -0700 From: Tao Zhang To: Mathieu Poirier , Suzuki K Poulose , Alexander Shishkin CC: Tao Zhang , Mike Leach , Leo Yan , Greg Kroah-Hartman , , , , Tingwei Zhang , Mao Jinlong , Yuanfang Zhang Subject: [PATCH] coresight: etm4x: avoid build failure with unrolled loops Date: Sun, 26 Sep 2021 18:35:50 +0800 Message-ID: <1632652550-26048-1-git-send-email-quic_taozha@quicinc.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nalasex01c.na.qualcomm.com (10.47.97.35) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210926_033622_962500_F440916F X-CRM114-Status: GOOD ( 15.40 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org clang-12 fails to build the etm4x driver with -fsanitize=array-bounds, where it decides to unroll certain loops in a way that result in a C variable getting put into an inline assembly. Search this build failure and find this is a known issue and there has been a mail thread discussing it. https://patchwork.kernel.org/project/linux-arm-kernel/patch/20210429145752.3218324-1-arnd@kernel.org/ According to the modification suggestions of this mail thread, coresight infrastucture has already provided another API that can replace the function that caused the error. Used here "csdev_access_read32" to replace the original API "etm4x_relaxed_read32". This patch applies to coresight/next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git Signed-off-by: Tao Zhang --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index f58afbab6e6d..0bca8e2be070 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -797,7 +797,7 @@ static void etm4_disable_hw(void *info) /* read back the current counter values */ for (i = 0; i < drvdata->nr_cntr; i++) { config->cntr_val[i] = - etm4x_relaxed_read32(csa, TRCCNTVRn(i)); + csdev_access_read32(csa, TRCCNTVRn(i)); } coresight_disclaim_device_unlocked(csdev);