2024-04-29 15:11:54

by Alexander Shishkin

[permalink] [raw]
Subject: [PATCH v1 00/15] stm class/intel_th: Updates for v6.10

Hi Greg,

Here are the patches I have for the next cycle. The bulk of them are new
PCI IDs. Besides that, there are cosmetic changes, one actual bugfix and
a new feature added to the SyS-T protocol driver that uses a specially
designated format for ftrace data. I re-added Uwe's patch converting
platform device's remove: dropping it was a brainfart on my part.
Please consider applying. Thanks!

Alexander Shishkin (6):
intel_th: pci: Add Granite Rapids support
intel_th: pci: Add Granite Rapids SOC support
intel_th: pci: Add Sapphire Rapids SOC support
intel_th: pci: Add Meteor Lake-S support
intel_th: pci: Add Meteor Lake-S CPU support
intel_th: pci: Add Lunar Lake support

Colin Ian King (1):
intel_th: Remove redundant initialization of pointer outp

Dan Carpenter (1):
stm class: Fix a double free in stm_register_device()

Li Zhijian (1):
intel_th: Convert sprintf/snprintf to sysfs_emit

Mikhail Lappo (3):
stm class: Add source type
stm class: Propagate source type to protocols
stm class: sys-t: Improve ftrace source handling

Randy Dunlap (1):
intel_th: msu: Fix kernel-doc warnings

Ricardo B. Marliere (1):
intel_th: Constify the struct device_type usage

Uwe Kleine-König (1):
intel_th: Convert to platform remove callback returning void

drivers/hwtracing/intel_th/acpi.c | 6 +-
drivers/hwtracing/intel_th/core.c | 8 +--
drivers/hwtracing/intel_th/gth.c | 8 +--
drivers/hwtracing/intel_th/msu.c | 12 +++-
drivers/hwtracing/intel_th/pci.c | 30 ++++++++++
drivers/hwtracing/intel_th/sth.c | 2 +-
drivers/hwtracing/stm/console.c | 1 +
drivers/hwtracing/stm/core.c | 19 ++++---
drivers/hwtracing/stm/ftrace.c | 1 +
drivers/hwtracing/stm/heartbeat.c | 1 +
drivers/hwtracing/stm/p_basic.c | 3 +-
drivers/hwtracing/stm/p_sys-t.c | 93 ++++++++++++++++++++++++++++---
drivers/hwtracing/stm/stm.h | 2 +-
include/linux/stm.h | 12 ++++
14 files changed, 164 insertions(+), 34 deletions(-)

--
2.43.0



2024-04-29 15:38:34

by Alexander Shishkin

[permalink] [raw]
Subject: [PATCH v1 03/15] stm class: Propagate source type to protocols

From: Mikhail Lappo <[email protected]>

Pass stm source type via stm_write() to allow different handling on
protocol level.

The measure above should allow protocol level encoder to differentiate
and accordingly pack the messages. As an example SyS-T might get use of
ftrace message ID's and instead of applying regular header, pack them
as SyS-T catalog or SyS-T Structured Binary Data message to allow proper
decoding on the other side.

Signed-off-by: Mikhail Lappo <[email protected]>
Signed-off-by: Alexander Shishkin <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
---
drivers/hwtracing/stm/core.c | 8 ++++----
drivers/hwtracing/stm/p_basic.c | 3 ++-
drivers/hwtracing/stm/p_sys-t.c | 3 ++-
drivers/hwtracing/stm/stm.h | 2 +-
4 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/hwtracing/stm/core.c b/drivers/hwtracing/stm/core.c
index 20895d391562..ccf39a80dc4f 100644
--- a/drivers/hwtracing/stm/core.c
+++ b/drivers/hwtracing/stm/core.c
@@ -600,7 +600,7 @@ EXPORT_SYMBOL_GPL(stm_data_write);

