AI Trajectory


Trajectory: (Expand/Collapse All)
Seq Timestamp Type Name Duration
0/0 2026/08/26 10:04 flow patch-triage
3m Args:
null

Results:
{
  "EnableConfigs": [
    "AMD_SFH_HID"
  ],
  "FocusSymbols": [
    "amd_mp2_pci_probe"
  ],
  "KMSANReasoning": "The patch adds validation for the PCI BAR 2 resource type and length in the AMD SFH HID driver to prevent out-of-bounds memory accesses or invalid mappings. Out-of-bounds memory accesses are effectively detected by KASAN and general memory protection mechanisms. The changes do not introduce or expose any uninitialized memory usage, info-leaks to user space, or uninitialized variables that would require KMSAN to detect. Therefore, a dedicated KMSAN fuzzing session is not necessary.",
  "NeedsKMSAN": false,
  "Reasoning": "The patch adds validation for PCI BAR 2 size and flags in the probe function of the AMD SFH HID driver. This is a functional change that prevents out-of-bounds memory accesses or invalid mappings. The syzkaller PCI fuzzer can reach this code by emulating a PCI device with matching vendor/device IDs.",
  "WorthFuzzing": true
}

1/1 2026/08/26 10:04 action read-patch-diff
0m Args:
null

Results:
{
  "PatchDiff": "commit d10314a4fc3d59620d53a462a80767243e73c9aa\nAuthor: syz-cluster \u003ctriage@syzkaller.com\u003e\nDate:   Wed Aug 26 10:04:11 2026 +0000\n\n    syz-cluster: applied patch under review\n\ndiff --git a/drivers/hid/amd-sfh-hid/amd_sfh_common.h b/drivers/hid/amd-sfh-hid/amd_sfh_common.h\nindex 78f830c133e5c..c0c324565bee4 100644\n--- a/drivers/hid/amd-sfh-hid/amd_sfh_common.h\n+++ b/drivers/hid/amd-sfh-hid/amd_sfh_common.h\n@@ -17,6 +17,8 @@\n #define PCI_DEVICE_ID_AMD_MP2\t\t0x15E4\n #define PCI_DEVICE_ID_AMD_MP2_1_1\t0x164A\n \n+#define AMD_SFH_MIN_BAR_SIZE\t\t(128 * 1024)\n+\n #define AMD_C2P_MSG(regno) (0x10500 + ((regno) * 4))\n #define AMD_P2C_MSG(regno) (0x10680 + ((regno) * 4))\n \ndiff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c\nindex 4b81cebdc3359..039b6ac327d3d 100644\n--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c\n+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c\n@@ -451,6 +451,16 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i\n \tif (rc)\n \t\treturn rc;\n \n+\tif (!(pci_resource_flags(pdev, 2) \u0026 IORESOURCE_MEM)) {\n+\t\tdev_err(\u0026pdev-\u003edev, \"BAR 2 is not IORESOURCE_MEM\\n\");\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tif (pci_resource_len(pdev, 2) \u003c AMD_SFH_MIN_BAR_SIZE) {\n+\t\tdev_err(\u0026pdev-\u003edev, \"BAR 2 is too small\\n\");\n+\t\treturn -EINVAL;\n+\t}\n+\n \trc = pcim_iomap_regions(pdev, BIT(2), DRIVER_NAME);\n \tif (rc)\n \t\treturn rc;\n"
}

2/1 2026/08/26 10:04 agent patch-evaluator
3m Model:
best-expensive

Args:
null

Results:
{
  "EnableConfigs": [
    "AMD_SFH_HID"
  ],
  "FocusSymbols": [
    "amd_mp2_pci_probe"
  ],
  "Reasoning": "The patch adds validation for PCI BAR 2 size and flags in the probe function of the AMD SFH HID driver. This is a functional change that prevents out-of-bounds memory accesses or invalid mappings. The syzkaller PCI fuzzer can reach this code by emulating a PCI device with matching vendor/device IDs.",
  "WorthFuzzing": true
}

Instruction:
You are an expert Linux kernel maintainer.
Your job is to review a provided patch series and determine
if it makes functional changes to the kernel that should be fuzzed.

IMPORTANT: The changes have ALREADY been applied and committed as the HEAD commit in
your workspace. Do NOT rely on your internal knowledge of the kernel. You must actively
use your code access tools to examine the actual source code and confirm any assumptions.

Return WorthFuzzing=false if the patch only contains:
- Modifications to Documentation/, Kconfig files, or code comments.
- Purely decorative changes, such as logging (e.g., pr_err, printk) or tracepoints.
- Changes to numeric constants or macros that do not functionally alter execution flow.
- Code paths that are impossible to reach in virtualized environments like GCE or QEMU,
  even when utilizing software-emulated hardware (e.g., usb gadget, mac80211_hwsim).
- Code in vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed,
  ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU.
- Driver .remove, .shutdown, or pci_unregister_driver teardown callbacks (e.g., igb_remove)
  that are executed only during PCI hot-unplug or sysfs driver unbind operations.

If it modifies reachable core kernel logic, drivers, or architectures, use your code search
tools to verify the code can be executed, then return WorthFuzzing=true.

When returning WorthFuzzing=true, you MUST ALSO:
1. Extract any specific kernel functions that should be heavily fuzzed into FocusSymbols.
   Avoid listing generic hot-path functions to prevent skewed test distributions.
   Prefer non-static, non-inlined API entrypoint functions over internal static helper functions
   (which are inlined by the compiler and do not have distinct symbol addresses).
2. Identify any specific CONFIG_ options required to properly test this new/modified feature.
   Go and look into the Kconfig files and check for ifdefs around the code, do not make assumptions.
   Also check "depends on" lines in Kconfig to include any non-standard parent subsystem configs
   needed for Kbuild to compile the code statically into vmlinux. List them in the EnableConfigs
   output array, and DO NOT add a 'CONFIG_' prefix (e.g., return "NET_IPV4" instead of "CONFIG_NET_IPV4").
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit d10314a4fc3d59620d53a462a80767243e73c9aa
Author: syz-cluster <triage@syzkaller.com>
Date:   Wed Aug 26 10:04:11 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_common.h b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
index 78f830c133e5c..c0c324565bee4 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_common.h
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
@@ -17,6 +17,8 @@
 #define PCI_DEVICE_ID_AMD_MP2		0x15E4
 #define PCI_DEVICE_ID_AMD_MP2_1_1	0x164A
 
+#define AMD_SFH_MIN_BAR_SIZE		(128 * 1024)
+
 #define AMD_C2P_MSG(regno) (0x10500 + ((regno) * 4))
 #define AMD_P2C_MSG(regno) (0x10680 + ((regno) * 4))
 
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index 4b81cebdc3359..039b6ac327d3d 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -451,6 +451,16 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 	if (rc)
 		return rc;
 
+	if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) {
+		dev_err(&pdev->dev, "BAR 2 is not IORESOURCE_MEM\n");
+		return -ENODEV;
+	}
+
+	if (pci_resource_len(pdev, 2) < AMD_SFH_MIN_BAR_SIZE) {
+		dev_err(&pdev->dev, "BAR 2 is too small\n");
+		return -EINVAL;
+	}
+
 	rc = pcim_iomap_regions(pdev, BIT(2), DRIVER_NAME);
 	if (rc)
 		return rc;

