From patchwork Mon Nov 30 02:14:24 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 57400 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1179150lbb; Sun, 29 Nov 2015 18:16:18 -0800 (PST) X-Received: by 10.66.164.196 with SMTP id ys4mr86617230pab.119.1448849778458; Sun, 29 Nov 2015 18:16:18 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id uo3si326358pac.221.2015.11.29.18.16.18; Sun, 29 Nov 2015 18:16:18 -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.20150623.gappssmtp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752929AbbK3CQQ (ORCPT + 28 others); Sun, 29 Nov 2015 21:16:16 -0500 Received: from mail-pa0-f49.google.com ([209.85.220.49]:34951 "EHLO mail-pa0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752295AbbK3CQG (ORCPT ); Sun, 29 Nov 2015 21:16:06 -0500 Received: by pacej9 with SMTP id ej9so167961151pac.2 for ; Sun, 29 Nov 2015 18:16:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=opNICgigpeSegW0fwm8/f/plpXFzA2TOPX65fELAYso=; b=Ij9jP/EcGfdsrR/7ZQk7tdL6MkV55+EBy7vwhsJ85TL6h8ysM9DELiVDvyXZKxcDFo TRFa1QIhX/4QDGll0en1FcqP6O1nXtfvjWbJJ4rhOodYP3sI+3zI8qByl7zfSRzfR3q2 6DeAbsDG/oup/5xuQRJGkUNm78177PqvqKs1Ez+2xK+ZZblwq13j26E5WJF/UDxZCdmr QQbxdP2+G8GMi07Ug4j3Gbs7caffW8tDqEKuqxRKrhYoUPVt+QYTZRPah4Wwd2s3oP6v vwiS8yPmS9NztoWP6xIf9PYncdlXEBN5ehJknFsIQBZQzVnkdSoba3uL//CgDAS52UZJ U6aA== 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=opNICgigpeSegW0fwm8/f/plpXFzA2TOPX65fELAYso=; b=kdFLEc1PJ6VYG9H0N/PAEMP+HQ4ct8PmL36gaMRItO8BwkIcZmt8TJKWsL1ctiAdMr tO4APWy7TMbFwtyzm5OPgP75h6MlF36U6sPkbgliFcO7cZyH7ZpcMgfZN4KMMIHW5fkB T/x+gIJ8oXKHYAKYeozb803YB0V5YRYC5zlfWgMvoT2vXRQv0SeBSoiwtlFUD/02TQyX c4FnaNN0m0KcwDZcsQ+0/S1oGKtVBiwNiNflqa2aSwivSEAQ/FFxWBlDt3+MRZR8Mm0S vciL3lANMcK0RxLj4dfNH7BWhgZHUBpsW0ahlN7Fq1LbjWc2cBfLVmu5PcaopEmWAlLx nACQ== X-Gm-Message-State: ALoCoQkFnEfU4TlkBB1fLa/0XqbOAISEN+ZWQbEOPYzQjQRUdsxAPSKIfC2EdZbF2fMH/3Z3BExq X-Received: by 10.98.15.215 with SMTP id 84mr66849709pfp.49.1448849766014; Sun, 29 Nov 2015 18:16:06 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id n16sm47168818pfa.53.2015.11.29.18.16.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 29 Nov 2015 18:16:05 -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, pawel.moll@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 V5 03/26] coresight: etm3x: unlocking tracers in default arch init Date: Sun, 29 Nov 2015 19:14:24 -0700 Message-Id: <1448849687-5724-4-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1448849687-5724-1-git-send-email-mathieu.poirier@linaro.org> References: <1448849687-5724-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 2a1950d0753d..737b6164f4a5 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(); } @@ -478,6 +478,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 */ @@ -602,9 +605,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");