Re: [PATCH v2 2/5] platform: surface: Propagate ACPI Dependency

From: kernel test robot
Date: Thu Nov 11 2021 - 14:45:59 EST


Hi Jarrett,

I love your patch! Yet something to improve:

[auto build test ERROR on robh/for-next]
[also build test ERROR on platform-drivers-x86/for-next linus/master v5.15 next-20211111]
[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]

url: https://github.com/0day-ci/linux/commits/Jarrett-Schultz/platform-surface-Introduce-Surface-XBL-Driver/20211109-004605
base: https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git for-next
config: arc-allyesconfig (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/0day-ci/linux/commit/6cc91cd949ff1d32a3f6b323d055b1925627be02
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Jarrett-Schultz/platform-surface-Introduce-Surface-XBL-Driver/20211109-004605
git checkout 6cc91cd949ff1d32a3f6b323d055b1925627be02
# save the attached .config to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All errors (new ones prefixed by >>):

drivers/platform/surface/aggregator/core.c: In function 'ssam_serial_hub_probe':
>> drivers/platform/surface/aggregator/core.c:648:49: error: invalid use of undefined type 'struct acpi_device'
648 | astatus = ssam_serdev_setup_via_acpi(ssh->handle, serdev);
| ^~
>> drivers/platform/surface/aggregator/core.c:702:9: error: implicit declaration of function 'acpi_dev_clear_dependencies' [-Werror=implicit-function-declaration]
702 | acpi_dev_clear_dependencies(ssh);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from include/linux/perf_event.h:25,
from include/linux/trace_events.h:10,
from include/trace/trace_events.h:21,
from include/trace/define_trace.h:102,
from drivers/platform/surface/aggregator/trace.h:632,
from drivers/platform/surface/aggregator/core.c:30:
At top level:
arch/arc/include/asm/perf_event.h:126:27: error: 'arc_pmu_cache_map' defined but not used [-Werror=unused-const-variable=]
126 | static const unsigned int arc_pmu_cache_map[C(MAX)][C(OP_MAX)][C(RESULT_MAX)] = {
| ^~~~~~~~~~~~~~~~~
arch/arc/include/asm/perf_event.h:91:27: error: 'arc_pmu_ev_hw_map' defined but not used [-Werror=unused-const-variable=]
91 | static const char * const arc_pmu_ev_hw_map[] = {
| ^~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
--
drivers/platform/surface/aggregator/controller.c: In function 'ssam_dsm_get_functions':
>> drivers/platform/surface/aggregator/controller.c:1044:14: error: implicit declaration of function 'acpi_has_method'; did you mean 'acpi_has_watchdog'? [-Werror=implicit-function-declaration]
1044 | if (!acpi_has_method(handle, "_DSM"))
| ^~~~~~~~~~~~~~~
| acpi_has_watchdog
>> drivers/platform/surface/aggregator/controller.c:1047:15: error: implicit declaration of function 'acpi_evaluate_dsm_typed'; did you mean 'acpi_evaluate_dsm'? [-Werror=implicit-function-declaration]
1047 | obj = acpi_evaluate_dsm_typed(handle, &SSAM_SSH_DSM_GUID,
| ^~~~~~~~~~~~~~~~~~~~~~~
| acpi_evaluate_dsm
>> drivers/platform/surface/aggregator/controller.c:1047:13: error: assignment to 'union acpi_object *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
1047 | obj = acpi_evaluate_dsm_typed(handle, &SSAM_SSH_DSM_GUID,
| ^
drivers/platform/surface/aggregator/controller.c: In function 'ssam_dsm_load_u32':
drivers/platform/surface/aggregator/controller.c:1071:13: error: assignment to 'union acpi_object *' from 'int' makes pointer from integer without a cast [-Werror=int-conversion]
1071 | obj = acpi_evaluate_dsm_typed(handle, &SSAM_SSH_DSM_GUID,
| ^
cc1: all warnings being treated as errors


vim +648 drivers/platform/surface/aggregator/core.c

c167b9c7e3d613 Maximilian Luz 2020-12-21 614
c167b9c7e3d613 Maximilian Luz 2020-12-21 615 static int ssam_serial_hub_probe(struct serdev_device *serdev)
c167b9c7e3d613 Maximilian Luz 2020-12-21 616 {
a9e10e58730432 Daniel Scally 2021-06-03 617 struct acpi_device *ssh = ACPI_COMPANION(&serdev->dev);
c167b9c7e3d613 Maximilian Luz 2020-12-21 618 struct ssam_controller *ctrl;
c167b9c7e3d613 Maximilian Luz 2020-12-21 619 acpi_status astatus;
c167b9c7e3d613 Maximilian Luz 2020-12-21 620 int status;
c167b9c7e3d613 Maximilian Luz 2020-12-21 621
c167b9c7e3d613 Maximilian Luz 2020-12-21 622 if (gpiod_count(&serdev->dev, NULL) < 0)
c167b9c7e3d613 Maximilian Luz 2020-12-21 623 return -ENODEV;
c167b9c7e3d613 Maximilian Luz 2020-12-21 624
c167b9c7e3d613 Maximilian Luz 2020-12-21 625 status = devm_acpi_dev_add_driver_gpios(&serdev->dev, ssam_acpi_gpios);
c167b9c7e3d613 Maximilian Luz 2020-12-21 626 if (status)
c167b9c7e3d613 Maximilian Luz 2020-12-21 627 return status;
c167b9c7e3d613 Maximilian Luz 2020-12-21 628
c167b9c7e3d613 Maximilian Luz 2020-12-21 629 /* Allocate controller. */
c167b9c7e3d613 Maximilian Luz 2020-12-21 630 ctrl = kzalloc(sizeof(*ctrl), GFP_KERNEL);
c167b9c7e3d613 Maximilian Luz 2020-12-21 631 if (!ctrl)
c167b9c7e3d613 Maximilian Luz 2020-12-21 632 return -ENOMEM;
c167b9c7e3d613 Maximilian Luz 2020-12-21 633
c167b9c7e3d613 Maximilian Luz 2020-12-21 634 /* Initialize controller. */
c167b9c7e3d613 Maximilian Luz 2020-12-21 635 status = ssam_controller_init(ctrl, serdev);
c167b9c7e3d613 Maximilian Luz 2020-12-21 636 if (status)
c167b9c7e3d613 Maximilian Luz 2020-12-21 637 goto err_ctrl_init;
c167b9c7e3d613 Maximilian Luz 2020-12-21 638
c167b9c7e3d613 Maximilian Luz 2020-12-21 639 ssam_controller_lock(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 640
c167b9c7e3d613 Maximilian Luz 2020-12-21 641 /* Set up serdev device. */
c167b9c7e3d613 Maximilian Luz 2020-12-21 642 serdev_device_set_drvdata(serdev, ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 643 serdev_device_set_client_ops(serdev, &ssam_serdev_ops);
c167b9c7e3d613 Maximilian Luz 2020-12-21 644 status = serdev_device_open(serdev);
c167b9c7e3d613 Maximilian Luz 2020-12-21 645 if (status)
c167b9c7e3d613 Maximilian Luz 2020-12-21 646 goto err_devopen;
c167b9c7e3d613 Maximilian Luz 2020-12-21 647
a9e10e58730432 Daniel Scally 2021-06-03 @648 astatus = ssam_serdev_setup_via_acpi(ssh->handle, serdev);
c167b9c7e3d613 Maximilian Luz 2020-12-21 649 if (ACPI_FAILURE(astatus)) {
c167b9c7e3d613 Maximilian Luz 2020-12-21 650 status = -ENXIO;
c167b9c7e3d613 Maximilian Luz 2020-12-21 651 goto err_devinit;
c167b9c7e3d613 Maximilian Luz 2020-12-21 652 }
c167b9c7e3d613 Maximilian Luz 2020-12-21 653
c167b9c7e3d613 Maximilian Luz 2020-12-21 654 /* Start controller. */
c167b9c7e3d613 Maximilian Luz 2020-12-21 655 status = ssam_controller_start(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 656 if (status)
c167b9c7e3d613 Maximilian Luz 2020-12-21 657 goto err_devinit;
c167b9c7e3d613 Maximilian Luz 2020-12-21 658
c167b9c7e3d613 Maximilian Luz 2020-12-21 659 ssam_controller_unlock(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 660
c167b9c7e3d613 Maximilian Luz 2020-12-21 661 /*
c167b9c7e3d613 Maximilian Luz 2020-12-21 662 * Initial SAM requests: Log version and notify default/init power
c167b9c7e3d613 Maximilian Luz 2020-12-21 663 * states.
c167b9c7e3d613 Maximilian Luz 2020-12-21 664 */
c167b9c7e3d613 Maximilian Luz 2020-12-21 665 status = ssam_log_firmware_version(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 666 if (status)
c167b9c7e3d613 Maximilian Luz 2020-12-21 667 goto err_initrq;
c167b9c7e3d613 Maximilian Luz 2020-12-21 668
c167b9c7e3d613 Maximilian Luz 2020-12-21 669 status = ssam_ctrl_notif_d0_entry(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 670 if (status)
c167b9c7e3d613 Maximilian Luz 2020-12-21 671 goto err_initrq;
c167b9c7e3d613 Maximilian Luz 2020-12-21 672
c167b9c7e3d613 Maximilian Luz 2020-12-21 673 status = ssam_ctrl_notif_display_on(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 674 if (status)
c167b9c7e3d613 Maximilian Luz 2020-12-21 675 goto err_initrq;
c167b9c7e3d613 Maximilian Luz 2020-12-21 676
c167b9c7e3d613 Maximilian Luz 2020-12-21 677 status = sysfs_create_group(&serdev->dev.kobj, &ssam_sam_group);
c167b9c7e3d613 Maximilian Luz 2020-12-21 678 if (status)
c167b9c7e3d613 Maximilian Luz 2020-12-21 679 goto err_initrq;
c167b9c7e3d613 Maximilian Luz 2020-12-21 680
c167b9c7e3d613 Maximilian Luz 2020-12-21 681 /* Set up IRQ. */
c167b9c7e3d613 Maximilian Luz 2020-12-21 682 status = ssam_irq_setup(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 683 if (status)
c167b9c7e3d613 Maximilian Luz 2020-12-21 684 goto err_irq;
c167b9c7e3d613 Maximilian Luz 2020-12-21 685
c167b9c7e3d613 Maximilian Luz 2020-12-21 686 /* Finally, set main controller reference. */
c167b9c7e3d613 Maximilian Luz 2020-12-21 687 status = ssam_try_set_controller(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 688 if (WARN_ON(status)) /* Currently, we're the only provider. */
c167b9c7e3d613 Maximilian Luz 2020-12-21 689 goto err_mainref;
c167b9c7e3d613 Maximilian Luz 2020-12-21 690
c167b9c7e3d613 Maximilian Luz 2020-12-21 691 /*
c167b9c7e3d613 Maximilian Luz 2020-12-21 692 * TODO: The EC can wake up the system via the associated GPIO interrupt
c167b9c7e3d613 Maximilian Luz 2020-12-21 693 * in multiple situations. One of which is the remaining battery
c167b9c7e3d613 Maximilian Luz 2020-12-21 694 * capacity falling below a certain threshold. Normally, we should
c167b9c7e3d613 Maximilian Luz 2020-12-21 695 * use the device_init_wakeup function, however, the EC also seems
c167b9c7e3d613 Maximilian Luz 2020-12-21 696 * to have other reasons for waking up the system and it seems
c167b9c7e3d613 Maximilian Luz 2020-12-21 697 * that Windows has additional checks whether the system should be
c167b9c7e3d613 Maximilian Luz 2020-12-21 698 * resumed. In short, this causes some spurious unwanted wake-ups.
c167b9c7e3d613 Maximilian Luz 2020-12-21 699 * For now let's thus default power/wakeup to false.
c167b9c7e3d613 Maximilian Luz 2020-12-21 700 */
c167b9c7e3d613 Maximilian Luz 2020-12-21 701 device_set_wakeup_capable(&serdev->dev, true);
a9e10e58730432 Daniel Scally 2021-06-03 @702 acpi_dev_clear_dependencies(ssh);
c167b9c7e3d613 Maximilian Luz 2020-12-21 703
c167b9c7e3d613 Maximilian Luz 2020-12-21 704 return 0;
c167b9c7e3d613 Maximilian Luz 2020-12-21 705
c167b9c7e3d613 Maximilian Luz 2020-12-21 706 err_mainref:
c167b9c7e3d613 Maximilian Luz 2020-12-21 707 ssam_irq_free(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 708 err_irq:
c167b9c7e3d613 Maximilian Luz 2020-12-21 709 sysfs_remove_group(&serdev->dev.kobj, &ssam_sam_group);
c167b9c7e3d613 Maximilian Luz 2020-12-21 710 err_initrq:
c167b9c7e3d613 Maximilian Luz 2020-12-21 711 ssam_controller_lock(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 712 ssam_controller_shutdown(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 713 err_devinit:
c167b9c7e3d613 Maximilian Luz 2020-12-21 714 serdev_device_close(serdev);
c167b9c7e3d613 Maximilian Luz 2020-12-21 715 err_devopen:
c167b9c7e3d613 Maximilian Luz 2020-12-21 716 ssam_controller_destroy(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 717 ssam_controller_unlock(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 718 err_ctrl_init:
c167b9c7e3d613 Maximilian Luz 2020-12-21 719 kfree(ctrl);
c167b9c7e3d613 Maximilian Luz 2020-12-21 720 return status;
c167b9c7e3d613 Maximilian Luz 2020-12-21 721 }
c167b9c7e3d613 Maximilian Luz 2020-12-21 722

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip