/* * Dummy stubs used when CONFIG_POSIX_TIMERS=n * * Created by: Nicolas Pitre, July 2016 * Copyright: (C) 2016 Linaro Limited * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. */ #include #include #include #include #include #include #include #include asmlinkage long sys_ni_posix_timers(void) { pr_err_once("process %d (%s) attempted a POSIX timer syscall " "while CONFIG_POSIX_TIMERS is not set\n", current->pid, current->comm); return -ENOSYS; } #define SYS_NI(name) SYSCALL_ALIAS(sys_##name, sys_ni_posix_timers) SYS_NI(timer_create); SYS_NI(timer_gettime); SYS_NI(timer_getoverrun); SYS_NI(timer_settime); SYS_NI(timer_delete); SYS_NI(clock_adjtime); SYS_NI(getitimer); SYS_NI(setitimer); #ifdef __ARCH_WANT_SYS_ALARM SYS_NI(alarm); #endif /* * We preserve minimal support for CLOCK_REALTIME and CLOCK_MONOTONIC * as it is easy to remain compatible with little code. CLOCK_BOOTTIME * is also included for convenience as at least systemd uses it. */ SYSCALL_DEFINE2(clock_settime, const clockid_t, which_clock, const struct timespec __user *, tp) { struct timespec new_tp; if (which_clock != CLOCK_REALTIME) return -EINVAL; if (copy_from_user(&new_tp, tp, sizeof (*tp))) return -EFAULT; return do_sys_settimeofday(&new_tp, NULL); } SYSCALL_DEFINE2(clock_gettime, const clockid_t, which_clock, struct timespec __user *,tp) { struct timespec kernel_tp; switch (which_clock) { case CLOCK_REALTIME: ktime_get_real_ts(&kernel_tp); break; case CLOCK_MONOTONIC: ktime_get_ts(&kernel_tp); break; case CLOCK_BOOTTIME: get_monotonic_boottime(&kernel_tp); break; default: return -EINVAL; } if (copy_to_user(tp, &kernel_tp, sizeof (kernel_tp))) return -EFAULT; return 0; } SYSCALL_DEFINE2(clock_getres, const clockid_t, which_clock, struct timespec __user *, tp) { struct timespec rtn_tp = { .tv_sec = 0, .tv_nsec = hrtimer_resolution, }; switch (which_clock) { case CLOCK_REALTIME: case CLOCK_MONOTONIC: case CLOCK_BOOTTIME: if (copy_to_user(tp, &rtn_tp, sizeof(rtn_tp))) return -EFAULT; return 0; default: return -EINVAL; } } SYSCALL_DEFINE4(clock_nanosleep, const clockid_t, which_clock, int, flags, const struct timespec __user *, rqtp, struct timespec __user *, rmtp) { struct timespec t; switch (which_clock) { case CLOCK_REALTIME: case CLOCK_MONOTONIC: case CLOCK_BOOTTIME: if (copy_from_user(&t, rqtp, sizeof (struct timespec))) return -EFAULT; if (!timespec_valid(&t)) return -EINVAL; return hrtimer_nanosleep(&t, rmtp, flags & TIMER_ABSTIME ? HRTIMER_MODE_ABS : HRTIMER_MODE_REL, which_clock); default: return -EINVAL; } } #ifdef CONFIG_COMPAT long clock_nanosleep_restart(struct restart_block *restart_block) { return hrtimer_nanosleep_restart(restart_block); } #endif '/cgit.cgi/linux/net-next.git/commit/include/soc?h=nds-private-remove&id=4e5b54f127426c82dc2816340c26d951a5bb3429'>soc
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2016-12-18 14:35:45 +0100
committerDaniel Vetter <daniel.vetter@ffwll.ch>2017-01-30 10:17:17 +0100
commit4e5b54f127426c82dc2816340c26d951a5bb3429 (patch)
treecc3a8f7e335cf12880bc8d1a1e2066f6cfe0a68e /include/soc
parent566cf877a1fcb6d6dc0126b076aad062054c2637 (diff)
drm: prevent double-(un)registration for connectors
If we're unlucky then the registration from a hotplugged connector might race with the final registration step on driver load. And since MST topology discover is asynchronous that's even somewhat likely. v2: Also update the kerneldoc for @registered! v3: Review from Chris: - Improve kerneldoc for late_register/early_unregister callbacks. - Use mutex_destroy. Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Sean Paul <seanpaul@chromium.org> Reported-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20161218133545.2106-1-daniel.vetter@ffwll.ch (cherry picked from commit e73ab00e9a0f1731f34d0620a9c55f5c30c4ad4e)
Diffstat (limited to 'include/soc')