All of lore.kernel.org
 help / color / mirror / Atom feed
* [GIT PULL 00/10] stm class/intel_th: Updates for v4.17
@ 2018-03-29 11:14 Alexander Shishkin
  2018-03-29 11:14 ` [GIT PULL 01/10] MAINTAINERS: Bestow upon myself the care for drivers/hwtracing Alexander Shishkin
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

Hi Greg,

Here are the patches I have for the next merge window. As usual, these
are aiaiai-clean (cppcheck/sparse/smatch/coccinelle). Individual patches
follow, for your convenience. Apologies for the late request.

One big thing is the addition of an ACPI device support to the Trace Hub
driver. Other than that, these are small fixes and SPDX stuff.

Please consider pulling or applying. Thanks!

The following changes since commit 7928b2cbe55b2a410a0f5c1f154610059c57b1b2:

  Linux 4.16-rc1 (2018-02-11 15:04:29 -0800)

are available in the Git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/ash/stm.git tags/stm-intel_th-for-greg-20180329

for you to fetch changes up to 72ef0f24d587d38f235334aef69afe611bba0d16:

  hwtracing: Add HW tracing support menu (2018-03-29 13:38:10 +0300)

----------------------------------------------------------------
stm class/intel_th: Updates for 4.17

These are:
  * Mass conversion to GPL-2 SPDX header
  * Moved "hwtracing" to now its own submenu, to uncrowd the parent menu a bit
  * Added MAINTAINERS entry for drivers/hwtracing
  * Somewhat small Trace Hub fixes
  * Added ACPI glue layer for the Trace Hub
  * Added more module parameters to dummy_stm for better test coverage

----------------------------------------------------------------
Alexander Shishkin (9):
      MAINTAINERS: Bestow upon myself the care for drivers/hwtracing
      stm class: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate
      stm class: Make dummy's master/channel ranges configurable
      intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate
      intel_th: Use correct method of finding hub
      intel_th: Don't touch switch routing in host mode
      intel_th: Pick up irq number from resources
      intel_th: Allow forcing host mode through drvdata
      intel_th: Add ACPI glue layer

Randy Dunlap (1):
      hwtracing: Add HW tracing support menu

 MAINTAINERS                           |  5 +++
 drivers/Kconfig                       |  4 +-
 drivers/hwtracing/Kconfig             |  7 ++++
 drivers/hwtracing/intel_th/Kconfig    | 12 ++++++
 drivers/hwtracing/intel_th/Makefile   |  3 ++
 drivers/hwtracing/intel_th/acpi.c     | 79 +++++++++++++++++++++++++++++++++++
 drivers/hwtracing/intel_th/core.c     | 31 ++++++++------
 drivers/hwtracing/intel_th/debug.c    | 10 +----
 drivers/hwtracing/intel_th/debug.h    | 10 +----
 drivers/hwtracing/intel_th/gth.c      | 10 +----
 drivers/hwtracing/intel_th/gth.h      | 10 +----
 drivers/hwtracing/intel_th/intel_th.h | 14 ++-----
 drivers/hwtracing/intel_th/msu.c      | 10 +----
 drivers/hwtracing/intel_th/msu.h      | 10 +----
 drivers/hwtracing/intel_th/pci.c      | 10 +----
 drivers/hwtracing/intel_th/pti.c      | 10 +----
 drivers/hwtracing/intel_th/pti.h      | 10 +----
 drivers/hwtracing/intel_th/sth.c      | 10 +----
 drivers/hwtracing/intel_th/sth.h      | 10 +----
 drivers/hwtracing/stm/console.c       | 10 +----
 drivers/hwtracing/stm/core.c          | 10 +----
 drivers/hwtracing/stm/dummy_stm.c     | 34 +++++++++------
 drivers/hwtracing/stm/heartbeat.c     | 10 +----
 drivers/hwtracing/stm/policy.c        | 10 +----
 drivers/hwtracing/stm/stm.h           | 10 +----
 include/linux/stm.h                   | 10 +----
 include/uapi/linux/stm.h              | 13 ++----
 27 files changed, 172 insertions(+), 200 deletions(-)
 create mode 100644 drivers/hwtracing/Kconfig
 create mode 100644 drivers/hwtracing/intel_th/acpi.c

-- 
2.16.2

^ permalink raw reply	[flat|nested] 12+ messages in thread

* [GIT PULL 01/10] MAINTAINERS: Bestow upon myself the care for drivers/hwtracing
  2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
@ 2018-03-29 11:14 ` 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
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

