mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-25 22:23:14 -04:00
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Conflicts: arch/mips/net/bpf_jit.c drivers/net/can/flexcan.c Both the flexcan and MIPS bpf_jit conflicts were cases of simple overlapping changes. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
commit
1f6d80358d
467 changed files with 4648 additions and 2442 deletions
|
|
@ -1524,6 +1524,11 @@ retry:
|
|||
*/
|
||||
if (ctx->is_active) {
|
||||
raw_spin_unlock_irq(&ctx->lock);
|
||||
/*
|
||||
* Reload the task pointer, it might have been changed by
|
||||
* a concurrent perf_event_context_sched_out().
|
||||
*/
|
||||
task = ctx->task;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
|
|
@ -1967,6 +1972,11 @@ retry:
|
|||
*/
|
||||
if (ctx->is_active) {
|
||||
raw_spin_unlock_irq(&ctx->lock);
|
||||
/*
|
||||
* Reload the task pointer, it might have been changed by
|
||||
* a concurrent perf_event_context_sched_out().
|
||||
*/
|
||||
task = ctx->task;
|
||||
goto retry;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2592,6 +2592,7 @@ static int futex_wait_requeue_pi(u32 __user *uaddr, unsigned int flags,
|
|||
* shared futexes. We need to compare the keys:
|
||||
*/
|
||||
if (match_futex(&q.key, &key2)) {
|
||||
queue_unlock(hb);
|
||||
ret = -EINVAL;
|
||||
goto out_put_keys;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,11 +44,12 @@ static long kptr_obfuscate(long v, int type)
|
|||
*/
|
||||
static int kcmp_ptr(void *v1, void *v2, enum kcmp_type type)
|
||||
{
|
||||
long ret;
|
||||
long t1, t2;
|
||||
|
||||
ret = kptr_obfuscate((long)v1, type) - kptr_obfuscate((long)v2, type);
|
||||
t1 = kptr_obfuscate((long)v1, type);
|
||||
t2 = kptr_obfuscate((long)v2, type);
|
||||
|
||||
return (ret < 0) | ((ret > 0) << 1);
|
||||
return (t1 < t2) | ((t1 > t2) << 1);
|
||||
}
|
||||
|
||||
/* The caller must have pinned the task */
|
||||
|
|
|
|||
|
|
@ -1665,15 +1665,15 @@ asmlinkage int vprintk_emit(int facility, int level,
|
|||
raw_spin_lock(&logbuf_lock);
|
||||
logbuf_cpu = this_cpu;
|
||||
|
||||
if (recursion_bug) {
|
||||
if (unlikely(recursion_bug)) {
|
||||
static const char recursion_msg[] =
|
||||
"BUG: recent printk recursion!";
|
||||
|
||||
recursion_bug = 0;
|
||||
text_len = strlen(recursion_msg);
|
||||
/* emit KERN_CRIT message */
|
||||
printed_len += log_store(0, 2, LOG_PREFIX|LOG_NEWLINE, 0,
|
||||
NULL, 0, recursion_msg, text_len);
|
||||
NULL, 0, recursion_msg,
|
||||
strlen(recursion_msg));
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
|
|
@ -464,18 +464,26 @@ static enum alarmtimer_type clock2alarm(clockid_t clockid)
|
|||
static enum alarmtimer_restart alarm_handle_timer(struct alarm *alarm,
|
||||
ktime_t now)
|
||||
{
|
||||
unsigned long flags;
|
||||
struct k_itimer *ptr = container_of(alarm, struct k_itimer,
|
||||
it.alarm.alarmtimer);
|
||||
if (posix_timer_event(ptr, 0) != 0)
|
||||
ptr->it_overrun++;
|
||||
enum alarmtimer_restart result = ALARMTIMER_NORESTART;
|
||||
|
||||
spin_lock_irqsave(&ptr->it_lock, flags);
|
||||
if ((ptr->it_sigev_notify & ~SIGEV_THREAD_ID) != SIGEV_NONE) {
|
||||
if (posix_timer_event(ptr, 0) != 0)
|
||||
ptr->it_overrun++;
|
||||
}
|
||||
|
||||
/* Re-add periodic timers */
|
||||
if (ptr->it.alarm.interval.tv64) {
|
||||
ptr->it_overrun += alarm_forward(alarm, now,
|
||||
ptr->it.alarm.interval);
|
||||
return ALARMTIMER_RESTART;
|
||||
result = ALARMTIMER_RESTART;
|
||||
}
|
||||
return ALARMTIMER_NORESTART;
|
||||
spin_unlock_irqrestore(&ptr->it_lock, flags);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -541,18 +549,22 @@ static int alarm_timer_create(struct k_itimer *new_timer)
|
|||
* @new_timer: k_itimer pointer
|
||||
* @cur_setting: itimerspec data to fill
|
||||
*
|
||||
* Copies the itimerspec data out from the k_itimer
|
||||
* Copies out the current itimerspec data
|
||||
*/
|
||||
static void alarm_timer_get(struct k_itimer *timr,
|
||||
struct itimerspec *cur_setting)
|
||||
{
|
||||
memset(cur_setting, 0, sizeof(struct itimerspec));
|
||||
ktime_t relative_expiry_time =
|
||||
alarm_expires_remaining(&(timr->it.alarm.alarmtimer));
|
||||
|
||||
cur_setting->it_interval =
|
||||
ktime_to_timespec(timr->it.alarm.interval);
|
||||
cur_setting->it_value =
|
||||
ktime_to_timespec(timr->it.alarm.alarmtimer.node.expires);
|
||||
return;
|
||||
if (ktime_to_ns(relative_expiry_time) > 0) {
|
||||
cur_setting->it_value = ktime_to_timespec(relative_expiry_time);
|
||||
} else {
|
||||
cur_setting->it_value.tv_sec = 0;
|
||||
cur_setting->it_value.tv_nsec = 0;
|
||||
}
|
||||
|
||||
cur_setting->it_interval = ktime_to_timespec(timr->it.alarm.interval);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -559,17 +559,20 @@ EXPORT_SYMBOL(usecs_to_jiffies);
|
|||
* that a remainder subtract here would not do the right thing as the
|
||||
* resolution values don't fall on second boundries. I.e. the line:
|
||||
* nsec -= nsec % TICK_NSEC; is NOT a correct resolution rounding.
|
||||
* Note that due to the small error in the multiplier here, this
|
||||
* rounding is incorrect for sufficiently large values of tv_nsec, but
|
||||
* well formed timespecs should have tv_nsec < NSEC_PER_SEC, so we're
|
||||
* OK.
|
||||
*
|
||||
* Rather, we just shift the bits off the right.
|
||||
*
|
||||
* The >> (NSEC_JIFFIE_SC - SEC_JIFFIE_SC) converts the scaled nsec
|
||||
* value to a scaled second value.
|
||||
*/
|
||||
unsigned long
|
||||
timespec_to_jiffies(const struct timespec *value)
|
||||
static unsigned long
|
||||
__timespec_to_jiffies(unsigned long sec, long nsec)
|
||||
{
|
||||
unsigned long sec = value->tv_sec;
|
||||
long nsec = value->tv_nsec + TICK_NSEC - 1;
|
||||
nsec = nsec + TICK_NSEC - 1;
|
||||
|
||||
if (sec >= MAX_SEC_IN_JIFFIES){
|
||||
sec = MAX_SEC_IN_JIFFIES;
|
||||
|
|
@ -580,6 +583,13 @@ timespec_to_jiffies(const struct timespec *value)
|
|||
(NSEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC;
|
||||
|
||||
}
|
||||
|
||||
unsigned long
|
||||
timespec_to_jiffies(const struct timespec *value)
|
||||
{
|
||||
return __timespec_to_jiffies(value->tv_sec, value->tv_nsec);
|
||||
}
|
||||
|
||||
EXPORT_SYMBOL(timespec_to_jiffies);
|
||||
|
||||
void
|
||||
|
|
@ -596,31 +606,27 @@ jiffies_to_timespec(const unsigned long jiffies, struct timespec *value)
|
|||
}
|
||||
EXPORT_SYMBOL(jiffies_to_timespec);
|
||||
|
||||
/* Same for "timeval"
|
||||
/*
|
||||
* We could use a similar algorithm to timespec_to_jiffies (with a
|
||||
* different multiplier for usec instead of nsec). But this has a
|
||||
* problem with rounding: we can't exactly add TICK_NSEC - 1 to the
|
||||
* usec value, since it's not necessarily integral.
|
||||
*
|
||||
* Well, almost. The problem here is that the real system resolution is
|
||||
* in nanoseconds and the value being converted is in micro seconds.
|
||||
* Also for some machines (those that use HZ = 1024, in-particular),
|
||||
* there is a LARGE error in the tick size in microseconds.
|
||||
|
||||
* The solution we use is to do the rounding AFTER we convert the
|
||||
* microsecond part. Thus the USEC_ROUND, the bits to be shifted off.
|
||||
* Instruction wise, this should cost only an additional add with carry
|
||||
* instruction above the way it was done above.
|
||||
* We could instead round in the intermediate scaled representation
|
||||
* (i.e. in units of 1/2^(large scale) jiffies) but that's also
|
||||
* perilous: the scaling introduces a small positive error, which
|
||||
* combined with a division-rounding-upward (i.e. adding 2^(scale) - 1
|
||||
* units to the intermediate before shifting) leads to accidental
|
||||
* overflow and overestimates.
|
||||
*
|
||||
* At the cost of one additional multiplication by a constant, just
|
||||
* use the timespec implementation.
|
||||
*/
|
||||
unsigned long
|
||||
timeval_to_jiffies(const struct timeval *value)
|
||||
{
|
||||
unsigned long sec = value->tv_sec;
|
||||
long usec = value->tv_usec;
|
||||
|
||||
if (sec >= MAX_SEC_IN_JIFFIES){
|
||||
sec = MAX_SEC_IN_JIFFIES;
|
||||
usec = 0;
|
||||
}
|
||||
return (((u64)sec * SEC_CONVERSION) +
|
||||
(((u64)usec * USEC_CONVERSION + USEC_ROUND) >>
|
||||
(USEC_JIFFIE_SC - SEC_JIFFIE_SC))) >> SEC_JIFFIE_SC;
|
||||
return __timespec_to_jiffies(value->tv_sec,
|
||||
value->tv_usec * NSEC_PER_USEC);
|
||||
}
|
||||
EXPORT_SYMBOL(timeval_to_jiffies);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue