linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/3] intel_th: Updates for v5.5
@ 2019-11-20 13:08 Alexander Shishkin
  2019-11-20 13:08 ` [GIT PULL 1/3] intel_th: Fix a double put_device() in error path Alexander Shishkin
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Alexander Shishkin @ 2019-11-20 13:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Alexander Shishkin

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(-)

-- 
2.24.0


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

* [GIT PULL 1/3] intel_th: Fix a double put_device() in error path
  2019-11-20 13:08 [GIT PULL 0/3] intel_th: Updates for v5.5 Alexander Shishkin
@ 2019-11-20 13:08 ` Alexander Shishkin
  2019-11-20 13:36   ` Wen Yang
  2019-11-20 13:08 ` [GIT PULL 2/3] intel_th: pci: Add Ice Lake CPU support Alexander Shishkin
  2019-11-20 13:08 ` [GIT PULL 3/3] intel_th: pci: Add Tiger " Alexander Shishkin
  2 siblings, 1 reply; 6+ messages in thread
From: Alexander Shishkin @ 2019-11-20 13:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Alexander Shishkin, Wen Yang, Andy Shevchenko, stable

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.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
Reported-by: Wen Yang <wenyang@linux.alibaba.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: stable@vger.kernel.org # v4.14+
---
 drivers/hwtracing/intel_th/core.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
index d5c1821b31c6..0dfd97bbde9e 100644
--- a/drivers/hwtracing/intel_th/core.c
+++ b/drivers/hwtracing/intel_th/core.c
@@ -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) {
-- 
2.24.0


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

* [GIT PULL 2/3] intel_th: pci: Add Ice Lake CPU support
  2019-11-20 13:08 [GIT PULL 0/3] intel_th: Updates for v5.5 Alexander Shishkin
  2019-11-20 13:08 ` [GIT PULL 1/3] intel_th: Fix a double put_device() in error path Alexander Shishkin
@ 2019-11-20 13:08 ` Alexander Shishkin
  2019-11-20 13:08 ` [GIT PULL 3/3] intel_th: pci: Add Tiger " Alexander Shishkin
  2 siblings, 0 replies; 6+ messages in thread
From: Alexander Shishkin @ 2019-11-20 13:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Alexander Shishkin, Andy Shevchenko, stable

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

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: stable@vger.kernel.org
---
 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 91dfeba62485..04a956ece9f7 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -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),
-- 
2.24.0


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

* [GIT PULL 3/3] intel_th: pci: Add Tiger Lake CPU support
  2019-11-20 13:08 [GIT PULL 0/3] intel_th: Updates for v5.5 Alexander Shishkin
  2019-11-20 13:08 ` [GIT PULL 1/3] intel_th: Fix a double put_device() in error path Alexander Shishkin
  2019-11-20 13:08 ` [GIT PULL 2/3] intel_th: pci: Add Ice Lake CPU support Alexander Shishkin
@ 2019-11-20 13:08 ` Alexander Shishkin
  2 siblings, 0 replies; 6+ messages in thread
From: Alexander Shishkin @ 2019-11-20 13:08 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Alexander Shishkin, Andy Shevchenko, stable

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

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: stable@vger.kernel.org
---
 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 04a956ece9f7..f777192890d2 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -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),
-- 
2.24.0


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

* Re: [GIT PULL 1/3] intel_th: Fix a double put_device() in error path
  2019-11-20 13:08 ` [GIT PULL 1/3] intel_th: Fix a double put_device() in error path Alexander Shishkin
@ 2019-11-20 13:36   ` Wen Yang
  2019-11-20 13:44     ` Alexander Shishkin
  0 siblings, 1 reply; 6+ messages in thread
From: Wen Yang @ 2019-11-20 13:36 UTC (permalink / raw)
  To: Alexander Shishkin, Greg Kroah-Hartman
  Cc: linux-kernel, Andy Shevchenko, stable


On 2019/11/20 9:08 下午, Alexander Shishkin wrote:
> 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.
>
> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Fixes: a753bfcfdb1f ("intel_th: Make the switch allocate its subdevices")
> Reported-by: Wen Yang <wenyang@linux.alibaba.com>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Cc: stable@vger.kernel.org # v4.14+
> ---
>   drivers/hwtracing/intel_th/core.c | 8 ++------
>   1 file changed, 2 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c
> index d5c1821b31c6..0dfd97bbde9e 100644
> --- a/drivers/hwtracing/intel_th/core.c
> +++ b/drivers/hwtracing/intel_th/core.c
> @@ -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) {
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



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

* Re: [GIT PULL 1/3] intel_th: Fix a double put_device() in error path
  2019-11-20 13:36   ` Wen Yang
@ 2019-11-20 13:44     ` Alexander Shishkin
  0 siblings, 0 replies; 6+ messages in thread
From: Alexander Shishkin @ 2019-11-20 13:44 UTC (permalink / raw)
  To: Wen Yang, Greg Kroah-Hartman
  Cc: linux-kernel, Andy Shevchenko, stable, alexander.shishkin

Wen Yang <wenyang@linux.alibaba.com> writes:

> 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

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

end of thread, other threads:[~2019-11-20 13:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-20 13:08 [GIT PULL 0/3] intel_th: Updates for v5.5 Alexander Shishkin
2019-11-20 13:08 ` [GIT PULL 1/3] intel_th: Fix a double put_device() in error path Alexander Shishkin
2019-11-20 13:36   ` Wen Yang
2019-11-20 13:44     ` Alexander Shishkin
2019-11-20 13:08 ` [GIT PULL 2/3] intel_th: pci: Add Ice Lake CPU support Alexander Shishkin
2019-11-20 13:08 ` [GIT PULL 3/3] intel_th: pci: Add Tiger " Alexander Shishkin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).