Re: [PATCH v1 4/4] virt: vmgenid: add support for devicetree bindings

From: kernel test robot
Date: Wed Mar 20 2024 - 21:10:46 EST


Hi Sudan,

kernel test robot noticed the following build errors:

[auto build test ERROR on robh/for-next]
[also build test ERROR on linus/master v6.8 next-20240320]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url: https://github.com/intel-lab-lkp/linux/commits/Sudan-Landge/virt-vmgenid-rearrange-code-to-make-review-easier/20240319-223642
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
patch link: https://lore.kernel.org/r/20240319143253.22317-5-sudanl%40amazon.com
patch subject: [PATCH v1 4/4] virt: vmgenid: add support for devicetree bindings
config: alpha-allyesconfig (https://download.01.org/0day-ci/archive/20240321/202403210806.pMEGAp0x-lkp@xxxxxxxxx/config)
compiler: alpha-linux-gcc (GCC) 13.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240321/202403210806.pMEGAp0x-lkp@xxxxxxxxx/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202403210806.pMEGAp0x-lkp@xxxxxxxxx/

All errors (new ones prefixed by >>):

drivers/virt/vmgenid.c: In function 'vmgenid_add_acpi':
>> drivers/virt/vmgenid.c:79:45: error: invalid use of undefined type 'struct acpi_device'
79 | status = acpi_evaluate_object(device->handle, "ADDR", NULL, &parsed);
| ^~
drivers/virt/vmgenid.c:96:56: error: invalid use of undefined type 'struct acpi_device'
96 | devm_memremap(&device->dev, phys_addr, VMGENID_SIZE, MEMREMAP_WB)
| ^~
drivers/virt/vmgenid.c:102:52: error: invalid use of undefined type 'struct acpi_device'
102 | status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
| ^~
drivers/virt/vmgenid.c: At top level:
drivers/virt/vmgenid.c:196:36: warning: 'vmgenid_acpi_ids' defined but not used [-Wunused-const-variable=]
196 | static const struct acpi_device_id vmgenid_acpi_ids[] = {
| ^~~~~~~~~~~~~~~~


vim +79 drivers/virt/vmgenid.c

657fab4d1001e1 Sudan Landge 2024-03-19 69
657fab4d1001e1 Sudan Landge 2024-03-19 70 static int vmgenid_add_acpi(struct device *dev, struct vmgenid_state *state)
657fab4d1001e1 Sudan Landge 2024-03-19 71 {
657fab4d1001e1 Sudan Landge 2024-03-19 72 struct acpi_device *device = ACPI_COMPANION(dev);
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 73 struct acpi_buffer parsed = { ACPI_ALLOCATE_BUFFER };
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 74 union acpi_object *obj;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 75 phys_addr_t phys_addr;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 76 acpi_status status;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 77 int ret = 0;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 78
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 @79 status = acpi_evaluate_object(device->handle, "ADDR", NULL, &parsed);
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 80 if (ACPI_FAILURE(status)) {
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 81 ACPI_EXCEPTION((AE_INFO, status, "Evaluating ADDR"));
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 82 return -ENODEV;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 83 }
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 84 obj = parsed.pointer;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 85 if (!obj || obj->type != ACPI_TYPE_PACKAGE || obj->package.count != 2 ||
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 86 obj->package.elements[0].type != ACPI_TYPE_INTEGER ||
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 87 obj->package.elements[1].type != ACPI_TYPE_INTEGER) {
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 88 ret = -EINVAL;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 89 goto out;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 90 }
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 91
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 92 phys_addr = (obj->package.elements[0].integer.value << 0) |
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 93 (obj->package.elements[1].integer.value << 32);
657fab4d1001e1 Sudan Landge 2024-03-19 94
657fab4d1001e1 Sudan Landge 2024-03-19 95 ret = setup_vmgenid_state(state,
657fab4d1001e1 Sudan Landge 2024-03-19 96 devm_memremap(&device->dev, phys_addr, VMGENID_SIZE, MEMREMAP_WB)
657fab4d1001e1 Sudan Landge 2024-03-19 97 );
657fab4d1001e1 Sudan Landge 2024-03-19 98 if (ret)
657fab4d1001e1 Sudan Landge 2024-03-19 99 goto out;
657fab4d1001e1 Sudan Landge 2024-03-19 100
657fab4d1001e1 Sudan Landge 2024-03-19 101 dev->driver_data = state;
657fab4d1001e1 Sudan Landge 2024-03-19 102 status = acpi_install_notify_handler(device->handle, ACPI_DEVICE_NOTIFY,
657fab4d1001e1 Sudan Landge 2024-03-19 103 vmgenid_acpi_handler, dev);
657fab4d1001e1 Sudan Landge 2024-03-19 104 if (ACPI_FAILURE(status)) {
657fab4d1001e1 Sudan Landge 2024-03-19 105 dev_err(dev, "Failed to install acpi notify handler");
657fab4d1001e1 Sudan Landge 2024-03-19 106 ret = -ENODEV;
657fab4d1001e1 Sudan Landge 2024-03-19 107 dev->driver_data = NULL;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 108 goto out;
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 109 }
657fab4d1001e1 Sudan Landge 2024-03-19 110 out:
657fab4d1001e1 Sudan Landge 2024-03-19 111 ACPI_FREE(parsed.pointer);
657fab4d1001e1 Sudan Landge 2024-03-19 112 return ret;
657fab4d1001e1 Sudan Landge 2024-03-19 113 }
af6b54e2b5baa5 Jason A. Donenfeld 2022-02-23 114

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki