Re: [PATCH RT 2/2] watchdog, rt: prevent deferral of watchdogd wakeup
From: kbuild test robot
Date: Fri Sep 28 2018 - 18:38:36 EST
Hi Julia,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on linus/master]
[also build test ERROR on v4.19-rc5 next-20180928]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Julia-Cartwright/kthread-convert-worker-lock-to-raw-spinlock/20180929-052522
config: i386-randconfig-x008-201838 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
drivers//watchdog/watchdog_dev.c: In function 'watchdog_cdev_register':
>> drivers//watchdog/watchdog_dev.c:948:49: error: 'HRTIMER_MODE_REL_HARD' undeclared (first use in this function); did you mean 'HRTIMER_MODE_REL_SOFT'?
hrtimer_init(&wd_data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
^~~~~~~~~~~~~~~~~~~~~
HRTIMER_MODE_REL_SOFT
drivers//watchdog/watchdog_dev.c:948:49: note: each undeclared identifier is reported only once for each function it appears in
vim +948 drivers//watchdog/watchdog_dev.c
919
920 /*
921 * watchdog_cdev_register: register watchdog character device
922 * @wdd: watchdog device
923 * @devno: character device number
924 *
925 * Register a watchdog character device including handling the legacy
926 * /dev/watchdog node. /dev/watchdog is actually a miscdevice and
927 * thus we set it up like that.
928 */
929
930 static int watchdog_cdev_register(struct watchdog_device *wdd, dev_t devno)
931 {
932 struct watchdog_core_data *wd_data;
933 int err;
934
935 wd_data = kzalloc(sizeof(struct watchdog_core_data), GFP_KERNEL);
936 if (!wd_data)
937 return -ENOMEM;
938 kref_init(&wd_data->kref);
939 mutex_init(&wd_data->lock);
940
941 wd_data->wdd = wdd;
942 wdd->wd_data = wd_data;
943
944 if (IS_ERR_OR_NULL(watchdog_kworker))
945 return -ENODEV;
946
947 kthread_init_work(&wd_data->work, watchdog_ping_work);
> 948 hrtimer_init(&wd_data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD);
949 wd_data->timer.function = watchdog_timer_expired;
950
951 if (wdd->id == 0) {
952 old_wd_data = wd_data;
953 watchdog_miscdev.parent = wdd->parent;
954 err = misc_register(&watchdog_miscdev);
955 if (err != 0) {
956 pr_err("%s: cannot register miscdev on minor=%d (err=%d).\n",
957 wdd->info->identity, WATCHDOG_MINOR, err);
958 if (err == -EBUSY)
959 pr_err("%s: a legacy watchdog module is probably present.\n",
960 wdd->info->identity);
961 old_wd_data = NULL;
962 kfree(wd_data);
963 return err;
964 }
965 }
966
967 /* Fill in the data structures */
968 cdev_init(&wd_data->cdev, &watchdog_fops);
969 wd_data->cdev.owner = wdd->ops->owner;
970
971 /* Add the device */
972 err = cdev_add(&wd_data->cdev, devno, 1);
973 if (err) {
974 pr_err("watchdog%d unable to add device %d:%d\n",
975 wdd->id, MAJOR(watchdog_devt), wdd->id);
976 if (wdd->id == 0) {
977 misc_deregister(&watchdog_miscdev);
978 old_wd_data = NULL;
979 kref_put(&wd_data->kref, watchdog_core_data_release);
980 }
981 return err;
982 }
983
984 /* Record time of most recent heartbeat as 'just before now'. */
985 wd_data->last_hw_keepalive = ktime_sub(ktime_get(), 1);
986
987 /*
988 * If the watchdog is running, prevent its driver from being unloaded,
989 * and schedule an immediate ping.
990 */
991 if (watchdog_hw_running(wdd)) {
992 __module_get(wdd->ops->owner);
993 kref_get(&wd_data->kref);
994 if (handle_boot_enabled)
995 hrtimer_start(&wd_data->timer, 0, HRTIMER_MODE_REL);
996 else
997 pr_info("watchdog%d running and kernel based pre-userspace handler disabled\n",
998 wdd->id);
999 }
1000
1001 return 0;
1002 }
1003
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip