From patchwork Fri Nov 27 17:52:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11936981 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0159CC3E8C5 for ; Fri, 27 Nov 2020 17:55:34 +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 A19422224A for ; Fri, 27 Nov 2020 17:55:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="BOfmEmk1"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="pIpihkDY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A19422224A 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+linux-arm-kernel=archiver.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=J/7o6Nzs5JO0BgQQnYwmHcMx6kiiwM+5+IAyJIvNIU8=; b=BOfmEmk1GeV+079M9nYc41OHg 1J0WZdbM9vMDcW8NjEArHyQjInD91sARLrekv9sqrgNSPz/UlVHunICkpe+oU0aSk4FuA+jYoDWGT COqL0mhaHhJRgU3XrxSrLRzqrsIGYyCcFoTgYxZfj6u3GmQwAP8toP8kqmkBMmAjp9WisRayiU2Ro lyf5HbDA7uq9ij6djNCrKNWlyEmiHF34doNhYdW/O8mRxq5ce336XOJWKf4jhBrMM6u5M3AKkGEoZ WMv8F8ZOxuUH2wQQGfRDDWeD5lkUCdFOhicqxY6gzHHrF6flLkLzM6WcT5C/4clUVx30klVwK3SAw cnwEzWgUw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kihwH-0004pq-FW; Fri, 27 Nov 2020 17:53:45 +0000 Received: from mail-pg1-x542.google.com ([2607:f8b0:4864:20::542]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kihve-0004cd-Oj for linux-arm-kernel@lists.infradead.org; Fri, 27 Nov 2020 17:53:11 +0000 Received: by mail-pg1-x542.google.com with SMTP id k11so4894073pgq.2 for ; Fri, 27 Nov 2020 09:53:06 -0800 (PST) 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=N2E66pa7IBvbk/IdE1gRolkB3YRUxj5SwwwquVUhVR0=; b=pIpihkDY74fXrCHjsuncXZDFXvcA255ISOL8COtoKZArXL9njuSF09wIFKLtgXRBra LmQ1rTvtCDfKDHtgUiQJc21m2l37Sbi1pCQk6ONTWhA7MVRRk6J5PzRLSf2XeieL9NDd h4TLim34tz9UIUjyAQcU5spDp/puUHr46m98GyvNCmWWK9hLZg4lUQBmMMZUNFnpyJ0G 40CnLRiPOCDjT4eToCGN7hbQf4nPu2mzqfULmKq9VyLRY7B5nZSQnM3AgMmfVJ9X7r/T lfcCGY0A41Ci3+uIf/APUkE4BWivszX5SNwT1ZrbN4A1whdVsR7CWoGD4+5eXVRZeANo mzvA== 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=N2E66pa7IBvbk/IdE1gRolkB3YRUxj5SwwwquVUhVR0=; b=SZqbkchvsiIVJhdkWp0Z9oYAUDaBTtnu9aboxV4gzEwuGYs/2tfdOvbOvazWIWTPIK /5Fv6Ty2pyUpken1xW7+0tmK3A6mipk7nB8XYdz+zsLtfJpt6pBEgMGavuWTTQ8sqdtC 103ozbFuw5VsSjKnrbHOSxy6XawV0KM0clYZ/W+B6zDA7wRu0ZuETcmyHomTzXQlFYP/ JcEGU3PSLnMc+xO+PVpn1C4KSqkknx0nKEtRME1blliP363FJ7g7DWJ3TpWCZA51J6gR GPkJIBCB/6eCpx3D/nwPrLMfNp+JR8TVAO4pCAFtQ/q4PU3Px7XPe1z8OW6S+QkX9uoi cFsw== X-Gm-Message-State: AOAM530xGVu8M21EhL8GOjUN5/blKUMbGWBWkcjvqlk1pUdhHa5P459N yA5MlUFx+CXUvRy5xGffrRL5Ng== X-Google-Smtp-Source: ABdhPJzPAsxWzRLEs6bXY5Z3FEYuJROkKzl0rF7LTRBS0/IguKssWrIJfBDcUxZLKLhfC0QwtG0IOQ== X-Received: by 2002:a17:90b:814:: with SMTP id bk20mr11114687pjb.61.1606499585063; Fri, 27 Nov 2020 09:53:05 -0800 (PST) Received: from xps15.cg.shawcable.net (S0106889e681aac74.cg.shawcable.net. [68.147.0.187]) by smtp.gmail.com with ESMTPSA id t18sm10536724pji.1.2020.11.27.09.53.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 09:53:04 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 07/15] coresight: etm4x: Handle TRCVIPCSSCTLR accesses Date: Fri, 27 Nov 2020 10:52:48 -0700 Message-Id: <20201127175256.1092685-8-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201127175256.1092685-1-mathieu.poirier@linaro.org> References: <20201127175256.1092685-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-20201127_125306_956570_B833E14A X-CRM114-Status: GOOD ( 13.94 ) 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Suzuki K Poulose TRCVIPCSSCTLR is not present if the TRCIDR4.NUMPC > 0. Thus we should only access the register if it is present, preventing any undesired behavior. Cc: stable@vger.kernel.org Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index 28dd278f6d47..d78a37b6592c 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -141,8 +141,9 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) writel_relaxed(config->viiectlr, drvdata->base + TRCVIIECTLR); writel_relaxed(config->vissctlr, drvdata->base + TRCVISSCTLR); - writel_relaxed(config->vipcssctlr, - drvdata->base + TRCVIPCSSCTLR); + if (drvdata->nr_pe_cmp) + writel_relaxed(config->vipcssctlr, + drvdata->base + TRCVIPCSSCTLR); for (i = 0; i < drvdata->nrseqstate - 1; i++) writel_relaxed(config->seq_ctrl[i], drvdata->base + TRCSEQEVRn(i)); @@ -1202,7 +1203,8 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) state->trcvictlr = readl(drvdata->base + TRCVICTLR); state->trcviiectlr = readl(drvdata->base + TRCVIIECTLR); state->trcvissctlr = readl(drvdata->base + TRCVISSCTLR); - state->trcvipcssctlr = readl(drvdata->base + TRCVIPCSSCTLR); + if (drvdata->nr_pe_cmp) + state->trcvipcssctlr = readl(drvdata->base + TRCVIPCSSCTLR); state->trcvdctlr = readl(drvdata->base + TRCVDCTLR); state->trcvdsacctlr = readl(drvdata->base + TRCVDSACCTLR); state->trcvdarcctlr = readl(drvdata->base + TRCVDARCCTLR); @@ -1310,7 +1312,8 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) writel_relaxed(state->trcvictlr, drvdata->base + TRCVICTLR); writel_relaxed(state->trcviiectlr, drvdata->base + TRCVIIECTLR); writel_relaxed(state->trcvissctlr, drvdata->base + TRCVISSCTLR); - writel_relaxed(state->trcvipcssctlr, drvdata->base + TRCVIPCSSCTLR); + if (drvdata->nr_pe_cmp) + writel_relaxed(state->trcvipcssctlr, drvdata->base + TRCVIPCSSCTLR); writel_relaxed(state->trcvdctlr, drvdata->base + TRCVDCTLR); writel_relaxed(state->trcvdsacctlr, drvdata->base + TRCVDSACCTLR); writel_relaxed(state->trcvdarcctlr, drvdata->base + TRCVDARCCTLR);