Commit Graph
100 Commits
Author SHA1 Message Date
Dennis Chen e5727faf62 platform/x86/intel/pmc/ssram: Rename probe and PCI ID table for consistency
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 90fd47d0d8109ef1301a60a44a7f85581a1e6efe
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Jun 12 14:01:50 2026 -0700

    platform/x86/intel/pmc/ssram: Rename probe and PCI ID table for consistency

    Rename intel_pmc_ssram_telemetry_probe() to pmc_ssram_telemetry_probe() and
    intel_pmc_ssram_telemetry_pci_ids[] to pmc_ssram_telemetry_pci_ids[],
    updating the MODULE_DEVICE_TABLE() and pci_driver wiring accordingly.

    This aligns the symbol names with the driver filename and module name,
    reduces redundant intel_ prefixes, and improves readability. No functional
    behavior changes are intended.

    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://patch.msgid.link/6d3935858214fdd0f530f9a7c08a387fa4e5e8cd.1781294741.git.david.e.box@linux.intel.com
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen 51663ce1f2 platform/x86/intel/pmc: Add ACPI PWRM telemetry driver for Nova Lake S
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

Conflicts:
- drivers/platform/x86/intel/pmc/pwrm_telemetry.c: Remove quotes from
symbol namespace import/exports because RHEL is missing cdd30ebb1b9f
("module: Convert symbol namespace to string literal")

commit adc5d98d9ff8b5d37e89e11a2ac5512595541329
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Jun 12 14:01:49 2026 -0700

    platform/x86/intel/pmc: Add ACPI PWRM telemetry driver for Nova Lake S

    Add an ACPI-based PMC PWRM telemetry driver for Nova Lake S. The driver
    locates PMT discovery data in _DSD under the Intel VSEC UUID, parses it,
    and registers telemetry regions with the PMT/VSEC framework so PMC
    telemetry is exposed via existing PMT interfaces.

    Export pmc_parse_telem_dsd() and pmc_find_telem_guid() to support ACPI
    discovery in other PMC drivers (e.g., ssram_telemetry) without duplicating
    ACPI parsing logic. Also export acpi_disc_t typedef from core.h for callers
    to properly declare discovery table arrays.

    Selected by INTEL_PMC_CORE. Existing PCI functionality is preserved.

    Assisted-by: GitHub-Copilot:claude-opus-4.7
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://patch.msgid.link/09b8211d8a5a79fa019ee2397137a6a43cf19430.1781294741.git.david.e.box@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen adfb9725e6 platform/x86/intel/pmc: Add PMC SSRAM Kconfig description
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 8ba4cf60c5ce4a3073126a6cbb09475010f8fa52
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Jun 12 14:01:48 2026 -0700

    platform/x86/intel/pmc: Add PMC SSRAM Kconfig description

    Add a proper description for the intel_pmc_ssram driver.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://patch.msgid.link/bd7ba2f98450751af1de054dac0469acc1138513.1781294741.git.david.e.box@linux.intel.com
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen 0d13c0221f platform/x86/intel/pmt: Unify header fetch and add ACPI source
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 13793c7f9e9ff30042a54bb680662b5cfa0f58fa
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Jun 12 14:01:47 2026 -0700

    platform/x86/intel/pmt: Unify header fetch and add ACPI source

    Allow the PMT class to read discovery headers from either PCI MMIO or
    ACPI-provided entries, depending on the discovery source. The new
    source-aware fetch helper caches the canonical discovery header for both
    paths, capping PCI MMIO reads to the mapped resource size, while keeping
    the mapped PCI discovery table available for users such as crashlog.

    Split intel_pmt_populate_entry() into source-specific resolvers:
      - pmt_resolve_access_pci(): handles both ACCESS_LOCAL and ACCESS_BARID
        for PCI-backed devices and sets entry->pcidev. Same existing
        functionality.
      - pmt_resolve_access_acpi(): handles only ACCESS_BARID for ACPI-backed
        devices, rejecting ACCESS_LOCAL which has no valid semantics without
        a physical discovery resource.

    This maintains existing PCI behavior and makes no functional changes
    for PCI devices.

    Assisted-by: GitHub-Copilot:claude-opus-4.7
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://patch.msgid.link/4b33b04ffaf0943b67d330f48b5d1dfcb6d1be5d.1781294741.git.david.e.box@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen 381a55f96f platform/x86/intel/pmt: Cache the telemetry discovery header
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 4dfc7dca6e934ca414d8d3c70a84e79d13d9e750
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Jun 12 14:01:46 2026 -0700

    platform/x86/intel/pmt: Cache the telemetry discovery header

    pmt_telem_header_decode() only needs the discovery header dwords, but it
    currently decodes them by reading directly from entry->disc_table.

    Cache the discovery header in intel_pmt_entry when the device is created
    and have telemetry decode use the cached values instead of performing MMIO
    reads at decode time.

    The DVSEC discovery resource for a namespace is sized by its per-entry
    entry_size (in dwords), which can be less than the 4-dword cache (e.g.
    telemetry uses entry_size = 3, i.e. 12 bytes). Cap the memcpy_fromio()
    to resource_size(disc_res) so the new cache does not read past the
    mapped region. Any unread dwords stay zero from the zero-initialized
    allocation of the containing struct.

    This keeps the telemetry header decode path independent of how the
    discovery data is backed and avoids baking a direct MMIO assumption into
    the feature-specific decode logic.

    Assisted-by: GitHub-Copilot:claude-opus-4.7
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://patch.msgid.link/f805e2ada52dc0661761cda7f692e76e6ea2d257.1781294741.git.david.e.box@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen f8235c09b4 platform/x86/intel/pmt: Pass discovery index instead of resource
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 4a87492cd137d158779923a034d7e742f7358952
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Jun 12 14:01:45 2026 -0700

    platform/x86/intel/pmt: Pass discovery index instead of resource

    Change PMT class code to pass a discovery index rather than a direct struct
    resource when creating entries. This allows the class to identify the
    discovery source generically without assuming PCI BAR resources. For PCI
    devices, the index still resolves to a resource in the intel_vsec_device.
    Other discovery sources, such as ACPI, can use the same index without
    needing a struct resource.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://patch.msgid.link/8e785902c6a3ac1b5a9c3f0f65096553dc5acd4f.1781294741.git.david.e.box@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen 43f2bf12e1 platform/x86/intel/pmt/telemetry: Move overlap check to post-decode hook
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 521460e6699557f2aa0e4818110e082b76809e98
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Jun 12 14:01:44 2026 -0700

    platform/x86/intel/pmt/telemetry: Move overlap check to post-decode hook

    Update the telemetry namespace to use the new PMT class pre/post decode
    interface. The overlap check, which previously occurred during header
    decode, is now performed in the post-decode hook once header fields are
    populated. This preserves existing behavior while reusing the same header
    decode logic across PMT drivers.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://patch.msgid.link/2f5e429a38e22eb45fcfaaca4e037fa395d4f199.1781294741.git.david.e.box@linux.intel.com
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen 97e46be01e platform/x86/intel/pmt/crashlog: Split init into pre-decode
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit b3de79d932bdcee4b2b9c8f9a058516699cf1c50
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Jun 12 14:01:43 2026 -0700

    platform/x86/intel/pmt/crashlog: Split init into pre-decode

    Refactor crashlog initialization to use the PMT namespace pre-decode hook:

      - Add pmt_crashlog_pre_decode() to parse type/version, select the
        crashlog_info, initialize the control mutex, and set entry->attr_grp.
      - Simplify pmt_crashlog_header_decode() to only read header fields from
        the discovery table.
      - Wire the namespace with .pmt_pre_decode = pmt_crashlog_pre_decode.

    This separates structural initialization from header parsing, aligning
    crashlog with the PMT class pre/post decode flow.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://patch.msgid.link/ed8cda8456c97132cf2d2b4ff6a5cffb1ce3a666.1781294741.git.david.e.box@linux.intel.com
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen 218eed2853 platform/x86/intel/pmt: Add pre/post decode hooks around header parsing
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit acd3b94f8604aeee2b62f8fd18e95a0474546288
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri Jun 12 14:01:42 2026 -0700

    platform/x86/intel/pmt: Add pre/post decode hooks around header parsing

    Add optional pre- and post-decode callbacks to the PMT class so namespaces
    can perform setup and cleanup steps around header parsing.

      - Add pmt_pre_decode() and pmt_post_decode() to struct
        intel_pmt_namespace.
      - Update intel_pmt_dev_create() to invoke, in order:
          pre → header_decode() → post.
      - Keep the existing pmt_header_decode() callback unchanged.

    No functional changes. This adds flexibility for upcoming decoders while
    preserving current behavior.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Link: https://patch.msgid.link/b178a341601ca694db99c3b738fe4ed9e0c2bede.1781294741.git.david.e.box@linux.intel.com
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen a7d3752295 platform/x86/intel/vsec: Restore BAR fallback for header walk
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 375bbbbd112af028ee0b45d833a6233c23d19bbf
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Fri May 29 11:31:49 2026 -0700

    platform/x86/intel/vsec: Restore BAR fallback for header walk

    The base_addr refactor changed intel_vsec_walk_header() to pass
    info->base_addr as the discovery-table base address. For the PCI VSEC
    driver this info comes from driver_data, but exported callers may provide
    their own static headers and leave base_addr unset.

    For xe, this made the discovery-table base address zero instead of the BAR
    selected by header->tbir, preventing PMT endpoints from being created.

    Restore the previous behavior for the header-walk path by falling back to
    pci_resource_start(pdev, header->tbir) when base_addr is not specified.
    Keep explicit base_addr override behavior unchanged.

    This preserves the refactor structure while fixing the functional
    regression in manual-header users.

    Fixes: 904b333fc51c ("platform/x86/intel/vsec: Refactor base_addr handling")
    Assisted-by: Claude:claude-sonnet-4-6
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
    Link: https://patch.msgid.link/20260529183150.129744-1-david.e.box@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen 44f2826ee2 platform/x86: intel-hid: Add HP ProBook x360 440 G1 to button_array_table
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit c39023ca9a447f09c072080efc84d6874c2275c9
Author: Nikolay Metchev <nikolaymetchev@gmail.com>
Date:   Tue Jun 9 22:33:09 2026 +0100

    platform/x86: intel-hid: Add HP ProBook x360 440 G1 to button_array_table

    The volume rocker buttons on the HP ProBook x360 440 G1 convertible emit
    events 0xc4-0xc7 via the intel-hid ACPI device (INT33D5). These codes are
    only present in intel_array_keymap, which is used when the "5 button
    array" input device exists. On this machine button_array_present()
    returns false because the firmware does not advertise the array through
    the HEBC method, so notify_handler() routes the events to a NULL
    priv->array and they are dropped as "unknown event 0xc4". As a result
    the side volume keys do nothing.

    Add the machine to button_array_table so the array device is created and
    the volume rocker emits KEY_VOLUMEUP / KEY_VOLUMEDOWN. This is equivalent
    to booting with the enable_5_button_array=1 module parameter, which was
    used to confirm the fix on the affected hardware.

    Signed-off-by: Nikolay Metchev <nikolaymetchev@gmail.com>
    Reviewed-by: Hans de Goede <johannes.goede@oss.qualcomm.com>
    Link: https://patch.msgid.link/20260609213309.445019-1-nikolaymetchev@gmail.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:48 -04:00
