From patchwork Tue Apr 5 17:53:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 65128 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp611159lbc; Tue, 5 Apr 2016 10:56:04 -0700 (PDT) X-Received: by 10.98.71.203 with SMTP id p72mr31693430pfi.165.1459878964185; Tue, 05 Apr 2016 10:56:04 -0700 (PDT) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id x80si35824156pfa.98.2016.04.05.10.56.03 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 05 Apr 2016 10:56:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for 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; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for 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; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org 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 1anVBt-00088K-H0; Tue, 05 Apr 2016 17:55:01 +0000 Received: from mail-io0-x229.google.com ([2607:f8b0:4001:c06::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1anVBM-0007rw-2C for linux-arm-kernel@lists.infradead.org; Tue, 05 Apr 2016 17:54:44 +0000 Received: by mail-io0-x229.google.com with SMTP id 2so28027982ioy.1 for ; Tue, 05 Apr 2016 10:54:07 -0700 (PDT) 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=ot8VY7rgpnMS6+eren7WXrYVqvPT7E043O9sD0mM/gE=; b=FvvsUixJUhfiFRrfZjaOBJ2xc0RqNNicvFZrk/Sle02Rxpi72K2d9Vf4emf3SB7Qg7 7uJDfLEbTDJO6Nu5Fk4qX7XmRagycaJTsajTF8ZDrVls/7pq9L8B9BytRTQ561BMsSd2 LIHEPcouxE3sRABF6mDhS+P+5IXbnmyqQa4Pc= 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=ot8VY7rgpnMS6+eren7WXrYVqvPT7E043O9sD0mM/gE=; b=MhubJzvZpqDy6SS1FpOZ3qO9IjhWy4y1DGK7PeAFPzPI+t/JDU7C7kKAnXYrDwxSzl ovqTUXjc3yHnZJmZOZYTpKibry+WtZf3mk5eTUyKcd6oC7x7NLzpMu3NjTYu29pt8Ibg vqFPLced+o511cAlA2Q7pkiIp1j1mJCpm/LkUCmb9GqyiMifNhNo59nb+fC/1ch1rOjg Hv1PQDGXvWeMEcMrfMc9s5mLGzFRi0EP9ixfyhE35oL8fa7elbXgRxnV+ufg8ZnVnfDY P0PSNpV/18NBQqPyUjl1GFLGvfKCQUcguL8uq6VzFRH5tAg/OzdhvDeJ4xleXiratLvr aJDg== X-Gm-Message-State: AD7BkJIMDiVl8eWyowz/fpdwKo3RgqkBdoLwqu/nW6KOoD0XFAWW1d8W6XY989z0LKemYd+z X-Received: by 10.107.18.89 with SMTP id a86mr12041889ioj.116.1459878847339; Tue, 05 Apr 2016 10:54:07 -0700 (PDT) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id n19sm4557012igi.19.2016.04.05.10.54.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 05 Apr 2016 10:54:06 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Subject: [PATCH 05/11] coresight: etm4x: unlocking tracers in default arch init Date: Tue, 5 Apr 2016 11:53:46 -0600 Message-Id: <1459878832-15219-6-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1459878832-15219-1-git-send-email-mathieu.poirier@linaro.org> References: <1459878832-15219-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160405_105428_406828_6A451BAA X-CRM114-Status: GOOD ( 13.08 ) X-Spam-Score: -2.7 (--) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-2.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [2607:f8b0:4001:c06:0:0:0:229 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 -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 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: linux-kernel@vger.kernel.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 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 _______________________________________________ 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-etm4x.c b/drivers/hwtracing/coresight/coresight-etm4x.c index 2744413dedb2..92524fe1aa6c 100644 --- a/drivers/hwtracing/coresight/coresight-etm4x.c +++ b/drivers/hwtracing/coresight/coresight-etm4x.c @@ -44,12 +44,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(); } @@ -286,6 +285,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 */ @@ -603,9 +605,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");