Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp259283pxx; Wed, 28 Oct 2020 04:20:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwU0eEaFTZPiNSvthwUpcKH0kLGMLJP+F3V8Az+mmm1xnDDSb9PcyaoRmirCwwnsNylhr/1 X-Received: by 2002:a17:907:2677:: with SMTP id ci23mr6959175ejc.270.1603884010658; Wed, 28 Oct 2020 04:20:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603884010; cv=none; d=google.com; s=arc-20160816; b=raa+yh9xK7HopGqrKqc3De4emWA8jHdBKV/zVoYzUSb9zcnovFL548ctK1Nm/2X1Lu eTf2ZcQiR+o0mlNPyDi1kybAe94xXt8p+nONyOWsj1sgvfdTkVnB72SC7RmkleJM6Dk+ zzlhpVb2ukyFDL7W3n3yQzHfYs6/1snLn/luJZRnq79QYg4eAtyTMJKnOWM9KyZ7xBzV 2S5irmNuVxtDx7lRxzmKs/tQ3Vo0emcmh4SRPjDyfoi53yeiw6jYxj/yGb+7MHrhcK/v Sv1ElU+NvSSUKUMd0oh6TFq3rPxiSr3POpIuX2o52Fx7qL7NkAHfVDxb5K7coG8pI7Rt c2Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=hlX4cMs7D9dPYLr7Zs1chrVMQM3N85lzb0OOrQi9hQs=; b=AuwQ9zLg9sGkDcI+oENUxwSmCRQJJKOR2YXWGLCSswFOPAExd2L0RsM0uXBjLobSZh wrsW6yIeSUjUM2MEH4rmV6Xp/UHFHZ/CjmaRTjgbPyLulVOZG7+tLbCayr8SfsvM33gq tyNI9YMnwdWcabTb+LHJTR1KyDbPcqKyet5+hF8mJMa2gEKMyFlmF97E79vIIN3a535L NKq2lJbHDSZL2S0AfFS8wx6W8KUU3OKwItp59Zugd488o7xo9EyoSVIjjDXIhkwObMv/ 0INNA0DX8MXN0MmZ6Z6aqi4r8nZN8Kw1QbsxuKH6tEMQXxxmwPoCHFXEmlFBH61uJu3d BDbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=guNYtDzM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jr1si3058858ejb.164.2020.10.28.04.19.48; Wed, 28 Oct 2020 04:20: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=@kernel.org header.s=default header.b=guNYtDzM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1789330AbgJ0PBz (ORCPT + 99 others); Tue, 27 Oct 2020 11:01:55 -0400 Received: from mail.kernel.org ([198.145.29.99]:59926 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1783610AbgJ0O6b (ORCPT ); Tue, 27 Oct 2020 10:58:31 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 78F19223FB; Tue, 27 Oct 2020 14:58:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810711; bh=70cIyWmGeRFSy4VJs/77CDY3anM54CAtlGO4o3NQJxE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=guNYtDzMQPw92IQsGpAvlzW8895Ory/afnYmn+2cH+hqlDCUXFTV9eKgfGTCmy607 VW6EKbDgGJiet9zjwB2+RczRZMEcWeAgRUFdQEVouvFye02f0auR9A/xyi+wneo8Db GLg2Prgj1wwjkD6SKKXGl9C/KIuQNh5vJ9gFwzkQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Poirier , Suzuki K Poulose , Mike Leach , Shaokun Zhang , Jonathan Zhou , Sasha Levin Subject: [PATCH 5.8 236/633] coresight: etm4x: Fix issues on trcseqevr access Date: Tue, 27 Oct 2020 14:49:39 +0100 Message-Id: <20201027135533.754830688@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jonathan Zhou [ Upstream commit 4cd83037cd957ad97756055355ab4ee63f259380 ] The TRCSEQEVR(3) is reserved, using '@nrseqstate - 1' instead to avoid accessing the reserved register. Fixes: f188b5e76aae ("coresight: etm4x: Save/restore state across CPU low power states") Cc: Mathieu Poirier Cc: Suzuki K Poulose Cc: Mike Leach Cc: Shaokun Zhang Signed-off-by: Jonathan Zhou [Fixed capital letter in title] Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200916191737.4001561-12-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/hwtracing/coresight/coresight-etm4x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 7a247273b7e0a..d6395aeffd99d 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -1189,7 +1189,7 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) state->trcvdsacctlr = readl(drvdata->base + TRCVDSACCTLR); state->trcvdarcctlr = readl(drvdata->base + TRCVDARCCTLR); - for (i = 0; i < drvdata->nrseqstate; i++) + for (i = 0; i < drvdata->nrseqstate - 1; i++) state->trcseqevr[i] = readl(drvdata->base + TRCSEQEVRn(i)); state->trcseqrstevr = readl(drvdata->base + TRCSEQRSTEVR); @@ -1294,7 +1294,7 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) writel_relaxed(state->trcvdsacctlr, drvdata->base + TRCVDSACCTLR); writel_relaxed(state->trcvdarcctlr, drvdata->base + TRCVDARCCTLR); - for (i = 0; i < drvdata->nrseqstate; i++) + for (i = 0; i < drvdata->nrseqstate - 1; i++) writel_relaxed(state->trcseqevr[i], drvdata->base + TRCSEQEVRn(i)); -- 2.25.1