Skip to content

Commit

Permalink
Linux 3.0.22
Browse files Browse the repository at this point in the history
  • Loading branch information
intervigilium authored and Snuzzo committed Oct 3, 2012
1 parent 4528769 commit 7f71f7c
Show file tree
Hide file tree
Showing 15 changed files with 108 additions and 57 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 21
SUBLEVEL = 22
EXTRAVERSION =
NAME = Sneaky Weasel

Expand Down
2 changes: 1 addition & 1 deletion arch/x86/pci/xen.c
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ int __init pci_xen_init(void)

int __init pci_xen_hvm_init(void)
{
if (!xen_feature(XENFEAT_hvm_pirqs))
if (!xen_have_vector_callback || !xen_feature(XENFEAT_hvm_pirqs))
return 0;

#ifdef CONFIG_ACPI
Expand Down
83 changes: 37 additions & 46 deletions crypto/sha512_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,6 @@ static inline u64 Maj(u64 x, u64 y, u64 z)
return (x & y) | (z & (x | y));
}

static inline u64 RORu64(u64 x, u64 y)
{
return (x >> y) | (x << (64 - y));
}

static const u64 sha512_K[80] = {
0x428a2f98d728ae22ULL, 0x7137449123ef65cdULL, 0xb5c0fbcfec4d3b2fULL,
0xe9b5dba58189dbbcULL, 0x3956c25bf348b538ULL, 0x59f111f1b605d019ULL,
Expand Down Expand Up @@ -66,10 +61,10 @@ static const u64 sha512_K[80] = {
0x5fcb6fab3ad6faecULL, 0x6c44198c4a475817ULL,
};

#define e0(x) (RORu64(x,28) ^ RORu64(x,34) ^ RORu64(x,39))
#define e1(x) (RORu64(x,14) ^ RORu64(x,18) ^ RORu64(x,41))
#define s0(x) (RORu64(x, 1) ^ RORu64(x, 8) ^ (x >> 7))
#define s1(x) (RORu64(x,19) ^ RORu64(x,61) ^ (x >> 6))
#define e0(x) (ror64(x,28) ^ ror64(x,34) ^ ror64(x,39))
#define e1(x) (ror64(x,14) ^ ror64(x,18) ^ ror64(x,41))
#define s0(x) (ror64(x, 1) ^ ror64(x, 8) ^ (x >> 7))
#define s1(x) (ror64(x,19) ^ ror64(x,61) ^ (x >> 6))

static inline void LOAD_OP(int I, u64 *W, const u8 *input)
{
Expand All @@ -78,7 +73,7 @@ static inline void LOAD_OP(int I, u64 *W, const u8 *input)

static inline void BLEND_OP(int I, u64 *W)
{
W[I % 16] += s1(W[(I-2) % 16]) + W[(I-7) % 16] + s0(W[(I-15) % 16]);
W[I & 15] += s1(W[(I-2) & 15]) + W[(I-7) & 15] + s0(W[(I-15) & 15]);
}

static void
Expand All @@ -89,46 +84,42 @@ sha512_transform(u64 *state, const u8 *input)
int i;
u64 W[16];

/* load the input */
for (i = 0; i < 16; i++)
LOAD_OP(i, W, input);

/* load the state into our registers */
a=state[0]; b=state[1]; c=state[2]; d=state[3];
e=state[4]; f=state[5]; g=state[6]; h=state[7];

#define SHA512_0_15(i, a, b, c, d, e, f, g, h) \
t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[i]; \
t2 = e0(a) + Maj(a, b, c); \
d += t1; \
h = t1 + t2

#define SHA512_16_79(i, a, b, c, d, e, f, g, h) \
BLEND_OP(i, W); \
t1 = h + e1(e) + Ch(e, f, g) + sha512_K[i] + W[(i)%16]; \
t2 = e0(a) + Maj(a, b, c); \
d += t1; \
h = t1 + t2

for (i = 0; i < 16; i += 8) {
SHA512_0_15(i, a, b, c, d, e, f, g, h);
SHA512_0_15(i + 1, h, a, b, c, d, e, f, g);
SHA512_0_15(i + 2, g, h, a, b, c, d, e, f);
SHA512_0_15(i + 3, f, g, h, a, b, c, d, e);
SHA512_0_15(i + 4, e, f, g, h, a, b, c, d);
SHA512_0_15(i + 5, d, e, f, g, h, a, b, c);
SHA512_0_15(i + 6, c, d, e, f, g, h, a, b);
SHA512_0_15(i + 7, b, c, d, e, f, g, h, a);
}
for (i = 16; i < 80; i += 8) {
SHA512_16_79(i, a, b, c, d, e, f, g, h);
SHA512_16_79(i + 1, h, a, b, c, d, e, f, g);
SHA512_16_79(i + 2, g, h, a, b, c, d, e, f);
SHA512_16_79(i + 3, f, g, h, a, b, c, d, e);
SHA512_16_79(i + 4, e, f, g, h, a, b, c, d);
SHA512_16_79(i + 5, d, e, f, g, h, a, b, c);
SHA512_16_79(i + 6, c, d, e, f, g, h, a, b);
SHA512_16_79(i + 7, b, c, d, e, f, g, h, a);
/* now iterate */
for (i=0; i<80; i+=8) {
if (!(i & 8)) {
int j;

if (i < 16) {
/* load the input */
for (j = 0; j < 16; j++)
LOAD_OP(i + j, W, input);
} else {
for (j = 0; j < 16; j++) {
BLEND_OP(i + j, W);
}
}
}

t1 = h + e1(e) + Ch(e,f,g) + sha512_K[i ] + W[(i & 15)];
t2 = e0(a) + Maj(a,b,c); d+=t1; h=t1+t2;
t1 = g + e1(d) + Ch(d,e,f) + sha512_K[i+1] + W[(i & 15) + 1];
t2 = e0(h) + Maj(h,a,b); c+=t1; g=t1+t2;
t1 = f + e1(c) + Ch(c,d,e) + sha512_K[i+2] + W[(i & 15) + 2];
t2 = e0(g) + Maj(g,h,a); b+=t1; f=t1+t2;
t1 = e + e1(b) + Ch(b,c,d) + sha512_K[i+3] + W[(i & 15) + 3];
t2 = e0(f) + Maj(f,g,h); a+=t1; e=t1+t2;
t1 = d + e1(a) + Ch(a,b,c) + sha512_K[i+4] + W[(i & 15) + 4];
t2 = e0(e) + Maj(e,f,g); h+=t1; d=t1+t2;
t1 = c + e1(h) + Ch(h,a,b) + sha512_K[i+5] + W[(i & 15) + 5];
t2 = e0(d) + Maj(d,e,f); g+=t1; c=t1+t2;
t1 = b + e1(g) + Ch(g,h,a) + sha512_K[i+6] + W[(i & 15) + 6];
t2 = e0(c) + Maj(c,d,e); f+=t1; b=t1+t2;
t1 = a + e1(f) + Ch(f,g,h) + sha512_K[i+7] + W[(i & 15) + 7];
t2 = e0(b) + Maj(b,c,d); e+=t1; a=t1+t2;
}

state[0] += a; state[1] += b; state[2] += c; state[3] += d;
Expand Down
6 changes: 3 additions & 3 deletions drivers/gpio/pca953x.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ static irqreturn_t pca953x_irq_handler(int irq, void *devid)

do {
level = __ffs(pending);
generic_handle_irq(level + chip->irq_base);
handle_nested_irq(level + chip->irq_base);

pending &= ~(1 << level);
} while (pending);
Expand Down Expand Up @@ -481,8 +481,8 @@ static int pca953x_irq_setup(struct pca953x_chip *chip,
int irq = lvl + chip->irq_base;

irq_set_chip_data(irq, chip);
irq_set_chip_and_handler(irq, &pca953x_irq_chip,
handle_simple_irq);
irq_set_chip(irq, &pca953x_irq_chip);
irq_set_nested_thread(irq, true);
#ifdef CONFIG_ARM
set_irq_flags(irq, IRQF_VALID);
#else
Expand Down
8 changes: 8 additions & 0 deletions drivers/gpu/drm/i915/intel_lvds.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,6 +712,14 @@ static const struct dmi_system_id intel_no_lvds[] = {
DMI_MATCH(DMI_BOARD_NAME, "i915GMm-HFS"),
},
},
{
.callback = intel_no_lvds_dmi_callback,
.ident = "AOpen i45GMx-I",
.matches = {
DMI_MATCH(DMI_BOARD_VENDOR, "AOpen"),
DMI_MATCH(DMI_BOARD_NAME, "i45GMx-I"),
},
},
{
.callback = intel_no_lvds_dmi_callback,
.ident = "Aopen i945GTt-VFA",
Expand Down
4 changes: 2 additions & 2 deletions drivers/hwmon/f75375s.c
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ static inline void f75375_write8(struct i2c_client *client, u8 reg,
static inline void f75375_write16(struct i2c_client *client, u8 reg,
u16 value)
{
int err = i2c_smbus_write_byte_data(client, reg, (value << 8));
int err = i2c_smbus_write_byte_data(client, reg, (value >> 8));
if (err)
return;
i2c_smbus_write_byte_data(client, reg + 1, (value & 0xFF));
Expand Down Expand Up @@ -311,7 +311,7 @@ static int set_pwm_enable_direct(struct i2c_client *client, int nr, int val)
fanmode |= (3 << FAN_CTRL_MODE(nr));
break;
case 2: /* AUTOMATIC*/
fanmode |= (2 << FAN_CTRL_MODE(nr));
fanmode |= (1 << FAN_CTRL_MODE(nr));
break;
case 3: /* fan speed */
break;
Expand Down
20 changes: 20 additions & 0 deletions include/linux/bitops.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,26 @@ static inline unsigned long hweight_long(unsigned long w)
return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
}

/**
* rol64 - rotate a 64-bit value left
* @word: value to rotate
* @shift: bits to roll
*/
static inline __u64 rol64(__u64 word, unsigned int shift)
{
return (word << shift) | (word >> (64 - shift));
}

/**
* ror64 - rotate a 64-bit value right
* @word: value to rotate
* @shift: bits to roll
*/
static inline __u64 ror64(__u64 word, unsigned int shift)
{
return (word >> shift) | (word << (64 - shift));
}

/**
* rol32 - rotate a 32-bit value left
* @word: value to rotate
Expand Down
4 changes: 4 additions & 0 deletions include/linux/proportions.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ void prop_inc_percpu(struct prop_descriptor *pd, struct prop_local_percpu *pl)
* Limit the time part in order to ensure there are some bits left for the
* cycle counter and fraction multiply.
*/
#if BITS_PER_LONG == 32
#define PROP_MAX_SHIFT (3*BITS_PER_LONG/4)
#else
#define PROP_MAX_SHIFT (BITS_PER_LONG/2)
#endif

#define PROP_FRAC_SHIFT (BITS_PER_LONG - PROP_MAX_SHIFT - 1)
#define PROP_FRAC_BASE (1UL << PROP_FRAC_SHIFT)
Expand Down
5 changes: 4 additions & 1 deletion include/trace/events/writeback.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,10 @@ DECLARE_EVENT_CLASS(writeback_work_class,
__field(int, for_background)
),
TP_fast_assign(
strncpy(__entry->name, dev_name(bdi->dev), 32);
struct device *dev = bdi->dev;
if (!dev)
dev = default_backing_dev_info.dev;
strncpy(__entry->name, dev_name(dev), 32);
__entry->nr_pages = work->nr_pages;
__entry->sb_dev = work->sb ? work->sb->s_dev : 0;
__entry->sync_mode = work->sync_mode;
Expand Down
10 changes: 8 additions & 2 deletions kernel/relay.c
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,14 @@ static void *relay_alloc_buf(struct rchan_buf *buf, size_t *size)
*/
static struct rchan_buf *relay_create_buf(struct rchan *chan)
{
struct rchan_buf *buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
if (!buf)
struct rchan_buf *buf;

if (chan->n_subbufs > UINT_MAX / sizeof(size_t *))
return NULL;

buf = kzalloc(sizeof(struct rchan_buf), GFP_KERNEL);
if (!buf)
return NULL;
buf->padding = kmalloc(chan->n_subbufs * sizeof(size_t *), GFP_KERNEL);
if (!buf->padding)
goto free_buf;
Expand Down Expand Up @@ -574,6 +578,8 @@ struct rchan *relay_open(const char *base_filename,

if (!(subbuf_size && n_subbufs))
return NULL;
if (subbuf_size > UINT_MAX / n_subbufs)
return NULL;

chan = kzalloc(sizeof(struct rchan), GFP_KERNEL);
if (!chan)
Expand Down
6 changes: 6 additions & 0 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1883,6 +1883,11 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
if (unlikely(!node_match(c, node)))
goto another_slab;

/* must check again c->freelist in case of cpu migration or IRQ */
object = c->freelist;
if (object)
goto update_freelist;

stat(s, ALLOC_REFILL);

load_freelist:
Expand All @@ -1892,6 +1897,7 @@ static void *__slab_alloc(struct kmem_cache *s, gfp_t gfpflags, int node,
if (kmem_cache_debug(s))
goto debug;

update_freelist:
c->freelist = get_freepointer(s, object);
page->inuse = page->objects;
page->freelist = NULL;
Expand Down
2 changes: 1 addition & 1 deletion net/mac80211/rx.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ static void ieee80211_sta_reorder_release(struct ieee80211_hw *hw,
index = seq_sub(tid_agg_rx->head_seq_num, tid_agg_rx->ssn) %
tid_agg_rx->buf_size;
if (!tid_agg_rx->reorder_buf[index] &&
tid_agg_rx->stored_mpdu_num > 1) {
tid_agg_rx->stored_mpdu_num) {
/*
* No buffers ready to be released, but check whether any
* frames in the reorder buffer have timed out.
Expand Down
6 changes: 6 additions & 0 deletions sound/pci/intel8x0.c
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,12 @@ static struct ac97_quirk ac97_quirks[] __devinitdata = {
.name = "MSI P4 ATX 645 Ultra",
.type = AC97_TUNE_HP_ONLY
},
{
.subvendor = 0x161f,
.subdevice = 0x202f,
.name = "Gateway M520",
.type = AC97_TUNE_INV_EAPD
},
{
.subvendor = 0x161f,
.subdevice = 0x203a,
Expand Down
6 changes: 6 additions & 0 deletions tools/perf/bench/mem-memcpy-x86-64-asm.S
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@

#include "../../../arch/x86/lib/memcpy_64.S"
/*
* We need to provide note.GNU-stack section, saying that we want
* NOT executable stack. Otherwise the final linking will assume that
* the ELF stack should not be restricted at all and set it RWX.
*/
.section .note.GNU-stack,"",@progbits
1 change: 1 addition & 0 deletions tools/perf/util/evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ int perf_event__parse_sample(const union perf_event *event, u64 type,

data->cpu = data->pid = data->tid = -1;
data->stream_id = data->id = data->time = -1ULL;
data->period = 1;

if (event->header.type != PERF_RECORD_SAMPLE) {
if (!sample_id_all)
Expand Down

0 comments on commit 7f71f7c

Please sign in to comment.