From patchwork Fri Nov 27 17:52:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 11936979 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 B900DC3E8C5 for ; Fri, 27 Nov 2020 17:55:11 +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 6DC962224A for ; Fri, 27 Nov 2020 17:55:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ioosCusw"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="d2rAkHuw" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6DC962224A 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=xVicac+6voBNqkgSXQtrgL3DFN3s8SVC+JnPym9SNZ0=; b=ioosCuswSPCQPpM0qrUCnIyae rz55yOOPtnzP5dXzuExlb2hcsz3CEGMJjTMtHQGxjyBuBgM766uiuTG8jnaVPDO+2wQ/zAHOFa5+3 fzjeaDf8AhnYIFbVglq50H7swLkJhFzkrXo1JItwrRNcJcO/eBZBMTEOGfxV2xGVUEJyZDWq9MLW/ 19JZPKYPuT2yNnzw9B7Cq8N584l86rKee95QmKBPnNwvh3tCDf9O4GUC5MQYsT01lU6ZLidiZCdwk Yvev7dULTTriZtCGM4GDVgHFcjlJzCyTSB7p3VIRZKjn0Yx+BSecCo5kWYvY5ZmJoRNHBOWSsNm1b quvEgnHbA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kihw2-0004ks-Vz; Fri, 27 Nov 2020 17:53:31 +0000 Received: from mail-pf1-x441.google.com ([2607:f8b0:4864:20::441]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kihve-0004cG-S8 for linux-arm-kernel@lists.infradead.org; Fri, 27 Nov 2020 17:53:11 +0000 Received: by mail-pf1-x441.google.com with SMTP id t8so5175068pfg.8 for ; Fri, 27 Nov 2020 09:53:05 -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=cid2rogdw3HyRMBHSUqYcWLnZZWMdByPGWRumoY2L3E=; b=d2rAkHuwXjfII83cJZ8mHH/OZZOJtv/Lfz3a0FEiWIQ7/xvX4UjOycMjbHSEOzjJCY sSDx5MOi73q3crZdety8Xe6DXihd6jpsgU2cQ0CfU5NX0FR88K/kPwjggeq/wz88LkN/ EUip0ygyVabW9c8d+cmrswk/TbgcOh7dMPBhKK4Wyd8gCeatcrx8PgXI+tZO18oMlRcl YwB1oeDWEm9XIlBE7NTzOHC29KSNxHkJHlTx3I4/0iLvtUMjRYsIesWPjOmf4PiW1K5j tQ57p+WH1d4rI8u+Ju+sDix5Oy+RwQ44r/sPpnhPQUOowR8vWch75zkR8U4ssFPEH0eh cnuw== 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=cid2rogdw3HyRMBHSUqYcWLnZZWMdByPGWRumoY2L3E=; b=uccXe2IOEaMETWSxda+XTOaRnauko2r2K2eHldHuy1H9tGKcivkZPX/TYY/7hfEgZo 5IF4yMMbc4MIg70FoVCvgu/IInRB5Ho/a1W8hFDFxXuDl/13DOBYW2BrkNhv/2O39hHJ y8sPZJGufZOgcnIEnhtnT8URpIJe3KrBTU6OsdEOIsq1enfLZCpP50jL07jkrmiaT8r3 UUR99rwxDJ3FE6Ao67RUnBkcfDckuhzFqa+OgcwMIexZ5hjO2EMLqI1HcmpmEYlxvh8v gltWZ2wkzT06yxRhjQJ9dFcVJO3D01553exGqYTsa8J3t2yyfACb11IYsDuV3AXDdlxV tolQ== X-Gm-Message-State: AOAM530FFZgArA8Ytnh4LRZV9ZdxUv41/X+5wSDrhNTBAh3hYlLzNx09 x6MDCEJA5ROGKaA/9ef4c0N+T5RB6ffLs84b X-Google-Smtp-Source: ABdhPJzX03QPJ1AncNxktfzMKPvm4FOWCk5HFFLOeENGfPc1NebStysshBIinjjFzCAfMGy6p7wi8Q== X-Received: by 2002:a63:4f03:: with SMTP id d3mr7430174pgb.184.1606499584025; Fri, 27 Nov 2020 09:53:04 -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.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Nov 2020 09:53:03 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 06/15] coresight: etm4x: Fix accesses to TRCPROCSELR Date: Fri, 27 Nov 2020 10:52:47 -0700 Message-Id: <20201127175256.1092685-7-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_125307_017134_785B398A X-CRM114-Status: GOOD ( 13.84 ) 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 TRCPROCSELR is not implemented if the TRCIDR3.NUMPROC == 0. Skip accessing the register in such cases. Cc: stable@vger.kernel.org Cc: Mathieu Poirier Cc: Mike Leach Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x-core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x-core.c b/drivers/hwtracing/coresight/coresight-etm4x-core.c index cbbe755d1d16..28dd278f6d47 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x-core.c +++ b/drivers/hwtracing/coresight/coresight-etm4x-core.c @@ -124,8 +124,8 @@ static int etm4_enable_hw(struct etmv4_drvdata *drvdata) if (coresight_timeout(drvdata->base, TRCSTATR, TRCSTATR_IDLE_BIT, 1)) dev_err(etm_dev, "timeout while waiting for Idle Trace Status\n"); - - writel_relaxed(config->pe_sel, drvdata->base + TRCPROCSELR); + if (drvdata->nr_pe) + writel_relaxed(config->pe_sel, drvdata->base + TRCPROCSELR); writel_relaxed(config->cfg, drvdata->base + TRCCONFIGR); /* nothing specific implemented */ writel_relaxed(0x0, drvdata->base + TRCAUXCTLR); @@ -1185,7 +1185,8 @@ static int etm4_cpu_save(struct etmv4_drvdata *drvdata) state = drvdata->save_state; state->trcprgctlr = readl(drvdata->base + TRCPRGCTLR); - state->trcprocselr = readl(drvdata->base + TRCPROCSELR); + if (drvdata->nr_pe) + state->trcprocselr = readl(drvdata->base + TRCPROCSELR); state->trcconfigr = readl(drvdata->base + TRCCONFIGR); state->trcauxctlr = readl(drvdata->base + TRCAUXCTLR); state->trceventctl0r = readl(drvdata->base + TRCEVENTCTL0R); @@ -1292,7 +1293,8 @@ static void etm4_cpu_restore(struct etmv4_drvdata *drvdata) writel_relaxed(state->trcclaimset, drvdata->base + TRCCLAIMSET); writel_relaxed(state->trcprgctlr, drvdata->base + TRCPRGCTLR); - writel_relaxed(state->trcprocselr, drvdata->base + TRCPROCSELR); + if (drvdata->nr_pe) + writel_relaxed(state->trcprocselr, drvdata->base + TRCPROCSELR); writel_relaxed(state->trcconfigr, drvdata->base + TRCCONFIGR); writel_relaxed(state->trcauxctlr, drvdata->base + TRCAUXCTLR); writel_relaxed(state->trceventctl0r, drvdata->base + TRCEVENTCTL0R);