From: Alexander Shishkin <alexander.shishkin@linux.intel.com>
To: Greg KH <greg@kroah.com>
Cc: Mathieu Poirier <mathieu.poirier@linaro.org>,
Chunyan Zhang <zhang.chunyan@linaro.org>,
linux-kernel@vger.kernel.org,
Alexander Shishkin <alexander.shishkin@linux.intel.com>
Subject: [GIT PULL 08/10] intel_th: Allow forcing host mode through drvdata
Date: Thu, 29 Mar 2018 14:14:16 +0300 [thread overview]
Message-ID: <20180329111418.9416-9-alexander.shishkin@linux.intel.com> (raw)
In-Reply-To: <20180329111418.9416-1-alexander.shishkin@linux.intel.com>
Some devices can only operate in host mode, so we need means of
communicating this to the core driver on per-device basis. This
adds a flag to drvdata to signal host-only capability to the core.
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
drivers/hwtracing/intel_th/core.c | 6 ++++--
drivers/hwtracing/intel_th/intel_th.h | 4 +++-
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 8f820c182240..da962aa2cef5 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -630,7 +630,8 @@ intel_th_subdevice_alloc(struct intel_th *th,
thdev->output.port = -1;
thdev->output.scratchpad = subdev->scrpd;
} else if (subdev->type == INTEL_TH_SWITCH) {
- thdev->host_mode = host_mode;
+ thdev->host_mode =
+ INTEL_TH_CAP(th, host_mode_only) ? true : host_mode;
th->hub = thdev;
}
@@ -729,7 +730,8 @@ static int intel_th_populate(struct intel_th *th)
struct intel_th_device *thdev;
/* only allow SOURCE and SWITCH devices in host mode */
- if (host_mode && subdev->type == INTEL_TH_OUTPUT)
+ if ((INTEL_TH_CAP(th, host_mode_only) || host_mode) &&
+ subdev->type == INTEL_TH_OUTPUT)
continue;
/*
diff --git a/drivers/hwtracing/intel_th/intel_th.h b/drivers/hwtracing/intel_th/intel_th.h
index cdeed3b017d0..780206dc9012 100644
--- a/drivers/hwtracing/intel_th/intel_th.h
+++ b/drivers/hwtracing/intel_th/intel_th.h
@@ -42,9 +42,11 @@ struct intel_th_output {
/**
* struct intel_th_drvdata - describes hardware capabilities and quirks
* @tscu_enable: device needs SW to enable time stamping unit
+ * @host_mode_only: device can only operate in 'host debugger' mode
*/
struct intel_th_drvdata {
- unsigned int tscu_enable : 1;
+ unsigned int tscu_enable : 1,
+ host_mode_only : 1;
};
#define INTEL_TH_CAP(_th, _cap) ((_th)->drvdata ? (_th)->drvdata->_cap : 0)
--
2.16.2
next prev parent reply other threads:[~2018-03-29 11:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
2018-03-29 11:14 ` [GIT PULL 01/10] MAINTAINERS: Bestow upon myself the care for drivers/hwtracing Alexander Shishkin
2018-03-29 11:14 ` [GIT PULL 02/10] stm class: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate Alexander Shishkin
2018-03-29 11:14 ` [GIT PULL 03/10] stm class: Make dummy's master/channel ranges configurable Alexander Shishkin
2018-03-29 11:14 ` [GIT PULL 04/10] intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate Alexander Shishkin
2018-03-29 11:14 ` [GIT PULL 05/10] intel_th: Use correct method of finding hub Alexander Shishkin
2018-03-29 11:14 ` [GIT PULL 06/10] intel_th: Don't touch switch routing in host mode Alexander Shishkin
2018-03-29 11:14 ` [GIT PULL 07/10] intel_th: Pick up irq number from resources Alexander Shishkin
2018-03-29 11:14 ` Alexander Shishkin [this message]
2018-03-29 11:14 ` [GIT PULL 09/10] intel_th: Add ACPI glue layer Alexander Shishkin
2018-03-29 11:14 ` [GIT PULL 10/10] hwtracing: Add HW tracing support menu Alexander Shishkin
2018-03-29 16:40 ` [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Greg KH
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180329111418.9416-9-alexander.shishkin@linux.intel.com \
--to=alexander.shishkin@linux.intel.com \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.poirier@linaro.org \
--cc=zhang.chunyan@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®