3/2 2026/08/26 10:04 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 2423
							output: 31
							thoughts: 561
						

Thoughts:
**Analyzing a Patch: AMD SFH PCI Driver**

Okay, so I'm looking at this patch for `drivers/hid/amd-sfh-hid/amd_sfh_pcie.c`. It's adding some checks within the `amd_mp2_pci_probe` function, specifically for BAR 2. It's verifying if the BAR is memory-mapped (`IORESOURCE_MEM`) and if its size meets a minimum requirement (`AMD_SFH_MIN_BAR_SIZE`). Classic PCI driver probe stuff.

My initial thought is to figure out the context of this. Is this a driver for a specific piece of hardware, or is it something that could be emulated? It's the AMD Sensor Fusion Hub, `amd-sfh-hid`, which is a PCI device. I know that usually these AMD-specific hardware components are not emulated, so it is probably a real hardware driver. However, syzkaller *does* have virtual PCI fuzzing (vhci/pci), so there's a chance it could be fuzzed. But wait, the documentation says syzkaller struggles with "vendor-specific PCIe switch, SmartNIC, or GPU drivers (e.g., mlxsw, pds_core, qed, ionic, amdgpu) that require physical PCIe hardware cards not emulated in standard QEMU".

Is the AMD SFH one of those? Yes, it's specific to AMD platforms. Okay, but syzkaller *can* fuzz PCI devices by mimicking the PCI config space and the BARs. Now the question is, *does* syzkaller fuzz this specific AMD SFH device? I need to check if there are any syzkaller descriptions for it, or if it's just treated generically as a PCI device.

Actually, I recall syzkaller has a general PCI fuzzer that can probe any PCI driver if the vendor/device IDs are known. Then the question becomes, is this worth fuzzing?

This patch itself is pretty telling. It's adding `pci_resource_flags` and `pci_resource_len` checks. That's *exactly* the kind of thing the PCI fuzzer hits - it provides random BAR sizes and flags, which the driver has to deal with. This patch is mitigating the possibility of out-of-bounds accesses. Bingo! This is likely exploitable with the syzkaller PCI fuzzer. Now, I need to check if `AMD_SFH_HID` is enabled in some generic configs, or if it is something that is possible for me to enable for testing.



4/2 2026/08/26 10:04 tool grepper
0m Args:
{
  "Expression": "config AMD_SFH_HID",
  "PathPrefix": "drivers/hid/"
}

Results:
{
  "Output": "drivers/hid/amd-sfh-hid/Kconfig=2=menu \"AMD SFH HID Support\"\n--\ndrivers/hid/amd-sfh-hid/Kconfig-5-\ndrivers/hid/amd-sfh-hid/Kconfig:6:config AMD_SFH_HID\ndrivers/hid/amd-sfh-hid/Kconfig-7-\ttristate \"AMD Sensor Fusion Hub\"\n"
}

5/2 2026/08/26 10:04 llm patch-evaluator
2m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 3676
							output: 35
							thoughts: 16
						

Thoughts:
Here's my take on those thoughts:

**Dissecting the Dependencies of AMD_SFH_HID**

Okay, so I need to figure out the architectural landscape around `AMD_SFH_HID`. My gut feeling is it's a critical component, probably related to the Secure Firmware Hub (SFH) and Human Interface Devices (HID), given the name. But I need to be precise. It's time to dig into the dependencies. I need to understand what other drivers, firmware modules, or system services rely on this, and what resources it provides to the system. Is it hardware-specific? Does it talk directly to the SFH or does it go through another layer of abstraction? Are there any obvious security implications? Knowing its dependencies is the only way I can understand its place in the system's overall function.



6/2 2026/08/26 10:06 tool grepper
0m Args:
{
  "Expression": "depends on",
  "PathPrefix": "drivers/hid/amd-sfh-hid/Kconfig"
}

Results:
{
  "Output": "drivers/hid/amd-sfh-hid/Kconfig=2=menu \"AMD SFH HID Support\"\ndrivers/hid/amd-sfh-hid/Kconfig:3:\tdepends on X86_64 || COMPILE_TEST\ndrivers/hid/amd-sfh-hid/Kconfig:4:\tdepends on PCI\ndrivers/hid/amd-sfh-hid/Kconfig-5-\ndrivers/hid/amd-sfh-hid/Kconfig=6=config AMD_SFH_HID\ndrivers/hid/amd-sfh-hid/Kconfig-7-\ttristate \"AMD Sensor Fusion Hub\"\ndrivers/hid/amd-sfh-hid/Kconfig:8:\tdepends on X86\ndrivers/hid/amd-sfh-hid/Kconfig-9-\thelp\n"
}

7/2 2026/08/26 10:06 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 4100
							output: 49
							thoughts: 296
						

Thoughts:
**My Assessment of the Patch's Worthiness for Fuzzing**

Okay, so this patch's fuzzability hinges on a few conditions: X86_64 or COMPILE_TEST, PCI, and X86. Assuming those are met, it *could* be a good target. But I have to be careful. Is this tied to some proprietary PCIe device that's going to require actual hardware? The instructions are pretty clear: if it's vendor-specific code that needs specific PCIe hardware cards not available in standard QEMU, it's out.

Right, so the description mentions the AMD SFH, a sensor hub, and that it's a PCI device. And the patch fixes a classic BAR mapping bug. That's good; a syzkaller PCI fuzzer identified that, I assume. But wait, does the syzkaller PCI fuzzer actually *emulate* the AMD SFH? I have to be sure about this.

Ah, no, it's more generic. The syzkaller fuzzer presents a basic PCI device with arbitrary vendor/device IDs, BARs, and config space. It'll bind to *any* PCI driver that matches the ID. So, in theory, the probe function *will* be executed by the fuzzer. This is good news.

So the patch adds the check in `amd_mp2_pci_probe`. Now, I need to confirm that `amd_mp2_pci_probe` *is* the probe function for this device. I'll check that next.



8/2 2026/08/26 10:06 tool grepper
0m Args:
{
  "Expression": "amd_mp2_pci_probe",
  "PathPrefix": "drivers/hid/amd-sfh-hid/amd_sfh_pcie.c"
}

Results:
{
  "Output": "drivers/hid/amd-sfh-hid/amd_sfh_pcie.c=425=static void amd_sfh_remove(struct pci_dev *pdev)\n--\ndrivers/hid/amd-sfh-hid/amd_sfh_pcie.c-433-\ndrivers/hid/amd-sfh-hid/amd_sfh_pcie.c:434:static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)\ndrivers/hid/amd-sfh-hid/amd_sfh_pcie.c-435-{\n--\ndrivers/hid/amd-sfh-hid/amd_sfh_pcie.c=559=static struct pci_driver amd_mp2_pci_driver = {\n--\ndrivers/hid/amd-sfh-hid/amd_sfh_pcie.c-561-\t.id_table\t= amd_mp2_pci_tbl,\ndrivers/hid/amd-sfh-hid/amd_sfh_pcie.c:562:\t.probe\t\t= amd_mp2_pci_probe,\ndrivers/hid/amd-sfh-hid/amd_sfh_pcie.c-563-\t.driver.pm\t= \u0026amd_mp2_pm_ops,\n"
}

9/2 2026/08/26 10:06 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 5123
							output: 32
							thoughts: 312
						

