Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp3434748imu; Sun, 11 Nov 2018 15:02:32 -0800 (PST) X-Google-Smtp-Source: AJdET5fzBtGj44nr3uQB5jIvvGVTh2o462bAFBYjrkzX+udTnCR/Cao5ReVrt+YYgAFQ3Yaesfl9 X-Received: by 2002:a63:1b1f:: with SMTP id b31mr15250854pgb.66.1541977352464; Sun, 11 Nov 2018 15:02:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541977352; cv=none; d=google.com; s=arc-20160816; b=eu36kIT+1UBGuhCiwzZXN1wp2Ix4rFT4326la6mgK2mvaVrzUaYb4ms7T8len9gbXb OxBxIpB513OJ2NpFxEGgrs+cL5O7LBJfz3B278CmSGUaxYF27z3kCn28lVA3nonnLCVQ wL1mrCn5x2KaXasDhEU4uBc8HcNqBdRjXdZtwovRYR4c9CDl/SnYCOeyqqHUuNwMVu5B yhZtpi34vtvUIWEU2V036VTjtii3RoRiKZtdFrpQYgppVsaPQPpt7kCbsmSad19Aw80H KBuceVOYG+2Er7Vc4uHGSSOOoYcLzu5kyuzCZxPnTgp1j0CHU6v76XcDgeSa2z+HUFdI CBrA== 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=teE2SVXQsa2YS/8GhzH4MaVCYrzfBoxnnkSBtPNmbOY=; b=EFNzcGpN8BlLVFwKcR7yIws39g6YgS+GYaJ4A0GpZ/DTfcBSmv/ekYWuF3tswbm0DR PWqtfjbHvWx8NLC07JrbOP6wYcurVSyuuIQgvDY8oGJG6ACS9g9X5eC5ywcRXTcD5Si1 AhDaDcxfONE+8O6GYUDqJEaealw+GUstk6TosBjEW8DhbvWDrfxv1gtdLTy4NdcsewGU RytrlZr4mGGx69tCwk8zYZ+myYKkkJ64ECvxc7pHPpafyetLejmf3kCpY+GSbMTxVhTA WNoRAMW6K/qSlNw1pUUvWDB5BJcR7ZM+taeWJnggs8eudwJ7StsQvPffvmrWSKo3bgK8 TSjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Cj8AHhm2; 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 k8-v6si9522303plt.144.2018.11.11.15.02.17; Sun, 11 Nov 2018 15:02:32 -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=Cj8AHhm2; 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 S2390856AbeKLIwA (ORCPT + 99 others); Mon, 12 Nov 2018 03:52:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:52752 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387543AbeKLIW3 (ORCPT ); Mon, 12 Nov 2018 03:22:29 -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 3F6F32154B; Sun, 11 Nov 2018 22:32:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541975552; bh=69O1Bkvf86+z3uO0hiIR7yKL9qHQtt5FoGzEPY/LIy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Cj8AHhm2P98130Nj0Z+KI7jkD3S7UqwJrTQwOSWsPzquyXpiZH7Z83ny+eSKVsifa Y+m4DGDK7PUjD0wUMp5TGvF7+004fIHBCVYCl3HiAZs6gDQPme3L3aYg8EtA3O0nBL b1jIDgsEZ7P9a1WXDVnfXo2Qy4l2f9x0sKMsn7yA= 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.14 095/222] coresight: etb10: Fix handling of perf mode Date: Sun, 11 Nov 2018 14:23:12 -0800 Message-Id: <20181111221656.430309087@linuxfoundation.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20181111221647.665769131@linuxfoundation.org> References: <20181111221647.665769131@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.14-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 @@ -155,6 +155,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;