Dennis Chen 03d105a5ce platform/x86/intel/tpmi: convert mutex in mem_write() to guard
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 6736b1801908acfa64ef2b651c5bb78389a8a4c6
Author: ZhaoJinming <zhaojinming@uniontech.com>
Date:   Thu May 21 21:08:48 2026 +0800

    platform/x86/intel/tpmi: convert mutex in mem_write() to guard

    Convert the explicit mutex_lock/mutex_unlock pair in mem_write() into
    a cleanup.h guard(mutex)() scope-based lock acquisition. This removes
    the remaining goto-based cleanup path and keeps the lock held until
    the end of the mem_write() scope.

    Suggested-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: ZhaoJinming <zhaojinming@uniontech.com>
    Link: https://patch.msgid.link/20260521130848.2860219-2-zhaojinming@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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen b4956fcff3 platform/x86/intel/pmc: rate-limit LTR scale-factor warning
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit ceb8678adfd68b33d5e8a52cb2e96cfa90d81761
Author: Mike Bommarito <michael.bommarito@gmail.com>
Date:   Sat May 23 07:45:17 2026 -0400

    platform/x86/intel/pmc: rate-limit LTR scale-factor warning

    convert_ltr_scale() emits an unconditional pr_warn() whenever an LTR row
    encoded by hardware has a scale-factor field of 6 or 7 (reserved values
    per the PCIe LTR ECN).  The function is called twice per LTR row (snoop
    + non-snoop) by pmc_core_ltr_show(), which is invoked on every read of
    /sys/kernel/debug/pmc_core/ltr_show as well as during certain platform
    driver activity.

    On a Meteor Lake laptop with an Intel AX210 Wi-Fi card, this produces
    4-12 "Invalid LTR scale factor." lines per second in dmesg, with no
    context to help identify which PMC IP / row carries the bad value.

    Switch to pr_warn_once() so the warning still flags the spec violation
    once per boot, and include the offending scale value in the message.
    Identifying the originating LTR row would require restructuring the
    caller's loop to perform the validity check itself; that is left as a
    separate change.

    Assisted-by: Claude:claude-opus-4-7
    Signed-off-by: Mike Bommarito <michael.bommarito@gmail.com>
    Link: https://patch.msgid.link/20260523114517.101305-1-michael.bommarito@gmail.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen a58d989e47 platform/x86/intel/tpmi: use cleanup helpers in mem_write()
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit a221557958e3a82d8565729d445a7385963f30b6
Author: ZhaoJinming <zhaojinming@uniontech.com>
Date:   Thu May 21 21:08:47 2026 +0800

    platform/x86/intel/tpmi: use cleanup helpers in mem_write()

    In mem_write(), the temporary array returned by
    parse_int_array_user() must be released on all exit paths.
    Convert the array variable to use cleanup.h scope-based
    cleanup so it is freed automatically on return.

    This also moves the array declaration next to
    parse_int_array_user() as required by cleanup.h usage
    guidelines.

    Fixes: 8e0a2fc68ec3 ("platform/x86/intel/tpmi: Use 32 bit aligned address for debugfs mem write")
    Cc: stable@vger.kernel.org
    Signed-off-by: ZhaoJinming <zhaojinming@uniontech.com>
    Link: https://patch.msgid.link/20260521130848.2860219-1-zhaojinming@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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen 6f04694b43 platform/x86: intel/smartconnect: Check ACPI_HANDLE() against NULL
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit 922952f2bbcfe21375973d0ea0e662a1a4837b10
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Tue May 12 16:11:43 2026 +0200

    platform/x86: intel/smartconnect: Check ACPI_HANDLE() against NULL

    Every platform driver can be forced to match a device that doesn't match
    its list of device IDs because of device_match_driver_override(), so
    platform drivers that rely on the existence of a device's ACPI companion
    object need to verify its presence.

    Accordingly, add a requisite ACPI_HANDLE() check against NULL to the
    platform/x86 intel/smartconnect driver.

    Fixes: 8a44bd3ffdb2 ("platform/x86: intel/smartconnect: Convert ACPI driver to a platform one")
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Link: https://patch.msgid.link/7956676.EvYhyI6sBW@rafael.j.wysocki
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen 143df576cb platform/x86: intel/rst: Check ACPI_COMPANION() against NULL
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit 51e91ad0a0ccb0906306c653f9e8b97a180d8608
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Tue May 12 16:11:00 2026 +0200

    platform/x86: intel/rst: Check ACPI_COMPANION() against NULL

    Every platform driver can be forced to match a device that doesn't match
    its list of device IDs because of device_match_driver_override(), so
    platform drivers that rely on the existence of a device's ACPI companion
    object need to verify its presence.

    Accordingly, add a requisite ACPI_COMPANION() check against NULL to the
    platform/x86 intel/rst driver.

    Fixes: 163a68a31f74 ("platform/x86: intel/rst: Convert ACPI driver to a platform one")
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Link: https://patch.msgid.link/2051525.PYKUYFuaPT@rafael.j.wysocki
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen ad09ab6f83 platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit 348ccc754d8939e21ca5956ff45720b81d6e407f
Author: Lukas Wunner <lukas@wunner.de>
Date:   Thu May 14 07:40:42 2026 +0200

    platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery

    After a PCIe Uncorrectable Error has been reported by a device with
    Intel Vendor Specific Extended Capabilities and has been recovered
    through a Secondary Bus Reset, its driver calls intel_vsec_pci_probe()
    to rescan and reinitialize VSECs.

    intel_vsec_pci_probe() invokes pcim_enable_device() and thereby adds
    another devm action which calls pcim_disable_device() on driver unbind.

    So once the driver unbinds, pcim_disable_device() will be called as many
    times as an Uncorrectable Error occurred, plus one.  This will lead to
    an enable_cnt imbalance on driver unbind.

    Additionally, since commit dc957ab6aa05 ("platform/x86/intel/vsec: Add
    private data for per-device data"), a devm_kzalloc() allocation is
    leaked on every Uncorrectable Error.

    Avoid by splitting the VSEC rescan out of intel_vsec_pci_probe() into a
    separate helper and calling that on PCIe error recovery.

    Fixes: 936874b77dd0 ("platform/x86/intel/vsec: Add PCI error recovery support to Intel PMT")
    Signed-off-by: Lukas Wunner <lukas@wunner.de>
    Cc: stable@vger.kernel.org  # v6.0+
    Link: https://patch.msgid.link/bd594d09fa866dc51dddc9a447c3b23f9b1402cc.1778736835.git.lukas@wunner.de
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

(cherry picked from commit 348ccc754d8939e21ca5956ff45720b81d6e407f)
Assisted-by: Patchpal
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen 57a71cfdf2 platform/x86: intel-vbtn: Check ACPI_HANDLE() against NULL
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit a9f305c5a355efeb240d406d378491d9eec02d07
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Tue May 12 17:16:22 2026 +0200

    platform/x86: intel-vbtn: Check ACPI_HANDLE() against NULL

    Every platform driver can be forced to match a device that doesn't match
    its list of device IDs because of device_match_driver_override(), so
    platform drivers that rely on the existence of a device's ACPI companion
    object need to verify its presence.

    Accordingly, add a requisite ACPI_HANDLE() check against NULL to the
    platform/x86 intel-vbtn driver.

    Fixes: 26173179fa ("platform/x86: intel-vbtn: Eval VBDL after registering our notifier")
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
    Link: https://patch.msgid.link/3426431.aeNJFYEL58@rafael.j.wysocki
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen 263024f0d1 platform/x86/intel/vsec: allocate res with intel_vsec_dev
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

Conflicts:
- drivers/platform/x86/intel/vsec.c: Missing kzalloc_obj conversion in
removed hunks

commit 8ef6b01cee44803691c0a0c95b36f8ec710e2afb
Author: Rosen Penev <rosenp@gmail.com>
Date:   Thu Apr 30 15:43:07 2026 -0700

    platform/x86/intel/vsec: allocate res with intel_vsec_dev

    Use a flexible array member to combine allocations. Avoids having to
    free separately.

    Add __counted_by for extra runtime analysis.

    Move counting variable assignment to after allocations as is already
    done by kzalloc_flex for GCC 15 and above.

    Signed-off-by: Rosen Penev <rosenp@gmail.com>
    Tested-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://patch.msgid.link/20260430224307.109311-1-rosenp@gmail.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen 7925a4c9e0 platform/x86/intel/pmc: Add Nova Lake support to intel_pmc_core driver
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 41354f4c8a791d3059f4355945e550693ac87ce8
Author: Xi Pardee <xi.pardee@linux.intel.com>
Date:   Mon May 4 21:33:38 2026 -0700

    platform/x86/intel/pmc: Add Nova Lake support to intel_pmc_core driver

    Add Nova Lake support in intel_pmc_core driver

    Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
    Link: https://patch.msgid.link/20260505043342.2573556-8-xi.pardee@linux.intel.com
    [ij: added missing statics to a few structs]
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen bf909011c7 platform/x86/intel/pmc: Retrieve PMC info only for available PMCs
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit a7d5916d132300b1ff6ac0c5f6d7a7cb7817a7fc
Author: Xi Pardee <xi.pardee@linux.intel.com>
Date:   Mon May 4 21:33:37 2026 -0700

    platform/x86/intel/pmc: Retrieve PMC info only for available PMCs

    Update the Intel PMC Core driver to fetch PMC information only for
    available PMCs. Previously, the driver attempted to retrieve PMC info
    even when the corresponding PMC was not present.

    This change aligns with recent updates to the Intel SSRAM Telemetry
    driver. Starting with NVL, the SSRAM Telemetry driver is probed for
    each individual SSRAM device. The prior implementation could not
    differentiate between an unavailable PMC and one that had not yet
    completed information retrieval. To resolve this, the PMC Core driver
    now skips obtaining PMC info for unavailable PMCs.

    Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
    Link: https://patch.msgid.link/20260505043342.2573556-7-xi.pardee@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen 3deef4a206 platform/x86/intel/pmc: Add support for variable DMU offsets
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit ebbf33380896cc489e870d88004ad3750e908a6c
Author: Xi Pardee <xi.pardee@linux.intel.com>
Date:   Mon May 4 21:33:36 2026 -0700

    platform/x86/intel/pmc: Add support for variable DMU offsets

    Add support for handling different DMU Die C6 offsets across platforms.
    The previous implementation assumed a uniform DMU Die C6 offset for all
    platforms, which is no longer valid after an upcoming change.

    Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
    Link: https://patch.msgid.link/20260505043342.2573556-6-xi.pardee@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen 38fc26f59e platform/x86/intel/pmc: Use PCI DID for PMC SSRAM device discovery
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 11de0586ecf40aa747972f1b0bf88bac192d7b06
Author: Xi Pardee <xi.pardee@linux.intel.com>
Date:   Mon May 4 21:33:35 2026 -0700

    platform/x86/intel/pmc: Use PCI DID for PMC SSRAM device discovery

    Update the PMC SSRAM discovery process to identify the device using its
    PCI Device ID rather than relying on a fixed PCI bus location. The
    enumeration of integrated devices on the PCI bus is no longer guaranteed
    to be consistent across CPUs.

    On earlier platforms, the IOE and PCH SSRAM devices were hidden from the
    BIOS, and the SOC SSRAM device is associated to telemetry regions from all
    available SSRAM devices. Starting with Nova Lake, the IOE and PCH SSRAM
    devices register their telemetry regions independently, meaning each
    telemetry region is now linked to its corresponding SSRAM device. A new
    ssram_hidden attribute has been added to the pmc_dev_info structure to
    reflect this distinction.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
    Link: https://patch.msgid.link/20260505043342.2573556-5-xi.pardee@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen e09ef35836 platform/x86/intel/pmc: Enable Pkgc blocking residency counter
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit d727eb1c3ede7c21f885ded1f1ad65b47434a9b9
Author: Xi Pardee <xi.pardee@linux.intel.com>
Date:   Mon May 4 21:33:34 2026 -0700

    platform/x86/intel/pmc: Enable Pkgc blocking residency counter

    Enable the Package C-state blocking counter in the PMT telemetry
    region. This counter reports the number of 10 µs intervals during
    which a Package C-state 10.2/3 entry was blocked for the specified
    reasons.

    Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
    Link: https://patch.msgid.link/20260505043342.2573556-4-xi.pardee@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen dbfc71c9c4 platform/x86/intel/pmc: Enable PkgC LTR blocking counter
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 38c79dd63b72e36919ef097d4e5025ca0fa17f34
Author: Xi Pardee <xi.pardee@linux.intel.com>
Date:   Mon May 4 21:33:33 2026 -0700

    platform/x86/intel/pmc: Enable PkgC LTR blocking counter

    Enable the Package C-state LTR blocking counter in the PMT telemetry
    region. This counter records how many times any Package C-state entry
    is blocked for the specified reasons.

    Add pmc_core_pkgc_counters_show() as a common helper to display
    package C-state blocking counters from the telemetry region.

    Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
    Link: https://patch.msgid.link/20260505043342.2573556-3-xi.pardee@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:47 -04:00
Dennis Chen 41b67b61ae platform/x86/intel/pmc: Use __free() in pmc_core_punit_pmt_init()
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit dfe614f82e445a65cb2afd01859b06b01fce8889
Author: Xi Pardee <xi.pardee@linux.intel.com>
Date:   Mon May 4 21:33:32 2026 -0700

    platform/x86/intel/pmc: Use __free() in pmc_core_punit_pmt_init()

    Use scope-based cleanup in pmc_core_punit_pmt_init() instead of manually
    freeing. This simplifies the code flow by removing the explicit put call,
    making it less error-prone.

    Signed-off-by: Xi Pardee <xi.pardee@linux.intel.com>
    Link: https://patch.msgid.link/20260505043342.2573556-2-xi.pardee@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:46 -04:00
Dennis Chen cb754e03b9 platform/x86/intel/tpmi/plr: Prevent fault during unbind
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

commit 14473e8c4e97d51eff9b2f384ae696f7a32f182b
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Apr 30 08:11:03 2026 -0700

    platform/x86/intel/tpmi/plr: Prevent fault during unbind

    This driver faults when intel vsec driver is unbound from PCI driver
    interface. For example:

    echo 0000:00:03.1 > /sys/bus/pci/drivers/intel_vsec/unbind

    This is caused by accessing plr->dbgfs_dir after vsec_tpmi driver is
    removed. Here vsec_tpmi driver is the parent. On unbind, the parent
    device remove callback is called first which here will remove debugfs
    interface. Hence plr->dbgfs_dir is no longer valid.

    Register notifier for TPMI_CORE_EXIT and make this pointer to NULL,
    so that debugfs_remove_recursive() is not called with bad plr->dbgfs_dir
    pointer.

    After notifier is returned the vsec_tpmi driver will call remove debugfs
    by calling debugfs_remove_recursive().

    Fixes: 811f67c51636 ("platform/x86/intel/tpmi: Add new auxiliary driver for performance limits")
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Cc: Stable@vger.kernel.org
    Link: https://patch.msgid.link/20260430151103.1549733-4-srinivas.pandruvada@linux.intel.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

(cherry picked from commit 14473e8c4e97d51eff9b2f384ae696f7a32f182b)
Assisted-by: Patchpal
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:50:46 -04:00
Dennis Chen 6069bf94e3 platform/x86: intel: Add notifiers support
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Conflicts:
- drivers/platform/x86/intel/vsec_tpmi.c:
  Remove quotes from symbol namespace exports because RHEL is missing
  cdd30ebb1b9f ("module: Convert symbol namespace to string literal")

commit 57c347a2e2473bfb5c1f1132a3209c55efbe640b
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Apr 30 08:11:02 2026 -0700

    platform/x86: intel: Add notifiers support

    In some cases a driver using services of vsec_tpmi driver requires some
    processing before vsec_tpmi exits. For example a children using debugfs
    can't use debugfs as this will be deleted by the vsec_tpmi driver.

    This is the case when unbind using PCI driver interface. In this case
    the remove callback of vsec_tpmi driver is called first, then remove
    callback of its children.

    Add support of blocking chain notifiers support. Notify on successful probe
    and before clean up in the remove callback.

    Fixes: 811f67c51636 ("platform/x86/intel/tpmi: Add new auxiliary driver for performance limits")
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Cc: Stable@vger.kernel.org
    Link: https://patch.msgid.link/20260430151103.1549733-3-srinivas.pandruvada@linux.intel.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

(cherry picked from commit 57c347a2e2473bfb5c1f1132a3209c55efbe640b)
Assisted-by: Patchpal
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:49:47 -04:00
Dennis Chen 731d47e24b platform/x86: intel: Move debugfs register before creating devices
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit ad3bff944c0f4f2e913298a9664391af32f87491
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Apr 30 08:11:01 2026 -0700

    platform/x86: intel: Move debugfs register before creating devices

    It is possible that the driver handling device is enumerated before
    registering debugfs. If the driver wants to access debugfs by calling
    tpmi_get_debugfs_dir(), this will return error in this case.

    Hence register debugfs before creating devices.

    Fixes: 811f67c51636 ("platform/x86/intel/tpmi: Add new auxiliary driver for performance limits")
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Cc: Stable@vger.kernel.org
    Link: https://patch.msgid.link/20260430151103.1549733-2-srinivas.pandruvada@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:46:37 -04:00
Dennis Chen 7c9b994d84 platform/x86/intel-uncore-freq: Expose instance ID in the sysfs
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.2

commit 6cf1c1e9f21ba2e44e05e691d5241290c7d6c41a
Author: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
Date:   Wed Apr 8 16:27:51 2026 +0000

    platform/x86/intel-uncore-freq: Expose instance ID in the sysfs

    Insufficient data is exported to allow direct access to TPMI registers
    through MMIO. On non-partitioned systems domain_id can be used both for
    mapping CPUs to their compute die IDs and for mapping die indices to
    their MMIO memory blocks presented to userspace via TPMI debugfs.
    However on partitioned systems the debugfs association doesn't work
    anymore. This is due to how TPMI partitioning influences domain_id
    calculation. The previous association is lost on partitioned systems in
    order to keep using domain_id for mapping CPUs to compute dies.

    Expose the instance ID in sysfs that's unique in the scope of one TPMI
    partition (and hence one TPMI device). It's a physical index into mapped
    MMIO blocks and can be used by userspace to figure out how to directly
    access TPMI registers.

    Signed-off-by: Maciej Wieczor-Retman <maciej.wieczor-retman@intel.com>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Link: https://patch.msgid.link/b9ae8d5f1ab86bcdb1a8636fa48865a9e49e2e21.1775665057.git.m.wieczorretman@pm.me
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:58 -04:00
Dennis Chen e46c974df0 platform/x86/intel/tpmi: Use 32 bit aligned address for debugfs mem write
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit 8e0a2fc68ec369f2b6755994da1d318d0898a9d9
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Mar 26 11:24:46 2026 -0700

    platform/x86/intel/tpmi: Use 32 bit aligned address for debugfs mem write

    The memory write feature supports 32-bit writes to any TPMI offset.
    However, future hardware generations may not allow writes to non-32-bit
    aligned addresses due to hardware optimizations.

    Since all TPMI addresses are 64-bit aligned and correspond to 64-bit
    registers, enforce 32-bit alignment for write operations.

    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Link: https://patch.msgid.link/20260326182446.3478672-1-srinivas.pandruvada@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen 6d21a43d3a platform/x86/intel/vsec: Plumb ACPI PMT discovery tables through vsec
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit 22fa2ebc11a164e1ea529da6c356e3e01aef8ac8
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Thu Mar 12 18:51:45 2026 -0700

    platform/x86/intel/vsec: Plumb ACPI PMT discovery tables through vsec

    Some platforms expose PMT discovery via ACPI instead of PCI BARs. Add a
    generic discovery source flag and carry ACPI discovery entries alongside
    the existing PCI resource path so PMT clients can consume either.

    Changes:
      - Add enum intel_vsec_disc_source { _PCI, _ACPI }.
      - Extend intel_vsec_platform_info and intel_vsec_device with source enum
        and ACPI discovery table pointer/
      - When src==ACPI, skip BAR resource setup and copy the ACPI discovery
        entries into the aux device.

    No user-visible behavior change yet; this only wires ACPI data through vsec
    in preparation for ACPI-enumerated PMT clients.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://patch.msgid.link/20260313015202.3660072-7-david.e.box@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen ad57ff41e2 platform/x86/intel/vsec: Return real error codes from registration path
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit a6ce8bf3c993d8c2e8a6aeb2596429c101fe4462
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Thu Mar 12 18:51:44 2026 -0700

    platform/x86/intel/vsec: Return real error codes from registration path

    Stop collapsing registration results into booleans. Make
    intel_vsec_walk_header() return int and propagate the first non-zero error
    from intel_vsec_register_device(). intel_vsec_register() now returns that
    error directly and 0 on success.

    This preserves success behavior while surfacing meaningful errors instead
    of hiding them behind a bool/-ENODEV, which makes debugging and probe
    ordering issues clearer.

    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://patch.msgid.link/20260313015202.3660072-6-david.e.box@linux.intel.com
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen 35dcb960a9 platform/x86/intel/vsec: Switch exported helpers from pci_dev to device
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit 353042d54d82f6c46449f0ee38c244b5a13c1fe4
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Thu Mar 12 18:51:43 2026 -0700

    platform/x86/intel/vsec: Switch exported helpers from pci_dev to device

    Preparatory refactor for ACPI-enumerated PMT endpoints. Several exported
    PMT/VSEC interfaces and structs carried struct pci_dev * even though
    callers only need a generic struct device. Move those to struct device * so
    the same APIs work for PCI and ACPI parents.

    Acked-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Link: https://patch.msgid.link/20260313015202.3660072-5-david.e.box@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen a338ac64c3 platform/x86/intel/vsec: Decouple add/link helpers from PCI
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit c62fd96a04e4a7b847448f97ecfe9f3fe706e7b3
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Thu Mar 12 18:51:42 2026 -0700

    platform/x86/intel/vsec: Decouple add/link helpers from PCI

    This refactor prepares for adding ACPI-enumerated PMT endpoints. While
    intel_vsec is bound to PCI today, some helpers are used by code that will
    also register PMT endpoints from non-PCI (ACPI) paths. Clean up
    PCI-specific plumbing where it isn’t strictly required and rely on generic
    struct device where possible.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
    Link: https://patch.msgid.link/20260313015202.3660072-4-david.e.box@linux.intel.com
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen 4194fd9ceb platform/x86/intel/vsec: Make driver_data info const
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit 9577c74c96f88d807d1ba005adbf5952e7127e55
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Thu Mar 12 18:51:41 2026 -0700

    platform/x86/intel/vsec: Make driver_data info const

    Treat PCI id->driver_data (intel_vsec_platform_info) as read-only by making
    vsec_priv->info a const pointer and updating all function signatures to
    accept const intel_vsec_platform_info *.

    This improves const-correctness and clarifies that the platform info data
    from the driver_data table is not meant to be modified at runtime.

    No functional changes intended.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
    Link: https://patch.msgid.link/20260313015202.3660072-3-david.e.box@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen 790a1c1b2b platform/x86/intel/vsec: Refactor base_addr handling
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit 904b333fc51cc045941df9656302449a0fc9978e
Author: David E. Box <david.e.box@linux.intel.com>
Date:   Thu Mar 12 18:51:40 2026 -0700

    platform/x86/intel/vsec: Refactor base_addr handling

    The base_addr field in intel_vsec_platform_info was originally added to
    support devices that emulate PCI VSEC capabilities in MMIO. Previously,
    the code would check at registration time whether base_addr was set,
    falling back to the PCI BAR if not.

    Refactor this by making base_addr an explicit function parameter. This
    clarifies ownership of the value and removes conditional logic from
    intel_vsec_add_dev(). It also enables making intel_vsec_platform_info
    const in a later patch, since the function no longer needs to write to
    info->base_addr.

    No functional change intended.

    Signed-off-by: David E. Box <david.e.box@linux.intel.com>
    Reviewed-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
    Link: https://patch.msgid.link/20260313015202.3660072-2-david.e.box@linux.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: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen 126b68f874 platform/x86: intel/smartconnect: Convert ACPI driver to a platform one
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

commit 8a44bd3ffdb269c028236d9165ce06a46c091373
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Sat Feb 28 16:28:19 2026 +0100

    platform/x86: intel/smartconnect: Convert ACPI driver to a platform one

    In all cases in which a struct acpi_driver is used for binding a driver
    to an ACPI device object, a corresponding platform device is created by
    the ACPI core and that device is regarded as a proper representation of
    underlying hardware.  Accordingly, a struct platform_driver should be
    used by driver code to bind to that device.  There are multiple reasons
    why drivers should not bind directly to ACPI device objects [1].

    Overall, it is better to bind drivers to platform devices than to their
    ACPI companions, so convert the Intel Smart Connect disabling ACPI
    driver to a platform one.

    While this is not expected to alter functionality, it changes sysfs
    layout and so it will be visible to user space.

    Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Link: https://patch.msgid.link/24282289.6Emhk5qWAg@rafael.j.wysocki
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen 2181d54f92 platform/x86: intel/rst: Convert ACPI driver to a platform one
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v7.1

Conflicts:
- drivers/platform/x86/intel/rst.c: Assign irst_remove to remove_new()
callback instead of remove() because RHEL is missing upstream commit
0edb555a65d1 ("platform: Make platform_driver::remove() return void")

commit 163a68a31f743c5a820f348322b9162bc89c720a
Author: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Date:   Sat Feb 28 16:27:33 2026 +0100

    platform/x86: intel/rst: Convert ACPI driver to a platform one

    In all cases in which a struct acpi_driver is used for binding a driver
    to an ACPI device object, a corresponding platform device is created by
    the ACPI core and that device is regarded as a proper representation of
    underlying hardware.  Accordingly, a struct platform_driver should be
    used by driver code to bind to that device.  There are multiple reasons
    why drivers should not bind directly to ACPI device objects [1].

    Overall, it is better to bind drivers to platform devices than to their
    ACPI companions, so convert the Intel Rapid Start Technology (rst) ACPI
    driver to a platform one.

    While this is not expected to alter functionality, it changes sysfs
    layout and so it will be visible to user space.

    Link: https://lore.kernel.org/all/2396510.ElGaqSPkdT@rafael.j.wysocki/ [1]
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Link: https://patch.msgid.link/3599223.QJadu78ljV@rafael.j.wysocki
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen 09de6b69dc platform/x86/intel/vsec: correct kernel-doc comments
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v6.19

commit 20e20b147cf7cb6780a5b95da2a0e37c52cd1015
Author: Randy Dunlap <rdunlap@infradead.org>
Date:   Mon Dec 15 22:38:00 2025 -0800

    platform/x86/intel/vsec: correct kernel-doc comments

    Fix kernel-doc warnings in intel_vsec.h to eliminate all kernel-doc
    warnings:

    Warning: include/linux/intel_vsec.h:92 struct member 'read_telem' not
     described in 'pmt_callbacks'
    Warning: include/linux/intel_vsec.h:146 expecting prototype for struct
     intel_sec_device.  Prototype was for struct intel_vsec_device instead
    Warning: include/linux/intel_vsec.h:146 struct member 'priv_data_size'
     not described in 'intel_vsec_device'

    In struct pmt_callbacks, correct the kernel-doc for @read_telem.
    kernel-doc doesn't support documenting callback function parameters,
    so drop the '@' signs on those and use "* *" to make them somewhat
    readable in the produced documentation output.

    Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
    Link: https://patch.msgid.link/20251216063801.2896495-1-rdunlap@infradead.org
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen d4aa63b277 platform/x86/intel/smartconnect: drop owner assignment
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: v6.10

commit e84a761f121524103df7b3674a8cde67a4f78fa6
Author: Krzysztof Kozlowski <krzk@kernel.org>
Date:   Thu Mar 28 20:49:20 2024 +0100

    platform/x86/intel/smartconnect: drop owner assignment

    ACPI bus core already sets the .owner, so driver does not need to.

    Acked-by: Hans de Goede <hdegoede@redhat.com>
    Acked-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
    Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
    Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:42:57 -04:00
Dennis Chen aa3eb7742d Revert "platform/x86: intel: Add notifiers support"
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: RHEL only

This reverts commit ddd5553c2b as it was
previously applied out of order. It will be applied later in the MR as
part of a subsystem rebase.

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:41:51 -04:00
Dennis Chen fb4d6a0b6c Revert "platform/x86/intel/tpmi/plr: Prevent fault during unbind"
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: RHEL only

This reverts commit fdb2188f41 as it was
previously applied out of order. It will be applied later in the MR as
part of a subsystem rebase.

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 22:39:59 -04:00
Dennis Chen 87344f26fa Revert "platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery"
JIRA: https://redhat.atlassian.net/browse/RHEL-241103

Upstream status: RHEL only

This reverts commit c33314e7ea as it was
previously applied out of order. It will be applied later in the MR as
part of a subsystem rebase.

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-24 15:47:09 -04:00
Dennis Chen fdb2188f41 platform/x86/intel/tpmi/plr: Prevent fault during unbind
JIRA: https://redhat.atlassian.net/browse/RHEL-212707

commit 14473e8c4e97d51eff9b2f384ae696f7a32f182b
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Apr 30 08:11:03 2026 -0700

    platform/x86/intel/tpmi/plr: Prevent fault during unbind

    This driver faults when intel vsec driver is unbound from PCI driver
    interface. For example:

    echo 0000:00:03.1 > /sys/bus/pci/drivers/intel_vsec/unbind

    This is caused by accessing plr->dbgfs_dir after vsec_tpmi driver is
    removed. Here vsec_tpmi driver is the parent. On unbind, the parent
    device remove callback is called first which here will remove debugfs
    interface. Hence plr->dbgfs_dir is no longer valid.

    Register notifier for TPMI_CORE_EXIT and make this pointer to NULL,
    so that debugfs_remove_recursive() is not called with bad plr->dbgfs_dir
    pointer.

    After notifier is returned the vsec_tpmi driver will call remove debugfs
    by calling debugfs_remove_recursive().

    Fixes: 811f67c51636 ("platform/x86/intel/tpmi: Add new auxiliary driver for performance limits")
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Cc: Stable@vger.kernel.org
    Link: https://patch.msgid.link/20260430151103.1549733-4-srinivas.pandruvada@linux.intel.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

(cherry picked from commit 14473e8c4e97d51eff9b2f384ae696f7a32f182b)
Assisted-by: Patchpal
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-04 13:37:53 -04:00
Dennis Chen ddd5553c2b platform/x86: intel: Add notifiers support
JIRA: https://redhat.atlassian.net/browse/RHEL-212707

Conflicts:
- drivers/platform/x86/intel/vsec_tpmi.c:
  Remove quotes from new symbol namespace exports to avoid cdd30ebb1b9f
  ("module: Convert symbol namespace to string literal")

commit 57c347a2e2473bfb5c1f1132a3209c55efbe640b
Author: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Date:   Thu Apr 30 08:11:02 2026 -0700

    platform/x86: intel: Add notifiers support

    In some cases a driver using services of vsec_tpmi driver requires some
    processing before vsec_tpmi exits. For example a children using debugfs
    can't use debugfs as this will be deleted by the vsec_tpmi driver.

    This is the case when unbind using PCI driver interface. In this case
    the remove callback of vsec_tpmi driver is called first, then remove
    callback of its children.

    Add support of blocking chain notifiers support. Notify on successful probe
    and before clean up in the remove callback.

    Fixes: 811f67c51636 ("platform/x86/intel/tpmi: Add new auxiliary driver for performance limits")
    Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Cc: Stable@vger.kernel.org
    Link: https://patch.msgid.link/20260430151103.1549733-3-srinivas.pandruvada@linux.intel.com
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

(cherry picked from commit 57c347a2e2473bfb5c1f1132a3209c55efbe640b)
Assisted-by: Patchpal
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-04 13:37:46 -04:00
Dennis Chen db8daffc53 x86/fpu: Ensure XFD state on signal delivery
JIRA: https://redhat.atlassian.net/browse/RHEL-212652

commit 388eff894d6bc5f921e9bfff0e4b0ab2684a96e9
Author: Chang S. Bae <chang.seok.bae@intel.com>
Date:   Mon Jun 9 17:16:59 2025 -0700

    x86/fpu: Ensure XFD state on signal delivery

    Sean reported [1] the following splat when running KVM tests:

       WARNING: CPU: 232 PID: 15391 at xfd_validate_state+0x65/0x70
       Call Trace:
        <TASK>
        fpu__clear_user_states+0x9c/0x100
        arch_do_signal_or_restart+0x142/0x210
        exit_to_user_mode_loop+0x55/0x100
        do_syscall_64+0x205/0x2c0
        entry_SYSCALL_64_after_hwframe+0x4b/0x53

    Chao further identified [2] a reproducible scenario involving signal
    delivery: a non-AMX task is preempted by an AMX-enabled task which
    modifies the XFD MSR.

    When the non-AMX task resumes and reloads XSTATE with init values,
    a warning is triggered due to a mismatch between fpstate::xfd and the
    CPU's current XFD state. fpu__clear_user_states() does not currently
    re-synchronize the XFD state after such preemption.

    Invoke xfd_update_state() which detects and corrects the mismatch if
    there is a dynamic feature.

    This also benefits the sigreturn path, as fpu__restore_sig() may call
    fpu__clear_user_states() when the sigframe is inaccessible.

    [ dhansen: minor changelog munging ]

    Closes: https://lore.kernel.org/lkml/aDCo_SczQOUaB2rS@google.com [1]
    Fixes: 672365477ae8a ("x86/fpu: Update XFD state where required")
    Reported-by: Sean Christopherson <seanjc@google.com>
    Signed-off-by: Chang S. Bae <chang.seok.bae@intel.com>
    Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
    Reviewed-by: Chao Gao <chao.gao@intel.com>
    Tested-by: Chao Gao <chao.gao@intel.com>
    Link: https://lore.kernel.org/all/aDWbctO%2FRfTGiCg3@intel.com [2]
    Cc:stable@vger.kernel.org
    Link: https://patch.msgid.link/20250610001700.4097-1-chang.seok.bae%40intel.com

(cherry picked from commit 388eff894d6bc5f921e9bfff0e4b0ab2684a96e9)
Assisted-by: Patchpal
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-04 09:37:31 -04:00
Dennis Chen c33314e7ea platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery
JIRA: https://redhat.atlassian.net/browse/RHEL-212719
Upstream-status: v7.1

Conflicts:
- drivers/platform/x86/intel/vsec.c::intel_vsec_pci_probe():
  Remove const qualifiers to avoid 9577c74c96f8
  ("platform/x86/intel/vsec: Make driver_data info const")

commit 348ccc754d8939e21ca5956ff45720b81d6e407f
Author: Lukas Wunner <lukas@wunner.de>
Date:   Thu May 14 07:40:42 2026 +0200

    platform/x86/intel/vsec: Fix enable_cnt imbalance on PCIe error recovery

    After a PCIe Uncorrectable Error has been reported by a device with
    Intel Vendor Specific Extended Capabilities and has been recovered
    through a Secondary Bus Reset, its driver calls intel_vsec_pci_probe()
    to rescan and reinitialize VSECs.

    intel_vsec_pci_probe() invokes pcim_enable_device() and thereby adds
    another devm action which calls pcim_disable_device() on driver unbind.

    So once the driver unbinds, pcim_disable_device() will be called as many
    times as an Uncorrectable Error occurred, plus one.  This will lead to
    an enable_cnt imbalance on driver unbind.

    Additionally, since commit dc957ab6aa05 ("platform/x86/intel/vsec: Add
    private data for per-device data"), a devm_kzalloc() allocation is
    leaked on every Uncorrectable Error.

    Avoid by splitting the VSEC rescan out of intel_vsec_pci_probe() into a
    separate helper and calling that on PCIe error recovery.

    Fixes: 936874b77dd0 ("platform/x86/intel/vsec: Add PCI error recovery support to Intel PMT")
    Signed-off-by: Lukas Wunner <lukas@wunner.de>
    Cc: stable@vger.kernel.org  # v6.0+
    Link: https://patch.msgid.link/bd594d09fa866dc51dddc9a447c3b23f9b1402cc.1778736835.git.lukas@wunner.de
    Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
    Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>

Assisted-by: Patchpal
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-08-03 20:48:09 -04:00
Dennis Chen 93e6beedd0 iTCO_wdt: mask NMI_NOW bit for update_no_reboot_bit() call
JIRA: https://redhat.atlassian.net/browse/RHEL-208620

commit daa814d784ac034c62ab3fb0ef83daeafef527e2
Author: Oleksandr Ocheretnyi <oocheret@cisco.com>
Date:   Fri Sep 13 12:14:03 2024 -0700

    iTCO_wdt: mask NMI_NOW bit for update_no_reboot_bit() call

    Commit da23b6faa8 ("watchdog: iTCO: Add support for Cannon Lake
    PCH iTCO") does not mask NMI_NOW bit during TCO1_CNT register's
    value comparison for update_no_reboot_bit() call causing following
    failure:

       ...
       iTCO_vendor_support: vendor-support=0
       iTCO_wdt iTCO_wdt: unable to reset NO_REBOOT flag, device
                                        disabled by hardware/BIOS
       ...

    and this can lead to unexpected NMIs later during regular
    crashkernel's workflow because of watchdog probe call failures.

    This change masks NMI_NOW bit for TCO1_CNT register values to
    avoid unexpected NMI_NOW bit inversions.

    Fixes: da23b6faa8 ("watchdog: iTCO: Add support for Cannon Lake PCH iTCO")
    Signed-off-by: Oleksandr Ocheretnyi <oocheret@cisco.com>
    Reviewed-by: Guenter Roeck <linux@roeck-us.net>
    Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
    Link: https://lore.kernel.org/r/20240913191403.2560805-1-oocheret@cisco.com
    Signed-off-by: Guenter Roeck <linux@roeck-us.net>
    Signed-off-by: Wim Van Sebroeck <wim@linux-watchdog.org>

Assisted-by: Patchpal
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-07-21 11:09:42 -04:00
Dennis Chen 47aa1a2512 x86/cpu: Enable FSGSBASE early in cpu_init_exception_handling()
JIRA: https://redhat.atlassian.net/browse/RHEL-208627

Upstream-status: v7.0

Conflicts:
  - arch/x86/kernel/cpu/common.c:
    - identify_cpu(): contextual conflict due to missing d5cb9574391c
      ("x86/cpu: Enable LASS during CPU initialization")
    - cpu_init_exception_handling(): contextual conflict due to missing
      changes enabling x86 FRED:
      a97756cbec44 ("x86/fred: Enable FRED right after init_mem_mapping()")
      73270c1f2369 ("x86/fred: Move FRED RSP initialization into a separate function")
      208d8c79fd0f ("x86/fred: Invoke FRED initialization code to enable FRED")

commit 05243d490bb7852a8acca7b5b5658019c7797a52
Author: Nikunj A Dadhania <nikunj@amd.com>
Date:   Wed Mar 18 07:56:52 2026 +0000

    x86/cpu: Enable FSGSBASE early in cpu_init_exception_handling()

    Move FSGSBASE enablement from identify_cpu() to cpu_init_exception_handling()
    to ensure it is enabled before any exceptions can occur on both boot and
    secondary CPUs.

    == Background ==

    Exception entry code (paranoid_entry()) uses ALTERNATIVE patching based on
    X86_FEATURE_FSGSBASE to decide whether to use RDGSBASE/WRGSBASE instructions
    or the slower RDMSR/SWAPGS sequence for saving/restoring GSBASE.

    On boot CPU, ALTERNATIVE patching happens after enabling FSGSBASE in CR4.
    When the feature is available, the code is permanently patched to use
    RDGSBASE/WRGSBASE, which require CR4.FSGSBASE=1 to execute without triggering

    == Boot Sequence ==

    Boot CPU (with CR pinning enabled):
      trap_init()
        cpu_init()                   <- Uses unpatched code (RDMSR/SWAPGS)
          x2apic_setup()
      ...
      arch_cpu_finalize_init()
        identify_boot_cpu()
          identify_cpu()
            cr4_set_bits(X86_CR4_FSGSBASE)  # Enables the feature
    	# This becomes part of cr4_pinned_bits
        ...
        alternative_instructions()   <- Patches code to use RDGSBASE/WRGSBASE

    Secondary CPUs (with CR pinning enabled):
      start_secondary()
        cr4_init()                   <- Code already patched, CR4.FSGSBASE=1
                                        set implicitly via cr4_pinned_bits

        cpu_init()                   <- exceptions work because FSGSBASE is
                                        already enabled

    Secondary CPU (with CR pinning disabled):
      start_secondary()
        cr4_init()                   <- Code already patched, CR4.FSGSBASE=0
        cpu_init()
          x2apic_setup()
            rdmsrq(MSR_IA32_APICBASE)  <- Triggers #VC in SNP guests
              exc_vmm_communication()
                paranoid_entry()       <- Uses RDGSBASE with CR4.FSGSBASE=0
                                          (patched code)
        ...
        ap_starting()
          identify_secondary_cpu()
            identify_cpu()
    	  cr4_set_bits(X86_CR4_FSGSBASE)  <- Enables the feature, which is
                                                 too late

    == CR Pinning ==

    Currently, for secondary CPUs, CR4.FSGSBASE is set implicitly through
    CR-pinning: the boot CPU sets it during identify_cpu(), it becomes part of
    cr4_pinned_bits, and cr4_init() applies those pinned bits to secondary CPUs.
    This works but creates an undocumented dependency between cr4_init() and the
    pinning mechanism.

    == Problem ==

    Secondary CPUs boot after alternatives have been applied globally. They
    execute already-patched paranoid_entry() code that uses RDGSBASE/WRGSBASE
    instructions, which require CR4.FSGSBASE=1. Upcoming changes to CR pinning
    behavior will break the implicit dependency, causing secondary CPUs to
    generate #UD.

    This issue manifests itself on AMD SEV-SNP guests, where the rdmsrq() in
    x2apic_setup() triggers a #VC exception early during cpu_init(). The #VC
    handler (exc_vmm_communication()) executes the patched paranoid_entry() path.
    Without CR4.FSGSBASE enabled, RDGSBASE instructions trigger #UD.

    == Fix ==

    Enable FSGSBASE explicitly in cpu_init_exception_handling() before loading
    exception handlers. This makes the dependency explicit and ensures both
    boot and secondary CPUs have FSGSBASE enabled before paranoid_entry()
    executes.

    Fixes: c82965f9e5 ("x86/entry/64: Handle FSGSBASE enabled paranoid entry/exit")
    Reported-by: Borislav Petkov <bp@alien8.de>
    Suggested-by: Sohil Mehta <sohil.mehta@intel.com>
    Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Reviewed-by: Sohil Mehta <sohil.mehta@intel.com>
    Cc: <stable@kernel.org>
    Link: https://patch.msgid.link/20260318075654.1792916-2-nikunj@amd.com

Conflicts:
- arch/x86/kernel/cpu/common.c: 2 hunks modified

(cherry picked from commit 05243d490bb7852a8acca7b5b5658019c7797a52)
Assisted-by: Patchpal AI
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-07-20 22:55:39 -07:00
Dennis Chen ed5bed2d05 x86/CPU/AMD: Prevent improper isolation of shared resources in Zen2's op cache
JIRA: https://redhat.atlassian.net/browse/RHEL-188795
Upstream status: v7.1
CVE: CVE-2025-54518

Conflicts:
- arch/x86/kernel/cpu/amd.c:
  Omitted contextual differences added by a74bb5f202da ("x86/CPU/AMD:
  Disable INVLPGB on Zen2") and 5b937a1ed64e ("x86/rdrand: Disable
  RDSEED on AMD Cyan Skillfish") not present in RHEL 9

commit c21b90f77687075115d989e53a8ec5e2bb427ab1
Author: Prathyushi Nangia <prathyushi.nangia@amd.com>
Date:   Tue Dec 9 10:01:33 2025 -0600

    x86/CPU/AMD: Prevent improper isolation of shared resources in Zen2's op cache

    Make sure resources are not improperly shared in the op cache and
    cause instruction corruption this way.

    Signed-off-by: Prathyushi Nangia <prathyushi.nangia@amd.com>
    Co-developed-by: Borislav Petkov (AMD) <bp@alien8.de>
    Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
    Cc: stable@vger.kernel.org
    Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Assisted-by: Patchpal
Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-06-30 10:18:14 -04:00
Dennis Chen 1bdd239a7e HID: intel-ish-hid: ipc: Add Nova Lake-H/S PCI device IDs
JIRA: https://issues.redhat.com/browse/RHEL-183866

commit 22f8bcec5aeb05104b3eaa950cb5a345e95f0aa8
Author: Zhang Lixu <lixu.zhang@intel.com>
Date:   Tue Feb 3 08:55:07 2026 +0800

    HID: intel-ish-hid: ipc: Add Nova Lake-H/S PCI device IDs

    Add device IDs of Nova Lake-H and Nova Lake-S into ishtp support list.

    Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
    Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-06-18 09:03:20 -04:00
Dennis Chen 2a16a38786 HID: intel-ish-hid: fix NULL-ptr-deref in ishtp_bus_remove_all_clients
JIRA: https://issues.redhat.com/browse/RHEL-183866

commit 56f7db581ee73af53cd512e00a6261a025bf1d58
Author: Ryan Lin <ryan.lin@intel.com>
Date:   Fri Jan 30 13:34:56 2026 +0800

    HID: intel-ish-hid: fix NULL-ptr-deref in ishtp_bus_remove_all_clients

    During a warm reset flow, the cl->device pointer may be NULL if the
    reset occurs while clients are still being enumerated. Accessing
    cl->device->reference_count without a NULL check leads to a kernel panic.

    This issue was identified during multi-unit warm reboot stress clycles.
    Add a defensive NULL check for cl->device to ensure stability under
    such intensive testing conditions.

    KASAN: null-ptr-deref in range [0000000000000000-0000000000000007]
    Workqueue: ish_fw_update_wq fw_reset_work_fn

    Call Trace:
     ishtp_bus_remove_all_clients+0xbe/0x130 [intel_ishtp]
     ishtp_reset_handler+0x85/0x1a0 [intel_ishtp]
     fw_reset_work_fn+0x8a/0xc0 [intel_ish_ipc]

    Fixes: 3703f53b99 ("HID: intel_ish-hid: ISH Transport layer")
    Signed-off-by: Ryan Lin <ryan.lin@intel.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-06-18 09:03:20 -04:00
Dennis Chen e9df3c4e69 HID: intel-ish-hid: loader: Add PRODUCT_FAMILY-based firmware matching
JIRA: https://issues.redhat.com/browse/RHEL-183866

commit 043251b2dd1c2b0cd23f67830748493fd3d3ed0f
Author: Vishnu Sankar <vishnuocv@gmail.com>
Date:   Mon Dec 22 17:05:11 2025 +0900

    HID: intel-ish-hid: loader: Add PRODUCT_FAMILY-based firmware matching

    Add support for firmware filenames that include the CRC32 checksum of the
    DMI product_family field. Several OEMs ship ISH firmware variants shared
    across a product family while product_name or product_sku may differ. This
    intermediate matching granularity reduces duplication and improves firmware
    selection for vendor-customized platforms.

    The newly supported filename forms are checked before existing patterns:

      ish_${gen}_${vendor}_${family}_${name}_${sku}.bin
      ish_${gen}_${vendor}_${family}_${sku}.bin
      ish_${gen}_${vendor}_${family}_${name}.bin
      ish_${gen}_${vendor}_${family}.bin

    The legacy product_name/product_sku rules remain unchanged and continue
    to provide fallback matching.

    ISH_FW_FILENAME_LEN_MAX is changed to 72 to accommodate the product_family.

    Tested with X9 series and X1 series.

    Reviewed-by: Mark Pearson <mpearson-lenovo@squebb.ca>
    Tested-by: Richie Roy Jayme <rjayme.jp@gmail.com>
    Signed-off-by: Vishnu Sankar <vishnuocv@gmail.com>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Jiri Kosina <jkosina@suse.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-06-18 09:03:20 -04:00
Dennis Chen bc9d90fdd8 HID: intel-ish-hid: Reset enum_devices_done before enumeration
JIRA: https://issues.redhat.com/browse/RHEL-183866

commit 56e230723e3a818373bd62331bccb1c6d2b3881b
Author: Zhang Lixu <lixu.zhang@intel.com>
Date:   Fri Dec 12 10:51:50 2025 +0800

    HID: intel-ish-hid: Reset enum_devices_done before enumeration

    Some systems have enabled ISH without any sensors. In this case sending
    HOSTIF_DM_ENUM_DEVICES results in 0 sensors. This triggers ISH hardware
    reset on subsequent enumeration after S3/S4 resume.

    The enum_devices_done flag was not reset before sending the
    HOSTIF_DM_ENUM_DEVICES command. On subsequent enumeration calls (such as
    after S3/S4 resume), this flag retains its previous true value, causing the
    wait loop to be skipped and returning prematurely to hid_ishtp_cl_init().
    If 0 HID devices are found, hid_ishtp_cl_init() skips getting HID device
    descriptors and sets init_done to true. When the delayed enumeration
    response arrives with init_done already true, the driver treats it as a bad
    packet and triggers an ISH hardware reset.

    Set enum_devices_done to false before sending the enumeration command,
    consistent with similar functions like ishtp_get_hid_descriptor() and
    ishtp_get_report_descriptor() which reset their respective flags.

    Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-06-18 09:03:19 -04:00
Dennis Chen bee9e01b53 HID: intel-ish-hid: Update ishtp bus match to support device ID table
JIRA: https://issues.redhat.com/browse/RHEL-183866

commit daeed86b686855adda79f13729e0c9b0530990be
Author: Zhang Lixu <lixu.zhang@intel.com>
Date:   Wed Dec 10 10:53:28 2025 +0800

    HID: intel-ish-hid: Update ishtp bus match to support device ID table

    The ishtp_cl_bus_match() function previously only checked the first entry
    in the driver's device ID table. Update it to iterate over the entire
    table, allowing proper matching for drivers with multiple supported
    protocol GUIDs.

    Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
    Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
    Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-06-18 09:03:19 -04:00
Dennis Chen 4e8197f165 tools/power turbostat: Fix unrecognized option '-P'
JIRA: https://issues.redhat.com/browse/RHEL-140922

commit ce012c966b518c53475ba9a4e979242d7322d819
Author: David Arcari <darcari@redhat.com>
Date:   Tue Apr 21 10:32:17 2026 -0400

    tools/power turbostat: Fix unrecognized option '-P'

    The '-P' short option (shorthand for --no-perf) is not present in the
    optstring of the second call to getopt_long_only(). This results in
    the "unrecognized option" error when the tool reaches the main parsing
    loop.

    Add 'P' to the second getopt_long_only() call to ensure it is
    consistently recognized.

    Fixes: a0e86c90b83c ("tools/power turbostat: Add --no-perf option")
    Signed-off-by: David Arcari <darcari@redhat.com>
    Signed-off-by: Len Brown <len.brown@intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2026-06-04 13:50:05 -04:00
Dennis Chen 187cf5f91c i40e: report VF tx_dropped with tx_errors instead of tx_discards
JIRA: https://issues.redhat.com/browse/RHEL-79910

commit 50b2af451597ca6eefe9d4543f8bbf8de8aa00e7
Author: Dennis Chen <dechen@redhat.com>
Date:   Wed Jun 18 15:52:40 2025 -0400

    i40e: report VF tx_dropped with tx_errors instead of tx_discards

    Currently the tx_dropped field in VF stats is not updated correctly
    when reading stats from the PF. This is because it reads from
    i40e_eth_stats.tx_discards which seems to be unused for per VSI stats,
    as it is not updated by i40e_update_eth_stats() and the corresponding
    register, GLV_TDPC, is not implemented[1].

    Use i40e_eth_stats.tx_errors instead, which is actually updated by
    i40e_update_eth_stats() by reading from GLV_TEPC.

    To test, create a VF and try to send bad packets through it:

    $ echo 1 > /sys/class/net/enp2s0f0/device/sriov_numvfs
    $ cat test.py
    from scapy.all import *

    vlan_pkt = Ether(dst="ff:ff:ff:ff:ff:ff") / Dot1Q(vlan=999) / IP(dst="192.168.0.1") / ICMP()
    ttl_pkt = IP(dst="8.8.8.8", ttl=0) / ICMP()

    print("Send packet with bad VLAN tag")
    sendp(vlan_pkt, iface="enp2s0f0v0")
    print("Send packet with TTL=0")
    sendp(ttl_pkt, iface="enp2s0f0v0")
    $ ip -s link show dev enp2s0f0
    16: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
        link/ether 3c:ec:ef:b7:e0:ac brd ff:ff:ff:ff:ff:ff
        RX:  bytes packets errors dropped  missed   mcast
                 0       0      0       0       0       0
        TX:  bytes packets errors dropped carrier collsns
                 0       0      0       0       0       0
        vf 0     link/ether e2:c6:fd:c1:1e:92 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
        RX: bytes  packets  mcast   bcast   dropped
                 0        0       0       0        0
        TX: bytes  packets   dropped
                 0        0        0
    $ python test.py
    Send packet with bad VLAN tag
    .
    Sent 1 packets.
    Send packet with TTL=0
    .
    Sent 1 packets.
    $ ip -s link show dev enp2s0f0
    16: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
        link/ether 3c:ec:ef:b7:e0:ac brd ff:ff:ff:ff:ff:ff
        RX:  bytes packets errors dropped  missed   mcast
                 0       0      0       0       0       0
        TX:  bytes packets errors dropped carrier collsns
                 0       0      0       0       0       0
        vf 0     link/ether e2:c6:fd:c1:1e:92 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
        RX: bytes  packets  mcast   bcast   dropped
                 0        0       0       0        0
        TX: bytes  packets   dropped
                 0        0        0

    A packet with non-existent VLAN tag and a packet with TTL = 0 are sent,
    but tx_dropped is not incremented.

    After patch:

    $ ip -s link show dev enp2s0f0
    19: enp2s0f0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP mode DEFAULT group default qlen 1000
        link/ether 3c:ec:ef:b7:e0:ac brd ff:ff:ff:ff:ff:ff
        RX:  bytes packets errors dropped  missed   mcast
                 0       0      0       0       0       0
        TX:  bytes packets errors dropped carrier collsns
                 0       0      0       0       0       0
        vf 0     link/ether 4a:b7:3d:37:f7:56 brd ff:ff:ff:ff:ff:ff, spoof checking on, link-state auto, trust off
        RX: bytes  packets  mcast   bcast   dropped
                 0        0       0       0        0
        TX: bytes  packets   dropped
                 0        0        2

    Fixes: dc645daef9 ("i40e: implement VF stats NDO")
    Signed-off-by: Dennis Chen <dechen@redhat.com>
    Link: https://www.intel.com/content/www/us/en/content-details/596333/intel-ethernet-controller-x710-tm4-at2-carlsville-datasheet.html
    Reviewed-by: Simon Horman <horms@kernel.org>
    Tested-by: Rafal Romanowski <rafal.romanowski@intel.com>
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-07-31 09:47:15 -04:00
Dennis Chen 9051f919c0 treewide: Switch/rename to timer_delete[_sync]()
JIRA: https://issues.redhat.com/browse/RHEL-72660

Conflicts: only includes sfc hunks

commit 8fa7292fee5c5240402371ea89ab285ec856c916
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Sat Apr 5 10:17:26 2025 +0200

    treewide: Switch/rename to timer_delete[_sync]()

    timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
    over and remove the historical wrapper inlines.

    Conversion was done with coccinelle plus manual fixups where necessary.

    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:32 -04:00
Dennis Chen c05b01953a sfc: fix NULL dereferences in ef100_process_design_param()
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 8241ecec1cdc6699ae197d52d58e76bddd995fa5
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Tue Apr 1 23:54:39 2025 +0100

    sfc: fix NULL dereferences in ef100_process_design_param()

    Since cited commit, ef100_probe_main() and hence also
     ef100_check_design_params() run before efx->net_dev is created;
     consequently, we cannot netif_set_tso_max_size() or _segs() at this
     point.
    Move those netif calls to ef100_probe_netdev(), and also replace
     netif_err within the design params code with pci_err.

    Reported-by: Kyungwook Boo <bookyungwook@gmail.com>
    Fixes: 98ff4c7c8ac7 ("sfc: Separate netdev probe/remove from PCI probe/remove")
    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
    Link: https://patch.msgid.link/20250401225439.2401047-1-edward.cree@amd.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:32 -04:00
Dennis Chen 0d8e2ed637 sfc: support X4 devlink flash
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 5726a15499daf619eb3e67d615a0252ca69b84b9
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Thu Mar 20 17:57:12 2025 +0000

    sfc: support X4 devlink flash

    Unlike X2 and EF100, we do not attempt to parse the firmware file to
     find an image within it; we simply hand the entire file to the MC,
     which is responsible for understanding any container formats we might
     use and validating that the firmware file is applicable to this NIC.

    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/9a72a74002a7819c780b0a18ce9294c9d4e1db12.1742493017.git.ecree.xilinx@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:31 -04:00
Dennis Chen 6830024ade sfc: update MCDI protocol headers
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 25d0c8e6f0bbd4042b0b8612bc8d6cc554d80563
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Thu Mar 20 17:57:11 2025 +0000

    sfc: update MCDI protocol headers

    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/bcb7597460a5a99d1dca4ef282f4aa2dd46ae545.1742493017.git.ecree.xilinx@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:31 -04:00
Dennis Chen 0e4f4350c6 sfc: rip out MDIO support
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit c339fcdd738be78c540407ae78fef5601ba5092a
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Thu Mar 20 17:57:10 2025 +0000

    sfc: rip out MDIO support

    Unlike Siena, no EF10 board ever had an external PHY, and consequently
     MDIO handling isn't even built into the firmware.  Since Siena has
     been split out into its own driver, the MDIO code can be deleted from
     the sfc driver.

    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/aa689d192ddaef7abe82709316c2be648a7bd66e.1742493017.git.ecree.xilinx@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:31 -04:00
Dennis Chen 76c6fb69f9 sfc: Remove newline at the end of a netlink error message
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 79d89fab225e85e3219258af860b5f086f40f3d3
Author: Gal Pressman <gal@nvidia.com>
Date:   Wed Feb 26 11:39:02 2025 +0200

    sfc: Remove newline at the end of a netlink error message

    Netlink error messages should not have a newline at the end of the
    string.

    Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
    Signed-off-by: Gal Pressman <gal@nvidia.com>
    Reviewed-by: Michal Swiatkowski <michal.swiatkowski@linux.intel.com>
    Link: https://patch.msgid.link/20250226093904.6632-4-gal@nvidia.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:31 -04:00
Dennis Chen 6c1e2e845d sfc: document devlink flash support
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 5ea73bf3c40d03f09d4cd19b8222ad6b585afbbb
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Feb 10 11:25:45 2025 +0000

    sfc: document devlink flash support

    Update the information in sfc's devlink documentation including
     support for firmware update with devlink flash.
    Also update the help text for CONFIG_SFC_MTD, as it is no longer
     strictly required for firmware updates.

    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/3476b0ef04a0944f03e0b771ec8ed1a9c70db4dc.1739186253.git.ecree.xilinx@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:31 -04:00
Dennis Chen d359c16126 sfc: deploy devlink flash images to NIC over MCDI
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 3ed63980ae7998b0a75d9f4e12918047d7493465
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Feb 10 11:25:44 2025 +0000

    sfc: deploy devlink flash images to NIC over MCDI

    Use MC_CMD_NVRAM_* wrappers to write the firmware to the partition
     identified from the image header.

    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/a746335876b621b3e54cf4e49948148e349a1745.1739186253.git.ecree.xilinx@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:31 -04:00
Dennis Chen 4a945e3458 sfc: extend NVRAM MCDI handlers
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit d41987e906e75d4c97b3db23ce3caf7252a38eef
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Feb 10 11:25:43 2025 +0000

    sfc: extend NVRAM MCDI handlers

    Support variable write-alignment, and background updates.  The latter
     allows other MCDI to continue while the device is processing an
     MC_CMD_NVRAM_UPDATE_FINISH, since this can take a long time owing to
     e.g. cryptographic signature verification.
    Expose these handlers in mcdi.h, and build them even when
     CONFIG_SFC_MTD=n, so they can be used for devlink flash in a
     subsequent patch.

    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/de3d9e14fee69e15d95b46258401a93b75659f78.1739186253.git.ecree.xilinx@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:30 -04:00
Dennis Chen ddecae1db4 sfc: parse headers of devlink flash images
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit fd118a77ede759baf1c815a0a6e288315425e92b
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Feb 10 11:25:42 2025 +0000

    sfc: parse headers of devlink flash images

    This parsing is necessary to obtain the metadata which will be
     used in a subsequent patch to write the image to the device.

    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/65318300f3f1b1462925f917f7c0d0ac833955ae.1739186253.git.ecree.xilinx@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:30 -04:00
Dennis Chen 670133d0b7 net: sfc: Correct key_len for efx_tc_ct_zone_ht_params
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit a8620de72e5676993ec3a3b975f7c10908f5f60f
Author: Liang Jie <liangjie@lixiang.com>
Date:   Mon Dec 30 17:37:09 2024 +0800

    net: sfc: Correct key_len for efx_tc_ct_zone_ht_params

    In efx_tc_ct_zone_ht_params, the key_len was previously set to
    offsetof(struct efx_tc_ct_zone, linkage). This calculation is incorrect
    because it includes any padding between the zone field and the linkage
    field due to structure alignment, which can vary between systems.

    This patch updates key_len to use sizeof_field(struct efx_tc_ct_zone, zone)
    , ensuring that the hash table correctly uses the zone as the key. This fix
    prevents potential hash lookup errors and improves connection tracking
    reliability.

    Fixes: c3bb5c6acd4e ("sfc: functions to register for conntrack zone offload")
    Signed-off-by: Liang Jie <liangjie@lixiang.com>
    Acked-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/20241230093709.3226854-1-buaajxlj@163.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:30 -04:00
Dennis Chen 616c35aa3b sfc: Use netdev refcount tracking in struct efx_async_filter_insertion
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 85101bda1387e85eabf77cd416bfc38e14f1bce6
Author: YiFei Zhu <zhuyifei@google.com>
Date:   Thu Dec 19 17:30:04 2024 +0000

    sfc: Use netdev refcount tracking in struct efx_async_filter_insertion

    I was debugging some netdev refcount issues in OpenOnload, and one
    of the places I was looking at was in the sfc driver. Only
    struct efx_async_filter_insertion was not using netdev refcount tracker,
    so add it here. GFP_ATOMIC because this code path is called by
    ndo_rx_flow_steer which holds RCU.

    This patch should be a no-op if !CONFIG_NET_DEV_REFCNT_TRACKER

    Signed-off-by: YiFei Zhu <zhuyifei@google.com>
    Reviewed-by: Eric Dumazet <edumazet@google.com>
    Link: https://patch.msgid.link/20241219173004.2615655-1-zhuyifei@google.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:30 -04:00
Dennis Chen fd22222420 sfc: remove efx_writed_page_locked
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 455e135c3042540cf15fff629a56600c11bea396
Author: Andy Moreton <andy.moreton@amd.com>
Date:   Wed Dec 18 13:59:30 2024 +0000

    sfc: remove efx_writed_page_locked

    From: Andy Moreton <andy.moreton@amd.com>

    efx_writed_page_locked is a workaround for Siena hardware that is not
    needed on later adapters, and has no callers. Remove it.

    Signed-off-by: Andy Moreton <andy.moreton@amd.com>
    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/20241218135930.2350358-1-edward.cree@amd.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:30 -04:00
Dennis Chen b48a892f92 net: sfc: use ethtool string helpers
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 9dae59210556114562b49f6b909181443ebdbabe
Author: Rosen Penev <rosenp@gmail.com>
Date:   Tue Nov 5 15:18:55 2024 -0800

    net: sfc: use ethtool string helpers

    The latter is the preferred way to copy ethtool strings.

    Avoids manually incrementing the pointer. Cleans up the code quite well.

    Signed-off-by: Rosen Penev <rosenp@gmail.com>
    Acked-by: Edward Cree <ecree.xilinx@gmail.com>
    Link: https://patch.msgid.link/20241105231855.235894-1-rosenp@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:30 -04:00
Dennis Chen cc24eedcef sfc: Remove more unused functions
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit d3e80070b5b49bb22fef1be22871196f29ee8d31
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Sat Nov 2 15:16:25 2024 +0000

    sfc: Remove more unused functions

    efx_ticks_to_usecs(), efx_reconfigure_port(), efx_ptp_get_mode(), and
    efx_tx_get_copy_buffer_limited() are unused.
    They seem to be partially due to the later splits to Siena, but
    some seem unused for longer.

    Remove them.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
    Link: https://patch.msgid.link/20241102151625.39535-5-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:29 -04:00
Dennis Chen 28e272adb1 sfc: Remove unused mcdi functions
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 5254fdfc746a443ba66469e048ae894c2defdc84
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Sat Nov 2 15:16:24 2024 +0000

    sfc: Remove unused mcdi functions

    efx_mcdi_flush_rxqs(), efx_mcdi_rpc_async_quiet(),
    efx_mcdi_rpc_finish_quiet(), and efx_mcdi_wol_filter_get_magic()
    are unused.
    I think these are fall out from the split into Siena
    that happened in
    commit 4d49e5cd4b09 ("sfc/siena: Rename functions in mcdi headers to avoid
    conflicts with sfc")
    and
    commit d48523cb88e0 ("sfc: Copy shared files needed for Siena (part 2)")

    Remove them.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
    Link: https://patch.msgid.link/20241102151625.39535-4-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:29 -04:00
Dennis Chen 4d1db42af1 sfc: Remove unused efx_mae_mport_vf
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 70e58249a6468fd98575da52ad83f7a29634377c
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Sat Nov 2 15:16:23 2024 +0000

    sfc: Remove unused efx_mae_mport_vf

    efx_mae_mport_vf() has been unused since
    commit 5227adff37af ("sfc: add mport lookup based on driver's mport data")

    Remove it.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
    Link: https://patch.msgid.link/20241102151625.39535-3-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:29 -04:00
Dennis Chen 45d64b2c76 sfc: Remove falcon deadcode
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit cc4914d90479bbf13ca7ecea3b71d9c86d3b252f
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Sat Nov 2 15:16:22 2024 +0000

    sfc: Remove falcon deadcode

    ef4_farch_dimension_resources(), ef4_nic_fix_nodesc_drop_stat(),
    ef4_ticks_to_usecs() and ef4_tx_get_copy_buffer_limited() were
    copied over from efx_ equivalents in 2016 but never used by
    commit 5a6681e22c ("sfc: separate out SFC4000 ("Falcon") support into new
    sfc-falcon driver")

    EF4_MAX_FLUSH_TIME is also unused.

    Remove them.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Acked-by: Martin Habets <habetsm.xilinx@gmail.com>
    Link: https://patch.msgid.link/20241102151625.39535-2-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:29 -04:00
Dennis Chen 17444e147a sfc: add per-queue RX bytes stats
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit b3411dbdaa55cffbcdfa1aaffa78f812132937fe
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Sep 30 14:52:45 2024 +0100

    sfc: add per-queue RX bytes stats

    While this does add overhead to the fast path, it should be minimal
     as the cacheline should already be held for write from updating the
     queue's rx_packets stat.

    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:29 -04:00
Dennis Chen c0b5191b2f sfc: implement per-queue TSO (hw_gso) stats
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit db3067c8aab6836004a985a4236e9825b34c4dd7
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Sep 30 14:52:44 2024 +0100

    sfc: implement per-queue TSO (hw_gso) stats

    Use our existing TSO stats, which count enqueued TSO TXes.
    Users may expect them to count completions, as tx-packets and
     tx-bytes do; however, these are the counters we have, and the
     qstats documentation doesn't actually specify.

    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:29 -04:00
Dennis Chen 2b3dffa6b9 sfc: implement per-queue rx drop and overrun stats
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 07e5fa5b7f43efd18040ae47569258850cf94a09
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Sep 30 14:52:43 2024 +0100

    sfc: implement per-queue rx drop and overrun stats

    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:28 -04:00
Dennis Chen 3dfd434c7c sfc: account XDP TXes in netdev base stats
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit cfa63b9080bce70a40d40ff0a0669cf81a2f66d1
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Sep 30 14:52:42 2024 +0100

    sfc: account XDP TXes in netdev base stats

    When we handle a TX completion for an XDP packet, it is not counted
     in the per-TXQ netdev stats.  Record it in new internal counters,
     and include those in the device-wide total in efx_get_base_stats().

    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:28 -04:00
Dennis Chen 0547e8c5a3 sfc: add n_rx_overlength to ethtool stats
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 5c24de42f1c1d77cf876ae4b1830e1bbf89f456f
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Sep 30 14:52:41 2024 +0100

    sfc: add n_rx_overlength to ethtool stats

    The previous patch changed when we increment the RX queue's rx_packets
     counter, to match the semantics of netdev per-queue stats.  The
     differences between the old and new counts are scatter errors (which
     produce a WARN_ON) and this counter, which is incremented by
     efx_rx_packet__check_len() when an RX packet (which was placed in a
     single buffer by SG, i.e. n_frags == 1) has a length (from the RX
     event) which is too long to fit in the RX buffer.  If this occurs, we
     drop the packet and fire a ratelimited netif_err().
    The counter previously was not reported anywhere; add it to ethtool -S
     output to ensure users still have this information.

    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:28 -04:00
Dennis Chen 941cae96e1 sfc: implement basic per-queue stats
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 873e85795026e1c57dd6db24148fc5b85cc2ccee
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Sep 30 14:52:40 2024 +0100

    sfc: implement basic per-queue stats

    Just RX and TX packet counts and TX bytes for now.  We do not
     have per-queue RX byte counts, which causes us to fail
     stats.pkt_byte_sum selftest with "Drivers should always report
     basic keys" error.
    Per-queue counts are since the last time the queue was inited
     (typically by efx_start_datapath(), on ifup or reconfiguration);
     device-wide total (efx_get_base_stats()) is since driver probe.
     This is not the same lifetime as rtnl_link_stats64, which uses
     firmware stats which count since FW (re)booted; this can cause a
     "Qstats are lower" or "RTNL stats are lower" failure in
     stats.pkt_byte_sum selftest.
    Move the increment of rx_queue->rx_packets to match the semantics
     specified for netdev per-queue stats, i.e. just before handing
     the packet to XDP (if present) or the netstack (through GRO).
     This will affect the existing ethtool -S output which also
     reports these counters.
    XDP TX packets are not yet counted into base_stats.

    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:28 -04:00
Dennis Chen ca6c2d4e54 sfc: remove obsolete counters from struct efx_channel
JIRA: https://issues.redhat.com/browse/RHEL-72660

commit 65131ea8d3f9a6033753d853ab497b61a2fd6090
Author: Edward Cree <ecree.xilinx@gmail.com>
Date:   Mon Sep 30 14:52:39 2024 +0100

    sfc: remove obsolete counters from struct efx_channel

    The n_rx_tobe_disc and n_rx_mcast_mismatch counters are a legacy
     from farch, and are never written in EF10 or EF100 code.  Remove
     them from the struct and from ethtool -S output, saving a bit of
     memory and avoiding user confusion.

    Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: Edward Cree <ecree.xilinx@gmail.com>
    Signed-off-by: David S. Miller <davem@davemloft.net>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-26 13:22:28 -04:00
Dennis Chen ed58f82a2b treewide: Switch/rename to timer_delete[_sync]()
JIRA: https://issues.redhat.com/browse/RHEL-83573

Conflict: partial backport only includes i40e changes

commit 8fa7292fee5c5240402371ea89ab285ec856c916
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Sat Apr 5 10:17:26 2025 +0200

    treewide: Switch/rename to timer_delete[_sync]()

    timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
    over and remove the historical wrapper inlines.

    Conversion was done with coccinelle plus manual fixups where necessary.

    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen 4410506744 i40e: fix MMIO write access to an invalid page in i40e_clear_hw
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit 015bac5daca978448f2671478c553ce1f300c21e
Author: Kyungwook Boo <bookyungwook@gmail.com>
Date:   Tue Mar 11 14:16:02 2025 +0900

    i40e: fix MMIO write access to an invalid page in i40e_clear_hw

    When the device sends a specific input, an integer underflow can occur, leading
    to MMIO write access to an invalid page.

    Prevent the integer underflow by changing the type of related variables.

    Signed-off-by: Kyungwook Boo <bookyungwook@gmail.com>
    Link: https://lore.kernel.org/lkml/ffc91764-1142-4ba2-91b6-8c773f6f7095@gmail.com/T/
    Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
    Tested-by: Rinitha S <sx.rinitha@intel.com> (A Contingent worker at Intel)
    Signed-off-by: Tony Nguyen <anthony.l.nguyen@intel.com>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen ba69d2955e i40e: use generic unrolled_count() macro
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit 9144e6f404da258a7620e66aadea953cf3b114d6
Author: Alexander Lobakin <aleksander.lobakin@intel.com>
Date:   Thu Feb 6 19:26:27 2025 +0100

    i40e: use generic unrolled_count() macro

    i40e, as well as ice, has a custom loop unrolling macro for unrolling
    Tx descriptors filling on XSk xmit.
    Replace i40e defs with generic unrolled_count(), which is also more
    convenient as it allows passing defines as its argument, not hardcoded
    values, while the loop declaration will still be a usual for-loop.

    Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
    Acked-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
    Link: https://patch.msgid.link/20250206182630.3914318-3-aleksander.lobakin@intel.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen d4181c46c6 i40e: Remove unused i40e_dcb_hw_get_num_tc
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit 47ea5d4e6f40446eddaf308eed942a3d3a9397e9
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Thu Jan 2 17:37:17 2025 +0000

    i40e: Remove unused i40e_dcb_hw_get_num_tc

    The last useof i40e_dcb_hw_get_num_tc() was removed in 2022 by
    commit fe20371578ef ("Revert "i40e: Fix reset bw limit when DCB enabled
    with 1 TC"")

    Remove it.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
    Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20250102173717.200359-10-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen e1f2b47fc1 i40e: Remove unused i40e_asq_send_command_v2
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit d424b93f35a61dc1147ef816cb3ae151395af656
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Thu Jan 2 17:37:16 2025 +0000

    i40e: Remove unused i40e_asq_send_command_v2

    i40e_asq_send_command_v2() was added in 2022 by
    commit 74073848b0d7 ("i40e: Add new versions of send ASQ command
    functions")
    but hasn't been used.

    Remove it.

    (The _atomic_v2 version of the function is used, so leave it).

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20250102173717.200359-9-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen e149d54416 i40e: Remove unused i40e_commit_partition_bw_setting
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit a324484ac855a6770c6e7220b2ce09810a625f75
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Thu Jan 2 17:37:15 2025 +0000

    i40e: Remove unused i40e_commit_partition_bw_setting

    i40e_commit_partition_bw_setting() was added in 2017 by
    commit 4fc8c67639 ("i40e: genericize the partition bandwidth control")
    but hasn't been used.

    Remove it.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
    Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20250102173717.200359-8-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen 0fa28a94f4 i40e: Remove unused i40e_del_filter
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit 38dfb07d9a65dd408bc50f0cc8e49a5381bc40f5
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Thu Jan 2 17:37:14 2025 +0000

    i40e: Remove unused i40e_del_filter

    The last use of i40e_del_filter() was removed in 2016 by
    commit 9569a9a454 ("i40e: when adding or removing MAC filters, correctly
    handle VLANs")

    Remove it.

    Fix up a comment that referenced it.

    Note: The __ version of this function is still used.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20250102173717.200359-7-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen 765b8c92a6 i40e: Remove unused i40e_get_cur_guaranteed_fd_count
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit 3eb24a9e0af3a336da8af0bf37140203f742b493
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Thu Jan 2 17:37:13 2025 +0000

    i40e: Remove unused i40e_get_cur_guaranteed_fd_count

    The last use of i40e_get_cur_guaranteed_fd_count() was removed in 2015 by
    commit 04294e38a4 ("i40e: FD filters flush policy changes")

    Remove it.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
    Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20250102173717.200359-6-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen fd8a7cf736 i40e: Deadcode profile code
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit 81d6bb2012e1d6410bc88dcb331113126a13a6ee
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Thu Jan 2 17:37:12 2025 +0000

    i40e: Deadcode profile code

    i40e_add_pinfo_to_list() was added in 2017 by
    commit 1d5c960c5e ("i40e: new AQ commands")

    i40e_find_section_in_profile() was added in 2019 by
    commit cdc594e003 ("i40e: Implement DDP support in i40e driver")

    Neither have been used.

    Remove them.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20250102173717.200359-5-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen 21b160f0d6 i40e: Remove unused i40e_(read|write)_phy_register
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit 8cc51e28ecce4c8b3a96d7802b543553d11f682c
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Thu Jan 2 17:37:11 2025 +0000

    i40e: Remove unused i40e_(read|write)_phy_register

    i40e_read_phy_register() and i40e_write_phy_register() were added in
    2016 by
    commit f62ba91458 ("i40e: Add functions which apply correct PHY access
    method for read and write operation")

    but haven't been used.

    Remove them.

    (There are more specific _clause* variants of these functions
    that are still used.)

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20250102173717.200359-4-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen 35fea8b351 i40e: Remove unused i40e_blink_phy_link_led
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit 39cabb01d26d2d27bd4794c62e67349d86f8b1df
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Thu Jan 2 17:37:10 2025 +0000

    i40e: Remove unused i40e_blink_phy_link_led

    i40e_blink_phy_link_led() was added in 2016 by
    commit fd077cd339 ("i40e: Add functions to blink led on 10GBaseT PHY")

    but hasn't been used.

    Remove it.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: Kalesh AP <kalesh-anakkur.purayil@broadcom.com>
    Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20250102173717.200359-3-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen 19bb2ccec3 i40e: Deadcode i40e_aq_*
JIRA: https://issues.redhat.com/browse/RHEL-83573

commit 59ec698d01ebb5bae4865f6083bb9f398e39d63b
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Thu Jan 2 17:37:09 2025 +0000

    i40e: Deadcode i40e_aq_*

    i40e_aq_add_mirrorrule(), i40e_aq_delete_mirrorrule() and
    i40e_aq_set_vsi_vlan_promisc() were added in 2016 by
    commit 7bd6875bef ("i40e: APIs to Add/remove port mirroring rules")
    but haven't been used.

    They were the last user of i40e_mirrorrule_op().

    i40e_aq_rearrange_nvm() was added in 2018 by
    commit f05798b4ff ("i40e: Add AQ command for rearrange NVM structure")
    but hasn't been used.

    i40e_aq_restore_lldp() was added in 2019 by
    commit c65e78f87f ("i40e: Further implementation of LLDP")
    but hasn't been used.

    Remove them.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: Tony Nguyen <anthony.l.nguyen@intel.com>
    Link: https://patch.msgid.link/20250102173717.200359-2-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:28:41 +00:00
Dennis Chen 6a7fa9af9f net: ena: Support persistent per-NAPI config.
JIRA: https://issues.redhat.com/browse/RHEL-94832

commit 0f681b0ecd190fb4516bb34cec227296b10533d1
Author: Kuniyuki Iwashima <kuniyu@amazon.com>
Date:   Mon Apr 7 09:47:59 2025 -0700

    net: ena: Support persistent per-NAPI config.

    Let's pass the queue index to netif_napi_add_config() to preserve
    per-NAPI config.

    Test:

    Set 100 to defer-hard-irqs (default is 0) and check the value after
    link down & up.

      $ cat /sys/class/net/enp39s0/napi_defer_hard_irqs
      0

      $ ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
        --dump napi-get --json='{"ifindex": 2}'
      [{'defer-hard-irqs': 0,
        'gro-flush-timeout': 0,
        'id': 65,
        'ifindex': 2,
        'irq': 29,
        'irq-suspend-timeout': 0}]

      $ sudo ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
        --do napi-set --json='{"id": 65, "defer-hard-irqs": 100}'

      $ sudo ip link set enp39s0 down && sudo ip link set enp39s0 up

    Without patch:

      $ ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
        --dump napi-get --json='{"ifindex": 2}'
      [{'defer-hard-irqs': 0,  <------------------- Reset to 0
        'gro-flush-timeout': 0,
        'id': 66,  <------------------------------- New ID
        'ifindex': 2,
        'irq': 29,
        'irq-suspend-timeout': 0}]

    With patch:

      $ ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/netdev.yaml \
        --dump napi-get --json='{"ifindex": 2}'
      [{'defer-hard-irqs': 100,  <--------------+-- Preserved
        'gro-flush-timeout': 0,                 |
        'id': 65,  <----------------------------'
        'ifindex': 2,
        'irq': 29,
        'irq-suspend-timeout': 0}]

    Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
    Reviewed-by: Joe Damato <jdamato@fastly.com>
    Reviewed-by: Arthur Kiyanovski <akiyano@amazon.com>
    Link: https://patch.msgid.link/20250407164802.25184-1-kuniyu@amazon.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:19:33 +00:00
Dennis Chen 7b7bf31370 treewide: Switch/rename to timer_delete[_sync]()
Conflict: partial backport only includes ena changes

JIRA: https://issues.redhat.com/browse/RHEL-94832

commit 8fa7292fee5c5240402371ea89ab285ec856c916
Author: Thomas Gleixner <tglx@linutronix.de>
Date:   Sat Apr 5 10:17:26 2025 +0200

    treewide: Switch/rename to timer_delete[_sync]()

    timer_delete[_sync]() replaces del_timer[_sync](). Convert the whole tree
    over and remove the historical wrapper inlines.

    Conversion was done with coccinelle plus manual fixups where necessary.

    Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
    Signed-off-by: Ingo Molnar <mingo@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:19:33 +00:00
Dennis Chen 302b502369 net: ena: Fix incorrect indentation
JIRA: https://issues.redhat.com/browse/RHEL-94832

commit 36e32b33d81152e1911a70750e0fe5c7621797ba
Author: Shay Agroskin <shayagr@amazon.com>
Date:   Thu Dec 12 13:59:08 2024 +0200

    net: ena: Fix incorrect indentation

    The assignment was accidentally aligned to the string one line before.
    This was raised by the kernel bot.

    Reported-by: kernel test robot <lkp@intel.com>
    Closes: https://lore.kernel.org/oe-kbuild-all/202412101739.umNl7yYu-lkp@intel.com/
    Signed-off-by: David Arinzon <darinzon@amazon.com>
    Signed-off-by: Shay Agroskin <shayagr@amazon.com>
    Reviewed-by: Simon Horman <horms@kernel.org>
    Link: https://patch.msgid.link/20241212115910.2485851-1-shayagr@amazon.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:19:33 +00:00
Dennis Chen 99a3c91158 net: ena: remove devm from ethtool
JIRA: https://issues.redhat.com/browse/RHEL-94832

commit d2068805f688ce6e9c6099f3636879fa76e76497
Author: Rosen Penev <rosenp@gmail.com>
Date:   Fri Nov 1 14:48:27 2024 -0700

    net: ena: remove devm from ethtool

    There's no need for devm bloat here. In addition, these are freed right
    before the function exits.

    Also swapped kcalloc order for consistency.

    Signed-off-by: Rosen Penev <rosenp@gmail.com>
    Reviewed-by: Shay Agroskin <shayagr@amazon.com>
    Link: https://patch.msgid.link/20241101214828.289752-2-rosenp@gmail.com
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:19:33 +00:00
Dennis Chen 585d1445c4 net: ena: Remove deadcode
JIRA: https://issues.redhat.com/browse/RHEL-94832

commit 6a7d68f72797de9ba8a5129975d42994ae27635d
Author: Dr. David Alan Gilbert <linux@treblig.org>
Date:   Sat Nov 2 22:01:42 2024 +0000

    net: ena: Remove deadcode

    ena_com_get_dev_basic_stats() has been unused since 2017's
    commit d81db24056 ("net/ena: refactor ena_get_stats64 to be atomic
    context safe")

    ena_com_get_offload_settings() has been unused since the original
    commit of ENA back in 2016 in
    commit 1738cd3ed3 ("net: ena: Add a driver for Amazon Elastic
    Network Adapters (ENA)")

    Remove them.

    Signed-off-by: Dr. David Alan Gilbert <linux@treblig.org>
    Reviewed-by: David Arinzon <darinzon@amazon.com>
    Link: https://patch.msgid.link/20241102220142.80285-1-linux@treblig.org
    Signed-off-by: Jakub Kicinski <kuba@kernel.org>

Signed-off-by: Dennis Chen <dechen@redhat.com>
2025-06-18 11:19:33 +00:00