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: 62151 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp309093lbl; Wed, 17 Feb 2016 16:55:50 -0800 (PST) X-Received: by 10.66.190.229 with SMTP id gt5mr6389342pac.118.1455756950097; Wed, 17 Feb 2016 16:55:50 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c64si5418124pfd.70.2016.02.17.16.55.49; Wed, 17 Feb 2016 16:55:50 -0800 (PST) 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; dkim=pass header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965751AbcBRAzs (ORCPT + 30 others); Wed, 17 Feb 2016 19:55:48 -0500 Received: from mail-ob0-f172.google.com ([209.85.214.172]:35508 "EHLO mail-ob0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1162003AbcBRAwQ (ORCPT ); Wed, 17 Feb 2016 19:52:16 -0500 Received: by mail-ob0-f172.google.com with SMTP id xk3so42921511obc.2 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=QGKARymOcGhFCo269vg+AMohBkA+ySXbyGHdW7CaGyMAUTkEK3doBGFovnEcjZiKGk b/C86KLIYdt3Rdkd0EHnhJH7p2WefGPovxIHv1FZAkLznYTL8myXb17iT5dA5a5ABWMT Bw4oOeL5FODbmN0VKm4wz9o9EGwe2tgpwJwfOHKA5Lsk6rzromC3aWf77KJXD01/rAPv YkApMqpU8Mreu9mN8Kqg3scBVkQddXimIgBLdgrGkeVO11nic3einJEuoUNpqOheO5+b E4lWjsa54/77Ih+EM50lwNmuOSzDT7RYq8Aqe1q17lDksd5rRWXGxN2NquVfwhZcvK9D X3Pw== X-Gm-Message-State: AG10YOTEK8IqR+esl5uGRdFiBAHtP+NRBwNxifbGHcFQ8xAhe7Uvv00SLA6q3zhh4qvaWO4u 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 Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.1.4 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");