Thoughts:
**Analyzing the Potential for Fuzzing: AMD SFH Probe Function**

Okay, so this is definitely the `amd_mp2_pci_probe` function. The patch implements a check for BAR 2's size and flags, which suggests a functional change aimed at preventing a bug – probably related to memory access. Since this is a PCI probe function, it's something that the syzkaller PCI fuzzer can easily reach.

Now, I was momentarily thrown by the "AMD SFH" label. My initial thought was whether it fell under that caveat about vendor-specific PCIe switch, SmartNIC, or GPU drivers. But, wait, it's actually a HID driver for a sensor hub, right? It's not a complex switch or GPU. So, the PCI fuzzer *can* effectively test those BAR checks. This is good news, as this makes it worth fuzzing.

My primary symbols of focus are `amd_mp2_pci_probe` and configuration `AMD_SFH_HID`.

I need to re-evaluate the implications of that exclusion rule in the instructions. It specifically mentions excluding drivers that are heavily reliant on hardware interactions and massive in size, due to the restrictions of the generic PCI fuzzer. Basically, the fuzzer can't meaningfully interact with them. But the AMD SFH driver is relatively small, so it *should* be fine. Time to check the size.



10/2 2026/08/26 10:07 tool grepper
0m Args:
{
  "Expression": ".",
  "PathPrefix": "drivers/hid/amd-sfh-hid/"
}

