Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1722483 > unrolled thread

[RFC PATCH v9 0/7] Cavium ARM64 uncore PMU support

Started byJan Glauber <jglauber@cavium.com>
First post2017-08-29 15:20 +0200
Last post2017-08-29 15:20 +0200
Articles 4 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [RFC PATCH v9 0/7] Cavium ARM64 uncore PMU support Jan Glauber <jglauber@cavium.com> - 2017-08-29 15:20 +0200
    [RFC PATCH v9 1/7] edac: thunderx: Remove suspend/resume support Jan Glauber <jglauber@cavium.com> - 2017-08-29 15:20 +0200
      Re: [RFC PATCH v9 1/7] edac: thunderx: Remove suspend/resume support Borislav Petkov <bp@alien8.de> - 2017-08-30 20:00 +0200
    [RFC PATCH v9 4/7] perf: export perf_event_update_userpage() Jan Glauber <jglauber@cavium.com> - 2017-08-29 15:20 +0200

#1722483 — [RFC PATCH v9 0/7] Cavium ARM64 uncore PMU support

FromJan Glauber <jglauber@cavium.com>
Date2017-08-29 15:20 +0200
Subject[RFC PATCH v9 0/7] Cavium ARM64 uncore PMU support
Message-ID<ujOAV-37c-3@gated-at.bofh.it>
I'm posting this as RFC following this discussion:
https://marc.info/?l=linux-arm-kernel&m=150099526923838&w=2

I've implemented the wrapper for the PCI devices and put it under
drivers/soc/cavium which I found more appropriate than drivers/misc.

I was not able to find a way to build the EDAC driver and the PMU driver
with all combinations (builtin and module) so I limited the build options
to module only. The problem is that the select from EDAC or PMU
sets the wrappers build type to whatever EDAC or PMU choose.
But all parts must be either built-in or modules, having the wrapper
builtin and calling into module code will not work. If there is a better
solution please let me know.

The PMU code is the same as in v8.

Add support for various PMU counters found on the Cavium ThunderX and
OcteonTx SoC.

The PMU driver provides common "uncore" functions to avoid code duplication
and support adding more device PMUs (like L2 cache) in the future.

Changes to v8:
- Wrapper for PCI devices

Jan Glauber (7):
  edac: thunderx: Remove suspend/resume support
  edac,soc: thunderx: Add wrapper for EDAC LMC PCI device
  edac,soc: thunderx: Add wrapper for EDAC OCX PCI device
  perf: export perf_event_update_userpage()
  perf: cavium: Support memory controller PMU counters
  perf: cavium: Support transmit-link PMU counters
  perf: cavium: Add Documentation

 Documentation/perf/cavium-pmu.txt |  75 +++++
 drivers/edac/Kconfig              |   3 +
 drivers/edac/thunderx_edac.c      |  92 +-----
 drivers/perf/Kconfig              |  15 +
 drivers/perf/Makefile             |   1 +
 drivers/perf/cavium_pmu.c         | 680 ++++++++++++++++++++++++++++++++++++++
 drivers/soc/Kconfig               |   1 +
 drivers/soc/Makefile              |   1 +
 drivers/soc/cavium/Kconfig        |  14 +
 drivers/soc/cavium/Makefile       |   2 +
 drivers/soc/cavium/cavium_lmc.c   |  53 +++
 drivers/soc/cavium/cavium_ocx.c   |  49 +++
 include/linux/cpuhotplug.h        |   1 +
 include/linux/soc/cavium/lmc.h    |  12 +
 include/linux/soc/cavium/ocx.h    |  12 +
 kernel/events/core.c              |   1 +
 16 files changed, 933 insertions(+), 79 deletions(-)
 create mode 100644 Documentation/perf/cavium-pmu.txt
 create mode 100644 drivers/perf/cavium_pmu.c
 create mode 100644 drivers/soc/cavium/Kconfig
 create mode 100644 drivers/soc/cavium/Makefile
 create mode 100644 drivers/soc/cavium/cavium_lmc.c
 create mode 100644 drivers/soc/cavium/cavium_ocx.c
 create mode 100644 include/linux/soc/cavium/lmc.h
 create mode 100644 include/linux/soc/cavium/ocx.h

-- 
2.9.0.rc0.21.g7777322

[toc] | [next] | [standalone]


#1722485 — [RFC PATCH v9 1/7] edac: thunderx: Remove suspend/resume support

FromJan Glauber <jglauber@cavium.com>
Date2017-08-29 15:20 +0200
Subject[RFC PATCH v9 1/7] edac: thunderx: Remove suspend/resume support
Message-ID<ujOAY-37c-55@gated-at.bofh.it>
In reply to#1722483
The memory controller on ThunderX/OcteonTX systems does not
support power management. Therefore remove the suspend/resume
callbacks.

