1 From: Greg Kroah-Hartman <gregkh@suse.de>
2 Subject: Linux 2.6.27.29
4 Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
6 diff --git a/Makefile b/Makefile
7 index 7598325..47d46f4 100644
16 NAME = Trembling Tortoise
19 diff --git a/arch/x86/mm/gup.c b/arch/x86/mm/gup.c
20 index 007bb06..73e6ce1 100644
21 --- a/arch/x86/mm/gup.c
22 +++ b/arch/x86/mm/gup.c
23 @@ -231,10 +231,15 @@ int get_user_pages_fast(unsigned long start, int nr_pages, int write,
26 len = (unsigned long) nr_pages << PAGE_SHIFT;
29 - if (unlikely(!access_ok(write ? VERIFY_WRITE : VERIFY_READ,
40 * XXX: batch / limit 'nr', to avoid large irq off latency
41 diff --git a/arch/x86/mm/srat_64.c b/arch/x86/mm/srat_64.c
42 index 1b4763e..e353618 100644
43 --- a/arch/x86/mm/srat_64.c
44 +++ b/arch/x86/mm/srat_64.c
45 @@ -87,8 +87,10 @@ static __init void bad_srat(void)
47 for (i = 0; i < MAX_LOCAL_APIC; i++)
48 apicid_to_node[i] = NUMA_NO_NODE;
49 - for (i = 0; i < MAX_NUMNODES; i++)
50 - nodes_add[i].start = nodes[i].end = 0;
51 + for (i = 0; i < MAX_NUMNODES; i++) {
52 + nodes[i].start = nodes[i].end = 0;
53 + nodes_add[i].start = nodes_add[i].end = 0;
55 remove_all_active_ranges();
58 diff --git a/drivers/acpi/ec.c b/drivers/acpi/ec.c
59 index e618cbe..e6b3c7e 100644
60 --- a/drivers/acpi/ec.c
61 +++ b/drivers/acpi/ec.c
62 @@ -1013,7 +1013,8 @@ int __init acpi_ec_ecdt_probe(void)
63 * which needs it, has fake EC._INI method, so use it as flag.
64 * Keep boot_ec struct as it will be needed soon.
66 - if (ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &dummy)))
67 + if (!dmi_name_in_vendors("ASUS") ||
68 + ACPI_FAILURE(acpi_get_handle(boot_ec->handle, "_INI", &dummy)))
71 if (!ec_install_handlers(boot_ec)) {
72 diff --git a/drivers/hid/usbhid/hiddev.c b/drivers/hid/usbhid/hiddev.c
73 index 842e9ed..993772c 100644
74 --- a/drivers/hid/usbhid/hiddev.c
75 +++ b/drivers/hid/usbhid/hiddev.c
76 @@ -484,8 +484,10 @@ static noinline int hiddev_ioctl_usage(struct hiddev *hiddev, unsigned int cmd,
79 case HIDIOCGCOLLECTIONINDEX:
80 + i = field->usage[uref->usage_index].collection_index;
83 - return field->usage[uref->usage_index].collection_index;
86 for (i = 0; i < uref_multi->num_values; i++)
87 uref_multi->values[i] =
88 diff --git a/drivers/hwmon/max6650.c b/drivers/hwmon/max6650.c
89 index f27af6a..65cf25f 100644
90 --- a/drivers/hwmon/max6650.c
91 +++ b/drivers/hwmon/max6650.c
92 @@ -407,6 +407,7 @@ static ssize_t set_div(struct device *dev, struct device_attribute *devattr,
96 + mutex_unlock(&data->update_lock);
98 "illegal value for fan divider (%d)\n", div);
100 diff --git a/drivers/input/misc/wistron_btns.c b/drivers/input/misc/wistron_btns.c
101 index fe268be..2dacc3e 100644
102 --- a/drivers/input/misc/wistron_btns.c
103 +++ b/drivers/input/misc/wistron_btns.c
104 @@ -627,6 +627,15 @@ static struct dmi_system_id dmi_ids[] __initdata = {
107 .callback = dmi_matched,
108 + .ident = "Maxdata Pro 7000 DX",
110 + DMI_MATCH(DMI_SYS_VENDOR, "MAXDATA"),
111 + DMI_MATCH(DMI_PRODUCT_NAME, "Pro 7000"),
113 + .driver_data = keymap_fs_amilo_pro_v2000
116 + .callback = dmi_matched,
117 .ident = "Fujitsu N3510",
119 DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
120 diff --git a/drivers/isdn/gigaset/ev-layer.c b/drivers/isdn/gigaset/ev-layer.c
121 index 5cbf64d..c712bcc 100644
122 --- a/drivers/isdn/gigaset/ev-layer.c
123 +++ b/drivers/isdn/gigaset/ev-layer.c
124 @@ -307,32 +307,33 @@ struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */
125 {RSP_OK, 604,604, -1, 605, 5, {ACT_CMD+AT_MSN}},
126 {RSP_OK, 605,605, -1, 606, 5, {ACT_CMD+AT_ISO}},
127 {RSP_NULL, 605,605, -1, 606, 5, {ACT_CMD+AT_ISO}},
128 - {RSP_OK, 606,606, -1, 607, 5, {0}, "+VLS=17\r"}, /* set "Endgeraetemodus" */
129 + {RSP_OK, 606,606, -1, 607, 5, {0}, "+VLS=17\r"},
130 {RSP_OK, 607,607, -1, 608,-1},
131 - //{RSP_ZSAU, 608,608,ZSAU_PROCEEDING, 608, 0, {ACT_ERROR}},//DELETE
132 {RSP_ZSAU, 608,608,ZSAU_PROCEEDING, 609, 5, {ACT_CMD+AT_DIAL}},
133 {RSP_OK, 609,609, -1, 650, 0, {ACT_DIALING}},
135 - {RSP_ZVLS, 608,608, 17, -1,-1, {ACT_DEBUG}},
136 - {RSP_ZCTP, 609,609, -1, -1,-1, {ACT_DEBUG}},
137 - {RSP_ZCPN, 609,609, -1, -1,-1, {ACT_DEBUG}},
138 {RSP_ERROR, 601,609, -1, 0, 0, {ACT_ABORTDIAL}},
139 {EV_TIMEOUT, 601,609, -1, 0, 0, {ACT_ABORTDIAL}},
142 - {RSP_ZCTP, 650,650, -1, -1,-1, {ACT_DEBUG}},
143 - {RSP_ZCPN, 650,650, -1, -1,-1, {ACT_DEBUG}},
144 - {RSP_ZSAU, 650,650,ZSAU_CALL_DELIVERED, -1,-1, {ACT_DEBUG}}, /* some devices don't send this */
146 - /* connection established */
147 - {RSP_ZSAU, 650,650,ZSAU_ACTIVE, 800,-1, {ACT_CONNECT}}, //FIXME -> DLE1
148 - {RSP_ZSAU, 750,750,ZSAU_ACTIVE, 800,-1, {ACT_CONNECT}}, //FIXME -> DLE1
150 - {EV_BC_OPEN, 800,800, -1, 800,-1, {ACT_NOTIFY_BC_UP}}, //FIXME new constate + timeout
151 + /* optional dialing responses */
152 + {EV_BC_OPEN, 650,650, -1, 651,-1},
153 + {RSP_ZVLS, 608,651, 17, -1,-1, {ACT_DEBUG}},
154 + {RSP_ZCTP, 609,651, -1, -1,-1, {ACT_DEBUG}},
155 + {RSP_ZCPN, 609,651, -1, -1,-1, {ACT_DEBUG}},
156 + {RSP_ZSAU, 650,651,ZSAU_CALL_DELIVERED, -1,-1, {ACT_DEBUG}},
159 + {RSP_ZSAU, 650,650,ZSAU_ACTIVE, 800,-1, {ACT_CONNECT}},
160 + {RSP_ZSAU, 651,651,ZSAU_ACTIVE, 800,-1, {ACT_CONNECT,
161 + ACT_NOTIFY_BC_UP}},
162 + {RSP_ZSAU, 750,750,ZSAU_ACTIVE, 800,-1, {ACT_CONNECT}},
163 + {RSP_ZSAU, 751,751,ZSAU_ACTIVE, 800,-1, {ACT_CONNECT,
164 + ACT_NOTIFY_BC_UP}},
165 + {EV_BC_OPEN, 800,800, -1, 800,-1, {ACT_NOTIFY_BC_UP}},
168 - {RSP_ZSAU, 650,650,ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEREJECT}},
169 - {RSP_ZSAU, 750,750,ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP}},
170 + {RSP_ZSAU, 650,651,ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEREJECT}},
171 + {RSP_ZSAU, 750,751,ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP}},
172 {RSP_ZSAU, 800,800,ZSAU_DISCONNECT_IND, 0, 0, {ACT_REMOTEHUP}},
175 @@ -371,7 +372,8 @@ struct reply_t gigaset_tab_cid_m10x[] = /* for M10x */
176 {RSP_ZSAU, 700,729,ZSAU_ACTIVE, 0, 0, {ACT_ABORTACCEPT}},
177 {RSP_ZSAU, 700,729,ZSAU_DISCONNECT_IND, 0, 0, {ACT_ABORTACCEPT}},
179 - {EV_TIMEOUT, 750,750, -1, 0, 0, {ACT_CONNTIMEOUT}},
180 + {EV_BC_OPEN, 750,750, -1, 751,-1},
181 + {EV_TIMEOUT, 750,751, -1, 0, 0, {ACT_CONNTIMEOUT}},
183 /* B channel closed (general case) */
184 {EV_BC_CLOSED, -1, -1, -1, -1,-1, {ACT_NOTIFY_BC_DOWN}}, //FIXME
185 @@ -914,12 +916,6 @@ static void bchannel_down(struct bc_state *bcs)
187 static void bchannel_up(struct bc_state *bcs)
189 - if (!(bcs->chstate & CHS_D_UP)) {
190 - dev_notice(bcs->cs->dev, "%s: D channel not up\n", __func__);
191 - bcs->chstate |= CHS_D_UP;
192 - gigaset_i4l_channel_cmd(bcs, ISDN_STAT_DCONN);
195 if (bcs->chstate & CHS_B_UP) {
196 dev_notice(bcs->cs->dev, "%s: B channel already up\n",
198 diff --git a/drivers/md/md.c b/drivers/md/md.c
199 index ebbc3bb..b60d328 100644
200 --- a/drivers/md/md.c
201 +++ b/drivers/md/md.c
202 @@ -3281,7 +3281,8 @@ suspend_lo_store(mddev_t *mddev, const char *buf, size_t len)
204 unsigned long long new = simple_strtoull(buf, &e, 10);
206 - if (mddev->pers->quiesce == NULL)
207 + if (mddev->pers == NULL ||
208 + mddev->pers->quiesce == NULL)
210 if (buf == e || (*e && *e != '\n'))
212 @@ -3309,7 +3310,8 @@ suspend_hi_store(mddev_t *mddev, const char *buf, size_t len)
214 unsigned long long new = simple_strtoull(buf, &e, 10);
216 - if (mddev->pers->quiesce == NULL)
217 + if (mddev->pers == NULL ||
218 + mddev->pers->quiesce == NULL)
220 if (buf == e || (*e && *e != '\n'))
222 diff --git a/drivers/net/e100.c b/drivers/net/e100.c
223 index 5cf78d6..d991167 100644
224 --- a/drivers/net/e100.c
225 +++ b/drivers/net/e100.c
226 @@ -1840,6 +1840,9 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
228 if (ioread8(&nic->csr->scb.status) & rus_no_res)
229 nic->ru_running = RU_SUSPENDED;
230 + pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr,
231 + sizeof(struct rfd),
232 + PCI_DMA_BIDIRECTIONAL);
236 diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c
237 index 0f501d2..91e4232 100644
238 --- a/drivers/net/hamradio/6pack.c
239 +++ b/drivers/net/hamradio/6pack.c
240 @@ -397,13 +397,14 @@ static DEFINE_RWLOCK(disc_data_lock);
242 static struct sixpack *sp_get(struct tty_struct *tty)
244 + unsigned long flags;
247 - read_lock(&disc_data_lock);
248 + read_lock_irqsave(&disc_data_lock, flags);
251 atomic_inc(&sp->refcnt);
252 - read_unlock(&disc_data_lock);
253 + read_unlock_irqrestore(&disc_data_lock, flags);
257 @@ -687,12 +688,13 @@ out:
259 static void sixpack_close(struct tty_struct *tty)
261 + unsigned long flags;
264 - write_lock(&disc_data_lock);
265 + write_lock_irqsave(&disc_data_lock, flags);
267 tty->disc_data = NULL;
268 - write_unlock(&disc_data_lock);
269 + write_unlock_irqrestore(&disc_data_lock, flags);
273 diff --git a/drivers/net/hamradio/mkiss.c b/drivers/net/hamradio/mkiss.c
274 index b8e25c4..2a9adcc 100644
275 --- a/drivers/net/hamradio/mkiss.c
276 +++ b/drivers/net/hamradio/mkiss.c
277 @@ -246,15 +246,16 @@ static int kiss_esc_crc(unsigned char *s, unsigned char *d, unsigned short crc,
278 /* Send one completely decapsulated AX.25 packet to the AX.25 layer. */
279 static void ax_bump(struct mkiss *ax)
281 + unsigned long flags;
285 - spin_lock_bh(&ax->buflock);
286 + spin_lock_irqsave(&ax->buflock, flags);
287 if (ax->rbuff[0] > 0x0f) {
288 if (ax->rbuff[0] & 0x80) {
289 if (check_crc_16(ax->rbuff, ax->rcount) < 0) {
290 ax->stats.rx_errors++;
291 - spin_unlock_bh(&ax->buflock);
292 + spin_unlock_irqrestore(&ax->buflock, flags);
296 @@ -269,7 +270,7 @@ static void ax_bump(struct mkiss *ax)
297 } else if (ax->rbuff[0] & 0x20) {
298 if (check_crc_flex(ax->rbuff, ax->rcount) < 0) {
299 ax->stats.rx_errors++;
300 - spin_unlock_bh(&ax->buflock);
301 + spin_unlock_irqrestore(&ax->buflock, flags);
304 if (ax->crcmode != CRC_MODE_FLEX && ax->crcauto) {
305 @@ -296,7 +297,7 @@ static void ax_bump(struct mkiss *ax)
306 printk(KERN_ERR "mkiss: %s: memory squeeze, dropping packet.\n",
308 ax->stats.rx_dropped++;
309 - spin_unlock_bh(&ax->buflock);
310 + spin_unlock_irqrestore(&ax->buflock, flags);
314 @@ -306,11 +307,13 @@ static void ax_bump(struct mkiss *ax)
315 ax->dev->last_rx = jiffies;
316 ax->stats.rx_packets++;
317 ax->stats.rx_bytes += count;
318 - spin_unlock_bh(&ax->buflock);
319 + spin_unlock_irqrestore(&ax->buflock, flags);
322 static void kiss_unesc(struct mkiss *ax, unsigned char s)
324 + unsigned long flags;
328 /* drop keeptest bit = VSV */
329 @@ -337,18 +340,18 @@ static void kiss_unesc(struct mkiss *ax, unsigned char s)
333 - spin_lock_bh(&ax->buflock);
334 + spin_lock_irqsave(&ax->buflock, flags);
335 if (!test_bit(AXF_ERROR, &ax->flags)) {
336 if (ax->rcount < ax->buffsize) {
337 ax->rbuff[ax->rcount++] = s;
338 - spin_unlock_bh(&ax->buflock);
339 + spin_unlock_irqrestore(&ax->buflock, flags);
343 ax->stats.rx_over_errors++;
344 set_bit(AXF_ERROR, &ax->flags);
346 - spin_unlock_bh(&ax->buflock);
347 + spin_unlock_irqrestore(&ax->buflock, flags);
350 static int ax_set_mac_address(struct net_device *dev, void *addr)
351 @@ -370,6 +373,7 @@ static void ax_changedmtu(struct mkiss *ax)
353 struct net_device *dev = ax->dev;
354 unsigned char *xbuff, *rbuff, *oxbuff, *orbuff;
355 + unsigned long flags;
359 @@ -395,7 +399,7 @@ static void ax_changedmtu(struct mkiss *ax)
363 - spin_lock_bh(&ax->buflock);
364 + spin_lock_irqsave(&ax->buflock, flags);
368 @@ -426,7 +430,7 @@ static void ax_changedmtu(struct mkiss *ax)
369 ax->mtu = dev->mtu + 73;
372 - spin_unlock_bh(&ax->buflock);
373 + spin_unlock_irqrestore(&ax->buflock, flags);
377 @@ -436,6 +440,7 @@ static void ax_changedmtu(struct mkiss *ax)
378 static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
380 struct mkiss *ax = netdev_priv(dev);
381 + unsigned long flags;
385 @@ -452,7 +457,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
389 - spin_lock_bh(&ax->buflock);
390 + spin_lock_irqsave(&ax->buflock, flags);
391 if ((*p & 0x0f) != 0) {
392 /* Configuration Command (kissparms(1).
393 * Protocol spec says: never append CRC.
394 @@ -482,7 +487,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
395 ax->crcauto = (cmd ? 0 : 1);
396 printk(KERN_INFO "mkiss: %s: crc mode %s %d\n", ax->dev->name, (len) ? "set to" : "is", cmd);
398 - spin_unlock_bh(&ax->buflock);
399 + spin_unlock_irqrestore(&ax->buflock, flags);
400 netif_start_queue(dev);
403 @@ -515,7 +520,7 @@ static void ax_encaps(struct net_device *dev, unsigned char *icp, int len)
404 count = kiss_esc(p, (unsigned char *)ax->xbuff, len);
407 - spin_unlock_bh(&ax->buflock);
408 + spin_unlock_irqrestore(&ax->buflock, flags);
410 set_bit(TTY_DO_WRITE_WAKEUP, &ax->tty->flags);
411 actual = ax->tty->ops->write(ax->tty, ax->xbuff, count);
412 @@ -711,13 +716,14 @@ static DEFINE_RWLOCK(disc_data_lock);
414 static struct mkiss *mkiss_get(struct tty_struct *tty)
416 + unsigned long flags;
419 - read_lock(&disc_data_lock);
420 + read_lock_irqsave(&disc_data_lock, flags);
423 atomic_inc(&ax->refcnt);
424 - read_unlock(&disc_data_lock);
425 + read_unlock_irqrestore(&disc_data_lock, flags);
429 @@ -816,12 +822,13 @@ out:
431 static void mkiss_close(struct tty_struct *tty)
433 + unsigned long flags;
436 - write_lock(&disc_data_lock);
437 + write_lock_irqsave(&disc_data_lock, flags);
439 tty->disc_data = NULL;
440 - write_unlock(&disc_data_lock);
441 + write_unlock_irqrestore(&disc_data_lock, flags);
445 diff --git a/drivers/net/ppp_async.c b/drivers/net/ppp_async.c
446 index 451bdb5..7dac631 100644
447 --- a/drivers/net/ppp_async.c
448 +++ b/drivers/net/ppp_async.c
449 @@ -132,13 +132,15 @@ static DEFINE_RWLOCK(disc_data_lock);
451 static struct asyncppp *ap_get(struct tty_struct *tty)
453 + unsigned long flags;
456 - read_lock(&disc_data_lock);
457 + read_lock_irqsave(&disc_data_lock, flags);
460 atomic_inc(&ap->refcnt);
461 - read_unlock(&disc_data_lock);
462 + read_unlock_irqrestore(&disc_data_lock, flags);
467 @@ -212,12 +214,13 @@ ppp_asynctty_open(struct tty_struct *tty)
469 ppp_asynctty_close(struct tty_struct *tty)
471 + unsigned long flags;
474 - write_lock_irq(&disc_data_lock);
475 + write_lock_irqsave(&disc_data_lock, flags);
477 tty->disc_data = NULL;
478 - write_unlock_irq(&disc_data_lock);
479 + write_unlock_irqrestore(&disc_data_lock, flags);
483 diff --git a/drivers/net/ppp_synctty.c b/drivers/net/ppp_synctty.c
484 index 801d8f9..13cc986 100644
485 --- a/drivers/net/ppp_synctty.c
486 +++ b/drivers/net/ppp_synctty.c
487 @@ -182,13 +182,15 @@ static DEFINE_RWLOCK(disc_data_lock);
489 static struct syncppp *sp_get(struct tty_struct *tty)
491 + unsigned long flags;
494 - read_lock(&disc_data_lock);
495 + read_lock_irqsave(&disc_data_lock, flags);
498 atomic_inc(&ap->refcnt);
499 - read_unlock(&disc_data_lock);
500 + read_unlock_irqrestore(&disc_data_lock, flags);
505 @@ -259,12 +261,13 @@ ppp_sync_open(struct tty_struct *tty)
507 ppp_sync_close(struct tty_struct *tty)
509 + unsigned long flags;
512 - write_lock_irq(&disc_data_lock);
513 + write_lock_irqsave(&disc_data_lock, flags);
515 tty->disc_data = NULL;
516 - write_unlock_irq(&disc_data_lock);
517 + write_unlock_irqrestore(&disc_data_lock, flags);
521 diff --git a/drivers/net/r8169.c b/drivers/net/r8169.c
522 index 5952522..f718215 100644
523 --- a/drivers/net/r8169.c
524 +++ b/drivers/net/r8169.c
525 @@ -2850,54 +2850,64 @@ static irqreturn_t rtl8169_interrupt(int irq, void *dev_instance)
529 + /* loop handling interrupts until we have no new ones or
530 + * we hit a invalid/hotplug case.
532 status = RTL_R16(IntrStatus);
533 + while (status && status != 0xffff) {
536 - /* hotplug/major error/no more work/shared irq */
537 - if ((status == 0xffff) || !status)
541 + /* Handle all of the error cases first. These will reset
542 + * the chip, so just exit the loop.
544 + if (unlikely(!netif_running(dev))) {
545 + rtl8169_asic_down(ioaddr);
549 - if (unlikely(!netif_running(dev))) {
550 - rtl8169_asic_down(ioaddr);
553 + /* Work around for rx fifo overflow */
554 + if (unlikely(status & RxFIFOOver) &&
555 + (tp->mac_version == RTL_GIGA_MAC_VER_11)) {
556 + netif_stop_queue(dev);
557 + rtl8169_tx_timeout(dev);
561 - status &= tp->intr_mask;
562 - RTL_W16(IntrStatus,
563 - (status & RxFIFOOver) ? (status | RxOverflow) : status);
564 + if (unlikely(status & SYSErr)) {
565 + rtl8169_pcierr_interrupt(dev);
569 - if (!(status & tp->intr_event))
571 + if (status & LinkChg)
572 + rtl8169_check_link_status(dev, tp, ioaddr);
574 - /* Work around for rx fifo overflow */
575 - if (unlikely(status & RxFIFOOver) &&
576 - (tp->mac_version == RTL_GIGA_MAC_VER_11)) {
577 - netif_stop_queue(dev);
578 - rtl8169_tx_timeout(dev);
581 + /* We need to see the lastest version of tp->intr_mask to
582 + * avoid ignoring an MSI interrupt and having to wait for
583 + * another event which may never come.
586 + if (status & tp->intr_mask & tp->napi_event) {
587 + RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
588 + tp->intr_mask = ~tp->napi_event;
590 + if (likely(napi_schedule_prep(&tp->napi)))
591 + __napi_schedule(&tp->napi);
592 + else if (netif_msg_intr(tp)) {
593 + printk(KERN_INFO "%s: interrupt %04x in poll\n",
594 + dev->name, status);
598 - if (unlikely(status & SYSErr)) {
599 - rtl8169_pcierr_interrupt(dev);
601 + /* We only get a new MSI interrupt when all active irq
602 + * sources on the chip have been acknowledged. So, ack
603 + * everything we've seen and check if new sources have become
604 + * active to avoid blocking all interrupts from the chip.
606 + RTL_W16(IntrStatus,
607 + (status & RxFIFOOver) ? (status | RxOverflow) : status);
608 + status = RTL_R16(IntrStatus);
611 - if (status & LinkChg)
612 - rtl8169_check_link_status(dev, tp, ioaddr);
614 - if (status & tp->napi_event) {
615 - RTL_W16(IntrMask, tp->intr_event & ~tp->napi_event);
616 - tp->intr_mask = ~tp->napi_event;
618 - if (likely(netif_rx_schedule_prep(dev, &tp->napi)))
619 - __netif_rx_schedule(dev, &tp->napi);
620 - else if (netif_msg_intr(tp)) {
621 - printk(KERN_INFO "%s: interrupt %04x in poll\n",
622 - dev->name, status);
626 return IRQ_RETVAL(handled);
629 @@ -2913,13 +2923,15 @@ static int rtl8169_poll(struct napi_struct *napi, int budget)
631 if (work_done < budget) {
632 netif_rx_complete(dev, napi);
633 - tp->intr_mask = 0xffff;
635 - * 20040426: the barrier is not strictly required but the
636 - * behavior of the irq handler could be less predictable
637 - * without it. Btw, the lack of flush for the posted pci
638 - * write is safe - FR
640 + /* We need for force the visibility of tp->intr_mask
641 + * for other CPUs, as we can loose an MSI interrupt
642 + * and potentially wait for a retransmit timeout if we don't.
643 + * The posted write to IntrMask is safe, as it will
644 + * eventually make it to the chip and we won't loose anything
647 + tp->intr_mask = 0xffff;
649 RTL_W16(IntrMask, tp->intr_event);
651 diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
652 index b68bc39..42963a9 100644
653 --- a/drivers/net/sky2.c
654 +++ b/drivers/net/sky2.c
655 @@ -2393,7 +2393,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
656 if (likely(status >> 16 == (status & 0xffff))) {
657 skb = sky2->rx_ring[sky2->rx_next].skb;
658 skb->ip_summed = CHECKSUM_COMPLETE;
659 - skb->csum = status & 0xffff;
660 + skb->csum = le16_to_cpu(status);
662 printk(KERN_NOTICE PFX "%s: hardware receive "
663 "checksum problem (status = %#x)\n",
664 diff --git a/drivers/net/usb/cdc_subset.c b/drivers/net/usb/cdc_subset.c
665 index c66b9c3..ca39ace 100644
666 --- a/drivers/net/usb/cdc_subset.c
667 +++ b/drivers/net/usb/cdc_subset.c
668 @@ -307,9 +307,10 @@ static const struct usb_device_id products [] = {
669 USB_DEVICE (0x1286, 0x8001), // "blob" bootloader
670 .driver_info = (unsigned long) &blob_info,
672 - // Linux Ethernet/RNDIS gadget on pxa210/25x/26x, second config
673 - // e.g. Gumstix, current OpenZaurus, ...
674 - USB_DEVICE_VER (0x0525, 0xa4a2, 0x0203, 0x0203),
675 + // Linux Ethernet/RNDIS gadget, mostly on PXA, second config
676 + // e.g. Gumstix, current OpenZaurus, ... or anything else
677 + // that just enables this gadget option.
678 + USB_DEVICE (0x0525, 0xa4a2),
679 .driver_info = (unsigned long) &linuxdev_info,
682 diff --git a/drivers/net/usb/pegasus.c b/drivers/net/usb/pegasus.c
683 index 8c19307..a04a8b0 100644
684 --- a/drivers/net/usb/pegasus.c
685 +++ b/drivers/net/usb/pegasus.c
686 @@ -295,7 +295,7 @@ static int update_eth_regs_async(pegasus_t * pegasus)
688 pegasus->dr.bRequestType = PEGASUS_REQT_WRITE;
689 pegasus->dr.bRequest = PEGASUS_REQ_SET_REGS;
690 - pegasus->dr.wValue = 0;
691 + pegasus->dr.wValue = cpu_to_le16(0);
692 pegasus->dr.wIndex = cpu_to_le16(EthCtrl0);
693 pegasus->dr.wLength = cpu_to_le16(3);
694 pegasus->ctrl_urb->transfer_buffer_length = 3;
695 @@ -444,11 +444,12 @@ static int write_eprom_word(pegasus_t * pegasus, __u8 index, __u16 data)
697 __u8 tmp, d[4] = { 0x3f, 0, 0, EPROM_WRITE };
699 + __le16 le_data = cpu_to_le16(data);
701 set_registers(pegasus, EpromOffset, 4, d);
702 enable_eprom_write(pegasus);
703 set_register(pegasus, EpromOffset, index);
704 - set_registers(pegasus, EpromData, 2, &data);
705 + set_registers(pegasus, EpromData, 2, &le_data);
706 set_register(pegasus, EpromCtrl, EPROM_WRITE);
708 for (i = 0; i < REG_TIMEOUT; i++) {
709 @@ -918,29 +919,32 @@ static struct net_device_stats *pegasus_netdev_stats(struct net_device *dev)
711 static inline void disable_net_traffic(pegasus_t * pegasus)
714 + __le16 tmp = cpu_to_le16(0);
716 - set_registers(pegasus, EthCtrl0, 2, &tmp);
717 + set_registers(pegasus, EthCtrl0, sizeof(tmp), &tmp);
720 static inline void get_interrupt_interval(pegasus_t * pegasus)
726 - read_eprom_word(pegasus, 4, (__u16 *) data);
727 + read_eprom_word(pegasus, 4, &data);
728 + interval = data >> 8;
729 if (pegasus->usb->speed != USB_SPEED_HIGH) {
730 - if (data[1] < 0x80) {
731 + if (interval < 0x80) {
732 if (netif_msg_timer(pegasus))
733 dev_info(&pegasus->intf->dev, "intr interval "
734 "changed from %ums to %ums\n",
739 + data = (data & 0x00FF) | ((u16)interval << 8);
740 #ifdef PEGASUS_WRITE_EEPROM
741 - write_eprom_word(pegasus, 4, *(__u16 *) data);
742 + write_eprom_word(pegasus, 4, data);
746 - pegasus->intr_interval = data[1];
747 + pegasus->intr_interval = interval;
750 static void set_carrier(struct net_device *net)
751 @@ -1293,7 +1297,8 @@ static int pegasus_blacklisted(struct usb_device *udev)
752 /* Special quirk to keep the driver from handling the Belkin Bluetooth
753 * dongle which happens to have the same ID.
755 - if ((udd->idVendor == VENDOR_BELKIN && udd->idProduct == 0x0121) &&
756 + if ((udd->idVendor == cpu_to_le16(VENDOR_BELKIN)) &&
757 + (udd->idProduct == cpu_to_le16(0x0121)) &&
758 (udd->bDeviceClass == USB_CLASS_WIRELESS_CONTROLLER) &&
759 (udd->bDeviceProtocol == 1))
761 diff --git a/drivers/net/wireless/strip.c b/drivers/net/wireless/strip.c
762 index 417e9e6..1e26ddc 100644
763 --- a/drivers/net/wireless/strip.c
764 +++ b/drivers/net/wireless/strip.c
765 @@ -856,6 +856,7 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu)
766 unsigned char *orbuff = strip_info->rx_buff;
767 unsigned char *osbuff = strip_info->sx_buff;
768 unsigned char *otbuff = strip_info->tx_buff;
769 + unsigned long flags;
771 if (new_mtu > MAX_SEND_MTU) {
773 @@ -864,11 +865,11 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu)
777 - spin_lock_bh(&strip_lock);
778 + spin_lock_irqsave(&strip_lock, flags);
779 if (!allocate_buffers(strip_info, new_mtu)) {
780 printk(KERN_ERR "%s: unable to grow strip buffers, MTU change cancelled.\n",
781 strip_info->dev->name);
782 - spin_unlock_bh(&strip_lock);
783 + spin_unlock_irqrestore(&strip_lock, flags);
787 @@ -892,7 +893,7 @@ static int strip_change_mtu(struct net_device *dev, int new_mtu)
790 strip_info->tx_head = strip_info->tx_buff;
791 - spin_unlock_bh(&strip_lock);
792 + spin_unlock_irqrestore(&strip_lock, flags);
794 printk(KERN_NOTICE "%s: strip MTU changed fom %d to %d.\n",
795 strip_info->dev->name, old_mtu, strip_info->mtu);
796 @@ -981,10 +982,13 @@ static void strip_seq_neighbours(struct seq_file *seq,
797 const MetricomNodeTable * table,
800 - /* We wrap this in a do/while loop, so if the table changes */
801 - /* while we're reading it, we just go around and try again. */
802 + unsigned long flags;
806 + * We wrap this in a do/while loop, so if the table changes
807 + * while we're reading it, we just go around and try again.
811 t = table->timestamp;
812 @@ -993,9 +997,9 @@ static void strip_seq_neighbours(struct seq_file *seq,
813 for (i = 0; i < table->num_nodes; i++) {
816 - spin_lock_bh(&strip_lock);
817 + spin_lock_irqsave(&strip_lock, flags);
818 node = table->node[i];
819 - spin_unlock_bh(&strip_lock);
820 + spin_unlock_irqrestore(&strip_lock, flags);
821 seq_printf(seq, " %s\n", node.c);
823 } while (table->timestamp.tv_sec != t.tv_sec
824 @@ -1535,6 +1539,7 @@ static void strip_send(struct strip *strip_info, struct sk_buff *skb)
825 static int strip_xmit(struct sk_buff *skb, struct net_device *dev)
827 struct strip *strip_info = netdev_priv(dev);
828 + unsigned long flags;
830 if (!netif_running(dev)) {
831 printk(KERN_ERR "%s: xmit call when iface is down\n",
832 @@ -1573,11 +1578,11 @@ static int strip_xmit(struct sk_buff *skb, struct net_device *dev)
833 strip_info->dev->name, sx_pps_count / 8);
836 - spin_lock_bh(&strip_lock);
837 + spin_lock_irqsave(&strip_lock, flags);
839 strip_send(strip_info, skb);
841 - spin_unlock_bh(&strip_lock);
842 + spin_unlock_irqrestore(&strip_lock, flags);
846 @@ -2263,12 +2268,13 @@ static void strip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
848 struct strip *strip_info = (struct strip *) tty->disc_data;
849 const unsigned char *end = cp + count;
850 + unsigned long flags;
852 if (!strip_info || strip_info->magic != STRIP_MAGIC
853 || !netif_running(strip_info->dev))
856 - spin_lock_bh(&strip_lock);
857 + spin_lock_irqsave(&strip_lock, flags);
861 @@ -2335,7 +2341,7 @@ static void strip_receive_buf(struct tty_struct *tty, const unsigned char *cp,
865 - spin_unlock_bh(&strip_lock);
866 + spin_unlock_irqrestore(&strip_lock, flags);
870 @@ -2525,9 +2531,11 @@ static void strip_dev_setup(struct net_device *dev)
872 static void strip_free(struct strip *strip_info)
874 - spin_lock_bh(&strip_lock);
875 + unsigned long flags;
877 + spin_lock_irqsave(&strip_lock, flags);
878 list_del_rcu(&strip_info->list);
879 - spin_unlock_bh(&strip_lock);
880 + spin_unlock_irqrestore(&strip_lock, flags);
882 strip_info->magic = 0;
884 @@ -2541,6 +2549,7 @@ static void strip_free(struct strip *strip_info)
885 static struct strip *strip_alloc(void)
888 + unsigned long flags;
889 struct net_device *dev;
890 struct strip *strip_info;
892 @@ -2564,7 +2573,7 @@ static struct strip *strip_alloc(void)
893 strip_info->idle_timer.function = strip_IdleTask;
896 - spin_lock_bh(&strip_lock);
897 + spin_lock_irqsave(&strip_lock, flags);
900 * Search the list to find where to put our new entry
901 @@ -2583,7 +2592,7 @@ static struct strip *strip_alloc(void)
902 sprintf(dev->name, "st%ld", dev->base_addr);
904 list_add_tail_rcu(&strip_info->list, &strip_list);
905 - spin_unlock_bh(&strip_lock);
906 + spin_unlock_irqrestore(&strip_lock, flags);
910 diff --git a/drivers/pnp/pnpacpi/core.c b/drivers/pnp/pnpacpi/core.c
911 index 98b9df7..c193540 100644
912 --- a/drivers/pnp/pnpacpi/core.c
913 +++ b/drivers/pnp/pnpacpi/core.c
914 @@ -84,7 +84,6 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
915 acpi_handle handle = dev->data;
916 struct acpi_buffer buffer;
918 - acpi_status status;
920 dev_dbg(&dev->dev, "set resources\n");
921 ret = pnpacpi_build_resource_template(dev, &buffer);
922 @@ -95,21 +94,29 @@ static int pnpacpi_set_resources(struct pnp_dev *dev)
923 kfree(buffer.pointer);
926 - status = acpi_set_current_resources(handle, &buffer);
927 - if (ACPI_FAILURE(status))
928 + if (ACPI_FAILURE(acpi_set_current_resources(handle, &buffer)))
930 + else if (acpi_bus_power_manageable(handle))
931 + ret = acpi_bus_set_power(handle, ACPI_STATE_D0);
932 kfree(buffer.pointer);
936 static int pnpacpi_disable_resources(struct pnp_dev *dev)
938 - acpi_status status;
939 + acpi_handle handle = dev->data;
942 + dev_dbg(&dev->dev, "disable resources\n");
944 /* acpi_unregister_gsi(pnp_irq(dev, 0)); */
945 - status = acpi_evaluate_object((acpi_handle) dev->data,
946 - "_DIS", NULL, NULL);
947 - return ACPI_FAILURE(status) ? -ENODEV : 0;
949 + if (acpi_bus_power_manageable(handle))
950 + acpi_bus_set_power(handle, ACPI_STATE_D3);
951 + /* continue even if acpi_bus_set_power() fails */
952 + if (ACPI_FAILURE(acpi_evaluate_object(handle, "_DIS", NULL, NULL)))
957 #ifdef CONFIG_ACPI_SLEEP
958 diff --git a/drivers/scsi/zalon.c b/drivers/scsi/zalon.c
959 index 3c4a300..b8171de 100644
960 --- a/drivers/scsi/zalon.c
961 +++ b/drivers/scsi/zalon.c
962 @@ -134,7 +134,7 @@ zalon_probe(struct parisc_device *dev)
964 host = ncr_attach(&zalon7xx_template, unit, &device);
969 if (request_irq(dev->irq, ncr53c8xx_intr, IRQF_SHARED, "zalon", host)) {
970 printk(KERN_ERR "%s: irq problem with %d, detaching\n ",
971 diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c
972 index 8d2d79e..1ff88af 100644
973 --- a/drivers/usb/core/devio.c
974 +++ b/drivers/usb/core/devio.c
975 @@ -976,7 +976,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
976 USBDEVFS_URB_ZERO_PACKET |
977 USBDEVFS_URB_NO_INTERRUPT))
980 + if (uurb->buffer_length > 0 && !uurb->buffer)
982 if (uurb->signr != 0 && (uurb->signr < SIGRTMIN ||
983 uurb->signr > SIGRTMAX))
984 @@ -1035,11 +1035,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
986 uurb->endpoint &= ~USB_DIR_IN;
988 - if (!access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
989 - uurb->buffer, uurb->buffer_length)) {
993 snoop(&ps->dev->dev, "control urb: bRequest=%02x "
994 "bRrequestType=%02x wValue=%04x "
995 "wIndex=%04x wLength=%04x\n",
996 @@ -1059,9 +1054,6 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
997 uurb->number_of_packets = 0;
998 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE)
1000 - if (!access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1001 - uurb->buffer, uurb->buffer_length))
1003 snoop(&ps->dev->dev, "bulk urb\n");
1006 @@ -1103,28 +1095,35 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1008 if (uurb->buffer_length > MAX_USBFS_BUFFER_SIZE)
1010 - if (!access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1011 - uurb->buffer, uurb->buffer_length))
1013 snoop(&ps->dev->dev, "interrupt urb\n");
1019 - as = alloc_async(uurb->number_of_packets);
1021 + if (uurb->buffer_length > 0 &&
1022 + !access_ok(is_in ? VERIFY_WRITE : VERIFY_READ,
1023 + uurb->buffer, uurb->buffer_length)) {
1029 - as->urb->transfer_buffer = kmalloc(uurb->buffer_length, GFP_KERNEL);
1030 - if (!as->urb->transfer_buffer) {
1031 + as = alloc_async(uurb->number_of_packets);
1038 + if (uurb->buffer_length > 0) {
1039 + as->urb->transfer_buffer = kmalloc(uurb->buffer_length,
1041 + if (!as->urb->transfer_buffer) {
1048 as->urb->dev = ps->dev;
1049 as->urb->pipe = (uurb->type << 30) |
1050 __create_pipe(ps->dev, uurb->endpoint & 0xf) |
1051 @@ -1166,7 +1165,7 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1055 - if (uurb->endpoint & USB_DIR_IN)
1056 + if (is_in && uurb->buffer_length > 0)
1057 as->userbuffer = uurb->buffer;
1059 as->userbuffer = NULL;
1060 @@ -1176,9 +1175,9 @@ static int proc_do_submiturb(struct dev_state *ps, struct usbdevfs_urb *uurb,
1061 as->uid = current->uid;
1062 as->euid = current->euid;
1063 security_task_getsecid(current, &as->secid);
1065 + if (!is_in && uurb->buffer_length > 0) {
1066 if (copy_from_user(as->urb->transfer_buffer, uurb->buffer,
1067 - as->urb->transfer_buffer_length)) {
1068 + uurb->buffer_length)) {
1072 @@ -1228,22 +1227,22 @@ static int processcompl(struct async *as, void __user * __user *arg)
1074 if (copy_to_user(as->userbuffer, urb->transfer_buffer,
1075 urb->transfer_buffer_length))
1078 if (put_user(as->status, &userurb->status))
1081 if (put_user(urb->actual_length, &userurb->actual_length))
1084 if (put_user(urb->error_count, &userurb->error_count))
1088 if (usb_endpoint_xfer_isoc(&urb->ep->desc)) {
1089 for (i = 0; i < urb->number_of_packets; i++) {
1090 if (put_user(urb->iso_frame_desc[i].actual_length,
1091 &userurb->iso_frame_desc[i].actual_length))
1094 if (put_user(urb->iso_frame_desc[i].status,
1095 &userurb->iso_frame_desc[i].status))
1101 @@ -1252,6 +1251,10 @@ static int processcompl(struct async *as, void __user * __user *arg)
1102 if (put_user(addr, (void __user * __user *)arg))
1111 static struct async *reap_as(struct dev_state *ps)
1112 diff --git a/drivers/usb/gadget/ether.c b/drivers/usb/gadget/ether.c
1113 index bcac2e6..c5d6765 100644
1114 --- a/drivers/usb/gadget/ether.c
1115 +++ b/drivers/usb/gadget/ether.c
1116 @@ -273,15 +273,16 @@ static int __init eth_bind(struct usb_composite_dev *cdev)
1118 eth_config_driver.label = "CDC Subset/SAFE";
1120 - device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM),
1121 - device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM),
1122 - device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC;
1123 + device_desc.idVendor = cpu_to_le16(SIMPLE_VENDOR_NUM);
1124 + device_desc.idProduct = cpu_to_le16(SIMPLE_PRODUCT_NUM);
1126 + device_desc.bDeviceClass = USB_CLASS_VENDOR_SPEC;
1130 /* RNDIS plus ECM-or-Subset */
1131 - device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM),
1132 - device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM),
1133 + device_desc.idVendor = cpu_to_le16(RNDIS_VENDOR_NUM);
1134 + device_desc.idProduct = cpu_to_le16(RNDIS_PRODUCT_NUM);
1135 device_desc.bNumConfigurations = 2;
1138 diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
1139 index 1d0b49e..18e8741 100644
1140 --- a/drivers/usb/host/ehci-sched.c
1141 +++ b/drivers/usb/host/ehci-sched.c
1142 @@ -1617,11 +1617,14 @@ itd_complete (
1143 desc->status = -EPROTO;
1145 /* HC need not update length with this error */
1146 - if (!(t & EHCI_ISOC_BABBLE))
1147 - desc->actual_length = EHCI_ITD_LENGTH (t);
1148 + if (!(t & EHCI_ISOC_BABBLE)) {
1149 + desc->actual_length = EHCI_ITD_LENGTH(t);
1150 + urb->actual_length += desc->actual_length;
1152 } else if (likely ((t & EHCI_ISOC_ACTIVE) == 0)) {
1154 - desc->actual_length = EHCI_ITD_LENGTH (t);
1155 + desc->actual_length = EHCI_ITD_LENGTH(t);
1156 + urb->actual_length += desc->actual_length;
1158 /* URB was too late */
1159 desc->status = -EXDEV;
1160 @@ -2012,7 +2015,8 @@ sitd_complete (
1161 desc->status = -EPROTO;
1164 - desc->actual_length = desc->length - SITD_LENGTH (t);
1165 + desc->actual_length = desc->length - SITD_LENGTH(t);
1166 + urb->actual_length += desc->actual_length;
1168 stream->depth -= stream->interval << 3;
1170 diff --git a/drivers/usb/serial/ti_usb_3410_5052.c b/drivers/usb/serial/ti_usb_3410_5052.c
1171 index d8c41ae..bc5e905 100644
1172 --- a/drivers/usb/serial/ti_usb_3410_5052.c
1173 +++ b/drivers/usb/serial/ti_usb_3410_5052.c
1174 @@ -240,7 +240,6 @@ static struct usb_device_id ti_id_table_5052[5+TI_EXTRA_VID_PID_COUNT+1] = {
1175 { USB_DEVICE(TI_VENDOR_ID, TI_5152_BOOT_PRODUCT_ID) },
1176 { USB_DEVICE(TI_VENDOR_ID, TI_5052_EEPROM_PRODUCT_ID) },
1177 { USB_DEVICE(TI_VENDOR_ID, TI_5052_FIRMWARE_PRODUCT_ID) },
1178 - { USB_DEVICE(IBM_VENDOR_ID, IBM_4543_PRODUCT_ID) },
1181 static struct usb_device_id ti_id_table_combined[14+2*TI_EXTRA_VID_PID_COUNT+1] = {
1182 @@ -1703,7 +1702,7 @@ static int ti_do_download(struct usb_device *dev, int pipe,
1185 struct ti_firmware_header *header;
1190 for (pos = sizeof(struct ti_firmware_header); pos < size; pos++)
1191 diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
1192 index e57df48..a6f8b8f 100644
1193 --- a/fs/binfmt_elf.c
1194 +++ b/fs/binfmt_elf.c
1195 @@ -1517,11 +1517,11 @@ static int fill_note_info(struct elfhdr *elf, int phdrs,
1196 info->thread = NULL;
1198 psinfo = kmalloc(sizeof(*psinfo), GFP_KERNEL);
1199 - fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo);
1204 + fill_note(&info->psinfo, "CORE", NT_PRPSINFO, sizeof(*psinfo), psinfo);
1207 * Figure out how many notes we're going to need for each thread.
1209 diff --git a/fs/ecryptfs/keystore.c b/fs/ecryptfs/keystore.c
1210 index 59b9833..247c0d4 100644
1211 --- a/fs/ecryptfs/keystore.c
1212 +++ b/fs/ecryptfs/keystore.c
1213 @@ -730,6 +730,13 @@ parse_tag_3_packet(struct ecryptfs_crypt_stat *crypt_stat,
1215 (*new_auth_tok)->session_key.encrypted_key_size =
1216 (body_size - (ECRYPTFS_SALT_SIZE + 5));
1217 + if ((*new_auth_tok)->session_key.encrypted_key_size
1218 + > ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES) {
1219 + printk(KERN_WARNING "Tag 3 packet contains key larger "
1220 + "than ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES\n");
1224 if (unlikely(data[(*packet_size)++] != 0x04)) {
1225 printk(KERN_WARNING "Unknown version number [%d]\n",
1226 data[(*packet_size) - 1]);
1227 @@ -876,6 +883,12 @@ parse_tag_11_packet(unsigned char *data, unsigned char *contents,
1231 + if (unlikely((*tag_11_contents_size) > max_contents_bytes)) {
1232 + printk(KERN_ERR "Literal data section in tag 11 packet exceeds "
1233 + "expected size\n");
1237 if (data[(*packet_size)++] != 0x62) {
1238 printk(KERN_WARNING "Unrecognizable packet\n");
1240 diff --git a/include/net/x25.h b/include/net/x25.h
1241 index fc3f03d..2cda040 100644
1242 --- a/include/net/x25.h
1243 +++ b/include/net/x25.h
1244 @@ -187,7 +187,7 @@ extern int x25_addr_ntoa(unsigned char *, struct x25_address *,
1245 extern int x25_addr_aton(unsigned char *, struct x25_address *,
1246 struct x25_address *);
1247 extern struct sock *x25_find_socket(unsigned int, struct x25_neigh *);
1248 -extern void x25_destroy_socket(struct sock *);
1249 +extern void x25_destroy_socket_from_timer(struct sock *);
1250 extern int x25_rx_call_request(struct sk_buff *, struct x25_neigh *, unsigned int);
1251 extern void x25_kill_by_neigh(struct x25_neigh *);
1253 diff --git a/mm/filemap.c b/mm/filemap.c
1254 index 8a477d3..bff0b00 100644
1257 @@ -2441,6 +2441,7 @@ again:
1259 flush_dcache_page(page);
1261 + mark_page_accessed(page);
1262 status = a_ops->write_end(file, mapping, pos, bytes, copied,
1264 if (unlikely(status < 0))
1265 diff --git a/mm/slab.c b/mm/slab.c
1266 index e76eee4..600e864 100644
1269 @@ -2580,7 +2580,7 @@ void kmem_cache_destroy(struct kmem_cache *cachep)
1272 if (unlikely(cachep->flags & SLAB_DESTROY_BY_RCU))
1273 - synchronize_rcu();
1276 __kmem_cache_destroy(cachep);
1277 mutex_unlock(&cache_chain_mutex);
1278 diff --git a/mm/slob.c b/mm/slob.c
1279 index cb675d1..ed04252 100644
1282 @@ -561,6 +561,8 @@ EXPORT_SYMBOL(kmem_cache_create);
1284 void kmem_cache_destroy(struct kmem_cache *c)
1286 + if (c->flags & SLAB_DESTROY_BY_RCU)
1288 slob_free(c, sizeof(struct kmem_cache));
1290 EXPORT_SYMBOL(kmem_cache_destroy);
1291 diff --git a/mm/slub.c b/mm/slub.c
1292 index 0c83e6a..f0175b4 100644
1295 @@ -2447,6 +2447,8 @@ static inline int kmem_cache_close(struct kmem_cache *s)
1297 void kmem_cache_destroy(struct kmem_cache *s)
1299 + if (s->flags & SLAB_DESTROY_BY_RCU)
1301 down_write(&slub_lock);
1304 diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
1305 index 76739e9..66cfe88 100644
1306 --- a/net/sunrpc/clnt.c
1307 +++ b/net/sunrpc/clnt.c
1308 @@ -1089,14 +1089,24 @@ static void
1309 call_transmit_status(struct rpc_task *task)
1311 task->tk_action = call_status;
1313 - * Special case: if we've been waiting on the socket's write_space()
1314 - * callback, then don't call xprt_end_transmit().
1316 - if (task->tk_status == -EAGAIN)
1318 - xprt_end_transmit(task);
1319 - rpc_task_force_reencode(task);
1320 + switch (task->tk_status) {
1324 + xprt_end_transmit(task);
1326 + * Special cases: if we've been waiting on the
1327 + * socket's write_space() callback, or if the
1328 + * socket just returned a connection error,
1329 + * then hold onto the transport lock.
1331 + case -ECONNREFUSED:
1334 + case -EHOSTUNREACH:
1335 + case -ENETUNREACH:
1336 + rpc_task_force_reencode(task);
1341 diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c
1342 index 4486c59..8f9295d 100644
1343 --- a/net/sunrpc/xprtsock.c
1344 +++ b/net/sunrpc/xprtsock.c
1345 @@ -1150,7 +1150,6 @@ static void xs_tcp_state_change(struct sock *sk)
1347 case TCP_CLOSE_WAIT:
1348 /* The server initiated a shutdown of the socket */
1349 - set_bit(XPRT_CLOSING, &xprt->state);
1350 xprt_force_disconnect(xprt);
1352 xprt->connect_cookie++;
1353 @@ -1163,6 +1162,7 @@ static void xs_tcp_state_change(struct sock *sk)
1354 xprt->reestablish_timeout = XS_TCP_INIT_REEST_TO;
1357 + set_bit(XPRT_CLOSING, &xprt->state);
1358 smp_mb__before_clear_bit();
1359 clear_bit(XPRT_CONNECTED, &xprt->state);
1360 smp_mb__after_clear_bit();
1361 @@ -1560,10 +1560,9 @@ out:
1362 * We need to preserve the port number so the reply cache on the server can
1363 * find our cached RPC replies when we get around to reconnecting.
1365 -static void xs_tcp_reuse_connection(struct rpc_xprt *xprt)
1366 +static void xs_abort_connection(struct rpc_xprt *xprt, struct sock_xprt *transport)
1369 - struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
1370 struct sockaddr any;
1372 dprintk("RPC: disconnecting xprt %p to reuse port\n", xprt);
1373 @@ -1580,6 +1579,17 @@ static void xs_tcp_reuse_connection(struct rpc_xprt *xprt)
1377 +static void xs_tcp_reuse_connection(struct rpc_xprt *xprt, struct sock_xprt *transport)
1379 + unsigned int state = transport->inet->sk_state;
1381 + if (state == TCP_CLOSE && transport->sock->state == SS_UNCONNECTED)
1383 + if ((1 << state) & (TCPF_ESTABLISHED|TCPF_SYN_SENT))
1385 + xs_abort_connection(xprt, transport);
1388 static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock)
1390 struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt);
1391 @@ -1650,7 +1660,7 @@ static void xs_tcp_connect_worker4(struct work_struct *work)
1394 /* "close" the socket, preserving the local port */
1395 - xs_tcp_reuse_connection(xprt);
1396 + xs_tcp_reuse_connection(xprt, transport);
1398 dprintk("RPC: worker connecting xprt %p to address: %s\n",
1399 xprt, xprt->address_strings[RPC_DISPLAY_ALL]);
1400 @@ -1710,7 +1720,7 @@ static void xs_tcp_connect_worker6(struct work_struct *work)
1403 /* "close" the socket, preserving the local port */
1404 - xs_tcp_reuse_connection(xprt);
1405 + xs_tcp_reuse_connection(xprt, transport);
1407 dprintk("RPC: worker connecting xprt %p to address: %s\n",
1408 xprt, xprt->address_strings[RPC_DISPLAY_ALL]);
1409 @@ -1780,9 +1790,6 @@ static void xs_tcp_connect(struct rpc_task *task)
1411 struct rpc_xprt *xprt = task->tk_xprt;
1413 - /* Initiate graceful shutdown of the socket if not already done */
1414 - if (test_bit(XPRT_CONNECTED, &xprt->state))
1415 - xs_tcp_shutdown(xprt);
1416 /* Exit if we need to wait for socket shutdown to complete */
1417 if (test_bit(XPRT_CLOSING, &xprt->state))
1419 diff --git a/net/x25/af_x25.c b/net/x25/af_x25.c
1420 index 88d80f5..220a5e3 100644
1421 --- a/net/x25/af_x25.c
1422 +++ b/net/x25/af_x25.c
1423 @@ -332,14 +332,14 @@ static unsigned int x25_new_lci(struct x25_neigh *nb)
1427 -void x25_destroy_socket(struct sock *);
1428 +static void __x25_destroy_socket(struct sock *);
1431 * handler for deferred kills.
1433 static void x25_destroy_timer(unsigned long data)
1435 - x25_destroy_socket((struct sock *)data);
1436 + x25_destroy_socket_from_timer((struct sock *)data);
1440 @@ -349,12 +349,10 @@ static void x25_destroy_timer(unsigned long data)
1441 * will touch it and we are (fairly 8-) ) safe.
1442 * Not static as it's used by the timer
1444 -void x25_destroy_socket(struct sock *sk)
1445 +static void __x25_destroy_socket(struct sock *sk)
1447 struct sk_buff *skb;
1451 x25_stop_heartbeat(sk);
1454 @@ -385,7 +383,22 @@ void x25_destroy_socket(struct sock *sk)
1455 /* drop last reference so sock_put will free */
1460 +void x25_destroy_socket_from_timer(struct sock *sk)
1464 + __x25_destroy_socket(sk);
1465 + bh_unlock_sock(sk);
1469 +static void x25_destroy_socket(struct sock *sk)
1473 + __x25_destroy_socket(sk);
1477 diff --git a/net/x25/x25_timer.c b/net/x25/x25_timer.c
1478 index d3e3e54..5c5db1a 100644
1479 --- a/net/x25/x25_timer.c
1480 +++ b/net/x25/x25_timer.c
1481 @@ -113,7 +113,7 @@ static void x25_heartbeat_expiry(unsigned long param)
1482 (sk->sk_state == TCP_LISTEN &&
1483 sock_flag(sk, SOCK_DEAD))) {
1485 - x25_destroy_socket(sk);
1486 + x25_destroy_socket_from_timer(sk);
1490 diff --git a/net/xfrm/xfrm_algo.c b/net/xfrm/xfrm_algo.c
1491 index 96036cf..79d78f4 100644
1492 --- a/net/xfrm/xfrm_algo.c
1493 +++ b/net/xfrm/xfrm_algo.c
1494 @@ -292,8 +292,8 @@ static struct xfrm_algo_desc ealg_list[] = {
1498 - .name = "cbc(cast128)",
1499 - .compat = "cast128",
1500 + .name = "cbc(cast5)",
1501 + .compat = "cast5",
1505 diff --git a/sound/pci/ca0106/ca0106_main.c b/sound/pci/ca0106/ca0106_main.c
1506 index 6abe8a3..2b8b1ed 100644
1507 --- a/sound/pci/ca0106/ca0106_main.c
1508 +++ b/sound/pci/ca0106/ca0106_main.c
1509 @@ -311,9 +311,9 @@ static struct snd_pcm_hardware snd_ca0106_capture_hw = {
1513 - .buffer_bytes_max = ((65536 - 64) * 8),
1514 + .buffer_bytes_max = 65536 - 128,
1515 .period_bytes_min = 64,
1516 - .period_bytes_max = (65536 - 64),
1517 + .period_bytes_max = 32768 - 64,
1521 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1522 index 3b5c6c2..07f8dcc 100644
1523 --- a/sound/pci/hda/patch_realtek.c
1524 +++ b/sound/pci/hda/patch_realtek.c
1525 @@ -9214,6 +9214,18 @@ static void alc262_lenovo_3000_unsol_event(struct hda_codec *codec,
1526 alc262_lenovo_3000_automute(codec, 1);
1529 +static int amp_stereo_mute_update(struct hda_codec *codec, hda_nid_t nid,
1530 + int dir, int idx, long *valp)
1532 + int i, change = 0;
1534 + for (i = 0; i < 2; i++, valp++)
1535 + change |= snd_hda_codec_amp_update(codec, nid, i, dir, idx,
1537 + *valp ? 0 : HDA_AMP_MUTE);
1541 /* bind hp and internal speaker mute (with plug check) */
1542 static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
1543 struct snd_ctl_elem_value *ucontrol)
1544 @@ -9222,13 +9234,8 @@ static int alc262_fujitsu_master_sw_put(struct snd_kcontrol *kcontrol,
1545 long *valp = ucontrol->value.integer.value;
1548 - change = snd_hda_codec_amp_stereo(codec, 0x14, HDA_OUTPUT, 0,
1550 - valp ? 0 : HDA_AMP_MUTE);
1551 - change |= snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0,
1553 - valp ? 0 : HDA_AMP_MUTE);
1555 + change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
1556 + change |= amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
1558 alc262_fujitsu_automute(codec, 0);
1560 @@ -9265,10 +9272,7 @@ static int alc262_lenovo_3000_master_sw_put(struct snd_kcontrol *kcontrol,
1561 long *valp = ucontrol->value.integer.value;
1564 - change = snd_hda_codec_amp_stereo(codec, 0x1b, HDA_OUTPUT, 0,
1566 - valp ? 0 : HDA_AMP_MUTE);
1568 + change = amp_stereo_mute_update(codec, 0x1b, HDA_OUTPUT, 0, valp);
1570 alc262_lenovo_3000_automute(codec, 0);
1572 @@ -10280,12 +10284,7 @@ static int alc268_acer_master_sw_put(struct snd_kcontrol *kcontrol,
1573 long *valp = ucontrol->value.integer.value;
1576 - change = snd_hda_codec_amp_update(codec, 0x14, 0, HDA_OUTPUT, 0,
1578 - valp[0] ? 0 : HDA_AMP_MUTE);
1579 - change |= snd_hda_codec_amp_update(codec, 0x14, 1, HDA_OUTPUT, 0,
1581 - valp[1] ? 0 : HDA_AMP_MUTE);
1582 + change = amp_stereo_mute_update(codec, 0x14, HDA_OUTPUT, 0, valp);
1584 alc268_acer_automute(codec, 0);
1586 diff --git a/sound/pci/oxygen/virtuoso.c b/sound/pci/oxygen/virtuoso.c
1587 index 01d7b75..d1773f6 100644
1588 --- a/sound/pci/oxygen/virtuoso.c
1589 +++ b/sound/pci/oxygen/virtuoso.c
1590 @@ -376,6 +376,8 @@ static void xonar_d2_resume(struct oxygen *chip)
1592 static void xonar_d1_resume(struct oxygen *chip)
1594 + oxygen_set_bits8(chip, OXYGEN_FUNCTION, OXYGEN_FUNCTION_RESET_CODEC);
1597 xonar_enable_output(chip);
1599 diff --git a/sound/usb/usbaudio.c b/sound/usb/usbaudio.c
1600 index c10e476..915a131 100644
1601 --- a/sound/usb/usbaudio.c
1602 +++ b/sound/usb/usbaudio.c
1603 @@ -2674,7 +2674,7 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
1604 struct usb_interface_descriptor *altsd;
1605 int i, altno, err, stream;
1607 - struct audioformat *fp;
1608 + struct audioformat *fp = NULL;
1609 unsigned char *fmt, *csep;
1612 @@ -2747,6 +2747,18 @@ static int parse_audio_endpoints(struct snd_usb_audio *chip, int iface_no)
1617 + * Blue Microphones workaround: The last altsetting is identical
1618 + * with the previous one, except for a larger packet size, but
1619 + * is actually a mislabeled two-channel setting; ignore it.
1621 + if (fmt[4] == 1 && fmt[5] == 2 && altno == 2 && num == 3 &&
1622 + fp && fp->altsetting == 1 && fp->channels == 1 &&
1623 + fp->format == SNDRV_PCM_FORMAT_S16_LE &&
1624 + le16_to_cpu(get_endpoint(alts, 0)->wMaxPacketSize) ==
1625 + fp->maxpacksize * 2)
1628 csep = snd_usb_find_desc(alts->endpoint[0].extra, alts->endpoint[0].extralen, NULL, USB_DT_CS_ENDPOINT);
1629 /* Creamware Noah has this descriptor after the 2nd endpoint */
1630 if (!csep && altsd->bNumEndpoints >= 2)