From patchwork Wed Nov 11 22:17:53 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 7598241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1773BBF90C for ; Wed, 11 Nov 2015 22:22:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 46256201DD for ; Wed, 11 Nov 2015 22:22:00 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 770B020656 for ; Wed, 11 Nov 2015 22:21:59 +0000 (UTC) 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 1ZwdkP-0006cP-6o; Wed, 11 Nov 2015 22:20:09 +0000 Received: from mail-pa0-x236.google.com ([2607:f8b0:400e:c03::236]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zwdjz-0005zK-PI for linux-arm-kernel@lists.infradead.org; Wed, 11 Nov 2015 22:19:45 +0000 Received: by pacdm15 with SMTP id dm15so42806473pac.3 for ; Wed, 11 Nov 2015 14:19:23 -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=Oj47QXLN48uoXzbPVzkcblpvgHSgNk5eWgv3dtvl0NZcCAE5psleGz7ZdTjoc0hL6x 2pB8FWGPqkRqUpEdp46Uq2tkkdP+DcvbUtTaF01SsG7oJwp0uFKlYM3Q2uG4GSRTEmAs vER6VS14oL/9SJ9JjF5TlCoahr4ouitDdBjFLx00E++SsaF4xyMpVaiQDoqGOY7oeSNC WjP+gJRIlfNrFGTQAcFQiBJDVgNUZ2uquq97dZNYcsselTPrf8FN/32qIaPq2raHh00k h5Qrh88s8GtxwDyRbJUqxWQ6USlqAPacI2KFIT5QPtiu7uSYRh8/0ScnL53xoSXHfR24 RMUA== 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=UnVxMNH+b9eZjkpt0bLJaE4zJ4RnaMrstgDELSkZpbc9Xex3r6umh+K5gB59waihLu NmWXCJboDL/j8nfThiQxIZNED9LeZs+E9BaYM0g3Zq1mXG8IqvIsqWEWPflJurIUd6Ks Rdz2BIyJ9uHfnmnfkiZvxFhJjAiwmcoLiSBi8IrtnMJEcTIFadIBohVJg3Otdngm2kCr MsQeg7t688rkYjspbb2VlsSh1NuX9ttzoLvb0l4P4JvEtTGihlJABHYCBR2m691Slf+K Rsd8kBB+pRZsDiMVf9ke7yO1xaTAyKOEkG6FNkiZPiyPZuVDg77BmhsmeynxHpM76SRI o1xg== X-Gm-Message-State: ALoCoQk2geR1WyB+0B8t98/WDlhturUn8iIvTucK6rbttqRq6E9iDO54oLrxrjSAE1yJFY5qJQFE X-Received: by 10.68.91.162 with SMTP id cf2mr8046786pbb.34.1447280363092; Wed, 11 Nov 2015 14:19:23 -0800 (PST) Received: from t430.cg.shawcable.net ([184.64.168.246]) by smtp.gmail.com with ESMTPSA id h10sm11156697pat.7.2015.11.11.14.19.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Nov 2015 14:19:22 -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 V3 03/26] coresight: etm3x: unlocking tracers in default arch init Date: Wed, 11 Nov 2015 15:17:53 -0700 Message-Id: <1447280296-19147-4-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1447280296-19147-1-git-send-email-mathieu.poirier@linaro.org> References: <1447280296-19147-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151111_141943_981736_170276D0 X-CRM114-Status: GOOD ( 14.00 ) X-Spam-Score: -2.6 (--) 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+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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");