From patchwork Thu Sep 20 19:17:46 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 147132 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2376131ljw; Thu, 20 Sep 2018 12:18:42 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaiGytcTn0Z+PRh1cSn4MIgAUqA614WuOTare+w4VEFIXMcZBGDTmdFxh2TGtaOhNPJN3n2 X-Received: by 2002:a17:902:9a47:: with SMTP id x7-v6mr41007842plv.37.1537471122490; Thu, 20 Sep 2018 12:18:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537471122; cv=none; d=google.com; s=arc-20160816; b=d+dxscrjptFmZqDljQc7TL9HOK22m2pz895P6wznaw0GAd/2lKQV+Bm9X1XRv/46Uq 3rwWh+DUhSP37G8fKhnlws7FQ/CykXlYaAFr+wXt9vr34Tt2NQN7Cm0iwMTDrwu5Cavr lDMM0YjE66kvYmyEnMGweXNwj7gHTSmW1Q3I9kTFeNaU0CjOjJLQy3BJvmxkNZfQwLPX UFMJTbTW2sJuTBdLcUMUw9FoFEDIl6qexyq7viuzX1xoULCgOHkYEgDyXutMUDax5x+S rFv00oNJoXozwbKAkMIqJYYiuDpRoEGQoT2+xlTicMPNpNwWO0SN9lY9TmYarsFtZq7J jVRg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=t1KhZyFjqvp9qI0UT6EcOP3PoDOXaznF3Gjt2laGV3Y=; b=AtH95dJEk82+c9YmrX309jwIaUAoOeTxJ2S2pql7EvE2yZlHUukpI4uwJJLBcrqbaW GOELZEgahYuj6n0cyfHcDeHCjgKewMD37Bef3M4d7tP7pgTmuvtrS4RUcdiq0T2kPTp4 ggarmsmsJKVvgr2DxSUqhkv+aEL4gzL+Ggfy+BauW3HoIZy33JQc6STKSMbnX6WaLQpx UjOtMJERYxoL94xqptZuZLWs5w+cp8v8Wur3o0+j2LPuIzXWXWf0F/1JLjiHRa8pyLti bBUa67DiepZpPZMuC+IdWjJTamdt1RJW5nibZic75X5Jr9YpdPSNjAAckkL9aVDnKRlW Bc7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=L9kS2n2d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m5-v6si28185689pfb.104.2018.09.20.12.18.42; Thu, 20 Sep 2018 12:18:42 -0700 (PDT) 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; dkim=pass header.i=@linaro.org header.s=google header.b=L9kS2n2d; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388777AbeIUBDh (ORCPT + 32 others); Thu, 20 Sep 2018 21:03:37 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:46420 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388760AbeIUBDh (ORCPT ); Thu, 20 Sep 2018 21:03:37 -0400 Received: by mail-pl1-f195.google.com with SMTP id t20-v6so1358161ply.13 for ; Thu, 20 Sep 2018 12:18:38 -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=t1KhZyFjqvp9qI0UT6EcOP3PoDOXaznF3Gjt2laGV3Y=; b=L9kS2n2dYrjXqP0FTqo/L6z3LMjLPFZnDy1/NCam49Pu/9K5j/V+6sKe2M7p5Sp/cJ Z3hvIIYw+O79vv50spP1XsQXNliUqi2HoSqh31VVfSkKUJhGdL3H7ASB9G5B4tyKJ9tV 2AC8LCNxWzW9GZesWiMNPqxLLy02oDiLe8/Lo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=t1KhZyFjqvp9qI0UT6EcOP3PoDOXaznF3Gjt2laGV3Y=; b=Uqj4dLrtO1Xuok4Ku4QtjjxZqAl/QRGqgoizgoRGAZ5nEdcqc304WcG7xywEuZDGlH +H1435/TntbohuNnpZ5oHV5DJwzuWe4uhuUEjValRvDE3K8+ig7pmwNGcZwYWiasNMrq 9Tk3PfwVmjfRgN/brCABNVpYLonxq+tdHKWBudcdvutdvN/9RiEPyp6QYaezREdmWffw /44frR0KRQ2vOvC9KC6bxObFgaVTw+GMld9R8SaRd47ClFIgE3MehSQ0bugrc1Iwehap kywUrAGrW83eKOg9lynR5IJBCRSLWad6Y1O/NWwdmWT6Ongpl19SARrKyooPLkzvn1rG 6mKw== X-Gm-Message-State: APzg51AxsgqJ2SPrd6dWEhw+5ckB/SW0OyP5uf6kVjdIxr92A2pstySr l5FQ2LJ7CJwdD7n1LQBw4euD6A== X-Received: by 2002:a17:902:14d:: with SMTP id 71-v6mr39564481plb.146.1537471118323; Thu, 20 Sep 2018 12:18:38 -0700 (PDT) Received: from localhost.localdomain ([209.121.128.187]) by smtp.gmail.com with ESMTPSA id k13-v6sm4424443pgf.37.2018.09.20.12.18.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Sep 2018 12:18:37 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 11/44] coresight: etb10: Fix handling of perf mode Date: Thu, 20 Sep 2018 13:17:46 -0600 Message-Id: <1537471099-19781-12-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1537471099-19781-1-git-send-email-mathieu.poirier@linaro.org> References: <1537471099-19781-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 From: Suzuki K Poulose If the ETB is already enabled in sysfs mode, the ETB reports success even if a perf mode is requested. Fix this by checking the requested mode. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etb10.c | 4 ++++ 1 file changed, 4 insertions(+) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c index 306119eaf16a..0dad8626bcfb 100644 --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -147,6 +147,10 @@ static int etb_enable(struct coresight_device *csdev, u32 mode) if (val == CS_MODE_PERF) return -EBUSY; + /* Don't let perf disturb sysFS sessions */ + if (val == CS_MODE_SYSFS && mode == CS_MODE_PERF) + return -EBUSY; + /* Nothing to do, the tracer is already enabled. */ if (val == CS_MODE_SYSFS) goto out;