From patchwork Mon Feb 29 18:54:24 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 63245 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp1415052lbc; Mon, 29 Feb 2016 10:56:55 -0800 (PST) X-Received: by 10.66.97.101 with SMTP id dz5mr24209763pab.61.1456772215775; Mon, 29 Feb 2016 10:56:55 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d80si18721010pfj.215.2016.02.29.10.56.55; Mon, 29 Feb 2016 10:56:55 -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 S1754153AbcB2S4u (ORCPT + 30 others); Mon, 29 Feb 2016 13:56:50 -0500 Received: from mail-pf0-f182.google.com ([209.85.192.182]:34070 "EHLO mail-pf0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753001AbcB2Syu (ORCPT ); Mon, 29 Feb 2016 13:54:50 -0500 Received: by mail-pf0-f182.google.com with SMTP id 4so18584309pfd.1 for ; Mon, 29 Feb 2016 10:54:50 -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=Fbz+U45rKf+4H2KXgCvR+VOXAdJWeKy4krYbzimXnUY=; b=DldcbAnB+UWf1+sgOFG53DtWb7sGXcfvM/o5e4xSM8gpxHc9YiTjNmInLb5wGFith/ dhuaTIBNVqc/dS/CXqvIxc+6+YwqkdbhE0j+m5jZ6U7in5rbbyqOjYXNzW0jqb80Q+V3 Nl15kYO+0fgrJk+LyL6TKBqZ7GKKP7kUaxDnw= 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=Fbz+U45rKf+4H2KXgCvR+VOXAdJWeKy4krYbzimXnUY=; b=XWlUmRU/Un+aQZ3CYmxgTzN2jDQ84jO5+Y6JhqHcJ8iXXfDPQ6jxtq2kOICQ3o8vfK DTR94Zknxhu9b4f4SjAsw3bCdLWh0lXImXd6tu4v4+6xsHtrLlph3ygRCec8psyRH1qv JJh16NxUAEE5klVNmXKYm5pbY88SYnyJwX/A/R5KvHfEtX81UmIVcq44MB8v4q/jqeKZ ap+nj2tBbjvqpqgi1Xga13qQYITKVpnp/czVmqTX2mmnvsjjd8B1XS8Af8lD+UUhuJZr bDkb5yHeHgXX+ljtxfAr8cnD81FwcGFN7hx5gNS8J7bkCJDrvqpVFYo71xFhdgqxnu88 IcFg== X-Gm-Message-State: AD7BkJJOOQk+yiyArCh54LT77fjyTiN2nN690HGBprKTv3qwPfqyvsDizytMSISm2xCBTkke X-Received: by 10.98.93.2 with SMTP id r2mr24250889pfb.64.1456772090145; Mon, 29 Feb 2016 10:54:50 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id l24sm39783355pfb.73.2016.02.29.10.54.49 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 29 Feb 2016 10:54:49 -0800 (PST) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com Subject: [PATCH 5/8] coresight: etm4x: unlocking tracers in default arch init Date: Mon, 29 Feb 2016 11:54:24 -0700 Message-Id: <1456772067-18085-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456772067-18085-1-git-send-email-mathieu.poirier@linaro.org> References: <1456772067-18085-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 As with the ETMv3.x driver, calling 'smp_call_function_single()' twice in a row is highly ineffective. As such moving function 'etm4_os_unlock()' before the default initialisation takes place, which results in the same outcome. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm4x.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) -- 2.1.4 diff --git a/drivers/hwtracing/coresight/coresight-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 6fd554f10ba5..4b83a753256b 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -45,12 +45,11 @@ module_param_named(boot_enable, boot_enable, int, S_IRUGO); static int etm4_count; static struct etmv4_drvdata *etmdrvdata[NR_CPUS]; -static void etm4_os_unlock(void *info) +static void etm4_os_unlock(struct etmv4_drvdata *drvdata) { - struct etmv4_drvdata *drvdata = (struct etmv4_drvdata *)info; - /* Writing any value to ETMOSLAR unlocks the trace registers */ writel_relaxed(0x0, drvdata->base + TRCOSLAR); + drvdata->os_unlock = true; isb(); } @@ -287,6 +286,9 @@ static void etm4_init_arch_data(void *info) u32 etmidr5; struct etmv4_drvdata *drvdata = info; + /* Make sure all registers are accessible */ + etm4_os_unlock(drvdata); + CS_UNLOCK(drvdata->base); /* find all capabilities of the tracing unit */ @@ -604,9 +606,6 @@ static int etm4_probe(struct amba_device *adev, const struct amba_id *id) get_online_cpus(); etmdrvdata[drvdata->cpu] = drvdata; - if (!smp_call_function_single(drvdata->cpu, etm4_os_unlock, drvdata, 1)) - drvdata->os_unlock = true; - if (smp_call_function_single(drvdata->cpu, etm4_init_arch_data, drvdata, 1)) dev_err(dev, "ETM arch init failed\n");