linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [GIT PULL 0/4] intel_th: Fixes for v5.2
@ 2019-06-21 16:19 Alexander Shishkin
  2019-06-21 16:19 ` [GIT PULL 1/4] intel_th: msu: Fix unused variable warning on arm64 platform Alexander Shishkin
                   ` (5 more replies)
  0 siblings, 6 replies; 9+ messages in thread
From: Alexander Shishkin @ 2019-06-21 16:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Alexander Shishkin

Hi Greg,

Here are the fixes I have for v5.2 cycle: two gcc warnings, one dma mapping
issue and a new PCI ID. All issues were introduced in the same cycle, so no
-stable involvement.

All patches are aiaiai-clean. Signed git tag below. Individual patches in
follow-up emails. Please consider pulling or applying. Thanks!

The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9:

  Linux 5.2-rc1 (2019-05-19 15:47:09 -0700)

are available in the Git repository at:

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

for you to fetch changes up to 0001019cdade192cb05a3c4e07df3b30a20c8ed0:

  intel_th: pci: Add Ice Lake NNPI support (2019-06-21 18:34:27 +0300)

----------------------------------------------------------------
intel_th: Fixes for v5.2

These are:
  * two trivial fixes for gcc warnings introduced in v5.2-rc1
  * a fix for a dma mapping problem, introduced in v5.2-rc1
  * a new PCI ID

----------------------------------------------------------------
Alexander Shishkin (2):
      intel_th: msu: Fix single mode with disabled IOMMU
      intel_th: pci: Add Ice Lake NNPI support

Shaokun Zhang (1):
      intel_th: msu: Fix unused variable warning on arm64 platform

YueHaibing (1):
      intel_th: msu: Remove set but not used variable 'last'

 drivers/hwtracing/intel_th/msu.c | 45 ++++++++++++++++++++++++++--------------
 drivers/hwtracing/intel_th/pci.c |  5 +++++
 2 files changed, 34 insertions(+), 16 deletions(-)

-- 
2.20.1


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