Results:
{
  "Output": "\nFull output is too long, showing 500 out of 3824 lines.\nUse more precise expression if possible.\n\ndrivers/hid/amd-sfh-hid/Kconfig:1:# SPDX-License-Identifier: GPL-2.0-or-later\ndrivers/hid/amd-sfh-hid/Kconfig:2:menu \"AMD SFH HID Support\"\ndrivers/hid/amd-sfh-hid/Kconfig:3:\tdepends on X86_64 || COMPILE_TEST\ndrivers/hid/amd-sfh-hid/Kconfig:4:\tdepends on PCI\ndrivers/hid/amd-sfh-hid/Kconfig-5-\ndrivers/hid/amd-sfh-hid/Kconfig:6:config AMD_SFH_HID\ndrivers/hid/amd-sfh-hid/Kconfig:7:\ttristate \"AMD Sensor Fusion Hub\"\ndrivers/hid/amd-sfh-hid/Kconfig:8:\tdepends on X86\ndrivers/hid/amd-sfh-hid/Kconfig:9:\thelp\ndrivers/hid/amd-sfh-hid/Kconfig:10:\t  If you say yes to this option, support will be included for the\ndrivers/hid/amd-sfh-hid/Kconfig:11:\t  AMD Sensor Fusion Hub.\ndrivers/hid/amd-sfh-hid/Kconfig:12:\t  This driver will enable sensors functionality on AMD platforms\ndrivers/hid/amd-sfh-hid/Kconfig:13:\t  starting from 17h family of RYZEN parts.\ndrivers/hid/amd-sfh-hid/Kconfig-14-\ndrivers/hid/amd-sfh-hid/Kconfig:15:\t  This driver can also be built as a module. If so, the module will\ndrivers/hid/amd-sfh-hid/Kconfig:16:\t  be called amd-sfh.\ndrivers/hid/amd-sfh-hid/Kconfig:17:\t  Say Y or M here if you want to support AMD SFH. If unsure, say N.\ndrivers/hid/amd-sfh-hid/Kconfig:18:endmenu\n--\ndrivers/hid/amd-sfh-hid/Makefile:1:# SPDX-License-Identifier: GPL-2.0-or-later\ndrivers/hid/amd-sfh-hid/Makefile:2:#\ndrivers/hid/amd-sfh-hid/Makefile:3:# Makefile - AMD SFH HID drivers\ndrivers/hid/amd-sfh-hid/Makefile:4:# Copyright (c) 2019-2020, Advanced Micro Devices, Inc.\ndrivers/hid/amd-sfh-hid/Makefile:5:#\ndrivers/hid/amd-sfh-hid/Makefile:6:#\ndrivers/hid/amd-sfh-hid/Makefile:7:obj-$(CONFIG_AMD_SFH_HID) += amd_sfh.o\ndrivers/hid/amd-sfh-hid/Makefile:8:amd_sfh-objs := amd_sfh_hid.o\ndrivers/hid/amd-sfh-hid/Makefile:9:amd_sfh-objs += amd_sfh_client.o\ndrivers/hid/amd-sfh-hid/Makefile:10:amd_sfh-objs += amd_sfh_pcie.o\ndrivers/hid/amd-sfh-hid/Makefile:11:amd_sfh-objs += hid_descriptor/amd_sfh_hid_desc.o\ndrivers/hid/amd-sfh-hid/Makefile:12:amd_sfh-objs += sfh1_1/amd_sfh_init.o\ndrivers/hid/amd-sfh-hid/Makefile:13:amd_sfh-objs += sfh1_1/amd_sfh_interface.o\ndrivers/hid/amd-sfh-hid/Makefile:14:amd_sfh-objs += sfh1_1/amd_sfh_desc.o\ndrivers/hid/amd-sfh-hid/Makefile-15-\ndrivers/hid/amd-sfh-hid/Makefile:16:ccflags-y += -I $(src)/\n--\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:1:// SPDX-License-Identifier: GPL-2.0-or-later\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:2:/*\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:3: *  AMD SFH Client Layer\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:4: *  Copyright 2020-2021 Advanced Micro Devices, Inc.\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:5: *  Authors: Nehal Bakulchandra Shah \u003cNehal-Bakulchandra.Shah@amd.com\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:6: *\t     Sandeep Singh \u003cSandeep.singh@amd.com\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:7: *\t     Basavaraj Natikar \u003cBasavaraj.Natikar@amd.com\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:8: */\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-9-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:10:#include \u003clinux/dma-mapping.h\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:11:#include \u003clinux/hid.h\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:12:#include \u003clinux/list.h\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:13:#include \u003clinux/slab.h\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:14:#include \u003clinux/workqueue.h\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:15:#include \u003clinux/errno.h\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-16-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:17:#include \"hid_descriptor/amd_sfh_hid_desc.h\"\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:18:#include \"amd_sfh_pcie.h\"\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:19:#include \"amd_sfh_hid.h\"\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-20-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:21:void amd_sfh_set_report(struct hid_device *hid, int report_id,\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:22:\t\t\tint report_type)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:23:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:24:\tstruct amdtp_hid_data *hid_data = hid-\u003edriver_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:25:\tstruct amdtp_cl_data *cli_data = hid_data-\u003ecli_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:26:\tint i;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-27-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:28:\tfor (i = 0; i \u003c cli_data-\u003enum_hid_devices; i++) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:29:\t\tif (cli_data-\u003ehid_sensor_hubs[i] == hid) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:30:\t\t\tcli_data-\u003ecur_hid_dev = i;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:31:\t\t\tbreak;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:32:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:33:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:34:\tamdtp_hid_wakeup(hid);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:35:}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-36-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:37:int amd_sfh_get_report(struct hid_device *hid, int report_id, int report_type)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:38:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:39:\tstruct amdtp_hid_data *hid_data = hid-\u003edriver_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:40:\tstruct amdtp_cl_data *cli_data = hid_data-\u003ecli_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:41:\tstruct request_list *req_list = \u0026cli_data-\u003ereq_list;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:42:\tstruct amd_input_data *in_data = cli_data-\u003ein_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:43:\tstruct amd_mp2_dev *mp2;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:44:\tint i;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-45-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:46:\tmp2 = container_of(in_data, struct amd_mp2_dev, in_data);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:47:\tguard(mutex)(\u0026mp2-\u003elock);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:48:\tfor (i = 0; i \u003c cli_data-\u003enum_hid_devices; i++) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:49:\t\tif (cli_data-\u003ehid_sensor_hubs[i] == hid) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:50:\t\t\tstruct request_list *new = kzalloc_obj(*new);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-51-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:52:\t\t\tif (!new)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:53:\t\t\t\treturn -ENOMEM;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-54-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:55:\t\t\tnew-\u003ecurrent_index = i;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:56:\t\t\tnew-\u003esensor_idx = cli_data-\u003esensor_idx[i];\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:57:\t\t\tnew-\u003ehid = hid;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:58:\t\t\tnew-\u003ereport_type = report_type;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:59:\t\t\tnew-\u003ereport_id = report_id;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:60:\t\t\tcli_data-\u003ereport_id[i] = report_id;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:61:\t\t\tcli_data-\u003erequest_done[i] = false;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:62:\t\t\tlist_add(\u0026new-\u003elist, \u0026req_list-\u003elist);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:63:\t\t\tbreak;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:64:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:65:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:66:\tschedule_delayed_work(\u0026cli_data-\u003ework, 0);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:67:\treturn 0;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:68:}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-69-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:70:void amd_sfh_work(struct work_struct *work)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:71:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:72:\tstruct amdtp_cl_data *cli_data = container_of(work, struct amdtp_cl_data, work.work);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:73:\tstruct request_list *req_list = \u0026cli_data-\u003ereq_list;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:74:\tstruct amd_input_data *in_data = cli_data-\u003ein_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:75:\tstruct request_list *req_node;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:76:\tu8 current_index, sensor_index;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:77:\tstruct amd_mp2_ops *mp2_ops;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:78:\tstruct amd_mp2_dev *mp2;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:79:\tu8 report_id, node_type;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:80:\tu8 report_size = 0;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-81-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:82:\tmp2 = container_of(in_data, struct amd_mp2_dev, in_data);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:83:\tguard(mutex)(\u0026mp2-\u003elock);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:84:\treq_node = list_last_entry(\u0026req_list-\u003elist, struct request_list, list);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:85:\tlist_del(\u0026req_node-\u003elist);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:86:\tcurrent_index = req_node-\u003ecurrent_index;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:87:\tsensor_index = req_node-\u003esensor_idx;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:88:\treport_id = req_node-\u003ereport_id;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:89:\tnode_type = req_node-\u003ereport_type;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:90:\tkfree(req_node);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-91-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:92:\tmp2_ops = mp2-\u003emp2_ops;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:93:\tif (node_type == HID_FEATURE_REPORT) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:94:\t\treport_size = mp2_ops-\u003eget_feat_rep(sensor_index, report_id,\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:95:\t\t\t\t\t\t    cli_data-\u003efeature_report[current_index]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:96:\t\tif (report_size)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:97:\t\t\thid_input_report(cli_data-\u003ehid_sensor_hubs[current_index],\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:98:\t\t\t\t\t cli_data-\u003ereport_type[current_index],\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:99:\t\t\t\t\t cli_data-\u003efeature_report[current_index], report_size, 0);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:100:\t\telse\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:101:\t\t\tpr_err(\"AMDSFH: Invalid report size\\n\");\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-102-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:103:\t} else if (node_type == HID_INPUT_REPORT) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:104:\t\treport_size = mp2_ops-\u003eget_in_rep(current_index, sensor_index, report_id, in_data);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:105:\t\tif (report_size)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:106:\t\t\thid_input_report(cli_data-\u003ehid_sensor_hubs[current_index],\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:107:\t\t\t\t\t cli_data-\u003ereport_type[current_index],\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:108:\t\t\t\t\t in_data-\u003einput_report[current_index], report_size, 0);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:109:\t\telse\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:110:\t\t\tpr_err(\"AMDSFH: Invalid report size\\n\");\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:111:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:112:\tcli_data-\u003ecur_hid_dev = current_index;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:113:\tcli_data-\u003esensor_requested_cnt[current_index] = 0;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:114:\tamdtp_hid_wakeup(cli_data-\u003ehid_sensor_hubs[current_index]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:115:\tif (!list_empty(\u0026req_list-\u003elist))\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:116:\t\tschedule_delayed_work(\u0026cli_data-\u003ework, 0);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:117:}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-118-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:119:void amd_sfh_work_buffer(struct work_struct *work)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:120:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:121:\tstruct amdtp_cl_data *cli_data = container_of(work, struct amdtp_cl_data, work_buffer.work);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:122:\tstruct amd_input_data *in_data = cli_data-\u003ein_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:123:\tstruct amd_mp2_dev *mp2;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:124:\tu8 report_size;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:125:\tint i;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-126-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:127:\tmp2 = container_of(in_data, struct amd_mp2_dev, in_data);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:128:\tguard(mutex)(\u0026mp2-\u003elock);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:129:\tfor (i = 0; i \u003c cli_data-\u003enum_hid_devices; i++) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:130:\t\tif (cli_data-\u003esensor_sts[i] == SENSOR_ENABLED) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:131:\t\t\treport_size = mp2-\u003emp2_ops-\u003eget_in_rep(i, cli_data-\u003esensor_idx[i],\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:132:\t\t\t\t\t\t\t       cli_data-\u003ereport_id[i], in_data);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:133:\t\t\thid_input_report(cli_data-\u003ehid_sensor_hubs[i], HID_INPUT_REPORT,\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:134:\t\t\t\t\t in_data-\u003einput_report[i], report_size, 0);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:135:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:136:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:137:\tschedule_delayed_work(\u0026cli_data-\u003ework_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:138:}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-139-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:140:static u32 amd_sfh_wait_for_response(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:141:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:142:\tif (mp2-\u003emp2_ops-\u003eresponse)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:143:\t\tsensor_sts = mp2-\u003emp2_ops-\u003eresponse(mp2, sid, sensor_sts);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-144-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:145:\treturn sensor_sts;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:146:}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-147-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:148:static const char *get_sensor_name(int idx)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:149:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:150:\tswitch (idx) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:151:\tcase accel_idx:\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:152:\t\treturn \"accelerometer\";\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:153:\tcase gyro_idx:\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:154:\t\treturn \"gyroscope\";\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:155:\tcase mag_idx:\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:156:\t\treturn \"magnetometer\";\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:157:\tcase op_idx:\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:158:\t\treturn \"operating-mode\";\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:159:\tcase als_idx:\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:160:\tcase ACS_IDX: /* ambient color sensor */\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:161:\t\treturn \"ALS\";\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:162:\tcase HPD_IDX:\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:163:\t\treturn \"HPD\";\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:164:\tdefault:\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:165:\t\treturn \"unknown sensor type\";\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:166:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:167:}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-168-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:169:static void amd_sfh_resume(struct amd_mp2_dev *mp2)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:170:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:171:\tstruct amdtp_cl_data *cl_data = mp2-\u003ecl_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:172:\tstruct amd_mp2_sensor_info info;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:173:\tint i, status;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-174-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:175:\tfor (i = 0; i \u003c cl_data-\u003enum_hid_devices; i++) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:176:\t\tif (cl_data-\u003esensor_sts[i] == SENSOR_DISABLED) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:177:\t\t\tinfo.period = AMD_SFH_IDLE_LOOP;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:178:\t\t\tinfo.sensor_idx = cl_data-\u003esensor_idx[i];\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:179:\t\t\tinfo.dma_address = cl_data-\u003esensor_dma_addr[i];\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:180:\t\t\tmp2-\u003emp2_ops-\u003estart(mp2, info);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:181:\t\t\tstatus = amd_sfh_wait_for_response\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:182:\t\t\t\t\t(mp2, cl_data-\u003esensor_idx[i], SENSOR_ENABLED);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:183:\t\t\tif (status == SENSOR_ENABLED)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:184:\t\t\t\tcl_data-\u003esensor_sts[i] = SENSOR_ENABLED;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:185:\t\t\tdev_dbg(\u0026mp2-\u003epdev-\u003edev, \"resume sid 0x%x (%s) status 0x%x\\n\",\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:186:\t\t\t\tcl_data-\u003esensor_idx[i], get_sensor_name(cl_data-\u003esensor_idx[i]),\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:187:\t\t\t\tcl_data-\u003esensor_sts[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:188:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:189:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-190-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:191:\tschedule_delayed_work(\u0026cl_data-\u003ework_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:192:\tamd_sfh_clear_intr(mp2);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:193:}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-194-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:195:static void amd_sfh_suspend(struct amd_mp2_dev *mp2)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:196:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:197:\tstruct amdtp_cl_data *cl_data = mp2-\u003ecl_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:198:\tint i, status;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-199-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:200:\tfor (i = 0; i \u003c cl_data-\u003enum_hid_devices; i++) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:201:\t\tif (cl_data-\u003esensor_idx[i] != HPD_IDX \u0026\u0026\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:202:\t\t    cl_data-\u003esensor_sts[i] == SENSOR_ENABLED) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:203:\t\t\tmp2-\u003emp2_ops-\u003estop(mp2, cl_data-\u003esensor_idx[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:204:\t\t\tstatus = amd_sfh_wait_for_response\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:205:\t\t\t\t\t(mp2, cl_data-\u003esensor_idx[i], SENSOR_DISABLED);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:206:\t\t\tif (status != SENSOR_ENABLED)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:207:\t\t\t\tcl_data-\u003esensor_sts[i] = SENSOR_DISABLED;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:208:\t\t\tdev_dbg(\u0026mp2-\u003epdev-\u003edev, \"suspend sid 0x%x (%s) status 0x%x\\n\",\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:209:\t\t\t\tcl_data-\u003esensor_idx[i], get_sensor_name(cl_data-\u003esensor_idx[i]),\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:210:\t\t\t\tcl_data-\u003esensor_sts[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:211:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:212:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-213-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:214:\tcancel_delayed_work_sync(\u0026cl_data-\u003ework_buffer);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:215:\tamd_sfh_clear_intr(mp2);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:216:}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-217-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:218:int amd_sfh_hid_client_init(struct amd_mp2_dev *privdata)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:219:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:220:\tstruct amd_input_data *in_data = \u0026privdata-\u003ein_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:221:\tstruct amdtp_cl_data *cl_data = privdata-\u003ecl_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:222:\tstruct amd_mp2_ops *mp2_ops = privdata-\u003emp2_ops;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:223:\tstruct amd_mp2_sensor_info info;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:224:\tstruct request_list *req_list;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:225:\tstruct device *dev;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:226:\tu32 feature_report_size;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:227:\tu32 input_report_size;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:228:\tint rc, i;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:229:\tu8 cl_idx;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-230-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:231:\treq_list = \u0026cl_data-\u003ereq_list;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:232:\tdev = \u0026privdata-\u003epdev-\u003edev;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:233:\tamd_sfh_set_desc_ops(mp2_ops);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-234-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:235:\tmp2_ops-\u003esuspend = amd_sfh_suspend;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:236:\tmp2_ops-\u003eresume = amd_sfh_resume;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-237-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:238:\tcl_data-\u003enum_hid_devices = amd_mp2_get_sensor_num(privdata, \u0026cl_data-\u003esensor_idx[0]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:239:\tif (cl_data-\u003enum_hid_devices == 0)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:240:\t\treturn -ENODEV;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:241:\tcl_data-\u003eis_any_sensor_enabled = false;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-242-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:243:\tINIT_DELAYED_WORK(\u0026cl_data-\u003ework, amd_sfh_work);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:244:\tINIT_DELAYED_WORK(\u0026cl_data-\u003ework_buffer, amd_sfh_work_buffer);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:245:\tINIT_LIST_HEAD(\u0026req_list-\u003elist);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:246:\tcl_data-\u003ein_data = in_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-247-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:248:\tfor (i = 0; i \u003c cl_data-\u003enum_hid_devices; i++) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:249:\t\tin_data-\u003esensor_virt_addr[i] = dmam_alloc_coherent(dev, sizeof(int) * 8,\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:250:\t\t\t\t\t\t\t\t   \u0026cl_data-\u003esensor_dma_addr[i],\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:251:\t\t\t\t\t\t\t\t   GFP_KERNEL);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:252:\t\tif (!in_data-\u003esensor_virt_addr[i]) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:253:\t\t\trc = -ENOMEM;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:254:\t\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:255:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-256-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:257:\t\tif (cl_data-\u003esensor_idx[i] == op_idx) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:258:\t\t\tinfo.period = AMD_SFH_IDLE_LOOP;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:259:\t\t\tinfo.sensor_idx = cl_data-\u003esensor_idx[i];\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:260:\t\t\tinfo.dma_address = cl_data-\u003esensor_dma_addr[i];\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:261:\t\t\tmp2_ops-\u003estart(privdata, info);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:262:\t\t\tcl_data-\u003esensor_sts[i] = amd_sfh_wait_for_response(privdata,\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:263:\t\t\t\t\t\t\t\t\t   cl_data-\u003esensor_idx[i],\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:264:\t\t\t\t\t\t\t\t\t   SENSOR_ENABLED);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:265:\t\t\tif (cl_data-\u003esensor_sts[i] == SENSOR_ENABLED)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:266:\t\t\t\tcl_data-\u003eis_any_sensor_enabled = true;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:267:\t\t\tcontinue;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:268:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-269-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:270:\t\tcl_data-\u003esensor_sts[i] = SENSOR_DISABLED;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:271:\t\tcl_data-\u003esensor_requested_cnt[i] = 0;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:272:\t\tcl_data-\u003ecur_hid_dev = i;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:273:\t\tcl_idx = cl_data-\u003esensor_idx[i];\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:274:\t\tcl_data-\u003ereport_descr_sz[i] = mp2_ops-\u003eget_desc_sz(cl_idx, descr_size);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:275:\t\tif (!cl_data-\u003ereport_descr_sz[i]) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:276:\t\t\trc = -EINVAL;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:277:\t\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:278:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:279:\t\tfeature_report_size = mp2_ops-\u003eget_desc_sz(cl_idx, feature_size);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:280:\t\tif (!feature_report_size) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:281:\t\t\trc = -EINVAL;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:282:\t\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:283:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:284:\t\tinput_report_size =  mp2_ops-\u003eget_desc_sz(cl_idx, input_size);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:285:\t\tif (!input_report_size) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:286:\t\t\trc = -EINVAL;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:287:\t\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:288:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:289:\t\tcl_data-\u003efeature_report[i] = devm_kzalloc(dev, feature_report_size, GFP_KERNEL);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:290:\t\tif (!cl_data-\u003efeature_report[i]) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:291:\t\t\trc = -ENOMEM;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:292:\t\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:293:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:294:\t\tin_data-\u003einput_report[i] = devm_kzalloc(dev, input_report_size, GFP_KERNEL);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:295:\t\tif (!in_data-\u003einput_report[i]) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:296:\t\t\trc = -ENOMEM;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:297:\t\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:298:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:299:\t\tinfo.period = AMD_SFH_IDLE_LOOP;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:300:\t\tinfo.sensor_idx = cl_idx;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:301:\t\tinfo.dma_address = cl_data-\u003esensor_dma_addr[i];\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-302-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:303:\t\tcl_data-\u003ereport_descr[i] =\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:304:\t\t\tdevm_kzalloc(dev, cl_data-\u003ereport_descr_sz[i], GFP_KERNEL);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:305:\t\tif (!cl_data-\u003ereport_descr[i]) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:306:\t\t\trc = -ENOMEM;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:307:\t\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:308:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:309:\t\trc = mp2_ops-\u003eget_rep_desc(cl_idx, cl_data-\u003ereport_descr[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:310:\t\tif (rc)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:311:\t\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:312:\t\tmp2_ops-\u003estart(privdata, info);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:313:\t\tcl_data-\u003esensor_sts[i] = amd_sfh_wait_for_response\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:314:\t\t\t\t\t\t(privdata, cl_data-\u003esensor_idx[i], SENSOR_ENABLED);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-315-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:316:\t\tif (cl_data-\u003esensor_sts[i] == SENSOR_ENABLED)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:317:\t\t\tcl_data-\u003eis_any_sensor_enabled = true;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:318:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-319-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:320:\tif (!cl_data-\u003eis_any_sensor_enabled ||\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:321:\t    (mp2_ops-\u003ediscovery_status \u0026\u0026 mp2_ops-\u003ediscovery_status(privdata) == 0)) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:322:\t\tdev_warn(dev, \"Failed to discover, sensors not enabled is %d\\n\",\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:323:\t\t\t cl_data-\u003eis_any_sensor_enabled);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:324:\t\trc = -EOPNOTSUPP;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:325:\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:326:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-327-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:328:\tfor (i = 0; i \u003c cl_data-\u003enum_hid_devices; i++) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:329:\t\tcl_data-\u003ecur_hid_dev = i;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:330:\t\tif (cl_data-\u003esensor_idx[i] == op_idx) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:331:\t\t\tdev_dbg(dev, \"sid 0x%x (%s) status 0x%x\\n\",\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:332:\t\t\t\tcl_data-\u003esensor_idx[i], get_sensor_name(cl_data-\u003esensor_idx[i]),\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:333:\t\t\t\tcl_data-\u003esensor_sts[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:334:\t\t\tcontinue;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:335:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-336-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:337:\t\tif (cl_data-\u003esensor_sts[i] == SENSOR_ENABLED) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:338:\t\t\trc = amdtp_hid_probe(i, cl_data);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:339:\t\t\tif (rc)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:340:\t\t\t\tgoto cleanup;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:341:\t\t} else {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:342:\t\t\tcl_data-\u003esensor_sts[i] = SENSOR_DISABLED;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:343:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:344:\t\tdev_dbg(dev, \"sid 0x%x (%s) status 0x%x\\n\",\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:345:\t\t\tcl_data-\u003esensor_idx[i], get_sensor_name(cl_data-\u003esensor_idx[i]),\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:346:\t\t\tcl_data-\u003esensor_sts[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:347:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-348-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:349:\tschedule_delayed_work(\u0026cl_data-\u003ework_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:350:\treturn 0;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-351-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:352:cleanup:\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:353:\tamd_sfh_hid_client_deinit(privdata);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:354:\tfor (i = 0; i \u003c cl_data-\u003enum_hid_devices; i++) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:355:\t\tdevm_kfree(dev, cl_data-\u003efeature_report[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:356:\t\tdevm_kfree(dev, in_data-\u003einput_report[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:357:\t\tdevm_kfree(dev, cl_data-\u003ereport_descr[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:358:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:359:\treturn rc;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:360:}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-361-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:362:int amd_sfh_hid_client_deinit(struct amd_mp2_dev *privdata)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:363:{\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:364:\tstruct amdtp_cl_data *cl_data = privdata-\u003ecl_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:365:\tint i, status;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-366-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:367:\tfor (i = 0; i \u003c cl_data-\u003enum_hid_devices; i++) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:368:\t\tif (cl_data-\u003esensor_sts[i] == SENSOR_ENABLED) {\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:369:\t\t\tprivdata-\u003emp2_ops-\u003estop(privdata, cl_data-\u003esensor_idx[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:370:\t\t\tstatus = amd_sfh_wait_for_response\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:371:\t\t\t\t\t(privdata, cl_data-\u003esensor_idx[i], SENSOR_DISABLED);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:372:\t\t\tif (status != SENSOR_ENABLED)\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:373:\t\t\t\tcl_data-\u003esensor_sts[i] = SENSOR_DISABLED;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:374:\t\t\tdev_dbg(\u0026privdata-\u003epdev-\u003edev, \"stopping sid 0x%x (%s) status 0x%x\\n\",\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:375:\t\t\t\tcl_data-\u003esensor_idx[i], get_sensor_name(cl_data-\u003esensor_idx[i]),\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:376:\t\t\t\tcl_data-\u003esensor_sts[i]);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:377:\t\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:378:\t}\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-379-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:380:\tcancel_delayed_work_sync(\u0026cl_data-\u003ework);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:381:\tcancel_delayed_work_sync(\u0026cl_data-\u003ework_buffer);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:382:\tamdtp_hid_remove(cl_data);\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c-383-\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:384:\treturn 0;\ndrivers/hid/amd-sfh-hid/amd_sfh_client.c:385:}\n--\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:1:/* SPDX-License-Identifier: GPL-2.0-or-later */\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:2:/*\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:3: * AMD MP2 common macros and structures\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:4: *\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:5: * Copyright (c) 2022, Advanced Micro Devices, Inc.\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:6: * All Rights Reserved.\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:7: *\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:8: * Author: Basavaraj Natikar \u003cBasavaraj.Natikar@amd.com\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:9: */\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:10:#ifndef AMD_SFH_COMMON_H\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:11:#define AMD_SFH_COMMON_H\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-12-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:13:#include \u003clinux/mutex.h\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:14:#include \u003clinux/pci.h\u003e\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:15:#include \"amd_sfh_hid.h\"\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-16-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:17:#define PCI_DEVICE_ID_AMD_MP2\t\t0x15E4\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:18:#define PCI_DEVICE_ID_AMD_MP2_1_1\t0x164A\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-19-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:20:#define AMD_SFH_MIN_BAR_SIZE\t\t(128 * 1024)\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-21-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:22:#define AMD_C2P_MSG(regno) (0x10500 + ((regno) * 4))\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:23:#define AMD_P2C_MSG(regno) (0x10680 + ((regno) * 4))\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-24-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:25:#define AMD_C2P_MSG_V1(regno) (0x10900 + ((regno) * 4))\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:26:#define AMD_P2C_MSG_V1(regno) (0x10500 + ((regno) * 4))\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-27-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:28:#define SENSOR_ENABLED\t\t\t4\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:29:#define SENSOR_DISABLED\t\t\t5\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-30-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:31:#define AMD_SFH_IDLE_LOOP\t\t200\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-32-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:33:enum cmd_id {\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:34:\tNO_OP,\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:35:\tENABLE_SENSOR,\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:36:\tDISABLE_SENSOR,\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:37:\tSTOP_ALL_SENSORS = 8,\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:38:};\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-39-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:40:struct amd_mp2_sensor_info {\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:41:\tu8 sensor_idx;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:42:\tu32 period;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:43:\tdma_addr_t dma_address;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:44:};\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-45-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:46:struct sfh_dev_status {\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:47:\tbool is_hpd_present;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:48:\tbool is_hpd_enabled;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:49:\tbool is_als_present;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:50:\tbool is_sra_present;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:51:};\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-52-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:53:struct amd_mp2_dev {\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:54:\tstruct pci_dev *pdev;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:55:\tstruct amdtp_cl_data *cl_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:56:\tvoid __iomem *mmio;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:57:\tvoid __iomem *vsbase;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:58:\tconst struct amd_sfh1_1_ops *sfh1_1_ops;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:59:\tstruct amd_mp2_ops *mp2_ops;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:60:\tstruct amd_input_data in_data;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:61:\t/* mp2 active control status */\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:62:\tu32 mp2_acs;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:63:\tstruct sfh_dev_status dev_en;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:64:\tstruct work_struct work;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:65:\t/* mp2 to protect data */\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:66:\tstruct mutex lock;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:67:\tu8 init_done;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:68:\tu8 rver;\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:69:};\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h-70-\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:71:struct amd_mp2_ops {\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:72:\tvoid (*start)(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info);\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:73:\tvoid (*stop)(struct amd_mp2_dev *privdata, u16 sensor_idx);\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:74:\tvoid (*stop_all)(struct amd_mp2_dev *privdata);\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:75:\tint (*response)(struct amd_mp2_dev *mp2, u8 sid, u32 sensor_sts);\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:76:\tvoid (*clear_intr)(struct amd_mp2_dev *privdata);\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:77:\tint (*init_intr)(struct amd_mp2_dev *privdata);\ndrivers/hid/amd-sfh-hid/amd_sfh_common.h:78:\tint (*discovery_status)(struct amd_mp2_dev *privdata);\n\n"
}

