stm class/intel_th: Updates for v5.13
Subsystems (5)
Alexander Shishkin
maintainercover stm class/intel_th: Updates for v5.13
Hi Greg,
Here are the stm class and intel_th updates that I have for v5.13. These are all trivial, including 2 new PCI IDs. Andy provided his reviewed-bys. Please consider applying. Thank you!
Alexander Shishkin (3):
intel_th: Constify all drvdata references
intel_th: pci: Add Rocket Lake CPU support
intel_th: pci: Add Alder Lake-M support
Andy Shevchenko (1):
stm class: Replace uuid_t with plain u8 uuid[16]
Jiapeng Chong (1):
stm class: Remove an unused function
Pavel Machek (1):
intel_th: Consistency and off-by-one fix
Rikard Falkeborn (1):
intel_th: Constify attribute_group structs
drivers/hwtracing/intel_th/core.c | 2 +- drivers/hwtracing/intel_th/gth.c | 4 ++-- drivers/hwtracing/intel_th/intel_th.h | 8 ++++---- drivers/hwtracing/intel_th/msu.c | 2 +- drivers/hwtracing/intel_th/pci.c | 12 +++++++++++- drivers/hwtracing/intel_th/pti.c | 4 ++-- drivers/hwtracing/stm/p_sys-t.c | 16 ++++++++++------ drivers/hwtracing/stm/policy.c | 5 ----- 8 files changed, 31 insertions(+), 22 deletions(-)
Signature · 1 line
2.30.2
Alexander Shishkin
maintainerPATCH 1/7 stm class: Remove an unused function
From: Jiapeng Chong <[email protected]>
Fix the following clang warning:
drivers/hwtracing/stm/policy.c:60:21: warning: unused function 'stp_policy_node_name' [-Wunused-function].
--- drivers/hwtracing/stm/policy.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/hwtracing/stm/policy.c +0 -5
@@ -57,11 +57,6 @@ void stp_policy_node_get_ranges(struct stp_policy_node *policy_node, *cend = policy_node->last_channel; } -static inline char *stp_policy_node_name (struct stp_policy_node *policy_node) -{ -return policy_node->group.cg_item.ci_name ? :"<none>" ; -} -static inline struct stp_policy *to_stp_policy (struct config_item *item) { return item ?
Signature · 1 line
2.30.2
Alexander Shishkin
maintainerPATCH 2/7 stm class: Replace uuid_t with plain u8 uuid[16]
In reply to Alexander ShishkinFrom: Andy Shevchenko <[email protected]>
It appears that uuid_t use in STM code abuses UUID API. Moreover, this type is only useful when we parse user input. Due to above replace uuid_t with u8 uuid[16] and use uuid_t only when parse user input.
--- drivers/hwtracing/stm/p_sys-t.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/hwtracing/stm/p_sys-t.c +10 -6
@@ -76,7 +76,7 @@ enum sys_t_message_string_subtype { MIPI_SYST_SEVERITY(MAX))struct sys_t_policy_node { -uuid_t uuid; +u8 uuid[UUID_SIZE ];bool do_len;unsigned long ts_interval;unsigned long clocksync_interval;
@@ -92,7 +92,7 @@ static void sys_t_policy_node_init(void *priv) {struct sys_t_policy_node *pn = priv; -generate_random_uuid (pn->uuid.b); +generate_random_uuid (pn->uuid); }static int sys_t_output_open (void *priv,struct stm_output *output)
@@ -120,7 +120,7 @@ static ssize_t sys_t_policy_uuid_show(struct config_item *item, {struct sys_t_policy_node *pn =to_pdrv_policy_node (item); -return sprintf (page,"%pU\n" , &pn->uuid); +return sprintf (page,"%pU\n" , pn->uuid); } static ssize_t
@@ -129,13 +129,17 @@ sys_t_policy_uuid_store(struct config_item *item, const char *page, {struct mutex *mutexp = &item->ci_group->cg_subsys->su_mutex;struct sys_t_policy_node *pn =to_pdrv_policy_node (item); +uuid_t uuid;int ret;mutex_lock (mutexp); - ret =uuid_parse (page, &pn->uuid); + ret =uuid_parse (page, &uuid);mutex_unlock (mutexp); +if (ret) +return ret; -return ret <0 ? ret : count; +export_uuid (pn->uuid, &uuid); +return count; }CONFIGFS_ATTR (sys_t_policy_, uuid);
@@ -322,7 +326,7 @@ static ssize_t sys_t_write(struct stm_data *data, struct stm_output *output,return sz;/* GUID */ - sz =stm_data_write (data, m, c, false, op->node.uuid.b,UUID_SIZE ); + sz =stm_data_write (data, m, c, false, op->node.uuid,sizeof (op->node.uuid));if (sz <=0 )return sz;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerRe: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
Quoted 3 lines · Alexander Shishkin
From: Andy Shevchenko <[email protected]>
It appears that
uuid_tuse in STM code abuses UUID API.
How is it being abused?
Moreover,
Quoted 15 lines
this type is only useful when we parse user input. Due to above replace
uuid_twith u8 uuid[16] and useuuid_tonly when parse user input.Signed-off-by Andy Shevchenko <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>--- drivers/hwtracing/stm/p_sys-t.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)drivers/hwtracing/stm/p_sys-t.c +0
-0
drivers/hwtracing/stm/p_sys-t.c enum sys_t_message_string_subtype { · line 79
Quoted 5 lines
drivers/hwtracing/stm/p_sys-t.c +1
-1@@ -76,7 +76,7 @@ enum sys_t_message_string_subtype { MIPI_SYST_SEVERITY(MAX)) struct sys_t_policy_node { - uuid_t uuid; + u8 uuid[UUID_SIZE];
This feels wrong, what is wrong with the uuid_t type usage here?
drivers/hwtracing/stm/p_sys-t.c static void sys_t_policy_node_init(void *priv) · line 95
Quoted 8 lines
drivers/hwtracing/stm/p_sys-t.c +0
-1bool do_len;unsigned long ts_interval;unsigned long clocksync_interval;@@ -92,7 +92,7 @@ static void sys_t_policy_node_init(void *priv) {struct sys_t_policy_node *pn = priv; -generate_random_uuid (pn->uuid.b);
Ok, that's not good, but that looks to be a flaw in the generate_random_uuid() api, not this driver implementation.
I don't understand why this change is needed?
thanks,
greg k-h
Re: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
Quoted 6 lines · Greg Kroah-Hartman
Quoted 3 lines · Alexander Shishkin
From: Andy Shevchenko <[email protected]>
It appears that
uuid_tuse in STM code abuses UUID API.How is it being abused?
We are using it against the buffer that is u8, and neither uuid_t nor guid_t.
Quoted 18 lines
Moreover,
Quoted 17 lines
this type is only useful when we parse user input. Due to above replace
uuid_twith u8 uuid[16] and useuuid_tonly when parse user input.Signed-off-by Andy Shevchenko <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>--- drivers/hwtracing/stm/p_sys-t.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)drivers/hwtracing/stm/p_sys-t.c +0
-0@@ -76,7 +76,7 @@ enum sys_t_message_string_subtype { MIPI_SYST_SEVERITY(MAX))
Quoted 5 lines
drivers/hwtracing/stm/p_sys-t.c enum sys_t_message_string_subtype { · line 79
Quoted 3 lines
drivers/hwtracing/stm/p_sys-t.c +1
-1struct sys_t_policy_node { -uuid_t uuid; +u8 uuid[UUID_SIZE ];This feels wrong, what is wrong with the
uuid_ttype usage here?
Nothing, just will require additional export_uuid() / import_uuid() call.
Quoted 7 lines
Quoted 7 lines
drivers/hwtracing/stm/p_sys-t.c +0
-0bool do_len;unsigned long ts_interval;unsigned long clocksync_interval;@@ -92,7 +92,7 @@ static void sys_t_policy_node_init(void *priv) {struct sys_t_policy_node *pn = priv;
Quoted 6 lines
drivers/hwtracing/stm/p_sys-t.c static void sys_t_policy_node_init(void *priv) · line 95
Quoted 1 line
drivers/hwtracing/stm/p_sys-t.c +0
-1-generate_random_uuid (pn->uuid.b);Ok, that's not good, but that looks to be a flaw in the
generate_random_uuid()api, not this driver implementation.I don't understand why this change is needed?
Using raw buffer APIs against uuid_t / guid_t.
We can import_uuid() first and call uuid_gen() against it. Will it work for you?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Greg Kroah-Hartman
maintainerRe: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
Quoted 9 lines · Andy Shevchenko
Quoted 6 lines · Greg Kroah-Hartman
Quoted 3 lines · Alexander Shishkin
From: Andy Shevchenko <[email protected]>
It appears that
uuid_tuse in STM code abuses UUID API.How is it being abused?
We are using it against the buffer that is u8, and neither
uuid_tnorguid_t.
And how should it be used?
Quoted 18 lines
Quoted 18 lines
Moreover,
Quoted 17 lines
this type is only useful when we parse user input. Due to above replace
uuid_twith u8 uuid[16] and useuuid_tonly when parse user input.Signed-off-by Andy Shevchenko <[email protected]>Signed-off-by Alexander Shishkin <[email protected]>--- drivers/hwtracing/stm/p_sys-t.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)drivers/hwtracing/stm/p_sys-t.c +0
-0@@ -76,7 +76,7 @@ enum sys_t_message_string_subtype { MIPI_SYST_SEVERITY(MAX))
Quoted 7 lines
Quoted 5 lines
drivers/hwtracing/stm/p_sys-t.c enum sys_t_message_string_subtype { · line 79
Quoted 3 lines
drivers/hwtracing/stm/p_sys-t.c +1
-1struct sys_t_policy_node { -uuid_t uuid; +u8 uuid[UUID_SIZE ];This feels wrong, what is wrong with the
uuid_ttype usage here?Nothing, just will require additional
export_uuid()/import_uuid()call.
Isn't that the "correct way" here?
Quoted 7 lines
Quoted 7 lines
Quoted 7 lines
drivers/hwtracing/stm/p_sys-t.c +0
-0bool do_len;unsigned long ts_interval;unsigned long clocksync_interval;@@ -92,7 +92,7 @@ static void sys_t_policy_node_init(void *priv) {struct sys_t_policy_node *pn = priv;
Quoted 8 lines
Quoted 6 lines
drivers/hwtracing/stm/p_sys-t.c static void sys_t_policy_node_init(void *priv) · line 95
Quoted 1 line
drivers/hwtracing/stm/p_sys-t.c +0
-1-generate_random_uuid (pn->uuid.b);Ok, that's not good, but that looks to be a flaw in the
generate_random_uuid()api, not this driver implementation.I don't understand why this change is needed?
Using raw buffer APIs against
uuid_t/guid_t.
So you want to do that, or you do not want to do that? Totally confused,
greg k-h
Re: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
Quoted 3 lines · Greg Kroah-Hartman
Quoted 2 lines · Andy Shevchenko
Quoted 1 line · Greg Kroah-Hartman
On Wed, Apr 14, 2021 at 08:12:46PM +0300, Alexander Shishkin wrote:
...
Quoted 3 lines
Quoted 1 line
Nothing, just will require additional
export_uuid()/import_uuid()call.Isn't that the "correct way" here?
I agree that it is better, yes.
Quoted 11 lines
Quoted 8 lines
Quoted 6 lines
drivers/hwtracing/stm/p_sys-t.c static void sys_t_policy_node_init(void *priv) · line 95
Quoted 1 line
drivers/hwtracing/stm/p_sys-t.c +0
-1-generate_random_uuid (pn->uuid.b);Ok, that's not good, but that looks to be a flaw in the
generate_random_uuid()api, not this driver implementation.I don't understand why this change is needed?
Using raw buffer APIs against
uuid_t/guid_t.So you want to do that, or you do not want to do that? Totally confused,
It is matter of consistency, so two possibilities here:
- use types _and_ APIs for raw buffer (this patch)
- use types _and_ APIs for uuid_t (suggested in this discussion)
Currently it uses uuid_t type _and_ raw buffer APIs — inconsistency.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Alexander Shishkin
maintainerRe: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
In reply to Greg Kroah-HartmanQuoted 4 lines · Greg Kroah-Hartman
Quoted 1 line
Using raw buffer APIs against
uuid_t/guid_t.So you want to do that, or you do not want to do that? Totally confused,
My understanding is that:
1) generate_random_uuid() use is allegedly bad even though it's in their header,
2) poking directly at the byte array inside uuid_t is bad, even though, again, header.
It is, indeed, not ideal.
If agreeable, I'll update this patch to the below and respin the whole series.
From 02340f8c7c17ace028040a35553c33cce8f3bce4 Mon Sep 17 00:00:00 2001
From: Andy Shevchenko <[email protected]>
Date: Wed, 22 Apr 2020 16:02:20 +0300
Subject: [PATCH] stm class: Use correct UUID APIs
It appears that the STM code didn't manage to accurately decypher the delicate inner workings of an alternative thought process behind the UUID API and directly called generate_random_uuid() that clearly needs to be a static function in lib/uuid.c.
At the same time, said STM code is poking directly at the byte array inside the uuid_t when it uses the UUID for its internal purposes.
Fix these two transgressions by using intended APIs instead.
--- drivers/hwtracing/stm/p_sys-t.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/hwtracing/stm/p_sys-t.c +4 -2
@@ -92,7 +92,7 @@ static void sys_t_policy_node_init(void *priv) {struct sys_t_policy_node *pn = priv; -generate_random_uuid (pn->uuid.b); +uuid_gen (&pn->uuid); }static int sys_t_output_open (void *priv,struct stm_output *output)
@@ -292,6 +292,7 @@ static ssize_t sys_t_write(struct stm_data *data, struct stm_output *output,unsigned int m = output->master;const unsigned char nil =0 ;u32 header =DATA_HEADER ; +u8 uuid[UUID_SIZE ];ssize_t sz;/* We require an existing policy node to proceed */
@@ -322,7 +323,8 @@ static ssize_t sys_t_write(struct stm_data *data, struct stm_output *output,return sz;/* GUID */ - sz =stm_data_write (data, m, c, false, op->node.uuid.b,UUID_SIZE ); +export_uuid (uuid, &op->node.uuid); + sz =stm_data_write (data, m, c, false, uuid,sizeof (op->node.uuid));if (sz <=0 )return sz;
Signature · 1 line
2.30.2
Re: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
Quoted 13 lines · Alexander Shishkin
Quoted 4 lines · Greg Kroah-Hartman
Quoted 1 line
Using raw buffer APIs against
uuid_t/guid_t.So you want to do that, or you do not want to do that? Totally confused,
My understanding is that:
1)generate_random_uuid()use is allegedly bad even though it's in their header,
2) poking directly at the byte array insideuuid_tis bad, even though, again, header.
Quoted 4 lines
It is, indeed, not ideal.
If agreeable, I'll update this patch to the below and respin the whole series.
Below patch looks good to me, thanks!
Quoted 56 lines
From
02340f8c7c17ace028040a35553c33cce8f3bce4Mon Sep 17 00:00:00 2001
From: Andy Shevchenko <[email protected]>
Date: Wed, 22 Apr 2020 16:02:20 +0300
Subject: [PATCH] stm class: Use correct UUID APIsIt appears that the STM code didn't manage to accurately decypher the delicate inner workings of an alternative thought process behind the UUID API and directly called
generate_random_uuid()that clearly needs to be a static function inlib/uuid.c.At the same time, said STM code is poking directly at the byte array inside the
uuid_twhen it uses the UUID for its internal purposes.Fix these two transgressions by using intended APIs instead.
Signed-off-by Andy Shevchenko <[email protected]>[ash: changed back to uuid_t and updated the commit message]Signed-off-by Alexander Shishkin <[email protected]>--- drivers/hwtracing/stm/p_sys-t.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)drivers/hwtracing/stm/p_sys-t.c +4
-2@@ -92,7 +92,7 @@ static void sys_t_policy_node_init(void *priv) {struct sys_t_policy_node *pn = priv; -generate_random_uuid (pn->uuid.b); +uuid_gen (&pn->uuid); }static int sys_t_output_open (void *priv,struct stm_output *output)@@ -292,6 +292,7 @@ static ssize_t sys_t_write(struct stm_data *data, struct stm_output *output,unsigned int m = output->master;const unsigned char nil =0 ;u32 header =DATA_HEADER ; +u8 uuid[UUID_SIZE ];ssize_t sz;/* We require an existing policy node to proceed */ @@ -322,7 +323,8 @@ static ssize_t sys_t_write(struct stm_data *data, struct stm_output *output,return sz;/* GUID */ - sz =stm_data_write (data, m, c, false, op->node.uuid.b,UUID_SIZE ); +export_uuid (uuid, &op->node.uuid); + sz =stm_data_write (data, m, c, false, uuid,sizeof (op->node.uuid));if (sz <=0 )return sz;Signature · 1 line
2.30.2
Signature · 2 lines
With Best Regards, Andy Shevchenko
Greg Kroah-Hartman
maintainerRe: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
In reply to Alexander ShishkinQuoted 13 lines · Alexander Shishkin
Quoted 4 lines · Greg Kroah-Hartman
Quoted 1 line
Using raw buffer APIs against
uuid_t/guid_t.So you want to do that, or you do not want to do that? Totally confused,
My understanding is that:
1)generate_random_uuid()use is allegedly bad even though it's in their header,
2) poking directly at the byte array insideuuid_tis bad, even though, again, header.
Quoted 4 lines
It is, indeed, not ideal.
If agreeable, I'll update this patch to the below and respin the whole series.
You are showing that Andy wrote this, when you are the one that did :(
Anyway, I've dropped this single patch from the series and applied the rest. Feel free to send this patch as a stand-alone one once you have the authorship issues sorted out.
thanks,
greg k-h
Re: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
Quoted 17 lines · Greg Kroah-Hartman
Quoted 15 lines · Alexander Shishkin
Quoted 4 lines · Greg Kroah-Hartman
Quoted 1 line
Using raw buffer APIs against
uuid_t/guid_t.So you want to do that, or you do not want to do that? Totally confused,
My understanding is that:
1)generate_random_uuid()use is allegedly bad even though it's in their header,
2) poking directly at the byte array insideuuid_tis bad, even though, again, header.It is, indeed, not ideal.
Quoted 8 lines
Quoted 2 lines
If agreeable, I'll update this patch to the below and respin the whole series.
You are showing that Andy wrote this, when you are the one that did :(
Anyway, I've dropped this single patch from the series and applied the rest. Feel free to send this patch as a stand-alone one once you have the authorship issues sorted out.
Internally it was proposed by me as well, so authorship is correct.
Signature · 2 lines
With Best Regards, Andy Shevchenko
Greg Kroah-Hartman
maintainerRe: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
Quoted 22 lines · Andy Shevchenko
Quoted 20 lines · Greg Kroah-Hartman
Quoted 17 lines · Alexander Shishkin
Quoted 4 lines · Greg Kroah-Hartman
Quoted 1 line
Using raw buffer APIs against
uuid_t/guid_t.So you want to do that, or you do not want to do that? Totally confused,
My understanding is that:
1)generate_random_uuid()use is allegedly bad even though it's in their header,
2) poking directly at the byte array insideuuid_tis bad, even though, again, header.It is, indeed, not ideal.
If agreeable, I'll update this patch to the below and respin the whole series.
Quoted 7 lines
Quoted 5 lines
You are showing that Andy wrote this, when you are the one that did :(
Anyway, I've dropped this single patch from the series and applied the rest. Feel free to send this patch as a stand-alone one once you have the authorship issues sorted out.
Internally it was proposed by me as well, so authorship is correct.
And I am supposed to know this how?
Come on people, you know better than this...
Alexander Shishkin
maintainerRe: [PATCH 2/7] stm class: Replace uuid_t with plain u8 uuid[16]
In reply to Greg Kroah-HartmanQuoted 14 lines · Greg Kroah-Hartman
Quoted 13 lines · Alexander Shishkin
Quoted 4 lines · Greg Kroah-Hartman
Quoted 1 line
Using raw buffer APIs against
uuid_t/guid_t.So you want to do that, or you do not want to do that? Totally confused,
My understanding is that:
1)generate_random_uuid()use is allegedly bad even though it's in their header,
2) poking directly at the byte array insideuuid_tis bad, even though, again, header.
Quoted 6 lines
Quoted 4 lines
It is, indeed, not ideal.
If agreeable, I'll update this patch to the below and respin the whole series.
You are showing that Andy wrote this, when you are the one that did :(
That's intentional, it's Andy's patch. In fact, it was probably me who insisted on the open-coded-byte-array version, in an offline conversation some time ago. I'd like to keep his name on it if that's ok. I've re-sent it [1] as a standalone patch.
Quoted 3 lines
Anyway, I've dropped this single patch from the series and applied the rest. Feel free to send this patch as a stand-alone one once you have the authorship issues sorted out.
Thank you!
[1] https://lore.kernel.org/lkml/[email protected]/
Regards,
--
Alex
Alexander Shishkin
maintainerPATCH 3/7 intel_th: Constify all drvdata references
In reply to Alexander ShishkinAnything that deals with drvdata structures should leave them intact. Reflect this in function signatures.
--- drivers/hwtracing/intel_th/core.c | 2 +- drivers/hwtracing/intel_th/intel_th.h | 6 +++--- drivers/hwtracing/intel_th/pci.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
drivers/hwtracing/intel_th/core.c +1 -1
@@ -844,7 +844,7 @@ static irqreturn_t intel_th_irq(int irq, void *data)* @irq: irq number */ struct intel_th * -intel_th_alloc (struct device *dev,struct intel_th_drvdata *drvdata, +intel_th_alloc (struct device *dev,const struct intel_th_drvdata *drvdata,struct resource *devres,unsigned int ndevres) {int err, r, nr_mmios =0 ;
drivers/hwtracing/intel_th/intel_th.h +3 -3
@@ -74,7 +74,7 @@ struct intel_th_drvdata {*/ struct intel_th_device {struct device dev; -struct intel_th_drvdata *drvdata; +const struct intel_th_drvdata *drvdata;struct resource *resource;unsigned int num_resources;unsigned int type;
@@ -224,7 +224,7 @@ static inline struct intel_th *to_intel_th(struct intel_th_device *thdev) }struct intel_th * -intel_th_alloc (struct device *dev,struct intel_th_drvdata *drvdata, +intel_th_alloc (struct device *dev,const struct intel_th_drvdata *drvdata,struct resource *devres,unsigned int ndevres);void intel_th_free (struct intel_th *th);
@@ -272,7 +272,7 @@ struct intel_th {struct intel_th_device *thdev[TH_SUBDEVICE_MAX ];struct intel_th_device *hub; -struct intel_th_drvdata *drvdata; +const struct intel_th_drvdata *drvdata;struct resource resource[TH_MMIO_END ];int (*activate)(struct intel_th *);
drivers/hwtracing/intel_th/pci.c +1 -1
@@ -71,7 +71,7 @@ static void intel_th_pci_deactivate(struct intel_th *th)static int intel_th_pci_probe (struct pci_dev *pdev,const struct pci_device_id *id) { -struct intel_th_drvdata *drvdata = (void *)id->driver_data; +const struct intel_th_drvdata *drvdata = (void *)id->driver_data;struct resource resource[TH_MMIO_END +TH_NVEC_MAX ] = { [TH_MMIO_CONFIG ] = pdev->resource[TH_PCI_CONFIG_BAR ], [TH_MMIO_SW ] = pdev->resource[TH_PCI_STH_SW_BAR ],
Signature · 1 line
2.30.2
Alexander Shishkin
maintainerPATCH 4/7 intel_th: Constify attribute_group structs
In reply to Alexander ShishkinFrom: Rikard Falkeborn <[email protected]>
The only usage of them is to pass their address to sysfs_create_group() and sysfs_remove_group(), both which have pointers to const attribute_group structs as input. Make them const to allow the compiler to put them in read-only memory.
--- drivers/hwtracing/intel_th/intel_th.h | 2 +- drivers/hwtracing/intel_th/msu.c | 2 +- drivers/hwtracing/intel_th/pti.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-)
drivers/hwtracing/intel_th/intel_th.h +1 -1
@@ -178,7 +178,7 @@ struct intel_th_driver {/* file_operations for those who want a device node */ const struct file_operations *fops;/* optional attributes */ -struct attribute_group *attr_group; +const struct attribute_group *attr_group;/* source ops */ int (*set_output)(struct intel_th_device *thdev,
drivers/hwtracing/intel_th/msu.c +1 -1
@@ -2095,7 +2095,7 @@ static struct attribute *msc_output_attrs[] = { NULL, }; -static struct attribute_group msc_output_group = { +static const struct attribute_group msc_output_group = { .attrs = msc_output_attrs, };
drivers/hwtracing/intel_th/pti.c +2 -2
@@ -142,7 +142,7 @@ static struct attribute *pti_output_attrs[] = { NULL, }; -static struct attribute_group pti_output_group = { +static const struct attribute_group pti_output_group = { .attrs = pti_output_attrs, };
@@ -295,7 +295,7 @@ static struct attribute *lpp_output_attrs[] = { NULL, }; -static struct attribute_group lpp_output_group = { +static const struct attribute_group lpp_output_group = { .attrs = lpp_output_attrs, };
Signature · 1 line
2.30.2
Alexander Shishkin
maintainerPATCH 5/7 intel_th: Consistency and off-by-one fix
In reply to Alexander ShishkinFrom: Pavel Machek <[email protected]>
Consistently use "< ... +1" in for loops.
Fix of-by-one in for_each_set_bit().
--- drivers/hwtracing/intel_th/gth.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwtracing/intel_th/gth.c +2 -2
@@ -543,7 +543,7 @@ static void intel_th_gth_disable(struct intel_th_device *thdev, output->active = false;for_each_set_bit (master, gth->output[output->port].master, -TH_CONFIGURABLE_MASTERS ) { +TH_CONFIGURABLE_MASTERS +1 ) {gth_master_set (gth, master,-1 ); }spin_unlock (>h->gth_lock);
@@ -697,7 +697,7 @@ static void intel_th_gth_unassign(struct intel_th_device *thdev, othdev->output.port =-1 ; othdev->output.active = false; gth->output[port].output =NULL ; -for (master =0 ; master <=TH_CONFIGURABLE_MASTERS ; master++) +for (master =0 ; master <TH_CONFIGURABLE_MASTERS +1 ; master++)if (gth->master[master] == port) gth->master[master] =-1 ;spin_unlock (>h->gth_lock);
Signature · 1 line
2.30.2
Alexander Shishkin
maintainerPATCH 6/7 intel_th: pci: Add Rocket Lake CPU support
In reply to Alexander ShishkinThis adds support for the Trace Hub in Rocket Lake CPUs.
--- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -278,6 +278,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f), .driver_data = (kernel_ulong_t)&intel_th_2x, }, + { +/* Rocket Lake CPU */ + PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x4c19), + .driver_data = (kernel_ulong_t)&intel_th_2x, + }, { 0 }, };
Signature · 1 line
2.30.2
Alexander Shishkin
maintainerPATCH 7/7 intel_th: pci: Add Alder Lake-M support
In reply to Alexander ShishkinThis adds support for the Trace Hub in Alder Lake-M PCH.
--- drivers/hwtracing/intel_th/pci.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
@@ -273,6 +273,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x51a6), .driver_data = (kernel_ulong_t)&intel_th_2x, }, + { +/* Alder Lake-M */ +PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x54a6 ), + .driver_data = (kernel_ulong_t)&intel_th_2x, + }, {/* Alder Lake CPU */ PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x466f),
Signature · 1 line
2.30.2