From patchwork Thu Feb 18 00:51:50 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 8344291 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5F2ACC0553 for ; Thu, 18 Feb 2016 00:56:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CEE5A2021A for ; Thu, 18 Feb 2016 00:56:45 +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 CB7BA20398 for ; Thu, 18 Feb 2016 00:56:38 +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 1aWCrr-00065u-Rk; Thu, 18 Feb 2016 00:54:51 +0000 Received: from mail-ob0-x236.google.com ([2607:f8b0:4003:c01::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aWCpg-0004cC-7v for linux-arm-kernel@lists.infradead.org; Thu, 18 Feb 2016 00:52:39 +0000 Received: by mail-ob0-x236.google.com with SMTP id wb13so43108622obb.1 for ; Wed, 17 Feb 2016 16:52:15 -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=uZVRcryCkeWxj99g2k6mmwgfSRna2CubH5bWqtSBdy4=; b=Ch6x9IFAAzWKwHRl3qb2WropcaXr2McbjXsxLGRI561S2pcOD0ly1F5ZA49NuWq9Cz K7MwfWWix1dZxU06Wo4anatKWHmjXK2h47sg9QydXn8TG5f7k7t/gxeRJYNj9DBlvdeL elTtauLt84LTh7926d5MlQ6cTHSUuDY0g2E7Y= 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=uZVRcryCkeWxj99g2k6mmwgfSRna2CubH5bWqtSBdy4=; b=HLcVVNc0zkTlXZoXrnnt8WbMgX0zfkLEOeHf+trqDD++7NTtHpf8GDZ1Q9zIh/ktaP vo/RV2dAkC3zhLHqKP68mxUOFkgP8Sy51SeuFJVgOyRi7akHhaBKObR7doMTaG+e+YbY D4nLJL3Nz06CoIqsjr0Q38QK4HXpyr7wEWNRPmWJxRdFLeuXUr1J/K8kVYXtUxdF21S/ PaC6PFYJrG+dXZn7XX0rucG8/AzgPxS08x7uMKiq5dK5xg1vdz277KqKG8SZ63rDalpj GC3xPQLhsYPr7O6g7crSwvk10+GRPJbyApYJJaqdiPEjEo+mpvXDm04gKNcb2g4xXyEE VOEg== X-Gm-Message-State: AG10YORi/woMxSPJKWX17EVkvZ0dQhtklB+Wbv6rgZXI/jFRhEIgGL3wN9MN1/lnyBPqlTjJ X-Received: by 10.202.83.142 with SMTP id h136mr3615966oib.131.1455756735464; Wed, 17 Feb 2016 16:52:15 -0800 (PST) Received: from t430.globalsuite.net (h58.159.185.173.static.ip.windstream.net. [173.185.159.58]) by smtp.gmail.com with ESMTPSA id gi5sm2357650obb.6.2016.02.17.16.52.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Feb 2016 16:52:14 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 08/21] coresight: etm3x: unlocking tracers in default arch init Date: Wed, 17 Feb 2016 17:51:50 -0700 Message-Id: <1455756723-8456-9-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455756723-8456-1-git-send-email-mathieu.poirier@linaro.org> References: <1455756723-8456-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160217_165236_576288_D0D15E20 X-CRM114-Status: GOOD ( 14.08 ) 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: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.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 Calling function 'smp_call_function_single()' to unlock a tracer and calling it again right after to perform the default initialisation doesn't make sense. Moving 'etm_os_unlock()' just before making the default initialisation results in the same outcome while saving one call to 'smp_call_function_single()'. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm3x.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index 6ea35b350958..f2c74bb56993 100644 --- a/drivers/hwtracing/coresight/coresight-etm3x.c +++ b/drivers/hwtracing/coresight/coresight-etm3x.c @@ -47,11 +47,11 @@ static struct etm_drvdata *etmdrvdata[NR_CPUS]; * and OS lock must be unlocked before any memory mapped access on such * processors, otherwise memory mapped reads/writes will be invalid. */ -static void etm_os_unlock(void *info) +static void etm_os_unlock(struct etm_drvdata *drvdata) { - struct etm_drvdata *drvdata = (struct etm_drvdata *)info; /* Writing any value to ETMOSLAR unlocks the trace registers */ etm_writel(drvdata, 0x0, ETMOSLAR); + drvdata->os_unlock = true; isb(); } @@ -483,6 +483,9 @@ static void etm_init_arch_data(void *info) u32 etmccr; struct etm_drvdata *drvdata = info; + /* Make sure all registers are accessible */ + etm_os_unlock(drvdata); + CS_UNLOCK(drvdata->base); /* First dummy read */ @@ -607,9 +610,6 @@ static int etm_probe(struct amba_device *adev, const struct amba_id *id) get_online_cpus(); etmdrvdata[drvdata->cpu] = drvdata; - if (!smp_call_function_single(drvdata->cpu, etm_os_unlock, drvdata, 1)) - drvdata->os_unlock = true; - if (smp_call_function_single(drvdata->cpu, etm_init_arch_data, drvdata, 1)) dev_err(dev, "ETM arch init failed\n");