11/2 2026/08/26 10:07 llm patch-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 23422
							output: 117
							thoughts: 683
						

Thoughts:
**Fuzzing Decision for AMD SFH HID Driver**

Okay, here's the breakdown. This is a pretty clear-cut case. The driver itself, the HID driver for AMD SFH, is relatively small, which is a good starting point for fuzzing. We're looking at a code change that's reachable by the PCI fuzzer, specifically `amd_mp2_pci_probe`. And, crucially, this is a functional fix – it addresses a bug where the code was missing checks for BAR size and flags. That means the fuzzer could definitely trigger this code path, especially since the PCI fuzzer will be providing random BAR configurations.

So, let's look at the enabling conditions. The main config here is `AMD_SFH_HID`. It depends on `X86_64 || COMPILE_TEST`, `PCI`, and `X86`. But `AMD_SFH_HID` by itself should be sufficient; no other dependencies seem like they could block this.

Now, for focus symbols, the primary function of interest is `amd_mp2_pci_probe`, which is the one being modified. Looking at the patch, it *only* modifies this function.

Reviewing the patch itself is pretty straightforward:

```c
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -451,6 +451,16 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 	if (rc)
 		return rc;
 
+	if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) {
+		dev_err(&pdev->dev, "BAR 2 is not IORESOURCE_MEM\n");
+		return -ENODEV;
+	}
+
+	if (pci_resource_len(pdev, 2) < AMD_SFH_MIN_BAR_SIZE) {
+		dev_err(&pdev->dev, "BAR 2 is too small\n");
+		return -EINVAL;
+	}
+
 	rc = pcim_iomap_regions(pdev, BIT(2), DRIVER_NAME);
 	if (rc)
 		return rc;
```

