From patchwork Thu Jan 14 21:46:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 59775 Delivered-To: patch@linaro.org Received: by 10.112.130.2 with SMTP id oa2csp152875lbb; Thu, 14 Jan 2016 13:47:30 -0800 (PST) X-Received: by 10.66.162.9 with SMTP id xw9mr9640010pab.46.1452808048743; Thu, 14 Jan 2016 13:47:28 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id mk9si11612287pab.101.2016.01.14.13.47.28; Thu, 14 Jan 2016 13:47:28 -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 S1754926AbcANVrO (ORCPT + 29 others); Thu, 14 Jan 2016 16:47:14 -0500 Received: from mail-pf0-f174.google.com ([209.85.192.174]:35351 "EHLO mail-pf0-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754822AbcANVrJ (ORCPT ); Thu, 14 Jan 2016 16:47:09 -0500 Received: by mail-pf0-f174.google.com with SMTP id 65so106063847pff.2 for ; Thu, 14 Jan 2016 13:47:09 -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=Joim9IkO9VbDeoV8om7SnIf2b0wymEcGY0yjXYnyUgzPbAHiraSGv7E2gWZOtSznFB jiPTp6ofV4lgr5qMjzlSoOwX7NcmDo1BSyW+p+8q6dQs7BGKY18VG6L9QouSAda+Pl8Q Zx1CoS/0E26mi3aSfRxzIqYmBFGm1NxQXLn64= 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=aKBsL+WI3Yo+mOqm7R3zr7HYXT5Gx95FGIttYai3CyeYAXQ4YA9EvH2yUkew2cZz46 unauQb/uwe3fQxZMboef2ZW7eVc0WeJCESyxdWDIhbnSbGuS5m3x8tKWVra5GoM1BC7b uEGjpq3N/99K7nPJ93ZmDHNW9iq3xIQwpeZHePCt8uEkb1a9VgeJeYQ1gx2q8/U+zups 7FBPnIn7UGhpd81wBXoOGOPLfVYaDyns/8OKvyE4CP5TC4wT1NGCXk0SHtPZvcr+7+N2 2G3EoQXoSnpqkbIwJfqcdA+NcxNlzfnEXs9qOgpZ0cDVrTZFzIsbE0yMa7RaPud+x5nA ZbQw== X-Gm-Message-State: ALoCoQkK4z0NxGp3uOJkL5aFLE+2cDQDDGtnijFjr5m9wmoN6/MXsCHvufA9VsmS3g/r6qso0WHiMfMtNuxs5AFjZrUv6oWN/A== X-Received: by 10.98.75.22 with SMTP id y22mr9669523pfa.147.1452808029385; Thu, 14 Jan 2016 13:47:09 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id c87sm11383309pfj.41.2016.01.14.13.47.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 14 Jan 2016 13:47:08 -0800 (PST) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: linux-doc@vger.kernel.org, zhang.chunyan@linaro.org, mike.leach@arm.com, tor@ti.com, al.grant@arm.com, rabin@rab.in, Mathieu Poirier Subject: [PATCH V8 06/23] coresight: etm3x: unlocking tracers in default arch init Date: Thu, 14 Jan 2016 14:46:00 -0700 Message-Id: <1452807977-8069-7-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452807977-8069-1-git-send-email-mathieu.poirier@linaro.org> References: <1452807977-8069-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 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");