From patchwork Thu Jul 16 17:57:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11668257 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A19D617C5 for ; Thu, 16 Jul 2020 18:05:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 724352070E for ; Thu, 16 Jul 2020 18:05:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="d7KSFvao"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="n+xtw+U8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 724352070E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3yJgXMo1ecTngqQ8DuiE6SfPV6+SJhq/jsWjWVvfXog=; b=d7KSFvaoeoI1HsXvxY07PhlfO 1NH5mDoxUnhlSkF374W/fDeW4uEkBdhEYcjHobp141OP/rUdFh5sDVQeBhKSH7vl1/Va9ZF7THtYC ec69jQIZTrXLELTwraY5gxPnPk7B727375HTjIYDYv9bkjde35QULIXAkvBmCPBnQzVQHbfvkjgmw pA344bRr3RmtP3pDKszkzrdrAeUc//nFpO/dUKH0tlWOv6+hkuiz3KdjamCxndD7jDrvROK0ewz0V bFO99tOimJvJ8RII8tAFYMH6AG2u/3FO0aQAh5BGEuyKVKnmszup4JnhTxPdkd1Tew9I0Vyb0O1nN U7Dcb4V9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw8BK-0004VA-Nf; Thu, 16 Jul 2020 18:00:30 +0000 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jw894-0003Iu-7V for linux-arm-kernel@lists.infradead.org; Thu, 16 Jul 2020 17:58:13 +0000 Received: by mail-pg1-x543.google.com with SMTP id o13so5229783pgf.0 for ; Thu, 16 Jul 2020 10:58:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U4pO0P/7t2x3XMhQAF12Ntbg1zwFRbA41/6HlrU49KM=; b=n+xtw+U8Q+ljJOBG4f2CisJhYDp+utumcxugE4GXha/wIv7E+tv6gDGUH0B58mGG1+ Btmps1dleZ35BloPER8hd3/1aVlXhbS1Q5SA2A+Ix98T9ZgjixLxT9T84YN1tZ6DaAk8 ZZfo8vedv7K6dBauzu9segHkm+/Vj6+q6ZH6VdSDHjnGv8VpMC6oH4InMI/lBk5yEUJR vCThVYTiOaRveH5vwaMIsX0UBZvGUyW59Oq5csKZfg12RAroE5DZ915CRuZCGjzlqY4x TpJJpGlWdbsudCORPeziUnMeB1SKo/daIQuOmj5/bh3BcYcXMTfQJGkk2h6n5vi+y7wr p4Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U4pO0P/7t2x3XMhQAF12Ntbg1zwFRbA41/6HlrU49KM=; b=XfBwqHnS8UlcXWAR92wn5KaH+I4r//ufKSr43zMZ6Z3fQO69tcVDKGFNkzH8U/SbG8 tt33CIHI3H55UQVZjkssnAj4JcjFq1sXA8UnoiuBddKRsIvGDbnXSRlYMId8qwjUR4w8 B0wPR8yP2qMhpmka6E8WZuL4q8uPayPc+4SLBMzpesl44iO6jayTX/SFmpTw9UnFv0vA jaZIli83blGhsqnKBSYiALZm3MB9XF8XFDOR22NPyOhQS5EcNnaRTwB7g58txYwX9es+ Wu4UagfQd38bZYegq6cGFLUA9BNB6Pe/AlDWvCOJv6hSNtZJ4I336xD+HCTwDuFRyi7B DuCg== X-Gm-Message-State: AOAM533ERsnYWw2cGv4EHYS5S8PL7+TUSZOY8OqK1kPXz3P9CKttx8Y5 trUhxTNKE/hABjJ0PLpSsJWVkA== X-Google-Smtp-Source: ABdhPJxpFrgHN50ogFyNKEUp1pNfg4H8ehNwV4QoFIXVOttjnnobtibo8O/n0umAQwZEf+I3+rLasA== X-Received: by 2002:a62:6446:: with SMTP id y67mr4757651pfb.299.1594922288377; Thu, 16 Jul 2020 10:58:08 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id 83sm5473253pfu.60.2020.07.16.10.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jul 2020 10:58:07 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 17/17] coresight: etm4x: Fix save/restore during cpu idle Date: Thu, 16 Jul 2020 11:57:46 -0600 Message-Id: <20200716175746.3338735-18-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200716175746.3338735-1-mathieu.poirier@linaro.org> References: <20200716175746.3338735-1-mathieu.poirier@linaro.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200716_135810_382471_2843B4BB X-CRM114-Status: GOOD ( 12.02 ) X-Spam-Score: -0.2 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.2 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:543 listed in] [list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: saiprakash.ranjan@codeaurora.org, suzuki.poulose@arm.com, vulab@iscas.ac.cn, tingwei@codeaurora.org, andriy.shevchenko@linux.intel.com, linux-arm-kernel@lists.infradead.org, mike.leach@linaro.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org From: Suzuki K Poulose 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 --- drivers/hwtracing/coresight/coresight-etm4x.c | 16 ++++++++-------- drivers/hwtracing/coresight/coresight-etm4x.h | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 2d732af8b3e7..6d7d2169bfb2 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -1206,8 +1206,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)); } /* @@ -1218,10 +1218,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); @@ -1319,18 +1319,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 7da022e87218..b8283e1d6d88 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;