This is a very sensible addition. It adds validation for PCI BAR 2 size and flags within the probe function. The PCI fuzzer, which we know can reach this code, will now generate configurations where the BAR size or flags might be invalid. This prevents subsequent out-of-bounds accesses.

Therefore, I'm setting:

*   **WorthFuzzing: true**
*   **FocusSymbols: \["amd\_mp2\_pci\_probe"\]**
*   **EnableConfigs: \["AMD\_SFH\_HID"\]**
*   **Reasoning: "The patch adds validation for PCI BAR 2 size and flags in the probe function of the AMD SFH HID driver. This is a functional change that prevents out-of-bounds memory accesses or invalid mappings. The syzkaller PCI fuzzer can reach this code by emulating a PCI device with matching vendor/device IDs."**



12/2 2026/08/26 10:07 tool set-results
0m Args:
{
  "EnableConfigs": [
    "AMD_SFH_HID"
  ],
  "FocusSymbols": [
    "amd_mp2_pci_probe"
  ],
  "Reasoning": "The patch adds validation for PCI BAR 2 size and flags in the probe function of the AMD SFH HID driver. This is a functional change that prevents out-of-bounds memory accesses or invalid mappings. The syzkaller PCI fuzzer can reach this code by emulating a PCI device with matching vendor/device IDs.",
  "WorthFuzzing": true
}

