From patchwork Mon Feb 29 18:54:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 8457491 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 2B53B9F52D for ; Mon, 29 Feb 2016 18:57:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 448CA201FA for ; Mon, 29 Feb 2016 18:57:54 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A6D2200E6 for ; Mon, 29 Feb 2016 18:57:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaSzW-0005s1-QN; Mon, 29 Feb 2016 18:56:22 +0000 Received: from mail-pf0-x234.google.com ([2607:f8b0:400e:c00::234]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aaSyL-0003bn-Nr for linux-arm-kernel@lists.infradead.org; Mon, 29 Feb 2016 18:55:14 +0000 Received: by mail-pf0-x234.google.com with SMTP id w128so51886873pfb.2 for ; Mon, 29 Feb 2016 10:54:50 -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; bh=Fbz+U45rKf+4H2KXgCvR+VOXAdJWeKy4krYbzimXnUY=; b=DldcbAnB+UWf1+sgOFG53DtWb7sGXcfvM/o5e4xSM8gpxHc9YiTjNmInLb5wGFith/ dhuaTIBNVqc/dS/CXqvIxc+6+YwqkdbhE0j+m5jZ6U7in5rbbyqOjYXNzW0jqb80Q+V3 Nl15kYO+0fgrJk+LyL6TKBqZ7GKKP7kUaxDnw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=Fbz+U45rKf+4H2KXgCvR+VOXAdJWeKy4krYbzimXnUY=; b=NpfIt2ZZnLsSk1YaCIUKkvNpCZaYBMMTt25pLAZXqqlcuzk+ZxS8Gce9P/mxnbXBX3 /DsOMzT0hbJAT5pQqTRSjw5Lkvj1D2i30fnVQ7Bp4AT91VxyxkMaGFrp3eNQNCt+Go3U 0ZUx2O5P+T+Dbyy30k0zh6gP35BIefrmyeMmyz2bIRKpWILdhR1jGf64+F0f5behyumM JnXvcy7p3yIpqdBz3311a5IcpLT8ZI+H7b7LnpW8TLo/BsIjhaodwaN52KvjvkkVacT7 QvNr/x1Ais2IQq2TXXvKohdkctNlKBhwqpaSIX9YdcA1VXJTLYBpJ8eXyFtsN3fHp4KQ 5M9A== X-Gm-Message-State: AD7BkJK+HF5NzDGRhW2IgiPJ2cc5uDBkkzEOqdFoviC2q32n3GskdUbdUAKVWiW0eGH8YaY1 X-Received: by 10.98.93.2 with SMTP id r2mr24250889pfb.64.1456772090145; Mon, 29 Feb 2016 10:54:50 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id l24sm39783355pfb.73.2016.02.29.10.54.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 10:54:49 -0800 (PST) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Subject: [PATCH 5/8] coresight: etm4x: unlocking tracers in default arch init Date: Mon, 29 Feb 2016 11:54:24 -0700 Message-Id: <1456772067-18085-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456772067-18085-1-git-send-email-mathieu.poirier@linaro.org> References: <1456772067-18085-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160229_105510_113095_DFEA99D3 X-CRM114-Status: GOOD ( 13.19 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: alexander.shishkin@linux.intel.com, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP As with the ETMv3.x driver, calling 'smp_call_function_single()' twice in a row is highly ineffective. As such moving function 'etm4_os_unlock()' before the default initialisation takes place, which results in the same outcome. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 6fd554f10ba5..4b83a753256b 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -45,12 +45,11 @@ module_param_named(boot_enable, boot_enable, int, S_IRUGO); static int etm4_count; static struct etmv4_drvdata *etmdrvdata[NR_CPUS]; -static void etm4_os_unlock(void *info) +static void etm4_os_unlock(struct etmv4_drvdata *drvdata) { - struct etmv4_drvdata *drvdata = (struct etmv4_drvdata *)info; - /* Writing any value to ETMOSLAR unlocks the trace registers */ writel_relaxed(0x0, drvdata->base + TRCOSLAR); + drvdata->os_unlock = true; isb(); } @@ -287,6 +286,9 @@ static void etm4_init_arch_data(void *info) u32 etmidr5; struct etmv4_drvdata *drvdata = info; + /* Make sure all registers are accessible */ + etm4_os_unlock(drvdata); + CS_UNLOCK(drvdata->base); /* find all capabilities of the tracing unit */ @@ -604,9 +606,6 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) get_online_cpus(); etmdrvdata[drvdata->cpu] = drvdata; - if (!smp_call_function_single(drvdata->cpu, etm4_os_unlock, drvdata, 1)) - drvdata->os_unlock = true; - if (smp_call_function_single(drvdata->cpu, etm4_init_arch_data, drvdata, 1)) dev_err(dev, "ETM arch init failed\n");