Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp169865imd; Wed, 31 Oct 2018 16:43:44 -0700 (PDT) X-Google-Smtp-Source: AJdET5fmj9kwwjcOV+qHb9my79o8VkNHuUkvmwOG5TqtgoE6OKancAeFacFWhcm+NZ2q0Mti3RPl X-Received: by 2002:a63:c942:: with SMTP id y2mr4952491pgg.331.1541029424263; Wed, 31 Oct 2018 16:43:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541029424; cv=none; d=google.com; s=arc-20160816; b=Wp4afk7W4LWrmJiZyhjc0hx+h99iBPp72uigbUHuURTld/+qPOnae0vVUqtIizuLCf NV+Xrmlx+b8iA53CjqSC9OYaQDYyknkiUFm5Qyi/DiUH0O0CsbGbixBpDefPYiQPkHne qhzzJkvBAN7S23AnQHAogctHFM7S9Um1Yc5YUyOIXCQEpCRlHQGQE5m0YzTwcWD65tHO L9N94maPdf5E1aBqvx9MqxMOEo7qr8vW1gvRebSTZyzPYE2SvjMljSe56k66lGFAwcJJ XgeQD7BXVCNoTTQvQojEHarM/M9SBizYZxAOuO0IWYuOmbLUsG7EwxLhbzXwWg1pwyPS c4aw== 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=NYNDJW6kyAOg/TBv1D1ojEvslCYYp/gRIQ0ATgQPReE=; b=QymhhtzyyKeBzHabEdjD6dKp8XRQjuL9r4onL7xeHzI71zwasThfqcPXksvV4KuwsQ MSIYiiLSuqmXlp6xJyxieUo7j1bsF0Wc4Y3oGEXO2LSr2lf8HNHgypRpHU/RnwuEMfd9 HDyKSQSvHq39SA+/8fJFro5tXqSGfrG54nmf15QThMp6RWb7+d56aZQcDHkQjHv5+IrR A5kR4UNr8x3ObqAmk7kpd6Eh9Mwc0Li7xU4ssn1wsoY5hCLVg4Hn9aADnc9gi23wEBgP CBU+Dio5DUXsxHO9m1pDC0m/3issqhpvPwPFFrbtgvaURcC2R4XaCcG39zxrNKY3YjAN yJ6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=g4CNcrft; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e21-v6si29679942pgl.305.2018.10.31.16.43.29; Wed, 31 Oct 2018 16:43:44 -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=@kernel.org header.s=default header.b=g4CNcrft; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729170AbeKAIHr (ORCPT + 99 others); Thu, 1 Nov 2018 04:07:47 -0400 Received: from mail.kernel.org ([198.145.29.99]:55880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729065AbeKAIHq (ORCPT ); Thu, 1 Nov 2018 04:07:46 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 31337208A3; Wed, 31 Oct 2018 23:07:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1541027255; bh=TZh0kuaNJUgcZ4KfLemz3qOvrVg8+bivLoE6Cm/itNI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=g4CNcrftIJyTYJc926JsNKniyW4AMXoygheCQf2wqjPRIbBzfckTpD0A9yWz/lEtm gFIJP8DRWUTJJZl+8QpWi/LPFHDige/YIQbfAF1h8Re/76pAtdNg+MBHLKLS1r01A3 RxXhCaktVZWrjg4LfMzicLwI1WStIIOBcNbp/WII= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Suzuki K Poulose , Mathieu Poirier , Greg Kroah-Hartman , Sasha Levin Subject: [PATCH AUTOSEL 4.19 126/146] coresight: etb10: Fix handling of perf mode Date: Wed, 31 Oct 2018 19:05:21 -0400 Message-Id: <20181031230541.28822-126-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181031230541.28822-1-sashal@kernel.org> References: <20181031230541.28822-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/hwtracing/coresight/coresight-etb10.c | 4 ++++ 1 file changed, 4 insertions(+) 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; -- 2.17.1