Commit Graph

14 Commits

Author SHA1 Message Date
David Arcari cf51bfbe37 platform/x86/intel/pmt: Correct the typo 'ACCCESS_LOCAL'
JIRA: https://issues.redhat.com/browse/RHEL-79553

commit 31440fe70167a1014f2433eb64b9888a24b30fd3
Author: WangYuli <wangyuli@uniontech.com>
Date:   Fri Sep 20 22:17:04 2024 +0800

    platform/x86/intel/pmt: Correct the typo 'ACCCESS_LOCAL'

    There is a spelling mistake of 'ACCCESS_LOCAL' which should be
    'ACCESS_LOCAL'.

    Cc: Thomas Zimmermann <tzimmermann@suse.de>
    Signed-off-by: WangYuli <wangyuli@uniontech.com>
    Link: https://lore.kernel.org/r/4F742FFF72DFD84F+20240920141704.34373-1-wangyuli@uniontech.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2025-02-14 16:43:41 -05:00
David Arcari 15e72ddfb0 platform/x86/intel/pmt: allow user offset for PMT callbacks
JIRA: https://issues.redhat.com/browse/RHEL-79553

commit 0c32840763b1579c923b4216c18bb756ca4ba473
Author: Michael J. Ruhl <michael.j.ruhl@intel.com>
Date:   Thu Nov 14 08:03:57 2024 -0500

    platform/x86/intel/pmt: allow user offset for PMT callbacks

    Usage of the telem sysfs file allows for partial reads at an offset.
    The current callback method returns the buffer starting from offset 0
    only.

    Include the requested offset in the callback and update the necessary
    address calculations with the offset.

    Note: offset addition is moved from the caller to the local usage. For
    non-callback usage this is unchanged behavior.

    Fixes: e92affc74cd8 ("platform/x86/intel/vsec: Add PMT read callbacks")
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
    Link: https://lore.kernel.org/r/20241114130358.2467787-2-michael.j.ruhl@intel.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2025-02-14 16:43:40 -05:00
David Arcari a618a220fc platform/x86/intel/pmt: Use PMT callbacks
JIRA: https://issues.redhat.com/browse/RHEL-65816

commit 045a513040cc0242d364c05c3791594e2294f32d
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Thu Jul 25 08:23:42 2024 -0400

    platform/x86/intel/pmt: Use PMT callbacks

    PMT providers may require device specific actions before their telemetry
    may be read. If the read_telem() is assigned, call it instead of
    memcpy_fromio() and return. Since this needs to be done in multiple
    locations, add pmt_telem_read_mmio() as a wrapper function to perform this
    and any other needed checks.

    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://lore.kernel.org/r/20240725122346.4063913-4-michael.j.ruhl@intel.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-11-05 08:53:14 -05:00
David Arcari bd38684648 platform/x86/intel/vsec.h: Move to include/linux
JIRA: https://issues.redhat.com/browse/RHEL-65816

commit fc9aef4382c02774662da3d7e1de8ba224e04f80
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Thu Jul 25 08:23:40 2024 -0400

    platform/x86/intel/vsec.h: Move to include/linux

    Some drivers outside of PDX86 need access to the vsec header. Move it to
    include/linux to make it easier to include.

    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://lore.kernel.org/r/20240725122346.4063913-2-michael.j.ruhl@intel.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-11-05 08:53:14 -05:00
David Arcari ead58f2cbb platform/x86/intel/pmt: telemetry: Export API to read telemetry
JIRA: https://issues.redhat.com/browse/RHEL-15539

commit 416eeb2e1fc7b60ab0c7ced26ab966dd7733357d
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Wed Nov 29 14:21:22 2023 -0800

    platform/x86/intel/pmt: telemetry: Export API to read telemetry

    Export symbols to allow access to Intel PMT Telemetry data on available
    devices. Provides APIs to search, register, and read telemetry using a
    kref managed pointer that serves as a handle to a telemetry endpoint.
    To simplify searching for present devices, have the IDA start at 1
    instead of 0 so that 0 can be used to indicate end of search.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://lore.kernel.org/r/20231129222132.2331261-11-david.e.box@linux.intel.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-10 10:01:42 -05:00
