From patchwork Fri Dec 18 20:59:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 58733 Delivered-To: patch@linaro.org Received: by 10.112.89.199 with SMTP id bq7csp1267523lbb; Fri, 18 Dec 2015 13:00:04 -0800 (PST) X-Received: by 10.67.5.69 with SMTP id ck5mr8277741pad.125.1450472404626; Fri, 18 Dec 2015 13:00:04 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v22si22162868pfi.241.2015.12.18.13.00.04; Fri, 18 Dec 2015 13:00:04 -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=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965345AbbLRU7z (ORCPT + 29 others); Fri, 18 Dec 2015 15:59:55 -0500 Received: from mail-ig0-f180.google.com ([209.85.213.180]:36866 "EHLO mail-ig0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965289AbbLRU7t (ORCPT ); Fri, 18 Dec 2015 15:59:49 -0500 Received: by mail-ig0-f180.google.com with SMTP id to18so294226igc.0 for ; Fri, 18 Dec 2015 12:59:49 -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=aDjBecOPJrJTpjCk4P0wVzAKoW/KTujnbiI8i5+juHM=; b=AAPP8CMBABE1vYEjY0XrDpFxOGBZx2t7O8JCCYIPgJcdjwxvanQJxb9XavBQdyYX44 Fj9et9RYENFLlKrDwZOcZXclj+vPYx60uRE5TJlYYIw9wv/fKtgU45yI/WAgZ6kR9n8t R9XyIdjFRqdDkv6TXQI48L0kTxlVqj7LYA4hU= 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=aDjBecOPJrJTpjCk4P0wVzAKoW/KTujnbiI8i5+juHM=; b=QdIMfmZHUg8kL9Q1Cu15rfFJ0f3pldxTP9MbkwkY0z2g8zJUxUw1rkgkP0tcq3MiLR S8om7ob11gftHAyabpHhG8tV9K4jiDX5bufo6w6H4EinZaIx3AWPTkZIg31/pJrXXOjh dbp0IsWyAXCD4/ur9Y5KczCek7ux7hzLvPm8aiw0aaskpovmZxCispt4Z5Ec0iLB9xNr z7h9RD35Ldzsb2giLyCUTHKsv+C8PfmvroCUrfeieYZNAjvZz/O+uzAbv7fEQQzC6p0a eF3vQ8/4/uif6V4Vl9i302ibIxNm1NqHNUNurn5Jhc7lwaeygQz3OSCST29GaxSxuvdm 5elA== X-Gm-Message-State: ALoCoQla7wgZ1339q2WcMXa3M/rvc+2X76Fx19J24G+pvYdUIU6Jr+BcTTBxQl22YKOHrBCJ8pV7FL0aOa5275YK4jBrz7noNA== X-Received: by 10.50.142.105 with SMTP id rv9mr5187992igb.72.1450472389210; Fri, 18 Dec 2015 12:59:49 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id l10sm843701igx.18.2015.12.18.12.59.47 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 18 Dec 2015 12:59:48 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com Cc: zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, fainelli@broadcom.com, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Mathieu Poirier Subject: [PATCH V7 07/24] coresight: etm3x: unlocking tracers in default arch init Date: Fri, 18 Dec 2015 13:59:03 -0700 Message-Id: <1450472361-426-8-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1450472361-426-1-git-send-email-mathieu.poirier@linaro.org> References: <1450472361-426-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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/ diff --git a/drivers/hwtracing/coresight/coresight-etm3x.c b/drivers/hwtracing/coresight/coresight-etm3x.c index 042b88ecae92..c383d218d921 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");