Although all components of drivers/hwtracing are Maintained, the
directory itself isn't, which leads to confusion when people want
to patch the Kconfig file, for example.

This adds an entry to the MAINTAINERS file with myself as a
maintainer.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 MAINTAINERS | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/MAINTAINERS b/MAINTAINERS
index 3bdc260e36b7..48e426fcde97 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6242,6 +6242,11 @@ F:	Documentation/hw_random.txt
 F:	drivers/char/hw_random/
 F:	include/linux/hw_random.h
 
+HARDWARE TRACING FACILITIES
+M:	Alexander Shishkin <alexander.shishkin@linux.intel.com>
+S:	Maintained
+F:	drivers/hwtracing/
+
 HARDWARE SPINLOCK CORE
 M:	Ohad Ben-Cohen <ohad@wizery.com>
 M:	Bjorn Andersson <bjorn.andersson@linaro.org>
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [GIT PULL 02/10] stm class: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate
  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 ` Alexander Shishkin
  2018-03-29 11:14 ` [GIT PULL 03/10] stm class: Make dummy's master/channel ranges configurable Alexander Shishkin
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

This adds SPDX GPL-2.0 header to to stm core files and removes the
GPLv2 boilerplate text.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/stm/console.c   | 10 +---------
 drivers/hwtracing/stm/core.c      | 10 +---------
 drivers/hwtracing/stm/dummy_stm.c | 10 +---------
 drivers/hwtracing/stm/heartbeat.c | 10 +---------
 drivers/hwtracing/stm/policy.c    | 10 +---------
 drivers/hwtracing/stm/stm.h       | 10 +---------
 include/linux/stm.h               | 10 +---------
 include/uapi/linux/stm.h          |  9 ---------
 8 files changed, 7 insertions(+), 72 deletions(-)

diff --git a/drivers/hwtracing/stm/console.c b/drivers/hwtracing/stm/console.c
index c9d9a8d2ff52..a00f65e21747 100644
--- a/drivers/hwtracing/stm/console.c
+++ b/drivers/hwtracing/stm/console.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Simple kernel console driver for STM devices
  * Copyright (c) 2014, Intel Corporation.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
  * STM console will send kernel messages over STM devices to a trace host.
  */
 
diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index f129869e05a9..05386b76465e 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * System Trace Module (STM) infrastructure
  * Copyright (c) 2014, Intel Corporation.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
  * STM class implements generic infrastructure for  System Trace Module devices
  * as defined in MIPI STPv2 specification.
  */
diff --git a/drivers/hwtracing/stm/dummy_stm.c b/drivers/hwtracing/stm/dummy_stm.c
index c5f94ca31c4d..63288020ea5b 100644
--- a/drivers/hwtracing/stm/dummy_stm.c
+++ b/drivers/hwtracing/stm/dummy_stm.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * A dummy STM device for stm/stm_source class testing.
  * Copyright (c) 2014, Intel Corporation.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
  * STM class implements generic infrastructure for  System Trace Module devices
  * as defined in MIPI STPv2 specification.
  */
diff --git a/drivers/hwtracing/stm/heartbeat.c b/drivers/hwtracing/stm/heartbeat.c
index 3da7b673aab2..7db42395e131 100644
--- a/drivers/hwtracing/stm/heartbeat.c
+++ b/drivers/hwtracing/stm/heartbeat.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Simple heartbeat STM source driver
  * Copyright (c) 2016, Intel Corporation.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
  * Heartbeat STM source will send repetitive messages over STM devices to a
  * trace host.
  */