David Arcari 7c7474ec6e platform/x86/intel/pmt: Add header to struct intel_pmt_entry
JIRA: https://issues.redhat.com/browse/RHEL-15539

commit 4d1b7efee3fc703c64bacc37c4824888c5f26e8b
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Wed Nov 29 14:21:21 2023 -0800

    platform/x86/intel/pmt: Add header to struct intel_pmt_entry

    The PMT header is passed to several functions. Instead, store the header in
    struct intel_pmt_entry which is also passed to these functions and shorten
    the argument list. This simplifies the calls in preparation for later
    changes. While here also perform a newline cleanup.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://lore.kernel.org/r/20231129222132.2331261-10-david.e.box@linux.intel.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-10 10:01:09 -05:00
David Arcari f7065ae909 platform/x86/intel/vsec: Add base address field
JIRA: https://issues.redhat.com/browse/RHEL-15539

commit e97ec7f621fbfdce07bf1b98a26883ee19281747
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Wed Nov 29 14:21:20 2023 -0800

    platform/x86/intel/vsec: Add base address field

    Some devices may emulate PCI VSEC capabilities in MMIO. In such cases the
    BAR is not readable from a config space. Provide a field for drivers to
    indicate the base address to be used.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://lore.kernel.org/r/20231129222132.2331261-9-david.e.box@linux.intel.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-10 09:35:48 -05:00
David Arcari 4b07942287 platform/x86/intel/vsec: remove platform_info from vsec device structure
JIRA: https://issues.redhat.com/browse/RHEL-15539

commit 0a0a52abaa65b844afde3d7229c209a8cddc5a07
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Wed Nov 29 14:21:16 2023 -0800

    platform/x86/intel/vsec: remove platform_info from vsec device structure

    In preparation for exporting an API to register Intel Vendor Specific
    Extended Capabilities (VSEC) from other drivers, remove the pointer to
    platform_info from intel_vsec_device. This prevents a potential page fault
    when auxiliary drivers probe and attempt to dereference this pointer to
    access the needed quirks field. Instead, just add the quirks to
    intel_vsec_device.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://lore.kernel.org/r/20231129222132.2331261-5-david.e.box@linux.intel.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2024-01-10 09:35:46 -05:00
David Arcari 359d10a40d platform/x86/intel/pmt: Add INTEL_PMT module namespace
JIRA: https://issues.redhat.com/browse/RHEL-19678

commit d908084385a41cfdb82dca6ab4086e3f1a9dd4ae
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Thu Mar 16 15:57:35 2023 -0700

    platform/x86/intel/pmt: Add INTEL_PMT module namespace

    Since the currently exported symbols in pmt_class are only used by other
    Intel PMT drivers, create an INTEL_PMT module namespace for them.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
    Link: https://lore.kernel.org/r/20230316225736.2856521-1-david.e.box@linux.intel.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2023-12-18 07:43:30 -05:00
Mark Langsdorf 902e0a8272 drivers: remove struct module * setting from struct class
JIRA: https://issues.redhat.com/browse/RHEL-1023
Conflicts:
	drivers/ptp/ptp_ocp.c - struct timecard_class
doesn't exist, so it wasn't possible to remove its
.owner field

commit 10a03c36b7dd7759788ebc613091d313b60f93e0
Author: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: Fri, 17 Mar 2023 15:16:27 +0000

There is no need to manually set the owner of a struct class, as the
registering function does it automatically, so remove all of the
explicit settings from various drivers that did so as it is unneeded.

This allows us to remove this pointer entirely from this structure going
forward.

Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Link: https://lore.kernel.org/r/20230313181843.1207845-2-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
2023-11-01 11:12:29 -05:00
David Arcari 34c30f9783 platform/x86/intel/pmt: Sapphire Rapids PMT errata fix
Bugzilla: https://bugzilla.redhat.com/2144690

