Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3481346imu; Sun, 11 Nov 2018 16:05:22 -0800 (PST) X-Google-Smtp-Source: AJdET5eal7dzfAn82pZgXlQZ/WXoPKt6i8/8lXUPjy3J1KC1icxvgi2OYmM5iKN9t0BwlPt2XJ1Q X-Received: by 2002:a63:5664:: with SMTP id g36mr15366717pgm.313.1541981122029; Sun, 11 Nov 2018 16:05:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541981122; cv=none; d=google.com; s=arc-20160816; b=tPda3ILraz69D/GCCm3hE5ZS4G+F7G5s5OlZpMHHk1v7nFVli9BQRE33XJDudnD63R zASsOaZwc7azEETKuj6JeR+crnKJkRKMKTrjgM6AU6Xod1jlnPBZb6l6kl5efqTesaT7 hqShIBhWtLeLsr6X+IGqysJ9XqGPxCUc7HZ6oHzdrXo6ZJXFrqnQ7tdn4qFGvWnywXAR TVQmRlTNhzvLSltkA79jxEwBkaECHxGyEzygEwNlXE43Q2jyas11sLwzQxRDOrjxXmkH 10nrRKL+A6Tf381Yd7kIFEXTOotx/cAD96ph2+HqwSbO2jlTyKsX/sVmkF6ZAsDmSAoD 7hbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=SIRcNFnxPMXLDzrlVmxHm1WmdrWDjW3c+2wfuCsrcQs=; b=Rb558FofTTmMZWBfS+fBGRnG8u/0A0MfCpcGMVyLx0eDYJECCRdFjaRN2oYonnsvju z9LN+MzYbOOssriRzgi5Son1D5Yi4IDqk/d9mlbGH5+krpG1vcVdQ36IqNs2pvus1C6/ bBDp43rBcyjnHdcZ0Jk05wJh/HMR3sXdqTGUUz756W3q+KwtKVG/jbGEEeSKKIC6D45/ nRzOEIEdBcRcje4U1pFRgiAWtVs8JrgmdsbDZr7z650aV6WQhCuByfcjUtdRef1TWHVl bOqEEMK0d+DNDiTKgmyu5xLMXORGIcs+z2JqVrQEND1vTufAdS8HtrE19UX3MKbFXiEp WGYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=IH7Zsgjy; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n78-v6si16545045pfi.171.2018.11.11.16.05.07; Sun, 11 Nov 2018 16:05:22 -0800 (PST) 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=@kernel.org header.s=default header.b=IH7Zsgjy; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732318AbeKLJzL (ORCPT + 99 others); Mon, 12 Nov 2018 04:55:11 -0500 Received: from mail.kernel.org ([198.145.29.99]:34210 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732020AbeKLIRq (ORCPT ); Mon, 12 Nov 2018 03:17:46 -0500 Received: from localhost (unknown [206.108.79.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 400E02154B; Sun, 11 Nov 2018 22:27:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975271; bh=8DveBt9ltGW1Eua9YGpjUiOOXJHA80J49rsh/mtW5dQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=IH7ZsgjyxFmROifbz2X+drYKY7uZG66MSXNNXDzP+UTrp5cWWj3EZP9fqkfNRq3Fo uGjBEI3AyZDpwWDXhguPM28Bgp2WmMUVadVyt/Zc6zQ5wNg7edz9m6+bPHfcM9Aeyq 8K7/XdZMt6XwCIJ5JlhES7anT6TZc6DqshNd6eNA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Poirier , Suzuki K Poulose , Sasha Levin Subject: [PATCH 4.19 170/361] coresight: etb10: Fix handling of perf mode Date: Sun, 11 Nov 2018 14:18:37 -0800 Message-Id: <20181111221644.176289613@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221619.915519183@linuxfoundation.org> References: <20181111221619.915519183@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.19-stable review patch. If anyone has any objections, please let me know. ------------------ From: Suzuki K Poulose [ Upstream commit 987d1e8dcd370d96029a3d76a0031b043c4a69ae ] 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 Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/hwtracing/coresight/coresight-etb10.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/hwtracing/coresight/coresight-etb10.c +++ b/drivers/hwtracing/coresight/coresight-etb10.c @@ -147,6 +147,10 @@ static int etb_enable(struct coresight_d 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;