diff --git a/drivers/hwtracing/stm/policy.c b/drivers/hwtracing/stm/policy.c
index 33e9a1b6ea7c..3fd07e275b34 100644
--- a/drivers/hwtracing/stm/policy.c
+++ b/drivers/hwtracing/stm/policy.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * System Trace Module (STM) master/channel allocation policy management
  * Copyright (c) 2014, Intel Corporation.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
  * A master/channel allocation policy allows mapping string identifiers to
  * master and channel ranges, where allocation can be done.
  */
diff --git a/drivers/hwtracing/stm/stm.h b/drivers/hwtracing/stm/stm.h
index 4e8c6926260f..923571adc6f4 100644
--- a/drivers/hwtracing/stm/stm.h
+++ b/drivers/hwtracing/stm/stm.h
@@ -1,16 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * System Trace Module (STM) infrastructure
  * Copyright (c) 2014, Intel Corporation.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
  * STM class implements generic infrastructure for  System Trace Module devices
  * as defined in MIPI STPv2 specification.
  */
diff --git a/include/linux/stm.h b/include/linux/stm.h
index 210ff2292361..c6f577ab6f21 100644
--- a/include/linux/stm.h
+++ b/include/linux/stm.h
@@ -1,15 +1,7 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * System Trace Module (STM) infrastructure apis
  * Copyright (C) 2014 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #ifndef _STM_H_
diff --git a/include/uapi/linux/stm.h b/include/uapi/linux/stm.h
index dbffdc23d804..29c89be72275 100644
--- a/include/uapi/linux/stm.h
+++ b/include/uapi/linux/stm.h
@@ -3,15 +3,6 @@
  * System Trace Module (STM) userspace interfaces
  * Copyright (c) 2014, Intel Corporation.
  *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
- *
  * STM class implements generic infrastructure for  System Trace Module devices
  * as defined in MIPI STPv2 specification.
  */
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [GIT PULL 03/10] stm class: Make dummy's master/channel ranges configurable
  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 ` 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
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

To allow for more flexible testing of the stm class, make it possible
to specify the ranges of masters and channels that the dummy_stm devices
cover. This is done via module parameters.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/stm/dummy_stm.c | 24 +++++++++++++++++++++---
 include/uapi/linux/stm.h          |  4 ++++
 2 files changed, 25 insertions(+), 3 deletions(-)

diff --git a/drivers/hwtracing/stm/dummy_stm.c b/drivers/hwtracing/stm/dummy_stm.c
index 63288020ea5b..38528ffdc0b3 100644
--- a/drivers/hwtracing/stm/dummy_stm.c
+++ b/drivers/hwtracing/stm/dummy_stm.c
@@ -12,6 +12,7 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/stm.h>
+#include <uapi/linux/stm.h>
 
 static ssize_t notrace
 dummy_stm_packet(struct stm_data *stm_data, unsigned int master,
@@ -44,6 +45,18 @@ static unsigned int fail_mode;
 
 module_param(fail_mode, int, 0600);
 
+static unsigned int master_min;
+
+module_param(master_min, int, 0400);
+
+static unsigned int master_max = STP_MASTER_MAX;
+
+module_param(master_max, int, 0400);
+
+static unsigned int nr_channels = STP_CHANNEL_MAX;
+
+module_param(nr_channels, int, 0400);
+
 static int dummy_stm_link(struct stm_data *data, unsigned int master,
 			  unsigned int channel)
 {
@@ -60,14 +73,19 @@ static int dummy_stm_init(void)
 	if (nr_dummies < 0 || nr_dummies > DUMMY_STM_MAX)
 		return -EINVAL;
 
+	if (master_min > master_max ||
+	    master_max > STP_MASTER_MAX ||
+	    nr_channels > STP_CHANNEL_MAX)
+		return -EINVAL;
+
 	for (i = 0; i < nr_dummies; i++) {
 		dummy_stm[i].name = kasprintf(GFP_KERNEL, "dummy_stm.%d", i);
 		if (!dummy_stm[i].name)
 			goto fail_unregister;
 
-		dummy_stm[i].sw_start		= 0x0000;
-		dummy_stm[i].sw_end		= 0xffff;
-		dummy_stm[i].sw_nchannels	= 0xffff;
+		dummy_stm[i].sw_start		= master_min;
+		dummy_stm[i].sw_end		= master_max;
+		dummy_stm[i].sw_nchannels	= nr_channels;
 		dummy_stm[i].packet		= dummy_stm_packet;
 		dummy_stm[i].link		= dummy_stm_link;
 
diff --git a/include/uapi/linux/stm.h b/include/uapi/linux/stm.h
index 29c89be72275..7bac318b4440 100644
--- a/include/uapi/linux/stm.h
+++ b/include/uapi/linux/stm.h
@@ -12,6 +12,10 @@
 
 #include <linux/types.h>
 
+/* Maximum allowed master and channel values */
+#define STP_MASTER_MAX	0xffff
+#define STP_CHANNEL_MAX	0xffff
+
 /**
  * struct stp_policy_id - identification for the STP policy
  * @size:	size of the structure including real id[] length
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [GIT PULL 04/10] intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate
  2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
                   ` (2 preceding siblings ...)
  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 ` Alexander Shishkin
  2018-03-29 11:14 ` [GIT PULL 05/10] intel_th: Use correct method of finding hub Alexander Shishkin
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

