Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5877179pxu; Wed, 23 Dec 2020 07:38:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJy2ylDrRBXvWEeAyeEnCEiF7CsRC9tcPZkohpAwuu8z6izaE3g3eKsBUx2zbuL0KIgg4WL1 X-Received: by 2002:a50:ee1a:: with SMTP id g26mr25327586eds.68.1608737882591; Wed, 23 Dec 2020 07:38:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608737882; cv=none; d=google.com; s=arc-20160816; b=el1yXgJLL+6M6q8ymc2gXptwTKzIHpOKzOPF2zQz/c907tYBhvX3Zy6WwfMnOGvsGX DStioMa9TbDf0x9Jse3N3qASmlzL5gb4FfsLOs8zYZMhorGpCQvydAyffwnvb6a4Gp5M hJf1LYLnq3hCujIu5Fz7P/wQxFDbvouP79CiyFOfFWr76jPU1Pc0i67DEz+aLDgyyYPu r7l3blJGVi34mAQSTCsX/m1MhfTBSHjJPp/dbKonoYxykg9gqbex/mMuQ4DSFeyEeX27 myfxosDj21lmRVYy9WXHilyVT0jWCz/cmizC3mVUYlnaCwlvRHQSxtsnIawF69uf42Z2 rfnA== 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=ddEin7ho+v+RMsKVCVQoyohXiB8jXNjNvEzAfShwGZI=; b=HcdBZycQgsjXxOd+/GcfWMaQMv4RkBaXfiJfw90VRcNGNO64F2BO+F9C+z5D6jNX2V jHlTfO0wWQz/Lh1/Z0Hp9hk6NbZHWwt/MyNXr5krVzQpoRJ/0metduCKLhwXjlhUzbQ7 qw0gr2JfefcSGsSEGa2AWMi+KZiYn3sZoIVHWfajCMYdL6FZWmkLub3lwmEXfc2AIFap kEULK6IGUnfKg2VtoWss3/D0AQVNdUzA9j/K5fPGAHePvlMhosgScV5tZ7y3jkarLch0 uks1stVZyhakM7wG9QW24e3V19iPXYgrk7NMYp/6kvyryHg8KY3n8WtTaQVn6UI7cWPx +L5A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cRJtrii2; 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 e17si13490421edr.527.2020.12.23.07.37.40; Wed, 23 Dec 2020 07:38:02 -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=cRJtrii2; 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 S1728641AbgLWPeP (ORCPT + 99 others); Wed, 23 Dec 2020 10:34:15 -0500 Received: from mail.kernel.org ([198.145.29.99]:45138 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728588AbgLWPeM (ORCPT ); Wed, 23 Dec 2020 10:34:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AD84E23381; Wed, 23 Dec 2020 15:33:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1608737591; bh=ZedZKbMJqx55QuPuIzHkL77G2DoZZJhKEZNIs1Nag8U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cRJtrii21ZsqCvOOFNae6uji8wfvn3gwqNlD2ogoDN/sTBLzYeFomjiOcl9CtTPs7 sZR+2tgW/tKPV7Jvx2QgkQUuRIuDhIfckv6FZLx6vb66uWdpRAlaNkSYV1/lNImQO4 OtfOEJb5OWu/pms/xCnQCdhNB6tlflTHvw/mMnDU= 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 21/40] coresight: etm4x: Fix accesses to TRCCIDCTLR1 Date: Wed, 23 Dec 2020 16:33:22 +0100 Message-Id: <20201223150516.566047670@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 f2603b22e3d2dcffd8b0736e5c68df497af6bc84 upstream. The TRCCIDCTLR1 is only implemented if TRCIDR4.NUMCIDC > 4. Don't touch the register if it is not implemented. 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-5-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 @@ -187,7 +187,8 @@ static int etm4_enable_hw(struct etmv4_d writeq_relaxed(config->ctxid_pid[i], drvdata->base + TRCCIDCVRn(i)); writel_relaxed(config->ctxid_mask0, drvdata->base + TRCCIDCCTLR0); - writel_relaxed(config->ctxid_mask1, drvdata->base + TRCCIDCCTLR1); + if (drvdata->numcidc > 4) + writel_relaxed(config->ctxid_mask1, drvdata->base + TRCCIDCCTLR1); for (i = 0; i < drvdata->numvmidc; i++) writeq_relaxed(config->vmid_val[i], @@ -1241,7 +1242,8 @@ static int etm4_cpu_save(struct etmv4_dr state->trcvmidcvr[i] = readq(drvdata->base + TRCVMIDCVRn(i)); state->trccidcctlr0 = readl(drvdata->base + TRCCIDCCTLR0); - state->trccidcctlr1 = readl(drvdata->base + TRCCIDCCTLR1); + if (drvdata->numcidc > 4) + state->trccidcctlr1 = readl(drvdata->base + TRCCIDCCTLR1); state->trcvmidcctlr0 = readl(drvdata->base + TRCVMIDCCTLR0); if (drvdata->numvmidc > 4) @@ -1352,7 +1354,8 @@ static void etm4_cpu_restore(struct etmv drvdata->base + TRCVMIDCVRn(i)); writel_relaxed(state->trccidcctlr0, drvdata->base + TRCCIDCCTLR0); - writel_relaxed(state->trccidcctlr1, drvdata->base + TRCCIDCCTLR1); + if (drvdata->numcidc > 4) + writel_relaxed(state->trccidcctlr1, drvdata->base + TRCCIDCCTLR1); writel_relaxed(state->trcvmidcctlr0, drvdata->base + TRCVMIDCCTLR0); if (drvdata->numvmidc > 4)