From patchwork Mon Aug 17 15:13:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 247868 Delivered-To: patch@linaro.org Received: by 2002:a54:3b12:0:0:0:0:0 with SMTP id j18csp2590506ect; Mon, 17 Aug 2020 12:33:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzxgRJ999GzyHFHwvZnDnFqGMRRNnGnesvGS8Xaaj0Q+MKyh29y1IkL9dQYagWg+okArHH2 X-Received: by 2002:a50:fb14:: with SMTP id d20mr15855855edq.191.1597692837912; Mon, 17 Aug 2020 12:33:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597692837; cv=none; d=google.com; s=arc-20160816; b=SXAC2u2tAGfj4Vl1dN5BRcmdmYyDuRDGg7bO4xkarCHwGkCW1ZX//4CQQgyV9TNI5I Ti20cIblCLYo8atWD8Brd0zDoddENIzxZVDGLoi7MSmkgJ349dsVBm08arwojdOw0eb1 ptgpumInnvFtUn4rudPfOA4xVu16Xa6BEGt+2K6PvUq5xyfRbJf3QXhJWTG0cFZ3+C6a 6Xki9r2sLABb8GYXgk66Ocu6AhBkFWAH4qdiL5q6sqLyjnhOVXMxfhY7dXmX5OEsJvVC jIrq1cWyRlalnG3VOyDGeCNF9p7O8ggSVIku91y90t0d0uSWi1ym0aRcunaUVa0yw6MY wq7g== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=TWZU0dVDledjFKIBGWGoNkeTXocH4n8hLk5kk/uxws8=; b=g7xCMMhS4xODD1WMyY99wvbe6Zvx/+P8M5lbxo21xDFUgFmQJ0T7TO925KBBzR2iTN ibVOqQIltKwl6khYaM87U+47xbOLNhbbXlxpm3id6EADbqC4vM6AFOebFZBnRtaMJnTX 4PEd+ZR7G+TkkoDI80IJjqQDWLehE+9rt0IAx9AXYbBlFDsf4YdXan8Ek5obktgXCVdM oHhr1Ka1wJf2kJHLjNLrYUjBwP73GgWtxUtqC8PGQetEyOy4FpCHi+sWkwwy1CVpMYlC uLnkTqbFJiCuT31HGCbhNjtRFOw6ehvAcAprSMqKb8PTEVX7L4+ixdEErb67XJvhVfZt tMiQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=aEQKWonu; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 39si12242982edq.552.2020.08.17.12.33.57; Mon, 17 Aug 2020 12:33:57 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=aEQKWonu; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S1730194AbgHQPaj (ORCPT + 15 others); Mon, 17 Aug 2020 11:30:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:52428 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729877AbgHQPah (ORCPT ); Mon, 17 Aug 2020 11:30:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 DC4C023132; Mon, 17 Aug 2020 15:30:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597678236; bh=ZebZqfa4CbDT7jXcsMVa+Nj/+qCStPKrWCWUJDF7bJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=aEQKWonuUEEwPt4gW+OuVVbCYdxegyy7dQURK0vmAngSp/JY7n8IyUmw62jqzFQFy 1v9PD8kd3Zs7IWQN4ShJkfLCN7GZlNyXzxLEUtHaNvDW15giufSIEhyEzIPipQIeyc 9Q7ZeJJ/fA+D32u8C1VNcj7jsYKfsx4ZIvcTNmk8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Poirier , Mike Leach , Suzuki K Poulose , Sasha Levin Subject: [PATCH 5.8 265/464] coresight: etm4x: Fix save/restore during cpu idle Date: Mon, 17 Aug 2020 17:13:38 +0200 Message-Id: <20200817143846.482976503@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143833.737102804@linuxfoundation.org> References: <20200817143833.737102804@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Suzuki K Poulose [ Upstream commit 342c8a1d1d9e418d32fa02d635cf96989f9a986e ] The ETM state save/restore incorrectly reads/writes some of the 64bit registers (e.g, address comparators, vmid/cid comparators etc.) using 32bit accesses. Ensure we use the appropriate width accessors for the registers. Fixes: f188b5e76aae ("coresight: etm4x: Save/restore state across CPU low power states") Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20200716175746.3338735-18-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/hwtracing/coresight/coresight-etm4x.c | 16 ++++++++-------- drivers/hwtracing/coresight/coresight-etm4x.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) -- 2.25.1 diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 007d7c6e91f48..6089c481f8f19 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -1202,8 +1202,8 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) } for (i = 0; i < drvdata->nr_addr_cmp * 2; i++) { - state->trcacvr[i] = readl(drvdata->base + TRCACVRn(i)); - state->trcacatr[i] = readl(drvdata->base + TRCACATRn(i)); + state->trcacvr[i] = readq(drvdata->base + TRCACVRn(i)); + state->trcacatr[i] = readq(drvdata->base + TRCACATRn(i)); } /* @@ -1214,10 +1214,10 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) */ for (i = 0; i < drvdata->numcidc; i++) - state->trccidcvr[i] = readl(drvdata->base + TRCCIDCVRn(i)); + state->trccidcvr[i] = readq(drvdata->base + TRCCIDCVRn(i)); for (i = 0; i < drvdata->numvmidc; i++) - state->trcvmidcvr[i] = readl(drvdata->base + TRCVMIDCVRn(i)); + state->trcvmidcvr[i] = readq(drvdata->base + TRCVMIDCVRn(i)); state->trccidcctlr0 = readl(drvdata->base + TRCCIDCCTLR0); state->trccidcctlr1 = readl(drvdata->base + TRCCIDCCTLR1); @@ -1315,18 +1315,18 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) } for (i = 0; i < drvdata->nr_addr_cmp * 2; i++) { - writel_relaxed(state->trcacvr[i], + writeq_relaxed(state->trcacvr[i], drvdata->base + TRCACVRn(i)); - writel_relaxed(state->trcacatr[i], + writeq_relaxed(state->trcacatr[i], drvdata->base + TRCACATRn(i)); } for (i = 0; i < drvdata->numcidc; i++) - writel_relaxed(state->trccidcvr[i], + writeq_relaxed(state->trccidcvr[i], drvdata->base + TRCCIDCVRn(i)); for (i = 0; i < drvdata->numvmidc; i++) - writel_relaxed(state->trcvmidcvr[i], + writeq_relaxed(state->trcvmidcvr[i], drvdata->base + TRCVMIDCVRn(i)); writel_relaxed(state->trccidcctlr0, drvdata->base + TRCCIDCCTLR0); diff --git a/drivers/hwtracing/coresight/coresight-etm4x.h b/drivers/hwtracing/coresight/coresight-etm4x.h index b0d633daf7162..47729e04aac72 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.h +++ b/drivers/hwtracing/coresight/coresight-etm4x.h @@ -334,7 +334,7 @@ struct etmv4_save_state { u64 trcacvr[ETM_MAX_SINGLE_ADDR_CMP]; u64 trcacatr[ETM_MAX_SINGLE_ADDR_CMP]; u64 trccidcvr[ETMv4_MAX_CTXID_CMP]; - u32 trcvmidcvr[ETM_MAX_VMID_CMP]; + u64 trcvmidcvr[ETM_MAX_VMID_CMP]; u32 trccidcctlr0; u32 trccidcctlr1; u32 trcvmidcctlr0;