Skip to contentSkip to conversation

intel_th: Updates for v5.5

GIT PULL Alexander Shishkin 2 participants 6 messages Nov 20, 2019

Subsystems (3)
lore
Share & tools
lore

Alexander Shishkin

author maintainer
#0 lore raw

Hi Greg,

Here are some more updates I have for v5.5. These are 2 new PCI IDs and a bug fix for something old. Stable CC on all of them. Signed tag below. Individual patches follow. I made sure that there aren't merge conflicts with other PCI ID patches in char-misc-next, so either way is good.

The following changes since commit 54ecb8f7028c5eb3d740bb82b0f1d90f2df63c5c:

Linux 5.4-rc1 (2019-09-30 10:35:40 -0700)

are available in the Git repository at:

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

for you to fetch changes up to 76a8b4a23ca875ef06401326b9d799f74f55d82a:

intel_th: pci: Add Tiger Lake CPU support (2019-11-20 14:53:05 +0200)

----------------------------------------------------------------
intel_th: Updates for v5.5

These are:
* a double free fix
* two new PCI IDs

----------------------------------------------------------------
Alexander Shishkin (3):
intel_th: Fix a double put_device() in error path
intel_th: pci: Add Ice Lake CPU support
intel_th: pci: Add Tiger Lake CPU support

 drivers/hwtracing/intel_th/core.c |  8 ++------
 drivers/hwtracing/intel_th/pci.c  | 10 ++++++++++
 2 files changed, 12 insertions(+), 6 deletions(-)
Signature · 1 line
2.24.0
author maintainer
#1 lore raw

[GIT PULL 1/3] intel_th: Fix a double put_device() in error path

Commit a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices") factored out intel_th_subdevice_alloc() from intel_th_populate(), but got the error path wrong, resulting in two instances of a double put_device() on a freshly initialized, but not 'added' device.

Fix this by only doing one put_device() in the error path.

Fixes a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
Cc [email protected] # v4.14+
---
 drivers/hwtracing/intel_th/core.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/hwtracing/intel_th/core.c +2 -6
index d5c1821b31c6..0dfd97bbde9e 100644
@@ -649,10 +649,8 @@ intel_th_subdevice_alloc(struct intel_th *th,
 	}
 
 	err = intel_th_device_add_resources(thdev, res, subdev->nres);
-	if (err) {
-		put_device(&thdev->dev);
+	if (err)
 		goto fail_put_device;
-	}
 
 	if (subdev->type == INTEL_TH_OUTPUT) {
 		if (subdev->mknode)
@@ -667,10 +665,8 @@ intel_th_subdevice_alloc(struct intel_th *th,
 	}
 
 	err = device_add(&thdev->dev);
-	if (err) {
-		put_device(&thdev->dev);
+	if (err)
 		goto fail_free_res;
-	}
 
 	/* need switch driver to be loaded to enumerate the rest */
 	if (subdev->type == INTEL_TH_SWITCH && !req) {
Signature · 1 line
2.24.0
#2 lore raw

Re: [GIT PULL 1/3] intel_th: Fix a double put_device() in error path

Quoted 34 lines · Alexander Shishkin

Commit a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices") factored out intel_th_subdevice_alloc() from intel_th_populate(), but got the error path wrong, resulting in two instances of a double put_device() on a freshly initialized, but not 'added' device.

Fix this by only doing one put_device() in the error path.

Fixes a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
Cc [email protected] # v4.14+
---
  drivers/hwtracing/intel_th/core.c | 8 ++------
  1 file changed, 2 insertions(+), 6 deletions(-)
drivers/hwtracing/intel_th/core.c +1 -3
index d5c1821b31c6..0dfd97bbde9e 100644
@@ -649,10 +649,8 @@ intel_th_subdevice_alloc(struct intel_th *th,
  	}
 
  	err = intel_th_device_add_resources(thdev, res, subdev->nres);
-	if (err) {
-		put_device(&thdev->dev);
+	if (err)
  		goto fail_put_device;
-	}
 
  	if (subdev->type == INTEL_TH_OUTPUT) {
  		if (subdev->mknode)
@@ -667,10 +665,8 @@ intel_th_subdevice_alloc(struct intel_th *th,
  	}

drivers/hwtracing/intel_th/core.c intel_th_subdevice_alloc(struct intel_th *th, · line 672

Quoted 10 lines
drivers/hwtracing/intel_th/core.c +1 -3
 
  	err = device_add(&thdev->dev);
-	if (err) {
-		put_device(&thdev->dev);
+	if (err)
  		goto fail_free_res;
-	}
 
  	/* need switch driver to be loaded to enumerate the rest */
  	if (subdev->type == INTEL_TH_SWITCH && !req) {

device_add() has increased the reference count,

so when it returns an error, an additional call to put_device()

is needed here to reduce the reference count.

--

Regards,

Wen

author maintainer
#3 lore raw

Re: [GIT PULL 1/3] intel_th: Fix a double put_device() in error path

Quoted 5 lines · Wen Yang

device_add() has increased the reference count,

so when it returns an error, an additional call to put_device()

is needed here to reduce the reference count.

No, in case of error it also drops its reference.

Regards,
--
Alex

author maintainer
#4 lore raw

[GIT PULL 2/3] intel_th: pci: Add Ice Lake CPU support

In reply to Alexander Shishkin

This adds support for the Trace Hub in Ice Lake CPU.

---
 drivers/hwtracing/intel_th/pci.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
index 91dfeba62485..04a956ece9f7 100644
@@ -204,6 +204,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x45c5),
 		.driver_data = (kernel_ulong_t)&intel_th_2x,
 	},
+	{
+		/* Ice Lake CPU */
+		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8a29),
+		.driver_data = (kernel_ulong_t)&intel_th_2x,
+	},
 	{
 		/* Tiger Lake PCH */
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6),
Signature · 1 line
2.24.0
author maintainer
#5 lore raw

[GIT PULL 3/3] intel_th: pci: Add Tiger Lake CPU support

In reply to Alexander Shishkin

This adds support for the Trace Hub in Tiger Lake CPU.

---
 drivers/hwtracing/intel_th/pci.c | 5 +++++
 1 file changed, 5 insertions(+)
drivers/hwtracing/intel_th/pci.c +5 -0
index 04a956ece9f7..f777192890d2 100644
@@ -209,6 +209,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8a29),
 		.driver_data = (kernel_ulong_t)&intel_th_2x,
 	},
+	{
+		/* Tiger Lake CPU */
+		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x9a33),
+		.driver_data = (kernel_ulong_t)&intel_th_2x,
+	},
 	{
 		/* Tiger Lake PCH */
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0xa0a6),
Signature · 1 line
2.24.0