commit bcdfa1f77ea7f67368d20384932a9d1e3047ddd2
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Nov 4 20:42:28 2022 -0700

    platform/x86/intel/pmt: Sapphire Rapids PMT errata fix

    On Sapphire Rapids, due to a hardware issue affecting the PUNIT telemetry
    region, reads that are not done in QWORD quantities and alignment may
    return incorrect data. Use a custom 64-bit copy for this region.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://lore.kernel.org/r/20221105034228.1376677-1-david.e.box@linux.intel.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-11-28 09:48:05 -05:00
David Arcari 994a191e2d platform/x86/intel/vsec: Rework early hardware code
Bugzilla: https://bugzilla.redhat.com/2076745

commit f21c179e1206e88d187d517d97d270c6492d4673
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Wed Jun 29 15:13:31 2022 -0700

    platform/x86/intel/vsec: Rework early hardware code

    In the Intel VSEC PCI driver, use a new VSEC_QUIRK_EARLY_HW flag in
    driver_data to indicate the need for early hardware quirks in
    auxiliary devices. Remove the separate PCI ID list maintained by the
    Intel PMT auxiliary driver.

    Cc: Srinivas Pandruvada <srinivas.pandruvada@intel.com>
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Signed-off-by: Gayatri Kammela <gayatri.kammela@linux.intel.com>
    Link: https://lore.kernel.org/r/20220629221334.434307-2-gayatri.kammela@linux.intel.com
    Reviewed-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-09-06 09:07:39 -04:00
David Arcari 88a7d8a4f0 platform/x86/intel: Move intel_pmt from MFD to Auxiliary Bus
Bugzilla: https://bugzilla.redhat.com/2058806

commit a3c8f906ed5fc1d4895b5e1a5c6ad6e942d6c0ca
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Tue Dec 7 17:50:12 2021 -0800

    platform/x86/intel: Move intel_pmt from MFD to Auxiliary Bus

    Intel Platform Monitoring Technology (PMT) support is indicated by presence
    of an Intel defined PCIe Designated Vendor Specific Extended Capabilities
    (DVSEC) structure with a PMT specific ID. The current MFD implementation
    creates child devices for each PMT feature, currently telemetry, watcher,
    and crashlog. However DVSEC structures may also be used by Intel to
    indicate support for other features. The Out Of Band Management Services
    Module (OOBMSM) uses DVSEC to enumerate several features, including PMT.
    In order to support them it is necessary to modify the intel_pmt driver to
    handle the creation of the child devices more generically. To that end,
    modify the driver to create child devices for any VSEC/DVSEC features on
    supported devices (indicated by PCI ID).  Additionally, move the
    implementation from MFD to the Auxiliary bus.  VSEC/DVSEC features are
    really multifunctional PCI devices, not platform devices as MFD was
    designed for. Auxiliary bus gives more flexibility by allowing the
    definition of custom structures that can be shared between associated
    auxiliary devices and the parent device. Also, rename the driver from
    intel_pmt to intel_vsec to better reflect the purpose.

    This series also removes the current runtime pm support which was not
    complete to begin with. None of the current devices require runtime pm.
    However the support will be replaced when a device is added that requires
    it.

    Reviewed-by: Mark Gross <markgross@kernel.org>
    Acked-by: Hans de Goede <hdegoede@redhat.com>
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://lore.kernel.org/r/20211208015015.891275-4-david.e.box@linux.intel.com
    Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-03-17 12:15:22 -04:00
David Arcari 09567f2bb2 platform/x86/intel: Move Intel PMT drivers to new subfolder
Bugzilla: https://bugzilla.redhat.com/2058806

commit e184b1e589a7fbb80bfdd0364c11422999a17a26
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Tue Jul 27 09:49:28 2021 -0700

    platform/x86/intel: Move Intel PMT drivers to new subfolder

    Move all Intel Platform Monitoring Technology drivers to
    drivers/platform/x86/intel/pmt.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Link: https://lore.kernel.org/r/20210727164928.3171521-1-david.e.box@linux.intel.com
    Signed-off-by: Hans de Goede <hdegoede@redhat.com>

Signed-off-by: David Arcari <darcari@redhat.com>
2022-03-17 12:15:22 -04:00