* [GIT PULL 1/4] intel_th: msu: Fix unused variable warning on arm64 platform
  2019-06-21 16:19 [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
@ 2019-06-21 16:19 ` Alexander Shishkin
  2019-06-21 16:19 ` [GIT PULL 2/4] intel_th: msu: Remove set but not used variable 'last' Alexander Shishkin
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Alexander Shishkin @ 2019-06-21 16:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Shaokun Zhang, Alexander Shishkin, Andy Shevchenko

From: Shaokun Zhang <zhangshaokun@hisilicon.com>

Commit ba39bd8306057 ("intel_th: msu: Switch over to scatterlist")
introduced the following warnings on non-x86 architectures, as a result
of reordering the multi mode buffer allocation sequence:

> drivers/hwtracing/intel_th/msu.c: In function ‘msc_buffer_win_alloc’:
> drivers/hwtracing/intel_th/msu.c:783:21: warning: unused variable ‘i’
> [-Wunused-variable]
> int ret = -ENOMEM, i;
>                    ^
> drivers/hwtracing/intel_th/msu.c: In function ‘msc_buffer_win_free’:
> drivers/hwtracing/intel_th/msu.c:863:6: warning: unused variable ‘i’
> [-Wunused-variable]
> int i;
>     ^

Fix this compiler warning by factoring out set_memory sequences and making
them x86-only.

Suggested-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Signed-off-by: Shaokun Zhang <zhangshaokun@hisilicon.com>
Fixes: ba39bd8306057 ("intel_th: msu: Switch over to scatterlist")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/msu.c | 40 +++++++++++++++++++++-----------
 1 file changed, 27 insertions(+), 13 deletions(-)

diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index 81bb54fa3ce8..8c568b5c8920 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -767,6 +767,30 @@ static int __msc_buffer_win_alloc(struct msc_window *win,
 	return -ENOMEM;
 }
 
+#ifdef CONFIG_X86
+static void msc_buffer_set_uc(struct msc_window *win, unsigned int nr_blocks)
+{
+	int i;
+
+	for (i = 0; i < nr_blocks; i++)
+		/* Set the page as uncached */
+		set_memory_uc((unsigned long)msc_win_block(win, i), 1);
+}
+
+static void msc_buffer_set_wb(struct msc_window *win)
+{
+	int i;
+
+	for (i = 0; i < win->nr_blocks; i++)
+		/* Reset the page to write-back */
+		set_memory_wb((unsigned long)msc_win_block(win, i), 1);
+}
+#else /* !X86 */
+static inline void
+msc_buffer_set_uc(struct msc_window *win, unsigned int nr_blocks) {}
+static inline void msc_buffer_set_wb(struct msc_window *win) {}
+#endif /* CONFIG_X86 */
+
 /**
  * msc_buffer_win_alloc() - alloc a window for a multiblock mode
  * @msc:	MSC device
@@ -780,7 +804,7 @@ static int __msc_buffer_win_alloc(struct msc_window *win,
 static int msc_buffer_win_alloc(struct msc *msc, unsigned int nr_blocks)
 {
 	struct msc_window *win;
-	int ret = -ENOMEM, i;
+	int ret = -ENOMEM;
 
 	if (!nr_blocks)
 		return 0;
@@ -811,11 +835,7 @@ static int msc_buffer_win_alloc(struct msc *msc, unsigned int nr_blocks)
 	if (ret < 0)
 		goto err_nomem;
 
-#ifdef CONFIG_X86
-	for (i = 0; i < ret; i++)
-		/* Set the page as uncached */
-		set_memory_uc((unsigned long)msc_win_block(win, i), 1);
-#endif
+	msc_buffer_set_uc(win, ret);
 
 	win->nr_blocks = ret;
 
@@ -860,8 +880,6 @@ static void __msc_buffer_win_free(struct msc *msc, struct msc_window *win)
  */
 static void msc_buffer_win_free(struct msc *msc, struct msc_window *win)
 {
-	int i;
-
 	msc->nr_pages -= win->nr_blocks;
 
 	list_del(&win->entry);
@@ -870,11 +888,7 @@ static void msc_buffer_win_free(struct msc *msc, struct msc_window *win)
 		msc->base_addr = 0;
 	}
 
-#ifdef CONFIG_X86
-	for (i = 0; i < win->nr_blocks; i++)
-		/* Reset the page to write-back */
-		set_memory_wb((unsigned long)msc_win_block(win, i), 1);
-#endif
+	msc_buffer_set_wb(win);
 
 	__msc_buffer_win_free(msc, win);
 
-- 
2.20.1


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

* [GIT PULL 2/4] intel_th: msu: Remove set but not used variable 'last'
  2019-06-21 16:19 [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
  2019-06-21 16:19 ` [GIT PULL 1/4] intel_th: msu: Fix unused variable warning on arm64 platform Alexander Shishkin
@ 2019-06-21 16:19 ` Alexander Shishkin
  2019-06-21 16:19 ` [GIT PULL 3/4] intel_th: msu: Fix single mode with disabled IOMMU Alexander Shishkin
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 9+ messages in thread
From: Alexander Shishkin @ 2019-06-21 16:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, YueHaibing, Andy Shevchenko, Alexander Shishkin

From: YueHaibing <yuehaibing@huawei.com>

Commit aad14ad3cf3a ("intel_th: msu: Add current window tracking") added
the following gcc warning:

> drivers/hwtracing/intel_th/msu.c: In function msc_win_switch:
> drivers/hwtracing/intel_th/msu.c:1389:21: warning: variable last set but
> not used [-Wunused-but-set-variable]

Fix it by removing the variable.

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Fixes: aad14ad3cf3a ("intel_th: msu: Add current window tracking")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
---
 drivers/hwtracing/intel_th/msu.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index 8c568b5c8920..6bfce03c6489 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -1400,10 +1400,9 @@ static int intel_th_msc_init(struct msc *msc)
 
 static void msc_win_switch(struct msc *msc)
 {
-	struct msc_window *last, *first;
+	struct msc_window *first;
 
 	first = list_first_entry(&msc->win_list, struct msc_window, entry);
-	last = list_last_entry(&msc->win_list, struct msc_window, entry);
 
 	if (msc_is_last_win(msc->cur_win))
 		msc->cur_win = first;
-- 
2.20.1


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

* [GIT PULL 3/4] intel_th: msu: Fix single mode with disabled IOMMU
  2019-06-21 16:19 [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
  2019-06-21 16:19 ` [GIT PULL 1/4] intel_th: msu: Fix unused variable warning on arm64 platform Alexander Shishkin
  2019-06-21 16:19 ` [GIT PULL 2/4] intel_th: msu: Remove set but not used variable 'last' Alexander Shishkin
@ 2019-06-21 16:19 ` Alexander Shishkin
  2019-07-03 15:36   ` Greg Kroah-Hartman
  2019-06-21 16:19 ` [GIT PULL 4/4] intel_th: pci: Add Ice Lake NNPI support Alexander Shishkin
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 9+ messages in thread
From: Alexander Shishkin @ 2019-06-21 16:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-kernel, Alexander Shishkin, Andy Shevchenko, Ammy Yi

Commit 4e0eaf239fb3 ("intel_th: msu: Fix single mode with IOMMU") switched
the single mode code to use dma mapping pages obtained from the page
allocator, but with IOMMU disabled, that may lead to using SWIOTLB bounce
buffers and without additional sync'ing, produces empty trace buffers.

Fix this by using a DMA32 GFP flag to the page allocation in single mode,
as the device supports full 32-bit DMA addressing.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Fixes: 4e0eaf239fb3 ("intel_th: msu: Fix single mode with IOMMU")
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Reported-by: Ammy Yi <ammy.yi@intel.com>
---
 drivers/hwtracing/intel_th/msu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/hwtracing/intel_th/msu.c b/drivers/hwtracing/intel_th/msu.c
index 6bfce03c6489..cfd48c81b9d9 100644
--- a/drivers/hwtracing/intel_th/msu.c
+++ b/drivers/hwtracing/intel_th/msu.c
@@ -667,7 +667,7 @@ static int msc_buffer_contig_alloc(struct msc *msc, unsigned long size)
 		goto err_out;
 
 	ret = -ENOMEM;
-	page = alloc_pages(GFP_KERNEL | __GFP_ZERO, order);
+	page = alloc_pages(GFP_KERNEL | __GFP_ZERO | GFP_DMA32, order);
 	if (!page)
 		goto err_free_sgt;
 
-- 
2.20.1


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

* [GIT PULL 4/4] intel_th: pci: Add Ice Lake NNPI support
  2019-06-21 16:19 [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
                   ` (2 preceding siblings ...)
  2019-06-21 16:19 ` [GIT PULL 3/4] intel_th: msu: Fix single mode with disabled IOMMU Alexander Shishkin
@ 2019-06-21 16:19 ` Alexander Shishkin
  2019-07-03 15:26 ` [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
  2019-07-03 15:35 ` Greg Kroah-Hartman
  5 siblings, 0 replies; 9+ messages in thread
From: Alexander Shishkin @ 2019-06-21 16:19 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, Alexander Shishkin, Andy Shevchenko

This adds Ice Lake NNPI support to the Intel(R) Trace Hub.

Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 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 f1228708f2a2..c0378c3de9a4 100644
--- a/drivers/hwtracing/intel_th/pci.c
+++ b/drivers/hwtracing/intel_th/pci.c
@@ -194,6 +194,11 @@ static const struct pci_device_id intel_th_pci_id_table[] = {
 		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x02a6),
 		.driver_data = (kernel_ulong_t)&intel_th_2x,
 	},
+	{
+		/* Ice Lake NNPI */
+		PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x45c5),
+		.driver_data = (kernel_ulong_t)&intel_th_2x,
+	},
 	{ 0 },
 };
 
-- 
2.20.1


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

* Re: [GIT PULL 0/4] intel_th: Fixes for v5.2
  2019-06-21 16:19 [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
                   ` (3 preceding siblings ...)
  2019-06-21 16:19 ` [GIT PULL 4/4] intel_th: pci: Add Ice Lake NNPI support Alexander Shishkin
@ 2019-07-03 15:26 ` Alexander Shishkin
  2019-07-03 15:34   ` Greg Kroah-Hartman
  2019-07-03 15:35 ` Greg Kroah-Hartman
  5 siblings, 1 reply; 9+ messages in thread
From: Alexander Shishkin @ 2019-07-03 15:26 UTC (permalink / raw)
  To: Greg Kroah-Hartman; +Cc: linux-kernel, alexander.shishkin

Alexander Shishkin <alexander.shishkin@linux.intel.com> writes:

> Hi Greg,

Hi Greg,

> Here are the fixes I have for v5.2 cycle: two gcc warnings, one dma mapping
> issue and a new PCI ID. All issues were introduced in the same cycle, so no
> -stable involvement.
>
> All patches are aiaiai-clean. Signed git tag below. Individual patches in
> follow-up emails. Please consider pulling or applying. Thanks!

Just in case this got buried under other email.

Thanks,
--
Alex

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

* Re: [GIT PULL 0/4] intel_th: Fixes for v5.2
  2019-07-03 15:26 ` [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
@ 2019-07-03 15:34   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-03 15:34 UTC (permalink / raw)
  To: Alexander Shishkin; +Cc: linux-kernel

On Wed, Jul 03, 2019 at 06:26:07PM +0300, Alexander Shishkin wrote:
> Alexander Shishkin <alexander.shishkin@linux.intel.com> writes:
> 
> > Hi Greg,
> 
> Hi Greg,
> 
> > Here are the fixes I have for v5.2 cycle: two gcc warnings, one dma mapping
> > issue and a new PCI ID. All issues were introduced in the same cycle, so no
> > -stable involvement.
> >
> > All patches are aiaiai-clean. Signed git tag below. Individual patches in
> > follow-up emails. Please consider pulling or applying. Thanks!
> 
> Just in case this got buried under other email.

It did, but it is in good company :)

thanks,

greg k-h

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

* Re: [GIT PULL 0/4] intel_th: Fixes for v5.2
  2019-06-21 16:19 [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
                   ` (4 preceding siblings ...)
  2019-07-03 15:26 ` [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
@ 2019-07-03 15:35 ` Greg Kroah-Hartman
  5 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-03 15:35 UTC (permalink / raw)
  To: Alexander Shishkin; +Cc: linux-kernel

On Fri, Jun 21, 2019 at 07:19:26PM +0300, Alexander Shishkin wrote:
> Hi Greg,
> 
> Here are the fixes I have for v5.2 cycle: two gcc warnings, one dma mapping
> issue and a new PCI ID. All issues were introduced in the same cycle, so no
> -stable involvement.
> 
> All patches are aiaiai-clean. Signed git tag below. Individual patches in
> follow-up emails. Please consider pulling or applying. Thanks!
> 
> The following changes since commit a188339ca5a396acc588e5851ed7e19f66b0ebd9:
> 
>   Linux 5.2-rc1 (2019-05-19 15:47:09 -0700)
> 
> are available in the Git repository at:
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/ash/stm.git tags/intel_th-fixes-for-greg-20190621
> 
> for you to fetch changes up to 0001019cdade192cb05a3c4e07df3b30a20c8ed0:

As it's too "late" for 5.2 (due to me traveling and the like), I'll just
take this for 5.3-rc1 and add the proper stable tags so they get
backported to 5.2.

thanks,

greg k-h

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

* Re: [GIT PULL 3/4] intel_th: msu: Fix single mode with disabled IOMMU
  2019-06-21 16:19 ` [GIT PULL 3/4] intel_th: msu: Fix single mode with disabled IOMMU Alexander Shishkin
@ 2019-07-03 15:36   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 9+ messages in thread
From: Greg Kroah-Hartman @ 2019-07-03 15:36 UTC (permalink / raw)
  To: Alexander Shishkin; +Cc: linux-kernel, Andy Shevchenko, Ammy Yi

On Fri, Jun 21, 2019 at 07:19:29PM +0300, Alexander Shishkin wrote:
> Commit 4e0eaf239fb3 ("intel_th: msu: Fix single mode with IOMMU") switched
> the single mode code to use dma mapping pages obtained from the page
> allocator, but with IOMMU disabled, that may lead to using SWIOTLB bounce
> buffers and without additional sync'ing, produces empty trace buffers.
> 
> Fix this by using a DMA32 GFP flag to the page allocation in single mode,
> as the device supports full 32-bit DMA addressing.
> 
> Signed-off-by: Alexander Shishkin <alexander.shishkin@linux.intel.com>
> Fixes: 4e0eaf239fb3 ("intel_th: msu: Fix single mode with IOMMU")
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Reported-by: Ammy Yi <ammy.yi@intel.com>
> ---
>  drivers/hwtracing/intel_th/msu.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

You should have had a stable tag on here anyway...

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

end of thread, other threads:[~2019-07-03 15:36 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-21 16:19 [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
2019-06-21 16:19 ` [GIT PULL 1/4] intel_th: msu: Fix unused variable warning on arm64 platform Alexander Shishkin
2019-06-21 16:19 ` [GIT PULL 2/4] intel_th: msu: Remove set but not used variable 'last' Alexander Shishkin
2019-06-21 16:19 ` [GIT PULL 3/4] intel_th: msu: Fix single mode with disabled IOMMU Alexander Shishkin
2019-07-03 15:36   ` Greg Kroah-Hartman
2019-06-21 16:19 ` [GIT PULL 4/4] intel_th: pci: Add Ice Lake NNPI support Alexander Shishkin
2019-07-03 15:26 ` [GIT PULL 0/4] intel_th: Fixes for v5.2 Alexander Shishkin
2019-07-03 15:34   ` Greg Kroah-Hartman
2019-07-03 15:35 ` Greg Kroah-Hartman

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