Received: by 10.213.65.68 with SMTP id h4csp238655imn; Fri, 23 Mar 2018 03:38:45 -0700 (PDT) X-Google-Smtp-Source: AG47ELsl6h9BQHxPD1MDqsppwUF64Wl9Oc+b2zRK7K3syFjzWhzYPreT/hQ2z/d4F19DCM0hrqKh X-Received: by 10.99.49.19 with SMTP id x19mr6785334pgx.250.1521801525346; Fri, 23 Mar 2018 03:38:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521801525; cv=none; d=google.com; s=arc-20160816; b=PZe7d2QomeoBihZqZAAHgp4kAw7vOWy8BNhpVhMJGwd6y8799ROBvMdHqpM0rOfW17 BtmKzMcU5w1doxtM25iQCA1iZyLIySNgFxD9p5fOpvJLwdvifPFnYYRRmi/gMtUXGn15 nE4gX4RQ9+ZBsOuDskdVS/OX6AGvzY6RU+jWvN+J50KXfzKTrPG/ajU+fDRtN5RbkJss DF3rjrT/yBxTxIgpHTfKSwEwDvZv4KlfblrH07Ilc8lu9I1ohSiIHlGMqa7KeN3J9RuG qyI9ekVxtbUUoVkx1nFpFilzg9MJagGukVJlDZikVMgBOycke5O+wWewSp5QDhywEBnc ljgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=x7+ziCtadCvLkodyaE/E7EsqdVOk/j1l0nzK0wqrPB4=; b=GFDVRHNesZRgNnOV4khLP3js9CtBYGOYnELxlDykARuwIbpZG091+YkiU+PKBi5bVN +16JuF0tEUGDdk/gkLi8SrCz0Pu1yuD0o4AR9qToPNHaiuN3iouQ0V72XycCDhmzVJ41 SRg8G4ZDdcEjRD0gEypHCDjaX5MUiLi1IjL+UJPojaapt94Frl5pCZI8GzWWxPeZlPM4 x+Og9USBssyhOLW3Rv6eJJzQ1RtIBbA/cwmJcfjwGPhHr7cXn+L97jf3OCioiUqiYJm6 terLSDkF3YxVjKQqD270Ew3qQnYhKvQvF82IZDI07kjl68d5jRt3bmq9bXEDE99kjkLb Il1w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t66si6484298pfk.215.2018.03.23.03.38.30; Fri, 23 Mar 2018 03:38:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756175AbeCWKgZ (ORCPT + 99 others); Fri, 23 Mar 2018 06:36:25 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47268 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933836AbeCWKRh (ORCPT ); Fri, 23 Mar 2018 06:17:37 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 980BAEEF; Fri, 23 Mar 2018 10:17:36 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Robert Walker , Mike Leach , Mathieu Poirier , Sasha Levin Subject: [PATCH 4.4 89/97] coresight: Fix disabling of CoreSight TPIU Date: Fri, 23 Mar 2018 10:55:16 +0100 Message-Id: <20180323094202.472118669@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180323094157.535925724@linuxfoundation.org> References: <20180323094157.535925724@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.4-stable review patch. If anyone has any objections, please let me know. ------------------ From: Robert Walker [ Upstream commit 11595db8e17faaa05fadc25746c870e31276962f ] The CoreSight TPIU should be disabled when tracing to other sinks to allow them to operate at full bandwidth. This patch fixes tpiu_disable_hw() to correctly disable the TPIU by configuring the TPIU to stop on flush, initiating a manual flush, waiting for the flush to complete and then waits for the TPIU to indicate it has stopped. Signed-off-by: Robert Walker Tested-by: Mike Leach Signed-off-by: Mathieu Poirier Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/hwtracing/coresight/coresight-tpiu.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) --- a/drivers/hwtracing/coresight/coresight-tpiu.c +++ b/drivers/hwtracing/coresight/coresight-tpiu.c @@ -45,8 +45,11 @@ #define TPIU_ITATBCTR0 0xef8 /** register definition **/ +/* FFSR - 0x300 */ +#define FFSR_FT_STOPPED BIT(1) /* FFCR - 0x304 */ #define FFCR_FON_MAN BIT(6) +#define FFCR_STOP_FI BIT(12) /** * @base: memory mapped base address for this component. @@ -85,10 +88,14 @@ static void tpiu_disable_hw(struct tpiu_ { CS_UNLOCK(drvdata->base); - /* Clear formatter controle reg. */ - writel_relaxed(0x0, drvdata->base + TPIU_FFCR); + /* Clear formatter and stop on flush */ + writel_relaxed(FFCR_STOP_FI, drvdata->base + TPIU_FFCR); /* Generate manual flush */ - writel_relaxed(FFCR_FON_MAN, drvdata->base + TPIU_FFCR); + writel_relaxed(FFCR_STOP_FI | FFCR_FON_MAN, drvdata->base + TPIU_FFCR); + /* Wait for flush to complete */ + coresight_timeout(drvdata->base, TPIU_FFCR, FFCR_FON_MAN, 0); + /* Wait for formatter to stop */ + coresight_timeout(drvdata->base, TPIU_FFSR, FFSR_FT_STOPPED, 1); CS_LOCK(drvdata->base); }