Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5877409pxu; Wed, 23 Dec 2020 07:38:20 -0800 (PST) X-Google-Smtp-Source: ABdhPJwx0ObmOWZhFV9SDW4vfbbp4bsPTIsD8enGxpdnRyFfIVrhXYt9CkSoCmSQJMoPIS/02+9o X-Received: by 2002:a17:906:cecd:: with SMTP id si13mr24294764ejb.441.1608737900211; Wed, 23 Dec 2020 07:38:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608737900; cv=none; d=google.com; s=arc-20160816; b=Prhg/jTwiVfDpVhvTvc9a2O5ipwQbIAk+V6JpcqjkzWsGWwsa9sEcu2AKMTQ88i88f oBsCSqbG5kTBnoLLnXbfrqXAZdCUcwN95hUet+UzH84tUSH3wWuVYGFkwD6Boy7QpZ99 JLcz6fWvZ32+YHwBHZHtrj+gTTDSgSHqrJuLSzyDxTOW4ik3jMvXWz5RiQ1sGHxRAY82 fmw0ABKAX87dibdo4OejEWON20onOEospMm5ZzJ7DJj/TWaB5NBVSmqvm4J2tRmTbXAH mWL2pG34rEHu2ZaP6bH6+4mgKTKWQdiWla2rZbLyhTXfKNccAR02bHgYjGioT2wnjfKx 2f1Q== 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=F+SMwSsKh+gXKpvufogEnDzNxo/f+XTXYBs9Eaq60d4=; b=AJwPEpVYd17cFW6jFIIHMhRuXMxB8cREfrAuDW+CxIg/nRpaczyNkcpNoyDzKSm5WK DTZSYX1Ov3jHrWF0XD4u+FERUw+8SdKUvCz3/jL5OkXI6RPqEsR06tSxEfZXY0Zk8U/k MFPeH5oJI6agy8gZIW7/QuaPjDWAFEzxVoFZspTzzqCT8ERfNmF1mrAoEagl8RkuHmWA KFHP8Ad/vh+eE31WgXxvIh5K7Ny6vTePiz7H/PegaoyJ6Rmaju3X/pdxS/i+LbS7EXR5 TILcFggfxYwZ98reoaFQX+P+6eSMaHyNG3a4c3Q1VvhWkcOjYNna8ZdWs0EODAc1PKJ9 N2sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=IQLI0inS; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gb17si12650685ejc.171.2020.12.23.07.37.57; Wed, 23 Dec 2020 07:38:20 -0800 (PST) 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=@linuxfoundation.org header.s=korg header.b=IQLI0inS; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728463AbgLWPeJ (ORCPT + 99 others); Wed, 23 Dec 2020 10:34:09 -0500 Received: from mail.kernel.org ([198.145.29.99]:44948 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727042AbgLWPeG (ORCPT ); Wed, 23 Dec 2020 10:34:06 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 6B02B23380; Wed, 23 Dec 2020 15:33:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1608737588; bh=VgYlDfnwE0rAZNUK2ngteYoKwutnUt5lyGNuyiPdz5Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IQLI0inSW3coezhYRm8UGW38p8RTcZFchLyLJcae/zfj4nijb/fmjDAnqjdp+6fx8 FdlY+ywpW89eK9QZ6XOsun36Sq6eswkuNkkdNRJzDT996InnRmpDR9LNZpi41PgwJU VWa8HcRE8Y0HREgppMFy0rnSFHJK/Mu//9G49hbU= 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 Subject: [PATCH 5.10 20/40] coresight: etm4x: Fix accesses to TRCVMIDCTLR1 Date: Wed, 23 Dec 2020 16:33:21 +0100 Message-Id: <20201223150516.520852368@linuxfoundation.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20201223150515.553836647@linuxfoundation.org> References: <20201223150515.553836647@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: Suzuki K Poulose commit 93dd64404cbe63b0afba371acd8db36e84b286c7 upstream. TRCVMIDCTRL1 is only implemented only if the TRCIDR4.NUMVMIDC > 4. We must not touch the register otherwise. Cc: stable@vger.kernel.org Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier Link: https://lore.kernel.org/r/20201127175256.1092685-4-mathieu.poirier@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -193,7 +193,8 @@ static int etm4_enable_hw(struct etmv4_d writeq_relaxed(config->vmid_val[i], drvdata->base + TRCVMIDCVRn(i)); writel_relaxed(config->vmid_mask0, drvdata->base + TRCVMIDCCTLR0); - writel_relaxed(config->vmid_mask1, drvdata->base + TRCVMIDCCTLR1); + if (drvdata->numvmidc > 4) + writel_relaxed(config->vmid_mask1, drvdata->base + TRCVMIDCCTLR1); if (!drvdata->skip_power_up) { /* @@ -1243,7 +1244,8 @@ static int etm4_cpu_save(struct etmv4_dr state->trccidcctlr1 = readl(drvdata->base + TRCCIDCCTLR1); state->trcvmidcctlr0 = readl(drvdata->base + TRCVMIDCCTLR0); - state->trcvmidcctlr1 = readl(drvdata->base + TRCVMIDCCTLR1); + if (drvdata->numvmidc > 4) + state->trcvmidcctlr1 = readl(drvdata->base + TRCVMIDCCTLR1); state->trcclaimset = readl(drvdata->base + TRCCLAIMCLR); @@ -1353,7 +1355,8 @@ static void etm4_cpu_restore(struct etmv writel_relaxed(state->trccidcctlr1, drvdata->base + TRCCIDCCTLR1); writel_relaxed(state->trcvmidcctlr0, drvdata->base + TRCVMIDCCTLR0); - writel_relaxed(state->trcvmidcctlr1, drvdata->base + TRCVMIDCCTLR1); + if (drvdata->numvmidc > 4) + writel_relaxed(state->trcvmidcctlr1, drvdata->base + TRCVMIDCCTLR1); writel_relaxed(state->trcclaimset, drvdata->base + TRCCLAIMSET);