From patchwork Fri Nov 13 18:44:54 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 56542 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp1214324lbb; Fri, 13 Nov 2015 10:48:36 -0800 (PST) X-Received: by 10.68.175.66 with SMTP id by2mr34356887pbc.3.1447440516873; Fri, 13 Nov 2015 10:48:36 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id tw1si28910297pab.195.2015.11.13.10.48.36 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Nov 2015 10:48:36 -0800 (PST) Received-SPF: pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) client-ip=2001:1868:205::9; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org designates 2001:1868:205::9 as permitted sender) smtp.mailfrom=linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org; dkim=neutral (body hash did not verify) header.i=@linaro_org.20150623.gappssmtp.com Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZxJNM-0006dg-RA; Fri, 13 Nov 2015 18:47:08 +0000 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZxJMt-0006Fn-9g for linux-arm-kernel@lists.infradead.org; Fri, 13 Nov 2015 18:46:41 +0000 Received: by pacdm15 with SMTP id dm15so107580335pac.3 for ; Fri, 13 Nov 2015 10:46:19 -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=WhVFm7f3mv0a2mY83uiqNdSPXWQYafiDDRvzhtlhkth2tDuwv0lJ4K5byDzwz7TAWe dO4EOvHDevNLTnuI4Kmj3lPl4jq9v439fOk3nih0MckDAzFH0DRXW1+fCjGNwdpXeCzB /GSaRXmLWQ6/rK2yvy2RPcwuYSBvnHEswvFv/9kKf+/U+1+tbhnOC4tWh3R/VF0hIOiz MVFPGW+5FD4PL1jkSZW1M0AaFUuszTNohsragT5AZetSVo1qOGb4hVVOAuQdwN3qIhJR eCLsiayVWE+jLJb/7HrzdLukuzRVnWvo/9feJIZ+xp/Xnc2nOMIKUJInnBOihIszClR7 2L+Q== 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=bc1U7luzGH8Uc8QudeUzgetFoGDTm3UYIpqHjxfYiRyfeVMf8INyHUU8AO/d+SSYzi mlMHAaEb56bJo8eaclZMVBsN4JJVst1ok8XofRPs5lP6vfoz+vJrAaSfZxEFmwk2pXPY lK0kCEdnIUAAISvDH7g7jR0uBUeI85OHj0Jp4zIqM+fm7vr+F89dUscWpqoTx9zaZO5c 8popBnvs5qtde+mfAXkGJSPZZKeCM/Uyq9MFguhGY8QAzY8e8NMFXkNpVH0wbCaDqaZi fOcZEN5J0np3t09pV7U+ORrUngc4BnsMmRlGncYvpKfY07M+hm+/tfH4DZvs3OlMXIG4 hJRQ== X-Gm-Message-State: ALoCoQmkXKF0ULpkSzACk4phlN0aZDx2NPYrUGfmBV9zgmTFO9G3kDAsTMKQSRoGl8rRjAHQimNp X-Received: by 10.66.145.2 with SMTP id sq2mr34063784pab.7.1447440379436; Fri, 13 Nov 2015 10:46:19 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id xi7sm21737967pbc.56.2015.11.13.10.46.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Nov 2015 10:46:18 -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 Subject: [PATCH V4 03/26] coresight: etm3x: unlocking tracers in default arch init Date: Fri, 13 Nov 2015 11:44:54 -0700 Message-Id: <1447440317-1977-4-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> References: <1447440317-1977-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151113_104639_612030_60DA0A4D X-CRM114-Status: GOOD ( 13.97 ) X-Spam-Score: -2.6 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.6 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:400e:c03:0:0:0:22f listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: al.grant@arm.com, mathieu.poirier@linaro.org, pawel.moll@arm.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, fainelli@broadcom.com, adrian.hunter@intel.com, tor@ti.com, mike.leach@arm.com, zhang.chunyan@linaro.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel 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");