Dave Airlie (2): drm/omap: drop the !FB_OMAP2 dep Revert "drm: kms_helper: don't lose hotplug event" Sedat Dilek (10): kbuild: deb-pkg: Try to determine distribution kbuild: deb-pkg: Bump year in debian/copyright file kbuild: deb-pkg: Update git repository URL in debian/copyright file Merge tag 'next-20130628' of git://git.kernel.org/.../next/linux-next into Linux-Next-v20130628 Revert "fix warnings from ?: operator in wait.h" Revert "wait: introduce prepare_to_wait_event()" Revert "wait: introduce wait_event_common(wq, condition, state, timeout)" Merge branch 'deb-pkg-3.10-fixes' into 3.10.0-rc7-next20130628-7-iniza-small Merge branch 'drm-next-fixes' into 3.10.0-rc7-next20130628-7-iniza-small Merge branch 'revert-wait.h-next20130628' into 3.10.0-rc7-next20130628-7-iniza-small arch/mips/kernel/rtlx.c | 17 ++-- drivers/gpu/drm/drm_crtc_helper.c | 32 +------ drivers/gpu/drm/omapdrm/Kconfig | 2 +- include/drm/drm_crtc.h | 1 - include/linux/wait.h | 193 ++++++++++++++++++++++---------------- kernel/wait.c | 13 --- net/irda/af_irda.c | 5 +- net/netfilter/ipvs/ip_vs_sync.c | 5 +- scripts/package/builddeb | 19 +++- 9 files changed, 146 insertions(+), 141 deletions(-) diff --git a/arch/mips/kernel/rtlx.c b/arch/mips/kernel/rtlx.c index 580d8b6..d763f11 100644 --- a/arch/mips/kernel/rtlx.c +++ b/arch/mips/kernel/rtlx.c @@ -172,8 +172,8 @@ int rtlx_open(int index, int can_sleep) if (rtlx == NULL) { if( (p = vpe_get_shared(tclimit)) == NULL) { if (can_sleep) { - ret = __wait_event_interruptible(channel_wqs[index].lx_queue, - (p = vpe_get_shared(tclimit))); + __wait_event_interruptible(channel_wqs[index].lx_queue, + (p = vpe_get_shared(tclimit)), ret); if (ret) goto out_fail; } else { @@ -263,11 +263,11 @@ unsigned int rtlx_read_poll(int index, int can_sleep) /* data available to read? */ if (chan->lx_read == chan->lx_write) { if (can_sleep) { - int ret; + int ret = 0; - ret = __wait_event_interruptible(channel_wqs[index].lx_queue, + __wait_event_interruptible(channel_wqs[index].lx_queue, (chan->lx_read != chan->lx_write) || - sp_stopping); + sp_stopping, ret); if (ret) return ret; @@ -440,13 +440,14 @@ static ssize_t file_write(struct file *file, const char __user * buffer, /* any space left... */ if (!rtlx_write_poll(minor)) { - int ret; + int ret = 0; if (file->f_flags & O_NONBLOCK) return -EAGAIN; - ret = __wait_event_interruptible(channel_wqs[minor].rt_queue, - rtlx_write_poll(minor)); + __wait_event_interruptible(channel_wqs[minor].rt_queue, + rtlx_write_poll(minor), + ret); if (ret) return ret; } diff --git a/drivers/gpu/drm/drm_crtc_helper.c b/drivers/gpu/drm/drm_crtc_helper.c index f6829ba..738a429 100644 --- a/drivers/gpu/drm/drm_crtc_helper.c +++ b/drivers/gpu/drm/drm_crtc_helper.c @@ -122,7 +122,6 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, int count = 0; int mode_flags = 0; bool verbose_prune = true; - enum drm_connector_status old_status; DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, drm_get_connector_name(connector)); @@ -138,32 +137,7 @@ int drm_helper_probe_single_connector_modes(struct drm_connector *connector, if (connector->funcs->force) connector->funcs->force(connector); } else { - old_status = connector->status; - connector->status = connector->funcs->detect(connector, true); - - /* - * Normally either the driver's hpd code or the poll loop should - * pick up any changes and fire the hotplug event. But if - * userspace sneaks in a probe, we might miss a change. Hence - * check here, and if anything changed start the hotplug code. - */ - if (old_status != connector->status) { - DRM_DEBUG_KMS("[CONNECTOR:%d:%s] status updated from %d to %d\n", - connector->base.id, - drm_get_connector_name(connector), - old_status, connector->status); - - /* - * The hotplug event code might call into the fb - * helpers, and so expects that we do not hold any - * locks. Fire up the poll struct instead, it will - * disable itself again. - */ - dev->mode_config.delayed_event = true; - schedule_delayed_work(&dev->mode_config.output_poll_work, - 0); - } } /* Re-enable polling in case the global poll config changed. */ @@ -1011,11 +985,7 @@ static void output_poll_execute(struct work_struct *work) struct drm_device *dev = container_of(delayed_work, struct drm_device, mode_config.output_poll_work); struct drm_connector *connector; enum drm_connector_status old_status; - bool repoll = false, changed; - - /* Pick up any changes detected by the probe functions. */ - changed = dev->mode_config.delayed_event; - dev->mode_config.delayed_event = false; + bool repoll = false, changed = false; if (!drm_kms_helper_poll) return; diff --git a/drivers/gpu/drm/omapdrm/Kconfig b/drivers/gpu/drm/omapdrm/Kconfig index 45875a0..20c41e7 100644 --- a/drivers/gpu/drm/omapdrm/Kconfig +++ b/drivers/gpu/drm/omapdrm/Kconfig @@ -1,7 +1,7 @@ config DRM_OMAP tristate "OMAP DRM" - depends on DRM && !FB_OMAP2 + depends on DRM depends on ARCH_OMAP2PLUS || ARCH_MULTIPLATFORM depends on OMAP2_DSS select DRM_KMS_HELPER diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index 663c3ab..fa12a2f 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h @@ -811,7 +811,6 @@ struct drm_mode_config { /* output poll support */ bool poll_enabled; bool poll_running; - bool delayed_event; struct delayed_work output_poll_work; /* pointers to standard properties */ diff --git a/include/linux/wait.h b/include/linux/wait.h index f3b793d..f487a47 100644 --- a/include/linux/wait.h +++ b/include/linux/wait.h @@ -179,61 +179,18 @@ wait_queue_head_t *bit_waitqueue(void *, int); #define wake_up_interruptible_sync_poll(x, m) \ __wake_up_sync_key((x), TASK_INTERRUPTIBLE, 1, (void *) (m)) -#define __wait_no_timeout(tout) \ - (__builtin_constant_p(tout) && (tout) == MAX_SCHEDULE_TIMEOUT) - -#define __wait_interruptible(state) \ - (!__builtin_constant_p(state) || \ - state == TASK_INTERRUPTIBLE || state == TASK_KILLABLE) - -#define __wait_event_common(wq, condition, state, tout) \ -({ \ - long __ret, __tout = tout; \ - wait_queue_t __wait; \ - \ - INIT_LIST_HEAD(&__wait.task_list); \ - __wait.flags = 0; \ +#define __wait_event(wq, condition) \ +do { \ + DEFINE_WAIT(__wait); \ \ for (;;) { \ - __ret = prepare_to_wait_event(&wq, &__wait, state); \ - if (condition) { \ - __ret = __wait_no_timeout(tout); \ - if (!__ret) { \ - __ret = __tout; \ - if (!__ret) \ - __ret = 1; \ - } \ - break; \ - } \ - \ - if (__wait_interruptible(state) && __ret) \ - break; \ - \ - if (__wait_no_timeout(tout)) \ - schedule(); \ - else if (__tout) \ - __tout = schedule_timeout(__tout); \ - else \ + prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ + if (condition) \ break; \ + schedule(); \ } \ finish_wait(&wq, &__wait); \ - __ret; \ -}) - -#define wait_event_common(wq, condition, state, tout) \ -({ \ - long __ret; \ - if (condition) { \ - __ret = __wait_no_timeout(tout); \ - if (!__ret) { \ - __ret = (tout); \ - if (!__ret) \ - __ret = 1; \ - } \ - } else \ - __ret = __wait_event_common(wq, condition, state, tout);\ - __ret; \ -}) +} while (0) /** * wait_event - sleep until a condition gets true @@ -247,13 +204,29 @@ wait_queue_head_t *bit_waitqueue(void *, int); * wake_up() has to be called after changing any variable that could * change the result of the wait condition. */ -#define __wait_event(wq, condition) \ - __wait_event_common(wq, condition, \ - TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT) \ +#define wait_event(wq, condition) \ +do { \ + if (condition) \ + break; \ + __wait_event(wq, condition); \ +} while (0) -#define wait_event(wq, condition) \ - wait_event_common(wq, condition, \ - TASK_UNINTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT) \ +#define __wait_event_timeout(wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_UNINTERRUPTIBLE); \ + if (condition) \ + break; \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + } \ + if (!ret && (condition)) \ + ret = 1; \ + finish_wait(&wq, &__wait); \ +} while (0) /** * wait_event_timeout - sleep until a condition gets true or a timeout elapses @@ -272,13 +245,31 @@ wait_queue_head_t *bit_waitqueue(void *, int); * jiffies (at least 1) if the @condition evaluated to %true before * the @timeout elapsed. */ -#define __wait_event_timeout(wq, condition, timeout) \ - __wait_event_common(wq, condition, \ - TASK_UNINTERRUPTIBLE, timeout) - #define wait_event_timeout(wq, condition, timeout) \ - wait_event_common(wq, condition, \ - TASK_UNINTERRUPTIBLE, timeout) +({ \ + long __ret = timeout; \ + if (!(condition)) \ + __wait_event_timeout(wq, condition, __ret); \ + __ret; \ +}) + +#define __wait_event_interruptible(wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + schedule(); \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + finish_wait(&wq, &__wait); \ +} while (0) /** * wait_event_interruptible - sleep until a condition gets true @@ -295,13 +286,35 @@ wait_queue_head_t *bit_waitqueue(void *, int); * The function will return -ERESTARTSYS if it was interrupted by a * signal and 0 if @condition evaluated to true. */ -#define __wait_event_interruptible(wq, condition) \ - __wait_event_common(wq, condition, \ - TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT) - #define wait_event_interruptible(wq, condition) \ - wait_event_common(wq, condition, \ - TASK_INTERRUPTIBLE, MAX_SCHEDULE_TIMEOUT) +({ \ + int __ret = 0; \ + if (!(condition)) \ + __wait_event_interruptible(wq, condition, __ret); \ + __ret; \ +}) + +#define __wait_event_interruptible_timeout(wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_INTERRUPTIBLE); \ + if (condition) \ + break; \ + if (!signal_pending(current)) { \ + ret = schedule_timeout(ret); \ + if (!ret) \ + break; \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + if (!ret && (condition)) \ + ret = 1; \ + finish_wait(&wq, &__wait); \ +} while (0) /** * wait_event_interruptible_timeout - sleep until a condition gets true or a timeout elapses @@ -321,13 +334,13 @@ wait_queue_head_t *bit_waitqueue(void *, int); * a signal, or the remaining jiffies (at least 1) if the @condition * evaluated to %true before the @timeout elapsed. */ -#define __wait_event_interruptible_timeout(wq, condition, timeout) \ - __wait_event_common(wq, condition, \ - TASK_INTERRUPTIBLE, timeout) - #define wait_event_interruptible_timeout(wq, condition, timeout) \ - wait_event_common(wq, condition, \ - TASK_INTERRUPTIBLE, timeout) +({ \ + long __ret = timeout; \ + if (!(condition)) \ + __wait_event_interruptible_timeout(wq, condition, __ret); \ + __ret; \ +}) #define __wait_event_hrtimeout(wq, condition, timeout, state) \ ({ \ @@ -594,6 +607,24 @@ do { \ +#define __wait_event_killable(wq, condition, ret) \ +do { \ + DEFINE_WAIT(__wait); \ + \ + for (;;) { \ + prepare_to_wait(&wq, &__wait, TASK_KILLABLE); \ + if (condition) \ + break; \ + if (!fatal_signal_pending(current)) { \ + schedule(); \ + continue; \ + } \ + ret = -ERESTARTSYS; \ + break; \ + } \ + finish_wait(&wq, &__wait); \ +} while (0) + /** * wait_event_killable - sleep until a condition gets true * @wq: the waitqueue to wait on @@ -609,13 +640,14 @@ do { \ * The function will return -ERESTARTSYS if it was interrupted by a * signal and 0 if @condition evaluated to true. */ -#define __wait_event_killable(wq, condition) \ - __wait_event_common(wq, condition, \ - TASK_KILLABLE, MAX_SCHEDULE_TIMEOUT) - #define wait_event_killable(wq, condition) \ - wait_event_common(wq, condition, \ - TASK_KILLABLE, MAX_SCHEDULE_TIMEOUT) +({ \ + int __ret = 0; \ + if (!(condition)) \ + __wait_event_killable(wq, condition, __ret); \ + __ret; \ +}) + #define __wait_event_lock_irq(wq, condition, lock, cmd) \ do { \ @@ -796,7 +828,6 @@ extern long interruptible_sleep_on_timeout(wait_queue_head_t *q, * Waitqueues which are removed from the waitqueue_head at wakeup time */ void prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state); -int prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state); void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state); void finish_wait(wait_queue_head_t *q, wait_queue_t *wait); void abort_exclusive_wait(wait_queue_head_t *q, wait_queue_t *wait, diff --git a/kernel/wait.c b/kernel/wait.c index 69f195f..ce0daa3 100644 --- a/kernel/wait.c +++ b/kernel/wait.c @@ -78,19 +78,6 @@ prepare_to_wait(wait_queue_head_t *q, wait_queue_t *wait, int state) } EXPORT_SYMBOL(prepare_to_wait); -int prepare_to_wait_event(wait_queue_head_t *q, wait_queue_t *wait, int state) -{ - if (signal_pending_state(state, current)) - return -ERESTARTSYS; - - wait->private = current; - wait->func = autoremove_wake_function; - prepare_to_wait(q, wait, state); - - return 0; -} -EXPORT_SYMBOL(prepare_to_wait_event); - void prepare_to_wait_exclusive(wait_queue_head_t *q, wait_queue_t *wait, int state) { diff --git a/net/irda/af_irda.c b/net/irda/af_irda.c index 0f67690..0578d4f 100644 --- a/net/irda/af_irda.c +++ b/net/irda/af_irda.c @@ -2563,8 +2563,9 @@ bed: jiffies + msecs_to_jiffies(val)); /* Wait for IR-LMP to call us back */ - err = __wait_event_interruptible(self->query_wait, - (self->cachedaddr != 0 || self->errno == -ETIME)); + __wait_event_interruptible(self->query_wait, + (self->cachedaddr != 0 || self->errno == -ETIME), + err); /* If watchdog is still activated, kill it! */ del_timer(&(self->watchdog)); diff --git a/net/netfilter/ipvs/ip_vs_sync.c b/net/netfilter/ipvs/ip_vs_sync.c index ce4239e..f6046d9 100644 --- a/net/netfilter/ipvs/ip_vs_sync.c +++ b/net/netfilter/ipvs/ip_vs_sync.c @@ -1624,9 +1624,12 @@ static int sync_thread_master(void *data) continue; } while (ip_vs_send_sync_msg(tinfo->sock, sb->mesg) < 0) { + int ret = 0; + __wait_event_interruptible(*sk_sleep(sk), sock_writeable(sk) || - kthread_should_stop()); + kthread_should_stop(), + ret); if (unlikely(kthread_should_stop())) goto done; } diff --git a/scripts/package/builddeb b/scripts/package/builddeb index acb8650..7d7c9d8 100644 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -172,9 +172,22 @@ else fi maintainer="$name <$email>" +# Try to determine distribution +if [ -e $(which lsb_release) ]; then + codename=$(lsb_release --codename --short) + if [ "$codename" != "" ]; then + distribution=$codename + else + distribution="UNRELEASED" + echo "WARNING: The distribution could NOT be determined!" + fi +else + echo "HINT: Install lsb_release binary, this helps to identify your distribution!" +fi + # Generate a simple changelog template cat < debian/changelog -linux-upstream ($packageversion) unstable; urgency=low +linux-upstream ($packageversion) $distribution; urgency=low * Custom built Linux kernel. @@ -188,10 +201,10 @@ This is a packacked upstream version of the Linux kernel. The sources may be found at most Linux ftp sites, including: ftp://ftp.kernel.org/pub/linux/kernel -Copyright: 1991 - 2009 Linus Torvalds and others. +Copyright: 1991 - 2013 Linus Torvalds and others. The git repository for mainline kernel development is at: -git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git +git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by