From patchwork Mon Nov 23 18:32:55 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 57171 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1602266lbb; Mon, 23 Nov 2015 10:34:16 -0800 (PST) X-Received: by 10.66.221.42 with SMTP id qb10mr28149249pac.51.1448303655868; Mon, 23 Nov 2015 10:34:15 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s79si21214120pfs.6.2015.11.23.10.34.15; Mon, 23 Nov 2015 10:34:15 -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 S1754841AbbKWSeI (ORCPT + 28 others); Mon, 23 Nov 2015 13:34:08 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:36676 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754665AbbKWSeB (ORCPT ); Mon, 23 Nov 2015 13:34:01 -0500 Received: by pacdm15 with SMTP id dm15so198917637pac.3 for ; Mon, 23 Nov 2015 10:34:01 -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=nzmrJ93ajOSj+P+yxLaJjUx+wT8QG+YR/74S537g75A=; b=chdTYWElmqFjxv69MqgWUMd9fHox34EwW+bskdd8v+dQ3FLy+Bp7tRDfmRp1uAbWVE 8qy3RJPoxnNe642iXRCyu85XWyRFkj+22Q8pBPk0P6uEVRedGFmuZwVmK+Vdf35RB8iU MGNF1Bnb4M3Cva+wiUu5GAm2U2ciwxnrXmXE3wkDbVeAQag7yb8aVyBi6qUktN0eyjTL fdf0vuPrRiBxZpEhZWbtyS2w5eEVNC+wjYnQSIsf7o8tusl58ED657DywoMW6ABo2ZyB 6FNS7LcFO5DSdPZYXU3VQY7gzKsPvQwbW+xjPJAbZzFayEspoNKdKk/eIBF0YIiajlzC 1eyQ== 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=nzmrJ93ajOSj+P+yxLaJjUx+wT8QG+YR/74S537g75A=; b=euTcnF/nnJe1kxJv7+Ctoj0FxYR2DfrfoxSBsVu9Oy2ntJ7muVAXaMbZCnxe/mmYa9 sSmwGMI6JtVRr/d7/cHbUciycYMuLpekjOAMmZLPsn2lhG0rsOQ4vvbGl37rmDchHcZ5 t1zd68Dhrf5Iae1CTjNuOb4+DjSom1zXp3M2dMaVeBWZMKaqkrrmrEX110w5HF1xgIM3 FtZugrMXM6ieRuchkTmdKFi8mzXL1kmTvBzz/Bsbb921QnoJU2HOtj/V0OLoshmEOMl5 Uhccy+s6lLe2OjFVrpyvzTDKF4YS+fC5+lzk47AxcQJwL5zPriWR/H1lBqjvrDdrqdTv L+jQ== X-Gm-Message-State: ALoCoQld5N/eJdWF+srW+WKPRR0a5QjQhej9Mrw9dVGMwEpcdbGwor38nRyGjUpVe2xtd8x9ibYq X-Received: by 10.68.109.196 with SMTP id hu4mr36946954pbb.71.1448303640957; Mon, 23 Nov 2015 10:34:00 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id r20sm10865186pfa.93.2015.11.23.10.33.59 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Nov 2015 10:34:00 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, a.p.zijlstra@chello.nl, alexander.shishkin@linux.intel.com, acme@kernel.org, mingo@redhat.com, corbet@lwn.net, nicolas.pitre@linaro.org 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 Subject: [RESEND PATCH V4 03/26] coresight: etm3x: unlocking tracers in default arch init Date: Mon, 23 Nov 2015 11:32:55 -0700 Message-Id: <1448303598-11249-4-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1448303598-11249-1-git-send-email-mathieu.poirier@linaro.org> References: <1448303598-11249-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(-) -- 1.9.1 -- 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");