From patchwork Thu Dec 3 21:04:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 57679 Delivered-To: patch@linaro.org Received: by 10.112.155.196 with SMTP id vy4csp167129lbb; Thu, 3 Dec 2015 13:07:35 -0800 (PST) X-Received: by 10.66.216.7 with SMTP id om7mr16138328pac.90.1449176855351; Thu, 03 Dec 2015 13:07:35 -0800 (PST) Return-Path: Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id 76si14170604pft.83.2015.12.03.13.07.35 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 03 Dec 2015 13:07:35 -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 1a4b4q-0004cu-Ja; Thu, 03 Dec 2015 21:06:08 +0000 Received: from mail-ig0-x22f.google.com ([2607:f8b0:4001:c05::22f]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1a4b4S-0004S3-Qi for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2015 21:05:46 +0000 Received: by igcph11 with SMTP id ph11so19812139igc.1 for ; Thu, 03 Dec 2015 13:05:24 -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=opNICgigpeSegW0fwm8/f/plpXFzA2TOPX65fELAYso=; b=IJ2JAzb87km38oxvSFVtgCwGGs/WSv3ejJ8JrY9iZJ73sAWxV6dhTfc8Cuvt/rFAEp Qmo8HIH3kKGFLIJiZD9j9t56SlfZc/Pk9AAJEVCKjOfThtgUYvPRt7xLqOpLTU8QxgDr NVL7Ru45m7+1prSHHs5MMyncgsLo3FYh9/g8ysfj6lIoiCmUHmis40ybjQP9kn+Y9Qbh YlMpMPMNo93p0q1yoEkibRH5isjxqqEqH+TftSl5PjUUu4Tj9on2p84X6xOdB7RKMDyb n7dkU7XqIm+6phPQtgnH+fbcmEdvxmG0t0EKSSjcku57e4Hu+d5VgUul80U2xc4GrSWx 5KBQ== 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=opNICgigpeSegW0fwm8/f/plpXFzA2TOPX65fELAYso=; b=RMCyJwdgHAFinkG3ZeNr6ANyJerzrCHg8jVvEfThW5yHceOCWw6PqDjiumLOgB0mq2 j8D79MzTySt8qMmOeufq4FuOdEQQ1qN/hQmaUEwaZFmRy6iX37KiExovxhCpUzmi2tEX zVWg17vLz7h76nn050y2kGcm+HAoCQvF7NHZiziXtYxZFdgIShSWSojezXRTEnlBdu5a 5xoTDILrTvvJyzvBabRQqoLJhMrOEuPdX4e4HJAjCPTaay9a+vLcH0lLStzedeKAIgqO /J6H6bXxqYcPphMUr8IjQDl9GY2imJS2FJeb+ZfwUcRzGjdFgkaNDm8Ehj9hic6/MIrE ZXZA== X-Gm-Message-State: ALoCoQldnwVht9+QNlAcmEPGvYUWf1COSSYVHlM+9QIm05ZPBlL3I+2aah1Qc7e79fDvQ1aTQeGYF1LNSZ4tNX3ZjkqvMkGN4Q== X-Received: by 10.50.147.36 with SMTP id th4mr704063igb.68.1449176724068; Thu, 03 Dec 2015 13:05:24 -0800 (PST) Received: from t430.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [184.64.168.246]) by smtp.gmail.com with ESMTPSA id d81sm3615433ioj.12.2015.12.03.13.05.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 03 Dec 2015 13:05:23 -0800 (PST) From: Mathieu Poirier To: gregkh@linuxfoundation.org, alexander.shishkin@linux.intel.com Subject: [PATCH V6 03/26] coresight: etm3x: unlocking tracers in default arch init Date: Thu, 3 Dec 2015 14:04:39 -0700 Message-Id: <1449176702-13213-4-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1449176702-13213-1-git-send-email-mathieu.poirier@linaro.org> References: <1449176702-13213-1-git-send-email-mathieu.poirier@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20151203_130545_036087_64F255F5 X-CRM114-Status: GOOD ( 13.76 ) 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:4001:c05: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_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 , linux-doc@vger.kernel.org, fainelli@broadcom.com, linux-kernel@vger.kernel.org, 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(-) -- 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-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");