Results:
{
  "EnableConfigs": [
    "AMD_SFH_HID"
  ],
  "FocusSymbols": [
    "amd_mp2_pci_probe"
  ],
  "Reasoning": "The patch adds validation for PCI BAR 2 size and flags in the probe function of the AMD SFH HID driver. This is a functional change that prevents out-of-bounds memory accesses or invalid mappings. The syzkaller PCI fuzzer can reach this code by emulating a PCI device with matching vendor/device IDs.",
  "WorthFuzzing": true
}

13/1 2026/08/26 10:07 action If
0m Args:
{
  "WorthFuzzing": true
}

Results:
null

14/2 2026/08/26 10:07 agent kmsan-evaluator
0m Model:
best-expensive

Args:
null

Results:
{
  "KMSANReasoning": "The patch adds validation for the PCI BAR 2 resource type and length in the AMD SFH HID driver to prevent out-of-bounds memory accesses or invalid mappings. Out-of-bounds memory accesses are effectively detected by KASAN and general memory protection mechanisms. The changes do not introduce or expose any uninitialized memory usage, info-leaks to user space, or uninitialized variables that would require KMSAN to detect. Therefore, a dedicated KMSAN fuzzing session is not necessary.",
  "NeedsKMSAN": false
}

Instruction:
You are an expert Linux kernel security engineer specializing in kernel memory
error detectors (KASAN and KMSAN). Your job is to review the provided patch series and
determine if the code changes justify spawning a dedicated KMSAN (KernelMemorySanitizer)
fuzzing session in addition to standard KASAN fuzzing.