static ssize_t notrace
stm_write(struct stm_device *stm, struct stm_output *output,
- unsigned int chan, const char *buf, size_t count)
+ unsigned int chan, const char *buf, size_t count, struct stm_source_data *source)
{
int err;

@@ -608,7 +608,7 @@ stm_write(struct stm_device *stm, struct stm_output *output,
if (!stm->pdrv)
return -ENODEV;

- err = stm->pdrv->write(stm->data, output, chan, buf, count);
+ err = stm->pdrv->write(stm->data, output, chan, buf, count, source);
if (err < 0)
return err;

@@ -657,7 +657,7 @@ static ssize_t stm_char_write(struct file *file, const char __user *buf,

pm_runtime_get_sync(&stm->dev);

- count = stm_write(stm, &stmf->output, 0, kbuf, count);
+ count = stm_write(stm, &stmf->output, 0, kbuf, count, NULL);

pm_runtime_mark_last_busy(&stm->dev);
pm_runtime_put_autosuspend(&stm->dev);
@@ -1299,7 +1299,7 @@ int notrace stm_source_write(struct stm_source_data *data,

stm = srcu_dereference(src->link, &stm_source_srcu);
if (stm)
- count = stm_write(stm, &src->output, chan, buf, count);
+ count = stm_write(stm, &src->output, chan, buf, count, data);
else
count = -ENODEV;

diff --git a/drivers/hwtracing/stm/p_basic.c b/drivers/hwtracing/stm/p_basic.c
index 8980a6a5fd6c..5525c975cc6f 100644
--- a/drivers/hwtracing/stm/p_basic.c
+++ b/drivers/hwtracing/stm/p_basic.c
@@ -10,7 +10,8 @@
#include "stm.h"

static ssize_t basic_write(struct stm_data *data, struct stm_output *output,
- unsigned int chan, const char *buf, size_t count)
+ unsigned int chan, const char *buf, size_t count,
+ struct stm_source_data *source)
{
unsigned int c = output->channel + chan;
unsigned int m = output->master;
diff --git a/drivers/hwtracing/stm/p_sys-t.c b/drivers/hwtracing/stm/p_sys-t.c
index 8254971c02e7..5b4b9f350ec1 100644
--- a/drivers/hwtracing/stm/p_sys-t.c
+++ b/drivers/hwtracing/stm/p_sys-t.c
@@ -285,7 +285,8 @@ sys_t_clock_sync(struct stm_data *data, unsigned int m, unsigned int c)
}

static ssize_t sys_t_write(struct stm_data *data, struct stm_output *output,
- unsigned int chan, const char *buf, size_t count)
+ unsigned int chan, const char *buf, size_t count,
+ struct stm_source_data *source)
{
struct sys_t_output *op = output->pdrv_private;
unsigned int c = output->channel + chan;
diff --git a/drivers/hwtracing/stm/stm.h b/drivers/hwtracing/stm/stm.h
index a9be49fc7a6b..85dda6e0d10c 100644
--- a/drivers/hwtracing/stm/stm.h
+++ b/drivers/hwtracing/stm/stm.h
@@ -96,7 +96,7 @@ struct stm_protocol_driver {
const char *name;
ssize_t (*write)(struct stm_data *data,
struct stm_output *output, unsigned int chan,
- const char *buf, size_t count);
+ const char *buf, size_t count, struct stm_source_data *source);
void (*policy_node_init)(void *arg);
int (*output_open)(void *priv, struct stm_output *output);
void (*output_close)(struct stm_output *output);
--
2.43.0


2024-04-29 15:58:13

by Alexander Shishkin

[permalink] [raw]
Subject: [PATCH v1 06/15] intel_th: Constify the struct device_type usage

From: "Ricardo B. Marliere" <[email protected]>

Since commit aed65af1cc2f ("drivers: make device_type const"), the driver
core can properly handle constant struct device_type. Move the
intel_th_source_device_type, intel_th_output_device_type,
intel_th_switch_device_type and intel_th_device_type variables to be
constant structures as well, placing it into read-only memory which can not
be modified at runtime.

Signed-off-by: Ricardo B. Marliere <[email protected]>
Signed-off-by: Alexander Shishkin <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
---
drivers/hwtracing/intel_th/core.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index cc7f879bb175..3511f3618f2d 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -180,7 +180,7 @@ static void intel_th_device_release(struct device *dev)
intel_th_device_free(to_intel_th_device(dev));
}

-static struct device_type intel_th_source_device_type = {
+static const struct device_type intel_th_source_device_type = {
.name = "intel_th_source_device",
.release = intel_th_device_release,
};
@@ -333,19 +333,19 @@ static struct attribute *intel_th_output_attrs[] = {

ATTRIBUTE_GROUPS(intel_th_output);

-static struct device_type intel_th_output_device_type = {
+static const struct device_type intel_th_output_device_type = {
.name = "intel_th_output_device",
.groups = intel_th_output_groups,
.release = intel_th_device_release,
.devnode = intel_th_output_devnode,
};

-static struct device_type intel_th_switch_device_type = {
+static const struct device_type intel_th_switch_device_type = {
.name = "intel_th_switch_device",
.release = intel_th_device_release,
};

-static struct device_type *intel_th_device_type[] = {
+static const struct device_type *intel_th_device_type[] = {
[INTEL_TH_SOURCE] = &intel_th_source_device_type,
[INTEL_TH_OUTPUT] = &intel_th_output_device_type,
[INTEL_TH_SWITCH] = &intel_th_switch_device_type,
--
2.43.0


2024-04-29 17:08:46

by Alexander Shishkin

[permalink] [raw]
Subject: [PATCH v1 12/15] intel_th: pci: Add Sapphire Rapids SOC support

Add support for the Trace Hub in Sapphire Rapids SOC.

Signed-off-by: Alexander Shishkin <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Cc: [email protected]
---
drivers/hwtracing/intel_th/pci.c | 5 +++++
1 file changed, 5 insertions(+)

diff --git a/drivers/hwtracing/intel_th/pci.c b/drivers/hwtracing/intel_th/pci.c
index 44c08db253d8..08c956fb4995 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -309,6 +309,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x3256),
.driver_data = (kernel_ulong_t)&intel_th_2x,
},
+ {
+ /* Sapphire Rapids SOC */
+ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x3456),
+ .driver_data = (kernel_ulong_t)&intel_th_2x,
+ },
{
/* Alder Lake CPU */
PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f),
--
2.43.0