This adds SPDX GPL-2.0 header to the Trace Hub driver and removes the
GPLv2 boilerplate text.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/core.c     | 10 +---------
 drivers/hwtracing/intel_th/debug.c    | 10 +---------
 drivers/hwtracing/intel_th/debug.h    | 10 +---------
 drivers/hwtracing/intel_th/gth.c      | 10 +---------
 drivers/hwtracing/intel_th/gth.h      | 10 +---------
 drivers/hwtracing/intel_th/intel_th.h | 10 +---------
 drivers/hwtracing/intel_th/msu.c      | 10 +---------
 drivers/hwtracing/intel_th/msu.h      | 10 +---------
 drivers/hwtracing/intel_th/pci.c      | 10 +---------
 drivers/hwtracing/intel_th/pti.c      | 10 +---------
 drivers/hwtracing/intel_th/pti.h      | 10 +---------
 drivers/hwtracing/intel_th/sth.c      | 10 +---------
 drivers/hwtracing/intel_th/sth.h      | 10 +---------
 13 files changed, 13 insertions(+), 117 deletions(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 1a023e30488c..bf1e4543c722 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Intel(R) Trace Hub driver core
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
diff --git a/drivers/hwtracing/intel_th/debug.c b/drivers/hwtracing/intel_th/debug.c
index 788a1f0a97ad..ff79063118a0 100644
--- a/drivers/hwtracing/intel_th/debug.c
+++ b/drivers/hwtracing/intel_th/debug.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Intel(R) Trace Hub driver debugging
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #include <linux/types.h>
diff --git a/drivers/hwtracing/intel_th/debug.h b/drivers/hwtracing/intel_th/debug.h
index 88311bad3ba4..78bd7e4bf9ce 100644
--- a/drivers/hwtracing/intel_th/debug.h
+++ b/drivers/hwtracing/intel_th/debug.h
@@ -1,16 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Intel(R) Trace Hub driver debugging
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #ifndef __INTEL_TH_DEBUG_H__
diff --git a/drivers/hwtracing/intel_th/gth.c b/drivers/hwtracing/intel_th/gth.c
index 018678ec3c13..8426b7970c14 100644
--- a/drivers/hwtracing/intel_th/gth.c
+++ b/drivers/hwtracing/intel_th/gth.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Intel(R) Trace Hub Global Trace Hub
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
diff --git a/drivers/hwtracing/intel_th/gth.h b/drivers/hwtracing/intel_th/gth.h
index f3d234251a12..6f2b0b930875 100644
--- a/drivers/hwtracing/intel_th/gth.h
+++ b/drivers/hwtracing/intel_th/gth.h
@@ -1,16 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Intel(R) Trace Hub Global Trace Hub (GTH) data structures
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #ifndef __INTEL_TH_GTH_H__
diff --git a/drivers/hwtracing/intel_th/intel_th.h b/drivers/hwtracing/intel_th/intel_th.h
index 99ad563fc40d..cdeed3b017d0 100644
--- a/drivers/hwtracing/intel_th/intel_th.h
+++ b/drivers/hwtracing/intel_th/intel_th.h
@@ -1,16 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Intel(R) Trace Hub data structures
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #ifndef __INTEL_TH_H__
diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index dfb57eaa9f22..ede388309376 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Intel(R) Trace Hub Memory Storage Unit
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
diff --git a/drivers/hwtracing/intel_th/msu.h b/drivers/hwtracing/intel_th/msu.h
index 9b710e4aa98a..9cc8aced6116 100644
--- a/drivers/hwtracing/intel_th/msu.h
+++ b/drivers/hwtracing/intel_th/msu.h
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Intel(R) Trace Hub Memory Storage Unit (MSU) data structures
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #ifndef __INTEL_TH_MSU_H__
diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
index c2a2ce8ee541..c2e55e5d97f6 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Intel(R) Trace Hub pci driver
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
diff --git a/drivers/hwtracing/intel_th/pti.c b/drivers/hwtracing/intel_th/pti.c
index e96a1fcb57b2..56694339cb06 100644
--- a/drivers/hwtracing/intel_th/pti.c
+++ b/drivers/hwtracing/intel_th/pti.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Intel(R) Trace Hub PTI output driver
  *
  * Copyright (C) 2014-2016 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
diff --git a/drivers/hwtracing/intel_th/pti.h b/drivers/hwtracing/intel_th/pti.h
index 30827be67b4c..e9381babc84c 100644
--- a/drivers/hwtracing/intel_th/pti.h
+++ b/drivers/hwtracing/intel_th/pti.h
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Intel(R) Trace Hub PTI output data structures
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #ifndef __INTEL_TH_STH_H__
diff --git a/drivers/hwtracing/intel_th/sth.c b/drivers/hwtracing/intel_th/sth.c
index b03444624648..4b7ae47789d2 100644
--- a/drivers/hwtracing/intel_th/sth.c
+++ b/drivers/hwtracing/intel_th/sth.c
@@ -1,16 +1,8 @@
+// SPDX-License-Identifier: GPL-2.0
 /*
  * Intel(R) Trace Hub Software Trace Hub support
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
diff --git a/drivers/hwtracing/intel_th/sth.h b/drivers/hwtracing/intel_th/sth.h
index f1390cd4f2ed..f97fc0c51739 100644
--- a/drivers/hwtracing/intel_th/sth.h
+++ b/drivers/hwtracing/intel_th/sth.h
@@ -1,16 +1,8 @@
+/* SPDX-License-Identifier: GPL-2.0 */
 /*
  * Intel(R) Trace Hub Software Trace Hub (STH) data structures
  *
  * Copyright (C) 2014-2015 Intel Corporation.
- *
- * This program is free software; you can redistribute it and/or modify it
- * under the terms and conditions of the GNU General Public License,
- * version 2, as published by the Free Software Foundation.
- *
- * This program is distributed in the hope it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
- * more details.
  */
 
 #ifndef __INTEL_TH_STH_H__
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [GIT PULL 05/10] intel_th: Use correct method of finding hub
  2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
                   ` (3 preceding siblings ...)
  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 ` Alexander Shishkin
  2018-03-29 11:14 ` [GIT PULL 06/10] intel_th: Don't touch switch routing in host mode Alexander Shishkin
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

Since commit 8edc514b01e9 ("intel_th: Make SOURCE devices children of the
root device") the hub is not the parent of SOURCE devices any more, so the
new helper function should be used for that instead of always using the
parent. The intel_th_set_output() path, however, still uses the old
logic, leading to the hub driver structure being aliased with something
else, like struct pci_driver or struct acpi_driver, and an incorrect call
to an address inferred from that, potentially resulting in a crash.

Fixes: 8edc514b01e9 ("intel_th: Make SOURCE devices children of the root device")
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index bf1e4543c722..8e4f5fd8a43e 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -927,7 +927,7 @@ EXPORT_SYMBOL_GPL(intel_th_trace_disable);
 int intel_th_set_output(struct intel_th_device *thdev,
 			unsigned int master)
 {
-	struct intel_th_device *hub = to_intel_th_device(thdev->dev.parent);
+	struct intel_th_device *hub = to_intel_th_hub(thdev);
 	struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
 
 	if (!hubdrv->set_output)
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [GIT PULL 06/10] intel_th: Don't touch switch routing in host mode
  2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
                   ` (4 preceding siblings ...)
  2018-03-29 11:14 ` [GIT PULL 05/10] intel_th: Use correct method of finding hub Alexander Shishkin
@ 2018-03-29 11:14 ` Alexander Shishkin
  2018-03-29 11:14 ` [GIT PULL 07/10] intel_th: Pick up irq number from resources Alexander Shishkin
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

When the Trace Hub is operating in Host Debugger mode, it is up to the
debugger to configure master routing even for the software sources. Do
not do this in the driver in this case.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/core.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index 8e4f5fd8a43e..d295b221e0bc 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -930,6 +930,10 @@ int intel_th_set_output(struct intel_th_device *thdev,
 	struct intel_th_device *hub = to_intel_th_hub(thdev);
 	struct intel_th_driver *hubdrv = to_intel_th_driver(hub->dev.driver);
 
+	/* In host mode, this is up to the external debugger, do nothing. */
+	if (hub->host_mode)
+		return 0;
+
 	if (!hubdrv->set_output)
 		return -ENOTSUPP;
 
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [GIT PULL 07/10] intel_th: Pick up irq number from resources
  2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
                   ` (5 preceding siblings ...)
  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 ` Alexander Shishkin
  2018-03-29 11:14 ` [GIT PULL 08/10] intel_th: Allow forcing host mode through drvdata Alexander Shishkin
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

Platform devices pass their IRQs around as resources, so as a convenience
for the glue layer code, allow them pass the IRQ to the core driver in
the resources array.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/core.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index d295b221e0bc..8f820c182240 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -805,7 +805,14 @@ intel_th_alloc(struct device *dev, struct intel_th_drvdata *drvdata,
 	       struct resource *devres, unsigned int ndevres, int irq)
 {
 	struct intel_th *th;
-	int err;
+	int err, r;
+
+	if (irq == -1)
+		for (r = 0; r < ndevres; r++)
+			if (devres[r].flags & IORESOURCE_IRQ) {
+				irq = devres[r].start;
+				break;
+			}
 
 	th = kzalloc(sizeof(*th), GFP_KERNEL);
 	if (!th)
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [GIT PULL 08/10] intel_th: Allow forcing host mode through drvdata
  2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
                   ` (6 preceding siblings ...)
  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
  2018-03-29 11:14 ` [GIT PULL 09/10] intel_th: Add ACPI glue layer Alexander Shishkin
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [GIT PULL 09/10] intel_th: Add ACPI glue layer
  2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
                   ` (7 preceding siblings ...)
  2018-03-29 11:14 ` [GIT PULL 08/10] intel_th: Allow forcing host mode through drvdata Alexander Shishkin
@ 2018-03-29 11:14 ` 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
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Alexander Shishkin

The Trace Hub devices now can be enumerated as ACPI devices, which
translates into "Host Debugger mode". There are two IDs: one for
PCH Trace Hub, and one for the uncore Trace Hub. These are expected
to stay the same across all platforms.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/Kconfig  | 12 ++++++
 drivers/hwtracing/intel_th/Makefile |  3 ++
 drivers/hwtracing/intel_th/acpi.c   | 79 +++++++++++++++++++++++++++++++++++++
 3 files changed, 94 insertions(+)
 create mode 100644 drivers/hwtracing/intel_th/acpi.c

diff --git a/drivers/hwtracing/intel_th/Kconfig b/drivers/hwtracing/intel_th/Kconfig
index 1b412f8a56b5..ca0527d588e9 100644
--- a/drivers/hwtracing/intel_th/Kconfig
+++ b/drivers/hwtracing/intel_th/Kconfig
@@ -25,6 +25,18 @@ config INTEL_TH_PCI
 
 	  Say Y here to enable PCI Intel TH support.
 
+config INTEL_TH_ACPI
+	tristate "Intel(R) Trace Hub ACPI controller"
+	depends on ACPI
+	help
+	  Intel(R) Trace Hub may exist as an ACPI device. This option enables
+	  support glue layer for ACPI-based Intel TH. This typically implies
+	  'host debugger' mode, that is, the trace configuration and capture
+	  is handled by an external debug host and corresponding controls will
+	  not be available on the target.
+
+	  Say Y here to enable ACPI Intel TH support.
+
 config INTEL_TH_GTH
 	tristate "Intel(R) Trace Hub Global Trace Hub"
 	help
diff --git a/drivers/hwtracing/intel_th/Makefile b/drivers/hwtracing/intel_th/Makefile
index 880c9b5e8566..d9252fa8d9ca 100644
--- a/drivers/hwtracing/intel_th/Makefile
+++ b/drivers/hwtracing/intel_th/Makefile
@@ -6,6 +6,9 @@ intel_th-$(CONFIG_INTEL_TH_DEBUG) += debug.o
 obj-$(CONFIG_INTEL_TH_PCI)	+= intel_th_pci.o
 intel_th_pci-y			:= pci.o
 
+obj-$(CONFIG_INTEL_TH_ACPI)	+= intel_th_acpi.o
+intel_th_acpi-y			:= acpi.o
+
 obj-$(CONFIG_INTEL_TH_GTH)	+= intel_th_gth.o
 intel_th_gth-y			:= gth.o
 
diff --git a/drivers/hwtracing/intel_th/acpi.c b/drivers/hwtracing/intel_th/acpi.c
new file mode 100644
index 000000000000..87bc3744755f
--- /dev/null
+++ b/drivers/hwtracing/intel_th/acpi.c
@@ -0,0 +1,79 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Intel(R) Trace Hub ACPI driver
+ *
+ * Copyright (C) 2017 Intel Corporation.
+ */
+
+#define pr_fmt(fmt)	KBUILD_MODNAME ": " fmt
+
+#include <linux/types.h>
+#include <linux/module.h>
+#include <linux/device.h>
+#include <linux/sysfs.h>
+#include <linux/platform_device.h>
+#include <linux/acpi.h>
+
+#include "intel_th.h"
+
+#define DRIVER_NAME "intel_th_acpi"
+
+static const struct intel_th_drvdata intel_th_acpi_pch = {
+	.host_mode_only	= 1,
+};
+
+static const struct intel_th_drvdata intel_th_acpi_uncore = {
+	.host_mode_only	= 1,
+};
+
+static const struct acpi_device_id intel_th_acpi_ids[] = {
+	{ "INTC1000",	(kernel_ulong_t)&intel_th_acpi_uncore },
+	{ "INTC1001",	(kernel_ulong_t)&intel_th_acpi_pch },
+	{ "",		0 },
+};
+
+MODULE_DEVICE_TABLE(acpi, intel_th_acpi_ids);
+
+static int intel_th_acpi_probe(struct platform_device *pdev)
+{
+	struct acpi_device *adev = ACPI_COMPANION(&pdev->dev);
+	const struct acpi_device_id *id;
+	struct intel_th *th;
+
+	id = acpi_match_device(intel_th_acpi_ids, &pdev->dev);
+	if (!id)
+		return -ENODEV;
+
+	th = intel_th_alloc(&pdev->dev, (void *)id->driver_data,
+			    pdev->resource, pdev->num_resources, -1);
+	if (IS_ERR(th))
+		return PTR_ERR(th);
+
+	adev->driver_data = th;
+
+	return 0;
+}
+
+static int intel_th_acpi_remove(struct platform_device *pdev)
+{
+	struct intel_th *th = platform_get_drvdata(pdev);
+
+	intel_th_free(th);
+
+	return 0;
+}
+
+static struct platform_driver intel_th_acpi_driver = {
+	.probe		= intel_th_acpi_probe,
+	.remove		= intel_th_acpi_remove,
+	.driver		= {
+		.name			= DRIVER_NAME,
+		.acpi_match_table	= intel_th_acpi_ids,
+	},
+};
+
+module_platform_driver(intel_th_acpi_driver);
+
+MODULE_LICENSE("GPL v2");
+MODULE_DESCRIPTION("Intel(R) Trace Hub ACPI controller driver");
+MODULE_AUTHOR("Alexander Shishkin <alexander.shishkin@intel.com>");
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [GIT PULL 10/10] hwtracing: Add HW tracing support menu
  2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
                   ` (8 preceding siblings ...)
  2018-03-29 11:14 ` [GIT PULL 09/10] intel_th: Add ACPI glue layer Alexander Shishkin
@ 2018-03-29 11:14 ` Alexander Shishkin
  2018-03-29 16:40 ` [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Greg KH
  10 siblings, 0 replies; 12+ messages in thread
From: Alexander Shishkin @ 2018-03-29 11:14 UTC (permalink / raw)
  To: Greg KH
  Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel, Randy Dunlap,
	Alexander Shishkin

From: Randy Dunlap <rdunlap@infradead.org>

Make a "HW tracing support" menu and move 2 entries into it.
(No change in Coresight, which is ARM-specific and is only listed for
ARM & ARM64.)

This makes the Device Drivers menu more consistent and prevents these
drivers from being listed at the top level of the Device Drivers menu.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/Kconfig           | 4 +---
 drivers/hwtracing/Kconfig | 7 +++++++
 2 files changed, 8 insertions(+), 3 deletions(-)
 create mode 100644 drivers/hwtracing/Kconfig

diff --git a/drivers/Kconfig b/drivers/Kconfig
index 879dc0604cba..95b9ccc08165 100644
--- a/drivers/Kconfig
+++ b/drivers/Kconfig
@@ -199,9 +199,7 @@ source "drivers/dax/Kconfig"
 
 source "drivers/nvmem/Kconfig"
 
-source "drivers/hwtracing/stm/Kconfig"
-
-source "drivers/hwtracing/intel_th/Kconfig"
+source "drivers/hwtracing/Kconfig"
 
 source "drivers/fpga/Kconfig"
 
diff --git a/drivers/hwtracing/Kconfig b/drivers/hwtracing/Kconfig
new file mode 100644
index 000000000000..f68e025c5131
--- /dev/null
+++ b/drivers/hwtracing/Kconfig
@@ -0,0 +1,7 @@
+menu "HW tracing support"
+
+source "drivers/hwtracing/stm/Kconfig"
+
+source "drivers/hwtracing/intel_th/Kconfig"
+
+endmenu
-- 
2.16.2

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [GIT PULL 00/10] stm class/intel_th: Updates for v4.17
  2018-03-29 11:14 [GIT PULL 00/10] stm class/intel_th: Updates for v4.17 Alexander Shishkin
                   ` (9 preceding siblings ...)
  2018-03-29 11:14 ` [GIT PULL 10/10] hwtracing: Add HW tracing support menu Alexander Shishkin
@ 2018-03-29 16:40 ` Greg KH
  10 siblings, 0 replies; 12+ messages in thread
From: Greg KH @ 2018-03-29 16:40 UTC (permalink / raw)
  To: Alexander Shishkin; +Cc: Mathieu Poirier, Chunyan Zhang, linux-kernel

On Thu, Mar 29, 2018 at 02:14:08PM +0300, Alexander Shishkin wrote:
> Hi Greg,
> 
> Here are the patches I have for the next merge window. As usual, these
> are aiaiai-clean (cppcheck/sparse/smatch/coccinelle). Individual patches
> follow, for your convenience. Apologies for the late request.
> 
> One big thing is the addition of an ACPI device support to the Trace Hub
> driver. Other than that, these are small fixes and SPDX stuff.
> 
> Please consider pulling or applying. Thanks!
> 
> The following changes since commit 7928b2cbe55b2a410a0f5c1f154610059c57b1b2:
> 
>   Linux 4.16-rc1 (2018-02-11 15:04:29 -0800)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/ash/stm.git tags/stm-intel_th-for-greg-20180329

All pulled in, thanks.

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-03-29 16:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [GIT PULL 08/10] intel_th: Allow forcing host mode through drvdata Alexander Shishkin
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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.