From patchwork Thu Sep 20 19:17:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 147136 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp2376232ljw; Thu, 20 Sep 2018 12:18:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaFPcpXRVzXftoWgi4yA4c0Mdjjg0QuKrF1/IhCJR4L8/3WX62uemlg+yMq0YXRlUx6fBV/ X-Received: by 2002:a62:a216:: with SMTP id m22-v6mr42257922pff.163.1537471128421; Thu, 20 Sep 2018 12:18:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537471128; cv=none; d=google.com; s=arc-20160816; b=m018N3jsQD7fBzALbSV2SQa6NBvZGp7tK7yjT+5yg/g215ndJaZgXhu6z5VmXvDS0W ni1lTy+Dnmse7v/wsjHSim6gsQOxlNHxk6ZlgGq2A2zJm3ChSnfxeGz3WcmNZu6KGGyN 7yyefx+Mor/h3FYL48hvaPeYDlzm5l1PlQO+0R4QOXOf+coCt2cE/A2eNLlgB2PGnHxI 8fEpN1cVNYcRXOz6iQj2+pgcdz5JOhRxnoczGtD1T49hcii9KTwGSyOD9RI2xo2jpbK9 Bw+i1F1oN5CPu0ah32gltDogoDI1yepLa3EX7FVO4JlO7oT2hXyB6z28syxwY6BFKIAx P/dg== 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=ZRpxBhstQqFQwU6Y9NFTCaAtWvfL9rLmbEuk40AVBmc=; b=bYGJwQVFX9Brkp9B/5JTIs4owkIWLGwZeT5xAuSIVGiP6/0HtYo5QcgguqBRlGGZ2G HYFrAohMrWrPH/c/pKvyg7obqLc37u8zKE8dicE5VuhDU0+YRD2tjXqljmka3Iwr+mNs +YVIwjnYtllKY5zkqott5lcCS1My2osrcLDh0oTXFzP8HeQyt/WbuZYNOrA3Et7TIwY+ azBliKQMzmwRG9RAqn0T0A+zKFz1Ajm9blmK5shvrJviQStrJK+7OdDraHoKBKKswbMu dZRthvtlSBwkIqY7HaI3LATTor65yqd39wppYMC8fLBnxCLwcgouUpjCKFzyEhcjZOwr brHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="DD/v9ZdU"; 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 a1-v6si23828838pgg.34.2018.09.20.12.18.48; Thu, 20 Sep 2018 12:18:48 -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="DD/v9ZdU"; 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 S2388831AbeIUBDo (ORCPT + 32 others); Thu, 20 Sep 2018 21:03:44 -0400 Received: from mail-pf1-f196.google.com ([209.85.210.196]:37719 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388779AbeIUBDn (ORCPT ); Thu, 20 Sep 2018 21:03:43 -0400 Received: by mail-pf1-f196.google.com with SMTP id h69-v6so4826109pfd.4 for ; Thu, 20 Sep 2018 12:18:44 -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=ZRpxBhstQqFQwU6Y9NFTCaAtWvfL9rLmbEuk40AVBmc=; b=DD/v9ZdULDaaDFJrEGuLvI68iRFEFUWmC/BLFTAAE380yYlWPLZiET2S0pNTuznmQO 6D5Jkm8lZd5Fp4bY6eR22twKi+VZ5DeDENB8ni0NZVm7wicx0AIa0OFxOoe0YLe0hhVd Sjd5nDHLwM65tvukeo8noORSddQdi7mUKZCxw= 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=ZRpxBhstQqFQwU6Y9NFTCaAtWvfL9rLmbEuk40AVBmc=; b=JtxS3Bp8yI/i4xgoDcj8CwcdZ0uWLab7erBgGdneyly6MkGCk6bOpx4gzGMJpBm90w dyB/hQ7yYSjAaqZxLaZApwdG47S4Pq04N4uw1yYV6K/jzEdpNN6uQEdvmP5H/psA5fYS Tu0/X7R7i7eEysF6lpTO+bCOdUCkCK9oVUR/wMDdCdq/S5zQOa/mlxC9HUs0p/fLoLId dL4DWdhnsVCTFf58S2yfg4hAEdhb9H5czpvty9OytjBCRdhDgKhpM5gwcBVtMrM8+VtA FLEeQRhR3eL3yGdqKMiisClkWPP3Mr7rmmDe2Hb1Kl4mUGqQSmz/8tWOTYExy7kR/pnZ RVQA== X-Gm-Message-State: APzg51D/xkEzfCbs25m5JRtgRpobrZcBubXQrcZpxAESZtptSw/qLVuB J+F8qGInLs/ChOUFLudvOZBhThS0iPc= X-Received: by 2002:a62:6cc6:: with SMTP id h189-v6mr4937473pfc.23.1537471124485; Thu, 20 Sep 2018 12:18:44 -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.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Sep 2018 12:18:43 -0700 (PDT) From: Mathieu Poirier To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 15/44] coresight: perf: Disable trace path upon source error Date: Thu, 20 Sep 2018 13:17:50 -0600 Message-Id: <1537471099-19781-16-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 We enable the trace path, before activating the source. If we fail to enable the source, we must disable the path to make sure it is available for another session. Cc: Mathieu Poirier Signed-off-by: Suzuki K Poulose Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-etm-perf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-etm-perf.c b/drivers/hwtracing/coresight/coresight-etm-perf.c index afe7e7fc1a93..6db76ce6ba5f 100644 --- a/drivers/hwtracing/coresight/coresight-etm-perf.c +++ b/drivers/hwtracing/coresight/coresight-etm-perf.c @@ -317,11 +317,13 @@ static void etm_event_start(struct perf_event *event, int flags) /* Finally enable the tracer */ if (source_ops(csdev)->enable(csdev, event, CS_MODE_PERF)) - goto fail_end_stop; + goto fail_disable_path; out: return; +fail_disable_path: + coresight_disable_path(path); fail_end_stop: perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); perf_aux_output_end(handle, 0);