From patchwork Tue Sep 11 21:49:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathieu Poirier X-Patchwork-Id: 146485 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp4096980ljw; Tue, 11 Sep 2018 14:50:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdajIqB9j4oWbIusAIYNIgOXrggEsqfYMDGra6FyD6Y0orN+BJF+zAihxxckuP/X+xccptDL X-Received: by 2002:a17:902:b70f:: with SMTP id d15-v6mr30049125pls.53.1536702606709; Tue, 11 Sep 2018 14:50:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536702606; cv=none; d=google.com; s=arc-20160816; b=x7sGnKC27nB7gEk4+5+GB8Ncg8nWc42+ewdiUNSe/XBlNECGQQFjU0zrZgnEtKHbDI b7RYVTDH71rskidI8d8oSxIWfYzRjc2RWA7Ec4JRy6rm4bWTZBqUYfG3H6hpWU2d2CuQ HPg3mTgmYIvV0jJWRB5ZfS2hHPueZUhsvW71ITYXOBJtIkzcriQ77wHAUKmjvzrzdqfw ADuD2RdOhZcE7zSwbmPiFE3Asx5eLsepyteNYyrAeE0Ss85skGexi2z+zz6bT6PxVeRk 9qqiz/RiAnJWBjaRTMndZ4R8pyi3OG91kgojUiXbIjXjPkbbY0oy2dGvle4Rz2AU+vnp n4BQ== 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=nE54tmiDsnKsQusmU2kfw+Wu31P7rt65tLwJCDG9RhE=; b=vuWDczKL92ThCeCmTGxN5fldYPmNzPeP3D5XkBkjrOyninoxAS8wYj8HgA7XwiGpiL Iy48O1Z3/tn4MxgmxLDlDOj/OOmvB47d0asTxbxk6Q9yovreOGXrkIeeWfIjiu9xOi3A ESpEk2k+o0PdTSUXNJBEGAjb/93hb6zuIqa4Z1r+h4+bfnyhEVylejh4eHex+6OKgWNQ +W2d+F9hdoyGS4LqLro7hTrzR0TCxj8FeZbVVTn0CwA6baCo2hM2V0GpcvTiGL8xcBuH g3N1N33ZvaI6YmJKiJAPzOL0gosrEyNnJHTjBz5N1lIpWMgH9rKGHnq8z32fL/xg3skL Fevw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=OstrpvlO; 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 q66-v6si21722482pfk.268.2018.09.11.14.50.06; Tue, 11 Sep 2018 14:50:06 -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=OstrpvlO; 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 S1728286AbeILCvV (ORCPT + 32 others); Tue, 11 Sep 2018 22:51:21 -0400 Received: from mail-io0-f194.google.com ([209.85.223.194]:41956 "EHLO mail-io0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727734AbeILCvU (ORCPT ); Tue, 11 Sep 2018 22:51:20 -0400 Received: by mail-io0-f194.google.com with SMTP id q4-v6so4846130iob.8 for ; Tue, 11 Sep 2018 14:50:02 -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=nE54tmiDsnKsQusmU2kfw+Wu31P7rt65tLwJCDG9RhE=; b=OstrpvlOZh00NoAWFSuVHHq9Q+vpuKiDeGtbGDGYi/Kugb6pGffEpallajzSyDfbGi zPYtWuNo4uy4zaE2VSjGl90u1OneBnqfiZr8TkFxHz1VjpKEXDdHMKXZgyJMpD2JH1NP eDxMqGh8/tQUjfWmlK0wV4d0myiY6362dF89o= 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=nE54tmiDsnKsQusmU2kfw+Wu31P7rt65tLwJCDG9RhE=; b=YjKykcD9ANYUmDsK60r2PM9oQVHcg0RalldNTkFb16OwJu0lu29DmRV6Y7Dom9haNg Z5UrrP2XYXbiBd/0s8IBHQ92tMwZE4LdTmd5dvTiFnEzyLWxbl5UpmNmPQNZSYlXLVzJ Q0Lj4RTEPZ5qrZA7f6lJZnlCuHKkAydgnftu0cD5eyqZABgojMpvy20P+lHWFCJocqMg YrNEsG1CBOMf1arZuEyK0Gx9RiMYDHlWSGd+h3CjPX60IhcaMXMNJiMmc4X2QOE+hRJG KmjdnbeVk3VJOCZpozhvG+ts7plhOfusx2O+bhGdJmUZezYVQ9hnqU9tZtAgsueykurb GABw== X-Gm-Message-State: APzg51BDcpYkHoGs3uAbwdCmdq73+GNSOaycU5RwUATzidvQSbWFcdDQ bjiHP9rOp4XlzSgBejuBRnKQ3A== X-Received: by 2002:a6b:7308:: with SMTP id e8-v6mr6622475ioh.57.1536702602424; Tue, 11 Sep 2018 14:50:02 -0700 (PDT) Received: from xps15.cg.shawcable.net (S0106002369de4dac.cg.shawcable.net. [68.147.8.254]) by smtp.gmail.com with ESMTPSA id c3-v6sm1102172itd.8.2018.09.11.14.50.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Sep 2018 14:50:01 -0700 (PDT) From: Mathieu Poirier To: linux-arm-kernel@lists.infradead.org Cc: alexander.shishkin@linux.intel.com, suzuki.poulose@arm.com, gregkh@linuxfoundation.org, kim.phillips@arm.com, leo.yan@linaro.org, linux-kernel@vger.kernel.org Subject: [PATCH 2/5] coresight: Make link components aware of operation mode Date: Tue, 11 Sep 2018 15:49:52 -0600 Message-Id: <1536702595-9999-3-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536702595-9999-1-git-send-email-mathieu.poirier@linaro.org> References: <1536702595-9999-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 Following what has been done for source and sinks, make link devices aware of the mode they are being operated from so that their verbosity can be controlled. Signed-off-by: Mathieu Poirier --- drivers/hwtracing/coresight/coresight-dynamic-replicator.c | 4 ++-- drivers/hwtracing/coresight/coresight-funnel.c | 4 ++-- drivers/hwtracing/coresight/coresight-replicator.c | 4 ++-- drivers/hwtracing/coresight/coresight-tmc-etf.c | 4 ++-- drivers/hwtracing/coresight/coresight.c | 13 +++++++------ include/linux/coresight.h | 6 ++++-- 6 files changed, 19 insertions(+), 16 deletions(-) -- 2.7.4 diff --git a/drivers/hwtracing/coresight/coresight-dynamic-replicator.c b/drivers/hwtracing/coresight/coresight-dynamic-replicator.c index ebb80438f6a5..de2c197886c6 100644 --- a/drivers/hwtracing/coresight/coresight-dynamic-replicator.c +++ b/drivers/hwtracing/coresight/coresight-dynamic-replicator.c @@ -35,7 +35,7 @@ struct replicator_state { }; static int replicator_enable(struct coresight_device *csdev, int inport, - int outport) + int outport, u32 mode) { struct replicator_state *drvdata = dev_get_drvdata(csdev->dev.parent); @@ -61,7 +61,7 @@ static int replicator_enable(struct coresight_device *csdev, int inport, } static void replicator_disable(struct coresight_device *csdev, int inport, - int outport) + int outport, u32 mode) { struct replicator_state *drvdata = dev_get_drvdata(csdev->dev.parent); diff --git a/drivers/hwtracing/coresight/coresight-funnel.c b/drivers/hwtracing/coresight/coresight-funnel.c index ee7a30bf9480..c1c9f5fccc4b 100644 --- a/drivers/hwtracing/coresight/coresight-funnel.c +++ b/drivers/hwtracing/coresight/coresight-funnel.c @@ -59,7 +59,7 @@ static void funnel_enable_hw(struct funnel_drvdata *drvdata, int port) } static int funnel_enable(struct coresight_device *csdev, int inport, - int outport) + int outport, u32 mode) { struct funnel_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); @@ -83,7 +83,7 @@ static void funnel_disable_hw(struct funnel_drvdata *drvdata, int inport) } static void funnel_disable(struct coresight_device *csdev, int inport, - int outport) + int outport, u32 mode) { struct funnel_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); diff --git a/drivers/hwtracing/coresight/coresight-replicator.c b/drivers/hwtracing/coresight/coresight-replicator.c index feac98315471..0b749302c066 100644 --- a/drivers/hwtracing/coresight/coresight-replicator.c +++ b/drivers/hwtracing/coresight/coresight-replicator.c @@ -31,7 +31,7 @@ struct replicator_drvdata { }; static int replicator_enable(struct coresight_device *csdev, int inport, - int outport) + int outport, u32 mode) { struct replicator_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); @@ -40,7 +40,7 @@ static int replicator_enable(struct coresight_device *csdev, int inport, } static void replicator_disable(struct coresight_device *csdev, int inport, - int outport) + int outport, u32 mode) { struct replicator_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); diff --git a/drivers/hwtracing/coresight/coresight-tmc-etf.c b/drivers/hwtracing/coresight/coresight-tmc-etf.c index 4156c95ce1bb..28b3ff830597 100644 --- a/drivers/hwtracing/coresight/coresight-tmc-etf.c +++ b/drivers/hwtracing/coresight/coresight-tmc-etf.c @@ -269,7 +269,7 @@ static void tmc_disable_etf_sink(struct coresight_device *csdev) } static int tmc_enable_etf_link(struct coresight_device *csdev, - int inport, int outport) + int inport, int outport, u32 mode) { unsigned long flags; struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); @@ -289,7 +289,7 @@ static int tmc_enable_etf_link(struct coresight_device *csdev, } static void tmc_disable_etf_link(struct coresight_device *csdev, - int inport, int outport) + int inport, int outport, u32 mode) { unsigned long flags; struct tmc_drvdata *drvdata = dev_get_drvdata(csdev->dev.parent); diff --git a/drivers/hwtracing/coresight/coresight.c b/drivers/hwtracing/coresight/coresight.c index 118b435f0887..edfb7f8d2f0b 100644 --- a/drivers/hwtracing/coresight/coresight.c +++ b/drivers/hwtracing/coresight/coresight.c @@ -161,7 +161,7 @@ static void coresight_disable_sink(struct coresight_device *csdev) static int coresight_enable_link(struct coresight_device *csdev, struct coresight_device *parent, - struct coresight_device *child) + struct coresight_device *child, u32 mode) { int ret; int link_subtype; @@ -186,7 +186,8 @@ static int coresight_enable_link(struct coresight_device *csdev, if (atomic_inc_return(&csdev->refcnt[refport]) == 1) { if (link_ops(csdev)->enable) { - ret = link_ops(csdev)->enable(csdev, inport, outport); + ret = link_ops(csdev)->enable(csdev, inport, + outport, mode); if (ret) return ret; } @@ -199,7 +200,7 @@ static int coresight_enable_link(struct coresight_device *csdev, static void coresight_disable_link(struct coresight_device *csdev, struct coresight_device *parent, - struct coresight_device *child) + struct coresight_device *child, u32 mode) { int i, nr_conns; int link_subtype; @@ -225,7 +226,7 @@ static void coresight_disable_link(struct coresight_device *csdev, if (atomic_dec_return(&csdev->refcnt[refport]) == 0) { if (link_ops(csdev)->disable) - link_ops(csdev)->disable(csdev, inport, outport); + link_ops(csdev)->disable(csdev, inport, outport, mode); } for (i = 0; i < nr_conns; i++) @@ -308,7 +309,7 @@ void coresight_disable_path(struct list_head *path, u32 mode) case CORESIGHT_DEV_TYPE_LINK: parent = list_prev_entry(nd, link)->csdev; child = list_next_entry(nd, link)->csdev; - coresight_disable_link(csdev, parent, child); + coresight_disable_link(csdev, parent, child, mode); break; default: break; @@ -357,7 +358,7 @@ int coresight_enable_path(struct list_head *path, u32 mode, void *sink_data) case CORESIGHT_DEV_TYPE_LINK: parent = list_prev_entry(nd, link)->csdev; child = list_next_entry(nd, link)->csdev; - ret = coresight_enable_link(csdev, parent, child); + ret = coresight_enable_link(csdev, parent, child, mode); if (ret) goto err; break; diff --git a/include/linux/coresight.h b/include/linux/coresight.h index 53535821dc25..8fc6f1e82c17 100644 --- a/include/linux/coresight.h +++ b/include/linux/coresight.h @@ -205,8 +205,10 @@ struct coresight_ops_sink { * @disable: disables flow between iport and oport. */ struct coresight_ops_link { - int (*enable)(struct coresight_device *csdev, int iport, int oport); - void (*disable)(struct coresight_device *csdev, int iport, int oport); + int (*enable)(struct coresight_device *csdev, + int iport, int oport, u32 mode); + void (*disable)(struct coresight_device *csdev, + int iport, int oport, u32 mode); }; /**