stm class/intel_th: Updates for v4.17
Alexander Shishkin
maintainerHi 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
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 01/10] MAINTAINERS: Bestow upon myself the care for drivers/hwtracing
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.
--- MAINTAINERS | 5 +++++ 1 file changed, 5 insertions(+)
MAINTAINERS +5 -0
@@ -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 <[email protected]> +S: Maintained +F: drivers/hwtracing/ + HARDWARE SPINLOCK CORE M: Ohad Ben-Cohen <[email protected]> M: Bjorn Andersson <[email protected]>
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 02/10] stm class: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate
In reply to Alexander ShishkinThis adds SPDX GPL-2.0 header to to stm core files and removes the GPLv2 boilerplate text.
--- 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(-)
drivers/hwtracing/stm/console.c +1 -9
@@ -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. */
drivers/hwtracing/stm/core.c +1 -9
@@ -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. */
drivers/hwtracing/stm/dummy_stm.c +1 -9
@@ -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. */
drivers/hwtracing/stm/heartbeat.c +1 -9
@@ -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. */
drivers/hwtracing/stm/policy.c +1 -9
@@ -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. */
drivers/hwtracing/stm/stm.h +1 -9
@@ -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. */
include/linux/stm.h +1 -9
@@ -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_
include/uapi/linux/stm.h +0 -9
@@ -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. */
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 03/10] stm class: Make dummy's master/channel ranges configurable
In reply to Alexander ShishkinTo 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.
--- drivers/hwtracing/stm/dummy_stm.c | 24 +++++++++++++++++++++--- include/uapi/linux/stm.h | 4 ++++ 2 files changed, 25 insertions(+), 3 deletions(-)
drivers/hwtracing/stm/dummy_stm.c +21 -3
@@ -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;
include/uapi/linux/stm.h +4 -0
@@ -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
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 04/10] intel_th: Add SPDX GPL-2.0 header to replace GPLv2 boilerplate
In reply to Alexander ShishkinThis adds SPDX GPL-2.0 header to the Trace Hub driver and removes the GPLv2 boilerplate text.
--- 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(-)
drivers/hwtracing/intel_th/core.c +1 -9
@@ -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
drivers/hwtracing/intel_th/debug.c +1 -9
@@ -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>
drivers/hwtracing/intel_th/debug.h +1 -9
@@ -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__
drivers/hwtracing/intel_th/gth.c +1 -9
@@ -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
drivers/hwtracing/intel_th/gth.h +1 -9
@@ -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__
drivers/hwtracing/intel_th/intel_th.h +1 -9
@@ -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__
drivers/hwtracing/intel_th/msu.c +1 -9
@@ -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
drivers/hwtracing/intel_th/msu.h +1 -9
@@ -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__
drivers/hwtracing/intel_th/pci.c +1 -9
@@ -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
drivers/hwtracing/intel_th/pti.c +1 -9
@@ -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
drivers/hwtracing/intel_th/pti.h +1 -9
@@ -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__
drivers/hwtracing/intel_th/sth.c +1 -9
@@ -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
drivers/hwtracing/intel_th/sth.h +1 -9
@@ -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__
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 05/10] intel_th: Use correct method of finding hub
In reply to Alexander ShishkinSince 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.
--- drivers/hwtracing/intel_th/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hwtracing/intel_th/core.c +1 -1
@@ -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)
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 06/10] intel_th: Don't touch switch routing in host mode
In reply to Alexander ShishkinWhen 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.
--- drivers/hwtracing/intel_th/core.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/hwtracing/intel_th/core.c +4 -0
@@ -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 ;
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 07/10] intel_th: Pick up irq number from resources
In reply to Alexander ShishkinPlatform 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.
--- drivers/hwtracing/intel_th/core.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/hwtracing/intel_th/core.c +8 -1
@@ -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)
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 08/10] intel_th: Allow forcing host mode through drvdata
In reply to Alexander ShishkinSome 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.
--- drivers/hwtracing/intel_th/core.c | 6 ++++-- drivers/hwtracing/intel_th/intel_th.h | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/hwtracing/intel_th/core.c +4 -2
@@ -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 ;/*
drivers/hwtracing/intel_th/intel_th.h +3 -1
@@ -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)
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 09/10] intel_th: Add ACPI glue layer
In reply to Alexander ShishkinThe 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.
--- 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
drivers/hwtracing/intel_th/Kconfig +12 -0
@@ -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
drivers/hwtracing/intel_th/Makefile +3 -0
@@ -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
drivers/hwtracing/intel_th/acpi.c new file +79 -0
79 lines not on this page · raw message
Signature · 1 line
2.16.2
Alexander Shishkin
maintainer[GIT PULL 10/10] hwtracing: Add HW tracing support menu
In reply to Alexander ShishkinFrom: Randy Dunlap <[email protected]>
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.
--- drivers/Kconfig | 4 +--- drivers/hwtracing/Kconfig | 7 +++++++ 2 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 drivers/hwtracing/Kconfig
drivers/Kconfig +1 -3
@@ -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"
drivers/hwtracing/Kconfig new file +7 -0
@@ -0,0 +1,7 @@ +menu "HW tracing support" + +source "drivers/hwtracing/stm/Kconfig" + +source "drivers/hwtracing/intel_th/Kconfig" + +endmenu
Signature · 1 line
2.16.2
Quoted 11 lines · 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!
Quoted 7 lines
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.gittags/stm-intel_th-for-greg-20180329
All pulled in, thanks.
greg k-h