Signed-off-by: Jan Glauber <jglauber@cavium.com>
---
 drivers/edac/thunderx_edac.c | 21 ---------------------
 1 file changed, 21 deletions(-)

diff --git a/drivers/edac/thunderx_edac.c b/drivers/edac/thunderx_edac.c
index 2d352b4..d02bf3b 100644
--- a/drivers/edac/thunderx_edac.c
+++ b/drivers/edac/thunderx_edac.c
@@ -639,27 +639,6 @@ static irqreturn_t thunderx_lmc_threaded_isr(int irq, void *dev_id)
 	return ret;
 }
 
-#ifdef CONFIG_PM
-static int thunderx_lmc_suspend(struct pci_dev *pdev, pm_message_t state)
-{
-	pci_save_state(pdev);
-	pci_disable_device(pdev);
-
-	pci_set_power_state(pdev, pci_choose_state(pdev, state));
-
-	return 0;
-}
-
-static int thunderx_lmc_resume(struct pci_dev *pdev)
-{
-	pci_set_power_state(pdev, PCI_D0);
-	pci_enable_wake(pdev, PCI_D0, 0);
-	pci_restore_state(pdev);
-
-	return 0;
-}
-#endif
-
 static const struct pci_device_id thunderx_lmc_pci_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVICE_ID_THUNDER_LMC) },
 	{ 0, },
-- 
2.9.0.rc0.21.g7777322

[toc] | [prev] | [next] | [standalone]


#1723550 — Re: [RFC PATCH v9 1/7] edac: thunderx: Remove suspend/resume support

FromBorislav Petkov <bp@alien8.de>
Date2017-08-30 20:00 +0200
SubjectRe: [RFC PATCH v9 1/7] edac: thunderx: Remove suspend/resume support
Message-ID<ukfrs-2W1-17@gated-at.bofh.it>
In reply to#1722485
On Tue, Aug 29, 2017 at 03:12:32PM +0200, Jan Glauber wrote:
> The memory controller on ThunderX/OcteonTX systems does not
> support power management. Therefore remove the suspend/resume
> callbacks.
> 
> Signed-off-by: Jan Glauber <jglauber@cavium.com>
> ---
>  drivers/edac/thunderx_edac.c | 21 ---------------------
>  1 file changed, 21 deletions(-)

Just when I thought I'd pick that one up now because it is removing
stuff:

drivers/edac/thunderx_edac.c:817:14: error: ‘thunderx_lmc_suspend’ undeclared here (not in a function)
  .suspend  = thunderx_lmc_suspend,
              ^~~~~~~~~~~~~~~~~~~~
drivers/edac/thunderx_edac.c:818:14: error: ‘thunderx_lmc_resume’ undeclared here (not in a function)
  .resume   = thunderx_lmc_resume,
              ^~~~~~~~~~~~~~~~~~~
scripts/Makefile.build:308: recipe for target 'drivers/edac/thunderx_edac.o' failed
make[1]: *** [drivers/edac/thunderx_edac.o] Error 1
make[1]: *** Waiting for unfinished jobs....
Makefile:1682: recipe for target 'drivers/edac/' failed
make: *** [drivers/edac/] Error 2

Please make sure you build and test every patch before submitting.
You're lucky I can at least build arm64 on my x86 workstation. :-)

Thx.

-- 
Regards/Gruss,
    Boris.

Good mailing practices for 400: avoid top-posting and trim the reply.

[toc] | [prev] | [next] | [standalone]


#1722487 — [RFC PATCH v9 4/7] perf: export perf_event_update_userpage()

FromJan Glauber <jglauber@cavium.com>
Date2017-08-29 15:20 +0200
Subject[RFC PATCH v9 4/7] perf: export perf_event_update_userpage()
Message-ID<ujOAY-37c-57@gated-at.bofh.it>
In reply to#1722483
Export perf_event_update_userpage(). This change is needed to allow
building a PMU driver as a kernel module.

Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Arnaldo Carvalho de Melo <acme@kernel.org>

Signed-off-by: Jan Glauber <jglauber@cavium.com>
---
 kernel/events/core.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 3504125..639bbf5 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4977,6 +4977,7 @@ void perf_event_update_userpage(struct perf_event *event)
 unlock:
 	rcu_read_unlock();
 }
+EXPORT_SYMBOL_GPL(perf_event_update_userpage);
 
 static int perf_mmap_fault(struct vm_fault *vmf)
 {
-- 
2.9.0.rc0.21.g7777322

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web