Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp3038188pxb; Sun, 26 Sep 2021 03:37:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwSY6RFYC7JQXxWqHYbR/Y4v48gJ3gf5lRXHuGiXPdiBxdCLQ1qAW8e4kcFbfqgHXggViuE X-Received: by 2002:a05:6638:16d4:: with SMTP id g20mr16892625jat.22.1632652630802; Sun, 26 Sep 2021 03:37:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632652630; cv=none; d=google.com; s=arc-20160816; b=jhA0EFzksZNSk0mBTEXzxYMGLE9GPswKeWjz6Xl9GjT3O/1OozYlafi1JxWK3hgq9N 1qiWFIcfwPFbJFBEIc3AdIYu7CZinUqmLe8pGlGUcYRpo71qqtSJDkMxv5fEdINpLQEF cs49BJ8tP+exffowz293cGzGyCawyqbFoBJHxJB7d+pWTaCaw/gV79N7nxd+82RJGq5p k+5B78sDn8U+oK3FIP88DMLqmoXkVUlM3aZyRTim/XuIJVz3ruIJshURJ5sRQMEIBcFw NyGvXRAHc5bQcxVwU2IWYXfnw/ziuQl6O7soXWz3zjVUUIoCeP+QF2WFTDg9bv/8mVhP c5mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=xjIlH6huUBUtPHOqwVDeMhWoi9SPzuIyzYgqU2usCVw=; b=L8tuUtp1Lx6aT/VGVSBl5zr+azXtPdDi9N9W4GRu870eettuph1/oLZjOJHE+2AIZP xZHkFdFLosrOvPjIfUO4FjS473diUbG0rtmmCsR63e5qjmu6c35ZJR82Ro9H8/lZsrqz xh8j+G71ye6G0x2vX9z+K0itk6ELpnWGVHrWM3r1pIC8WMc6myT2SWGePQdj9aOMtRUF ozrQF1xqyZJn2SIOtxSKJaVoeQssFEMyHRtC8qjHGlY+mLZn+jFb7WjGsVplldyrVV/v BuCOLBaLbtzBYn2At3PWpHRArSjZnnGpCynTb0Z3g4WKKhNyI9icUKlB9EnvuSJREmFF hHiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=ZR9azYZc; 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=quicinc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y5si5678959ill.73.2021.09.26.03.36.59; Sun, 26 Sep 2021 03:37:10 -0700 (PDT) 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=@quicinc.com header.s=qcdkim header.b=ZR9azYZc; 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=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230123AbhIZKhz (ORCPT + 99 others); Sun, 26 Sep 2021 06:37:55 -0400 Received: from alexa-out.qualcomm.com ([129.46.98.28]:54518 "EHLO alexa-out.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230025AbhIZKhy (ORCPT ); Sun, 26 Sep 2021 06:37:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1632652578; x=1664188578; h=from:to:cc:subject:date:message-id:mime-version; bh=xjIlH6huUBUtPHOqwVDeMhWoi9SPzuIyzYgqU2usCVw=; b=ZR9azYZcnkxa1FZTR77g4gvZEkuKzkic/iZV+IqBzAPXJl7tvt74anyF 52hKsengHn58YAitx3tk13MSx1HOOlOOlSWOMWE7VGD4YGJjfZQMfouI0 8w71GzwvIgJ8EvQ2+0m8U4gTmc6wbpIEDyqxBu+U1m01wQjWZg+nRV4K9 U=; 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 Content-Type: text/plain 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) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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); -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project