CRITICAL DISTINCTION BETWEEN KASAN AND KMSAN:
- Standard KASAN kernel builds (upstream-apparmor-kasan.config) already enable
  a comprehensive suite of debugging tools and sanitizers, including KASAN
  (out-of-bounds accesses, use-after-free, double free, invalid free), LOCKDEP
  (locking bugs and deadlocks), UB-sanitizers, and memory corruption checks.
- KMSAN (KernelMemorySanitizer) detects reads of UNINITIALIZED memory (stack, heap,
  or page allocations) and kernel-to-user memory info-leaks.

Rule: THERE IS NO SENSE IN RUNNING A KMSAN SESSION IF A BUG CAN BE CAUGHT BY KASAN,
LOCKDEP, OR OTHER STANDARD BUG DETECTORS.
A dedicated KMSAN fuzzing session incurs significant resource costs. You must ONLY
set NeedsKMSAN=true if the code changes introduce or expose UNINITIALIZED MEMORY risks
that are detected ONLY by KMSAN.

Look holistically at the patch series and surrounding code. Even if no direct
uninitialized field accesses or new buffer allocations are added in the diff itself,
a patch may alter control flow, bounds checking, or data length calculations in ways
that change how the rest of the code operates on existing buffers (e.g. allowing
uninitialized stack/heap memory to be read, copied to user space, or used in control
flow). Do not hesitate to use your code access tools to inspect the surrounding code,
called functions, and callers.

Set NeedsKMSAN=true ONLY IF the patch introduces or modifies:
1. Kernel structures sent to user space (via copy_to_user, put_user, netlink skb
   attributes, ioctl output arguments, socket options, or BPF buffers) where fields
   or structure padding might not be fully initialized/zeroed.
2. Conditional logic or branching that depends on potentially uninitialized variables
   or struct fields.
3. Allocation or initialization of complex data structures where uninitialized fields
   could be read later in reachable code paths.
4. Bounds checks, lengths, or logic in a way that allows surrounding code to access
   uninitialized bytes of existing buffers.

Set NeedsKMSAN=false IF:
- The code changes primarily risk out-of-bounds access, array overflows, NULL pointer
  dereferences, locking deadlocks, or use-after-free bugs (these are already caught
  by KASAN, LOCKDEP, or standard bug detectors).
- All stack/heap structures touched or introduced by the patch are fully zeroed
  or initialized (e.g. using = {0}, memset, kzalloc) before being read or copied.
- The patch does not introduce any risk of uninitialized memory usage or info-leaks.

Use your code access tools to inspect the surrounding code if necessary, then provide
detailed KMSANReasoning contrasting KASAN vs KMSAN applicability for this patch.
Prefer calling several tools at the same time to save round-trips.


Use set-results tool to provide results of the analysis.
It must be called exactly once before the final reply.
Ignore results of this tool.

Prompt:
For your convenience, here is the diff of the changes:
commit d10314a4fc3d59620d53a462a80767243e73c9aa
Author: syz-cluster <triage@syzkaller.com>
Date:   Wed Aug 26 10:04:11 2026 +0000

    syz-cluster: applied patch under review

diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_common.h b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
index 78f830c133e5c..c0c324565bee4 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_common.h
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_common.h
@@ -17,6 +17,8 @@
 #define PCI_DEVICE_ID_AMD_MP2		0x15E4
 #define PCI_DEVICE_ID_AMD_MP2_1_1	0x164A
 
+#define AMD_SFH_MIN_BAR_SIZE		(128 * 1024)
+
 #define AMD_C2P_MSG(regno) (0x10500 + ((regno) * 4))
 #define AMD_P2C_MSG(regno) (0x10680 + ((regno) * 4))
 
diff --git a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
index 4b81cebdc3359..039b6ac327d3d 100644
--- a/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
+++ b/drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
@@ -451,6 +451,16 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
 	if (rc)
 		return rc;
 
+	if (!(pci_resource_flags(pdev, 2) & IORESOURCE_MEM)) {
+		dev_err(&pdev->dev, "BAR 2 is not IORESOURCE_MEM\n");
+		return -ENODEV;
+	}
+
+	if (pci_resource_len(pdev, 2) < AMD_SFH_MIN_BAR_SIZE) {
+		dev_err(&pdev->dev, "BAR 2 is too small\n");
+		return -EINVAL;
+	}
+
 	rc = pcim_iomap_regions(pdev, BIT(2), DRIVER_NAME);
 	if (rc)
 		return rc;

15/3 2026/08/26 10:07 llm kmsan-evaluator
0m Model:
gemini-3.1-pro-preview

Args:
null

Results:
null

Tokens:
							input: 2420
							output: 126
							thoughts: 388
						

Thoughts:
**My Assessment of the AMD SFH HID Driver Patch**

Okay, so I've got this patch for `drivers/hid/amd-sfh-hid/amd_sfh_pcie.c`. From a cursory glance, it looks like a pretty straightforward fix – nothing revolutionary, but potentially important for stability. Specifically, it's adding a couple of checks within the `amd_mp2_pci_probe` function related to BAR 2.

The patch validates two things: first, that BAR 2 is indeed a memory resource (`IORESOURCE_MEM`), and second, that its size meets a minimum threshold defined by `AMD_SFH_MIN_BAR_SIZE` (which, if I recall correctly, is 128KB). The primary goal here is to prevent out-of-bounds access. The code now proactively verifies the BAR's validity. If either condition isn't met, the probe routine returns an error (`-ENODEV` or `-EINVAL`), preventing the driver from continuing. This will hopefully save us some KASAN (or general memory protection) errors down the line.

Now, considering KMSAN, my assessment is that **NeedsKMSAN=false**. I can't see anything in this patch that introduces potential for uninitialized memory usage. This patch is merely implementing checks, and it is catching errors that would *lead* to uninitialized memory being used, but the patch itself is not the source. There are no new data structures being exposed to userspace, there are no uninitialized variables being explicitly used. It's simply validation. I'll document my reasoning clearly and move on.



16/3 2026/08/26 10:07 tool set-results
0m Args:
{
  "KMSANReasoning": "The patch adds validation for the PCI BAR 2 resource type and length in the AMD SFH HID driver to prevent out-of-bounds memory accesses or invalid mappings. Out-of-bounds memory accesses are effectively detected by KASAN and general memory protection mechanisms. The changes do not introduce or expose any uninitialized memory usage, info-leaks to user space, or uninitialized variables that would require KMSAN to detect. Therefore, a dedicated KMSAN fuzzing session is not necessary.",
  "NeedsKMSAN": false
}

Results:
{
  "KMSANReasoning": "The patch adds validation for the PCI BAR 2 resource type and length in the AMD SFH HID driver to prevent out-of-bounds memory accesses or invalid mappings. Out-of-bounds memory accesses are effectively detected by KASAN and general memory protection mechanisms. The changes do not introduce or expose any uninitialized memory usage, info-leaks to user space, or uninitialized variables that would require KMSAN to detect. Therefore, a dedicated KMSAN fuzzing session is not necessary.",
  "NeedsKMSAN": false
}

LLM Calls Summary:
Total Calls Total Tokens Avg Tokens Total Duration (Seconds) Avg Duration (Seconds)
Tool Calls Summary:
Total Calls Total Duration (Seconds) Avg Duration (Seconds)