/[linux-patches]/genpatches-2.6/tags/3.0-30/1029_linux-3.0.30.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1029_linux-3.0.30.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (22 months ago) by mpagano
File size: 62513 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index 3b57cac..8ab9415 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 29
9 +SUBLEVEL = 30
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/crypto/sha512_generic.c b/crypto/sha512_generic.c
14 index 107f6f7..dd30f40 100644
15 --- a/crypto/sha512_generic.c
16 +++ b/crypto/sha512_generic.c
17 @@ -174,7 +174,7 @@ sha512_update(struct shash_desc *desc, const u8 *data, unsigned int len)
18 index = sctx->count[0] & 0x7f;
19
20 /* Update number of bytes */
21 - if (!(sctx->count[0] += len))
22 + if ((sctx->count[0] += len) < len)
23 sctx->count[1]++;
24
25 part_len = 128 - index;
26 diff --git a/drivers/bluetooth/ath3k.c b/drivers/bluetooth/ath3k.c
27 index c08e874..a714c73 100644
28 --- a/drivers/bluetooth/ath3k.c
29 +++ b/drivers/bluetooth/ath3k.c
30 @@ -73,6 +73,7 @@ static struct usb_device_id ath3k_table[] = {
31 { USB_DEVICE(0x0CF3, 0x3004) },
32 { USB_DEVICE(0x0CF3, 0x311D) },
33 { USB_DEVICE(0x13d3, 0x3375) },
34 + { USB_DEVICE(0x04CA, 0x3005) },
35
36 /* Atheros AR5BBU12 with sflash firmware */
37 { USB_DEVICE(0x0489, 0xE02C) },
38 @@ -91,6 +92,7 @@ static struct usb_device_id ath3k_blist_tbl[] = {
39 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
40 { USB_DEVICE(0x0cf3, 0x311D), .driver_info = BTUSB_ATH3012 },
41 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
42 + { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
43
44 { } /* Terminating entry */
45 };
46 diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
47 index 72172a7..8fbda40 100644
48 --- a/drivers/bluetooth/btusb.c
49 +++ b/drivers/bluetooth/btusb.c
50 @@ -125,6 +125,7 @@ static struct usb_device_id blacklist_table[] = {
51 { USB_DEVICE(0x0cf3, 0x3004), .driver_info = BTUSB_ATH3012 },
52 { USB_DEVICE(0x0cf3, 0x311d), .driver_info = BTUSB_ATH3012 },
53 { USB_DEVICE(0x13d3, 0x3375), .driver_info = BTUSB_ATH3012 },
54 + { USB_DEVICE(0x04ca, 0x3005), .driver_info = BTUSB_ATH3012 },
55
56 /* Atheros AR5BBU12 with sflash firmware */
57 { USB_DEVICE(0x0489, 0xe02c), .driver_info = BTUSB_IGNORE },
58 diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
59 index 5d06b89..6f03846 100644
60 --- a/drivers/media/rc/winbond-cir.c
61 +++ b/drivers/media/rc/winbond-cir.c
62 @@ -1058,6 +1058,7 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
63 goto exit_unregister_led;
64 }
65
66 + data->dev->driver_type = RC_DRIVER_IR_RAW;
67 data->dev->driver_name = WBCIR_NAME;
68 data->dev->input_name = WBCIR_NAME;
69 data->dev->input_phys = "wbcir/cir0";
70 diff --git a/drivers/net/8139cp.c b/drivers/net/8139cp.c
71 index 10c4505..a8b82da 100644
72 --- a/drivers/net/8139cp.c
73 +++ b/drivers/net/8139cp.c
74 @@ -992,6 +992,11 @@ static inline void cp_start_hw (struct cp_private *cp)
75 cpw8(Cmd, RxOn | TxOn);
76 }
77
78 +static void cp_enable_irq(struct cp_private *cp)
79 +{
80 + cpw16_f(IntrMask, cp_intr_mask);
81 +}
82 +
83 static void cp_init_hw (struct cp_private *cp)
84 {
85 struct net_device *dev = cp->dev;
86 @@ -1031,8 +1036,6 @@ static void cp_init_hw (struct cp_private *cp)
87
88 cpw16(MultiIntr, 0);
89
90 - cpw16_f(IntrMask, cp_intr_mask);
91 -
92 cpw8_f(Cfg9346, Cfg9346_Lock);
93 }
94
95 @@ -1164,6 +1167,8 @@ static int cp_open (struct net_device *dev)
96 if (rc)
97 goto err_out_hw;
98
99 + cp_enable_irq(cp);
100 +
101 netif_carrier_off(dev);
102 mii_check_media(&cp->mii_if, netif_msg_link(cp), true);
103 netif_start_queue(dev);
104 @@ -2052,6 +2057,7 @@ static int cp_resume (struct pci_dev *pdev)
105 /* FIXME: sh*t may happen if the Rx ring buffer is depleted */
106 cp_init_rings_index (cp);
107 cp_init_hw (cp);
108 + cp_enable_irq(cp);
109 netif_start_queue (dev);
110
111 spin_lock_irqsave (&cp->lock, flags);
112 diff --git a/drivers/net/atlx/atl1.c b/drivers/net/atlx/atl1.c
113 index cd5789f..48c27d3 100644
114 --- a/drivers/net/atlx/atl1.c
115 +++ b/drivers/net/atlx/atl1.c
116 @@ -2476,7 +2476,7 @@ static irqreturn_t atl1_intr(int irq, void *data)
117 "pcie phy link down %x\n", status);
118 if (netif_running(adapter->netdev)) { /* reset MAC */
119 iowrite32(0, adapter->hw.hw_addr + REG_IMR);
120 - schedule_work(&adapter->pcie_dma_to_rst_task);
121 + schedule_work(&adapter->reset_dev_task);
122 return IRQ_HANDLED;
123 }
124 }
125 @@ -2488,7 +2488,7 @@ static irqreturn_t atl1_intr(int irq, void *data)
126 "pcie DMA r/w error (status = 0x%x)\n",
127 status);
128 iowrite32(0, adapter->hw.hw_addr + REG_IMR);
129 - schedule_work(&adapter->pcie_dma_to_rst_task);
130 + schedule_work(&adapter->reset_dev_task);
131 return IRQ_HANDLED;
132 }
133
134 @@ -2633,10 +2633,10 @@ static void atl1_down(struct atl1_adapter *adapter)
135 atl1_clean_rx_ring(adapter);
136 }
137
138 -static void atl1_tx_timeout_task(struct work_struct *work)
139 +static void atl1_reset_dev_task(struct work_struct *work)
140 {
141 struct atl1_adapter *adapter =
142 - container_of(work, struct atl1_adapter, tx_timeout_task);
143 + container_of(work, struct atl1_adapter, reset_dev_task);
144 struct net_device *netdev = adapter->netdev;
145
146 netif_device_detach(netdev);
147 @@ -3034,12 +3034,10 @@ static int __devinit atl1_probe(struct pci_dev *pdev,
148 (unsigned long)adapter);
149 adapter->phy_timer_pending = false;
150
151 - INIT_WORK(&adapter->tx_timeout_task, atl1_tx_timeout_task);
152 + INIT_WORK(&adapter->reset_dev_task, atl1_reset_dev_task);
153
154 INIT_WORK(&adapter->link_chg_task, atlx_link_chg_task);
155
156 - INIT_WORK(&adapter->pcie_dma_to_rst_task, atl1_tx_timeout_task);
157 -
158 err = register_netdev(netdev);
159 if (err)
160 goto err_common;
161 diff --git a/drivers/net/atlx/atl1.h b/drivers/net/atlx/atl1.h
162 index 68de8cb..c27b724 100644
163 --- a/drivers/net/atlx/atl1.h
164 +++ b/drivers/net/atlx/atl1.h
165 @@ -759,9 +759,8 @@ struct atl1_adapter {
166 u16 link_speed;
167 u16 link_duplex;
168 spinlock_t lock;
169 - struct work_struct tx_timeout_task;
170 + struct work_struct reset_dev_task;
171 struct work_struct link_chg_task;
172 - struct work_struct pcie_dma_to_rst_task;
173
174 struct timer_list phy_config_timer;
175 bool phy_timer_pending;
176 diff --git a/drivers/net/atlx/atlx.c b/drivers/net/atlx/atlx.c
177 index afb7f7d..2b7af06 100644
178 --- a/drivers/net/atlx/atlx.c
179 +++ b/drivers/net/atlx/atlx.c
180 @@ -193,7 +193,7 @@ static void atlx_tx_timeout(struct net_device *netdev)
181 {
182 struct atlx_adapter *adapter = netdev_priv(netdev);
183 /* Do the reset outside of interrupt context */
184 - schedule_work(&adapter->tx_timeout_task);
185 + schedule_work(&adapter->reset_dev_task);
186 }
187
188 /*
189 diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
190 index 0b65c5f..e6da842 100644
191 --- a/drivers/net/bonding/bond_main.c
192 +++ b/drivers/net/bonding/bond_main.c
193 @@ -3076,7 +3076,11 @@ static void bond_ab_arp_commit(struct bonding *bond, int delta_in_ticks)
194 trans_start + delta_in_ticks)) ||
195 bond->curr_active_slave != slave) {
196 slave->link = BOND_LINK_UP;
197 - bond->current_arp_slave = NULL;
198 + if (bond->current_arp_slave) {
199 + bond_set_slave_inactive_flags(
200 + bond->current_arp_slave);
201 + bond->current_arp_slave = NULL;
202 + }
203
204 pr_info("%s: link status definitely up for interface %s.\n",
205 bond->dev->name, slave->dev->name);
206 diff --git a/drivers/net/davinci_mdio.c b/drivers/net/davinci_mdio.c
207 index 7615040..f470ab6 100644
208 --- a/drivers/net/davinci_mdio.c
209 +++ b/drivers/net/davinci_mdio.c
210 @@ -181,6 +181,11 @@ static inline int wait_for_user_access(struct davinci_mdio_data *data)
211 __davinci_mdio_reset(data);
212 return -EAGAIN;
213 }
214 +
215 + reg = __raw_readl(&regs->user[0].access);
216 + if ((reg & USERACCESS_GO) == 0)
217 + return 0;
218 +
219 dev_err(data->dev, "timed out waiting for user access\n");
220 return -ETIMEDOUT;
221 }
222 diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
223 index 39cf9b9..3fa19c1 100644
224 --- a/drivers/net/dummy.c
225 +++ b/drivers/net/dummy.c
226 @@ -106,14 +106,14 @@ static int dummy_dev_init(struct net_device *dev)
227 return 0;
228 }
229
230 -static void dummy_dev_free(struct net_device *dev)
231 +static void dummy_dev_uninit(struct net_device *dev)
232 {
233 free_percpu(dev->dstats);
234 - free_netdev(dev);
235 }
236
237 static const struct net_device_ops dummy_netdev_ops = {
238 .ndo_init = dummy_dev_init,
239 + .ndo_uninit = dummy_dev_uninit,
240 .ndo_start_xmit = dummy_xmit,
241 .ndo_validate_addr = eth_validate_addr,
242 .ndo_set_multicast_list = set_multicast_list,
243 @@ -127,7 +127,7 @@ static void dummy_setup(struct net_device *dev)
244
245 /* Initialize the device structure. */
246 dev->netdev_ops = &dummy_netdev_ops;
247 - dev->destructor = dummy_dev_free;
248 + dev->destructor = free_netdev;
249
250 /* Fill in device structure with ethernet-generic values. */
251 dev->tx_queue_len = 0;
252 diff --git a/drivers/net/ks8851_mll.c b/drivers/net/ks8851_mll.c
253 index 61631ca..3eacbb4 100644
254 --- a/drivers/net/ks8851_mll.c
255 +++ b/drivers/net/ks8851_mll.c
256 @@ -38,7 +38,7 @@
257 #define DRV_NAME "ks8851_mll"
258
259 static u8 KS_DEFAULT_MAC_ADDRESS[] = { 0x00, 0x10, 0xA1, 0x86, 0x95, 0x11 };
260 -#define MAX_RECV_FRAMES 32
261 +#define MAX_RECV_FRAMES 255
262 #define MAX_BUF_SIZE 2048
263 #define TX_BUF_SIZE 2000
264 #define RX_BUF_SIZE 2000
265 diff --git a/drivers/net/ksz884x.c b/drivers/net/ksz884x.c
266 index 41ea592..95b6664 100644
267 --- a/drivers/net/ksz884x.c
268 +++ b/drivers/net/ksz884x.c
269 @@ -5679,7 +5679,7 @@ static int netdev_set_mac_address(struct net_device *dev, void *addr)
270 memcpy(hw->override_addr, mac->sa_data, MAC_ADDR_LEN);
271 }
272
273 - memcpy(dev->dev_addr, mac->sa_data, MAX_ADDR_LEN);
274 + memcpy(dev->dev_addr, mac->sa_data, ETH_ALEN);
275
276 interrupt = hw_block_intr(hw);
277
278 diff --git a/drivers/net/ppp_generic.c b/drivers/net/ppp_generic.c
279 index 33d0131..b890401 100644
280 --- a/drivers/net/ppp_generic.c
281 +++ b/drivers/net/ppp_generic.c
282 @@ -968,7 +968,6 @@ ppp_start_xmit(struct sk_buff *skb, struct net_device *dev)
283 proto = npindex_to_proto[npi];
284 put_unaligned_be16(proto, pp);
285
286 - netif_stop_queue(dev);
287 skb_queue_tail(&ppp->file.xq, skb);
288 ppp_xmit_process(ppp);
289 return NETDEV_TX_OK;
290 @@ -1063,6 +1062,8 @@ ppp_xmit_process(struct ppp *ppp)
291 code that we can accept some more. */
292 if (!ppp->xmit_pending && !skb_peek(&ppp->file.xq))
293 netif_wake_queue(ppp->dev);
294 + else
295 + netif_stop_queue(ppp->dev);
296 }
297 ppp_xmit_unlock(ppp);
298 }
299 diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
300 index c6d47d1..3d12e8c 100644
301 --- a/drivers/net/smsc911x.c
302 +++ b/drivers/net/smsc911x.c
303 @@ -1083,10 +1083,8 @@ smsc911x_rx_counterrors(struct net_device *dev, unsigned int rxstat)
304
305 /* Quickly dumps bad packets */
306 static void
307 -smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktbytes)
308 +smsc911x_rx_fastforward(struct smsc911x_data *pdata, unsigned int pktwords)
309 {
310 - unsigned int pktwords = (pktbytes + NET_IP_ALIGN + 3) >> 2;
311 -
312 if (likely(pktwords >= 4)) {
313 unsigned int timeout = 500;
314 unsigned int val;
315 @@ -1150,7 +1148,7 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
316 continue;
317 }
318
319 - skb = netdev_alloc_skb(dev, pktlength + NET_IP_ALIGN);
320 + skb = netdev_alloc_skb(dev, pktwords << 2);
321 if (unlikely(!skb)) {
322 SMSC_WARN(pdata, rx_err,
323 "Unable to allocate skb for rx packet");
324 @@ -1160,14 +1158,12 @@ static int smsc911x_poll(struct napi_struct *napi, int budget)
325 break;
326 }
327
328 - skb->data = skb->head;
329 - skb_reset_tail_pointer(skb);
330 + pdata->ops->rx_readfifo(pdata,
331 + (unsigned int *)skb->data, pktwords);
332
333 /* Align IP on 16B boundary */
334 skb_reserve(skb, NET_IP_ALIGN);
335 skb_put(skb, pktlength - 4);
336 - pdata->ops->rx_readfifo(pdata,
337 - (unsigned int *)skb->head, pktwords);
338 skb->protocol = eth_type_trans(skb, dev);
339 skb_checksum_none_assert(skb);
340 netif_receive_skb(skb);
341 @@ -1390,7 +1386,7 @@ static int smsc911x_open(struct net_device *dev)
342 smsc911x_reg_write(pdata, FIFO_INT, temp);
343
344 /* set RX Data offset to 2 bytes for alignment */
345 - smsc911x_reg_write(pdata, RX_CFG, (2 << 8));
346 + smsc911x_reg_write(pdata, RX_CFG, (NET_IP_ALIGN << 8));
347
348 /* enable NAPI polling before enabling RX interrupts */
349 napi_enable(&pdata->napi);
350 diff --git a/drivers/net/usb/smsc75xx.c b/drivers/net/usb/smsc75xx.c
351 index 15b3d68..de0de3e 100644
352 --- a/drivers/net/usb/smsc75xx.c
353 +++ b/drivers/net/usb/smsc75xx.c
354 @@ -1049,6 +1049,7 @@ static int smsc75xx_bind(struct usbnet *dev, struct usb_interface *intf)
355 dev->net->ethtool_ops = &smsc75xx_ethtool_ops;
356 dev->net->flags |= IFF_MULTICAST;
357 dev->net->hard_header_len += SMSC75XX_TX_OVERHEAD;
358 + dev->hard_mtu = dev->net->mtu + dev->net->hard_header_len;
359 return 0;
360 }
361
362 diff --git a/drivers/net/wimax/i2400m/netdev.c b/drivers/net/wimax/i2400m/netdev.c
363 index 2edd8fe..0a99863 100644
364 --- a/drivers/net/wimax/i2400m/netdev.c
365 +++ b/drivers/net/wimax/i2400m/netdev.c
366 @@ -606,7 +606,8 @@ static void i2400m_get_drvinfo(struct net_device *net_dev,
367 struct i2400m *i2400m = net_dev_to_i2400m(net_dev);
368
369 strncpy(info->driver, KBUILD_MODNAME, sizeof(info->driver) - 1);
370 - strncpy(info->fw_version, i2400m->fw_name, sizeof(info->fw_version) - 1);
371 + strncpy(info->fw_version,
372 + i2400m->fw_name ? : "", sizeof(info->fw_version) - 1);
373 if (net_dev->dev.parent)
374 strncpy(info->bus_info, dev_name(net_dev->dev.parent),
375 sizeof(info->bus_info) - 1);
376 diff --git a/drivers/net/wireless/rt2x00/rt2800usb.c b/drivers/net/wireless/rt2x00/rt2800usb.c
377 index 97edee2..0781fb0 100644
378 --- a/drivers/net/wireless/rt2x00/rt2800usb.c
379 +++ b/drivers/net/wireless/rt2x00/rt2800usb.c
380 @@ -819,11 +819,14 @@ static struct usb_device_id rt2800usb_device_table[] = {
381 { USB_DEVICE(0x050d, 0x8053) },
382 { USB_DEVICE(0x050d, 0x805c) },
383 { USB_DEVICE(0x050d, 0x815c) },
384 + { USB_DEVICE(0x050d, 0x825a) },
385 { USB_DEVICE(0x050d, 0x825b) },
386 { USB_DEVICE(0x050d, 0x935a) },
387 { USB_DEVICE(0x050d, 0x935b) },
388 /* Buffalo */
389 { USB_DEVICE(0x0411, 0x00e8) },
390 + { USB_DEVICE(0x0411, 0x0158) },
391 + { USB_DEVICE(0x0411, 0x015d) },
392 { USB_DEVICE(0x0411, 0x016f) },
393 { USB_DEVICE(0x0411, 0x01a2) },
394 /* Corega */
395 @@ -838,6 +841,8 @@ static struct usb_device_id rt2800usb_device_table[] = {
396 { USB_DEVICE(0x07d1, 0x3c0e) },
397 { USB_DEVICE(0x07d1, 0x3c0f) },
398 { USB_DEVICE(0x07d1, 0x3c11) },
399 + { USB_DEVICE(0x07d1, 0x3c13) },
400 + { USB_DEVICE(0x07d1, 0x3c15) },
401 { USB_DEVICE(0x07d1, 0x3c16) },
402 { USB_DEVICE(0x2001, 0x3c1b) },
403 /* Draytek */
404 @@ -846,6 +851,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
405 { USB_DEVICE(0x7392, 0x7711) },
406 { USB_DEVICE(0x7392, 0x7717) },
407 { USB_DEVICE(0x7392, 0x7718) },
408 + { USB_DEVICE(0x7392, 0x7722) },
409 /* Encore */
410 { USB_DEVICE(0x203d, 0x1480) },
411 { USB_DEVICE(0x203d, 0x14a9) },
412 @@ -880,6 +886,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
413 { USB_DEVICE(0x1737, 0x0070) },
414 { USB_DEVICE(0x1737, 0x0071) },
415 { USB_DEVICE(0x1737, 0x0077) },
416 + { USB_DEVICE(0x1737, 0x0078) },
417 /* Logitec */
418 { USB_DEVICE(0x0789, 0x0162) },
419 { USB_DEVICE(0x0789, 0x0163) },
420 @@ -903,9 +910,13 @@ static struct usb_device_id rt2800usb_device_table[] = {
421 { USB_DEVICE(0x0db0, 0x871b) },
422 { USB_DEVICE(0x0db0, 0x871c) },
423 { USB_DEVICE(0x0db0, 0x899a) },
424 + /* Ovislink */
425 + { USB_DEVICE(0x1b75, 0x3071) },
426 + { USB_DEVICE(0x1b75, 0x3072) },
427 /* Para */
428 { USB_DEVICE(0x20b8, 0x8888) },
429 /* Pegatron */
430 + { USB_DEVICE(0x1d4d, 0x0002) },
431 { USB_DEVICE(0x1d4d, 0x000c) },
432 { USB_DEVICE(0x1d4d, 0x000e) },
433 { USB_DEVICE(0x1d4d, 0x0011) },
434 @@ -943,6 +954,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
435 { USB_DEVICE(0x0df6, 0x0048) },
436 { USB_DEVICE(0x0df6, 0x0051) },
437 { USB_DEVICE(0x0df6, 0x005f) },
438 + { USB_DEVICE(0x0df6, 0x0060) },
439 /* SMC */
440 { USB_DEVICE(0x083a, 0x6618) },
441 { USB_DEVICE(0x083a, 0x7511) },
442 @@ -957,7 +969,9 @@ static struct usb_device_id rt2800usb_device_table[] = {
443 /* Sparklan */
444 { USB_DEVICE(0x15a9, 0x0006) },
445 /* Sweex */
446 + { USB_DEVICE(0x177f, 0x0153) },
447 { USB_DEVICE(0x177f, 0x0302) },
448 + { USB_DEVICE(0x177f, 0x0313) },
449 /* U-Media */
450 { USB_DEVICE(0x157e, 0x300e) },
451 { USB_DEVICE(0x157e, 0x3013) },
452 @@ -975,6 +989,8 @@ static struct usb_device_id rt2800usb_device_table[] = {
453 { USB_DEVICE(0x0586, 0x341e) },
454 { USB_DEVICE(0x0586, 0x343e) },
455 #ifdef CONFIG_RT2800USB_RT33XX
456 + /* Belkin */
457 + { USB_DEVICE(0x050d, 0x945b) },
458 /* Ralink */
459 { USB_DEVICE(0x148f, 0x3370) },
460 { USB_DEVICE(0x148f, 0x8070) },
461 @@ -999,6 +1015,7 @@ static struct usb_device_id rt2800usb_device_table[] = {
462 { USB_DEVICE(0x148f, 0x3572) },
463 /* Sitecom */
464 { USB_DEVICE(0x0df6, 0x0041) },
465 + { USB_DEVICE(0x0df6, 0x0062) },
466 /* Toshiba */
467 { USB_DEVICE(0x0930, 0x0a07) },
468 /* Zinwell */
469 @@ -1038,27 +1055,24 @@ static struct usb_device_id rt2800usb_device_table[] = {
470 { USB_DEVICE(0x13d3, 0x3322) },
471 /* Belkin */
472 { USB_DEVICE(0x050d, 0x1003) },
473 - { USB_DEVICE(0x050d, 0x825a) },
474 /* Buffalo */
475 { USB_DEVICE(0x0411, 0x012e) },
476 { USB_DEVICE(0x0411, 0x0148) },
477 { USB_DEVICE(0x0411, 0x0150) },
478 - { USB_DEVICE(0x0411, 0x015d) },
479 /* Corega */
480 { USB_DEVICE(0x07aa, 0x0041) },
481 { USB_DEVICE(0x07aa, 0x0042) },
482 { USB_DEVICE(0x18c5, 0x0008) },
483 /* D-Link */
484 { USB_DEVICE(0x07d1, 0x3c0b) },
485 - { USB_DEVICE(0x07d1, 0x3c13) },
486 - { USB_DEVICE(0x07d1, 0x3c15) },
487 { USB_DEVICE(0x07d1, 0x3c17) },
488 { USB_DEVICE(0x2001, 0x3c17) },
489 /* Edimax */
490 { USB_DEVICE(0x7392, 0x4085) },
491 - { USB_DEVICE(0x7392, 0x7722) },
492 /* Encore */
493 { USB_DEVICE(0x203d, 0x14a1) },
494 + /* Fujitsu Stylistic 550 */
495 + { USB_DEVICE(0x1690, 0x0761) },
496 /* Gemtek */
497 { USB_DEVICE(0x15a9, 0x0010) },
498 /* Gigabyte */
499 @@ -1070,19 +1084,13 @@ static struct usb_device_id rt2800usb_device_table[] = {
500 /* LevelOne */
501 { USB_DEVICE(0x1740, 0x0605) },
502 { USB_DEVICE(0x1740, 0x0615) },
503 - /* Linksys */
504 - { USB_DEVICE(0x1737, 0x0078) },
505 /* Logitec */
506 { USB_DEVICE(0x0789, 0x0168) },
507 { USB_DEVICE(0x0789, 0x0169) },
508 /* Motorola */
509 { USB_DEVICE(0x100d, 0x9032) },
510 - /* Ovislink */
511 - { USB_DEVICE(0x1b75, 0x3071) },
512 - { USB_DEVICE(0x1b75, 0x3072) },
513 /* Pegatron */
514 { USB_DEVICE(0x05a6, 0x0101) },
515 - { USB_DEVICE(0x1d4d, 0x0002) },
516 { USB_DEVICE(0x1d4d, 0x0010) },
517 /* Planex */
518 { USB_DEVICE(0x2019, 0x5201) },
519 @@ -1096,16 +1104,11 @@ static struct usb_device_id rt2800usb_device_table[] = {
520 { USB_DEVICE(0x0df6, 0x004a) },
521 { USB_DEVICE(0x0df6, 0x004d) },
522 { USB_DEVICE(0x0df6, 0x0053) },
523 - { USB_DEVICE(0x0df6, 0x0060) },
524 - { USB_DEVICE(0x0df6, 0x0062) },
525 /* SMC */
526 { USB_DEVICE(0x083a, 0xa512) },
527 { USB_DEVICE(0x083a, 0xc522) },
528 { USB_DEVICE(0x083a, 0xd522) },
529 { USB_DEVICE(0x083a, 0xf511) },
530 - /* Sweex */
531 - { USB_DEVICE(0x177f, 0x0153) },
532 - { USB_DEVICE(0x177f, 0x0313) },
533 /* Zyxel */
534 { USB_DEVICE(0x0586, 0x341a) },
535 #endif
536 diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
537 index cec4629..a6b07dd 100644
538 --- a/drivers/pci/quirks.c
539 +++ b/drivers/pci/quirks.c
540 @@ -2822,6 +2822,40 @@ static void __devinit fixup_ti816x_class(struct pci_dev* dev)
541 }
542 DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_TI, 0xb800, fixup_ti816x_class);
543
544 +/*
545 + * Some BIOS implementations leave the Intel GPU interrupts enabled,
546 + * even though no one is handling them (f.e. i915 driver is never loaded).
547 + * Additionally the interrupt destination is not set up properly
548 + * and the interrupt ends up -somewhere-.
549 + *
550 + * These spurious interrupts are "sticky" and the kernel disables
551 + * the (shared) interrupt line after 100.000+ generated interrupts.
552 + *
553 + * Fix it by disabling the still enabled interrupts.
554 + * This resolves crashes often seen on monitor unplug.
555 + */
556 +#define I915_DEIER_REG 0x4400c
557 +static void __devinit disable_igfx_irq(struct pci_dev *dev)
558 +{
559 + void __iomem *regs = pci_iomap(dev, 0, 0);
560 + if (regs == NULL) {
561 + dev_warn(&dev->dev, "igfx quirk: Can't iomap PCI device\n");
562 + return;
563 + }
564 +
565 + /* Check if any interrupt line is still enabled */
566 + if (readl(regs + I915_DEIER_REG) != 0) {
567 + dev_warn(&dev->dev, "BIOS left Intel GPU interrupts enabled; "
568 + "disabling\n");
569 +
570 + writel(0, regs + I915_DEIER_REG);
571 + }
572 +
573 + pci_iounmap(dev, regs);
574 +}
575 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x0102, disable_igfx_irq);
576 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, 0x010a, disable_igfx_irq);
577 +
578 static void pci_do_fixups(struct pci_dev *dev, struct pci_fixup *f,
579 struct pci_fixup *end)
580 {
581 diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
582 index 2e13a14..b423fe9 100644
583 --- a/drivers/spi/spi.c
584 +++ b/drivers/spi/spi.c
585 @@ -318,7 +318,7 @@ struct spi_device *spi_alloc_device(struct spi_master *master)
586 }
587
588 spi->master = master;
589 - spi->dev.parent = dev;
590 + spi->dev.parent = &master->dev;
591 spi->dev.bus = &spi_bus_type;
592 spi->dev.release = spidev_release;
593 device_initialize(&spi->dev);
594 diff --git a/drivers/tty/amiserial.c b/drivers/tty/amiserial.c
595 index 2205795..3411148 100644
596 --- a/drivers/tty/amiserial.c
597 +++ b/drivers/tty/amiserial.c
598 @@ -1113,8 +1113,10 @@ static int set_serial_info(struct async_struct * info,
599 (new_serial.close_delay != state->close_delay) ||
600 (new_serial.xmit_fifo_size != state->xmit_fifo_size) ||
601 ((new_serial.flags & ~ASYNC_USR_MASK) !=
602 - (state->flags & ~ASYNC_USR_MASK)))
603 + (state->flags & ~ASYNC_USR_MASK))) {
604 + tty_unlock();
605 return -EPERM;
606 + }
607 state->flags = ((state->flags & ~ASYNC_USR_MASK) |
608 (new_serial.flags & ASYNC_USR_MASK));
609 info->flags = ((info->flags & ~ASYNC_USR_MASK) |
610 diff --git a/drivers/tty/serial/clps711x.c b/drivers/tty/serial/clps711x.c
611 index e6c3dbd..836fe273 100644
612 --- a/drivers/tty/serial/clps711x.c
613 +++ b/drivers/tty/serial/clps711x.c
614 @@ -154,10 +154,9 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
615 port->x_char = 0;
616 return IRQ_HANDLED;
617 }
618 - if (uart_circ_empty(xmit) || uart_tx_stopped(port)) {
619 - clps711xuart_stop_tx(port);
620 - return IRQ_HANDLED;
621 - }
622 +
623 + if (uart_circ_empty(xmit) || uart_tx_stopped(port))
624 + goto disable_tx_irq;
625
626 count = port->fifosize >> 1;
627 do {
628 @@ -171,8 +170,11 @@ static irqreturn_t clps711xuart_int_tx(int irq, void *dev_id)
629 if (uart_circ_chars_pending(xmit) < WAKEUP_CHARS)
630 uart_write_wakeup(port);
631
632 - if (uart_circ_empty(xmit))
633 - clps711xuart_stop_tx(port);
634 + if (uart_circ_empty(xmit)) {
635 + disable_tx_irq:
636 + disable_irq_nosync(TX_IRQ(port));
637 + tx_enabled(port) = 0;
638 + }
639
640 return IRQ_HANDLED;
641 }
642 diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
643 index 579ed6b..101eda9 100644
644 --- a/drivers/tty/serial/pch_uart.c
645 +++ b/drivers/tty/serial/pch_uart.c
646 @@ -1354,9 +1354,11 @@ static int pch_uart_verify_port(struct uart_port *port,
647 __func__);
648 return -EOPNOTSUPP;
649 #endif
650 - priv->use_dma = 1;
651 priv->use_dma_flag = 1;
652 dev_info(priv->port.dev, "PCH UART : Use DMA Mode\n");
653 + if (!priv->use_dma)
654 + pch_request_dma(port);
655 + priv->use_dma = 1;
656 }
657
658 return 0;
659 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
660 index 3776ddf..34bb059 100644
661 --- a/drivers/usb/core/hub.c
662 +++ b/drivers/usb/core/hub.c
663 @@ -1644,7 +1644,6 @@ void usb_disconnect(struct usb_device **pdev)
664 {
665 struct usb_device *udev = *pdev;
666 int i;
667 - struct usb_hcd *hcd = bus_to_hcd(udev->bus);
668
669 if (!udev) {
670 pr_debug ("%s nodev\n", __func__);
671 @@ -1672,9 +1671,7 @@ void usb_disconnect(struct usb_device **pdev)
672 * so that the hardware is now fully quiesced.
673 */
674 dev_dbg (&udev->dev, "unregistering device\n");
675 - mutex_lock(hcd->bandwidth_mutex);
676 usb_disable_device(udev, 0);
677 - mutex_unlock(hcd->bandwidth_mutex);
678 usb_hcd_synchronize_unlinks(udev);
679
680 usb_remove_ep_devs(&udev->ep0);
681 diff --git a/drivers/usb/core/message.c b/drivers/usb/core/message.c
682 index 9223600..1eebd45 100644
683 --- a/drivers/usb/core/message.c
684 +++ b/drivers/usb/core/message.c
685 @@ -1136,8 +1136,6 @@ void usb_disable_interface(struct usb_device *dev, struct usb_interface *intf,
686 * Deallocates hcd/hardware state for the endpoints (nuking all or most
687 * pending urbs) and usbcore state for the interfaces, so that usbcore
688 * must usb_set_configuration() before any interfaces could be used.
689 - *
690 - * Must be called with hcd->bandwidth_mutex held.
691 */
692 void usb_disable_device(struct usb_device *dev, int skip_ep0)
693 {
694 @@ -1190,7 +1188,9 @@ void usb_disable_device(struct usb_device *dev, int skip_ep0)
695 usb_disable_endpoint(dev, i + USB_DIR_IN, false);
696 }
697 /* Remove endpoints from the host controller internal state */
698 + mutex_lock(hcd->bandwidth_mutex);
699 usb_hcd_alloc_bandwidth(dev, NULL, NULL, NULL);
700 + mutex_unlock(hcd->bandwidth_mutex);
701 /* Second pass: remove endpoint pointers */
702 }
703 for (i = skip_ep0; i < 16; ++i) {
704 @@ -1750,7 +1750,6 @@ free_interfaces:
705 /* if it's already configured, clear out old state first.
706 * getting rid of old interfaces means unbinding their drivers.
707 */
708 - mutex_lock(hcd->bandwidth_mutex);
709 if (dev->state != USB_STATE_ADDRESS)
710 usb_disable_device(dev, 1); /* Skip ep0 */
711
712 @@ -1763,6 +1762,7 @@ free_interfaces:
713 * host controller will not allow submissions to dropped endpoints. If
714 * this call fails, the device state is unchanged.
715 */
716 + mutex_lock(hcd->bandwidth_mutex);
717 ret = usb_hcd_alloc_bandwidth(dev, cp, NULL, NULL);
718 if (ret < 0) {
719 mutex_unlock(hcd->bandwidth_mutex);
720 diff --git a/drivers/usb/gadget/f_fs.c b/drivers/usb/gadget/f_fs.c
721 index 19fffcc..1cefb9f 100644
722 --- a/drivers/usb/gadget/f_fs.c
723 +++ b/drivers/usb/gadget/f_fs.c
724 @@ -720,7 +720,7 @@ static long ffs_ep0_ioctl(struct file *file, unsigned code, unsigned long value)
725 if (code == FUNCTIONFS_INTERFACE_REVMAP) {
726 struct ffs_function *func = ffs->func;
727 ret = func ? ffs_func_revmap_intf(func, value) : -ENODEV;
728 - } else if (gadget->ops->ioctl) {
729 + } else if (gadget && gadget->ops->ioctl) {
730 ret = gadget->ops->ioctl(gadget, code, value);
731 } else {
732 ret = -ENOTTY;
733 diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
734 index b27ceab..6a25c35 100644
735 --- a/drivers/usb/host/ehci-hcd.c
736 +++ b/drivers/usb/host/ehci-hcd.c
737 @@ -808,8 +808,13 @@ static irqreturn_t ehci_irq (struct usb_hcd *hcd)
738 goto dead;
739 }
740
741 + /*
742 + * We don't use STS_FLR, but some controllers don't like it to
743 + * remain on, so mask it out along with the other status bits.
744 + */
745 + masked_status = status & (INTR_MASK | STS_FLR);
746 +
747 /* Shared IRQ? */
748 - masked_status = status & INTR_MASK;
749 if (!masked_status || unlikely(hcd->state == HC_STATE_HALT)) {
750 spin_unlock(&ehci->lock);
751 return IRQ_NONE;
752 diff --git a/drivers/usb/misc/yurex.c b/drivers/usb/misc/yurex.c
753 index ac5bfd6..2504694 100644
754 --- a/drivers/usb/misc/yurex.c
755 +++ b/drivers/usb/misc/yurex.c
756 @@ -99,9 +99,7 @@ static void yurex_delete(struct kref *kref)
757 usb_put_dev(dev->udev);
758 if (dev->cntl_urb) {
759 usb_kill_urb(dev->cntl_urb);
760 - if (dev->cntl_req)
761 - usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
762 - dev->cntl_req, dev->cntl_urb->setup_dma);
763 + kfree(dev->cntl_req);
764 if (dev->cntl_buffer)
765 usb_free_coherent(dev->udev, YUREX_BUF_SIZE,
766 dev->cntl_buffer, dev->cntl_urb->transfer_dma);
767 @@ -234,9 +232,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
768 }
769
770 /* allocate buffer for control req */
771 - dev->cntl_req = usb_alloc_coherent(dev->udev, YUREX_BUF_SIZE,
772 - GFP_KERNEL,
773 - &dev->cntl_urb->setup_dma);
774 + dev->cntl_req = kmalloc(YUREX_BUF_SIZE, GFP_KERNEL);
775 if (!dev->cntl_req) {
776 err("Could not allocate cntl_req");
777 goto error;
778 @@ -286,7 +282,7 @@ static int yurex_probe(struct usb_interface *interface, const struct usb_device_
779 usb_rcvintpipe(dev->udev, dev->int_in_endpointAddr),
780 dev->int_buffer, YUREX_BUF_SIZE, yurex_interrupt,
781 dev, 1);
782 - dev->cntl_urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
783 + dev->urb->transfer_flags |= URB_NO_TRANSFER_DMA_MAP;
784 if (usb_submit_urb(dev->urb, GFP_KERNEL)) {
785 retval = -EIO;
786 err("Could not submitting URB");
787 diff --git a/drivers/usb/musb/omap2430.c b/drivers/usb/musb/omap2430.c
788 index c5d4c44..6958ab9 100644
789 --- a/drivers/usb/musb/omap2430.c
790 +++ b/drivers/usb/musb/omap2430.c
791 @@ -295,7 +295,8 @@ static int musb_otg_notifications(struct notifier_block *nb,
792
793 static int omap2430_musb_init(struct musb *musb)
794 {
795 - u32 l, status = 0;
796 + u32 l;
797 + int status = 0;
798 struct device *dev = musb->controller;
799 struct musb_hdrc_platform_data *plat = dev->platform_data;
800 struct omap_musb_board_data *data = plat->board_data;
801 @@ -312,7 +313,7 @@ static int omap2430_musb_init(struct musb *musb)
802
803 status = pm_runtime_get_sync(dev);
804 if (status < 0) {
805 - dev_err(dev, "pm_runtime_get_sync FAILED");
806 + dev_err(dev, "pm_runtime_get_sync FAILED %d\n", status);
807 goto err1;
808 }
809
810 @@ -464,14 +465,14 @@ static int __init omap2430_probe(struct platform_device *pdev)
811 goto err2;
812 }
813
814 + pm_runtime_enable(&pdev->dev);
815 +
816 ret = platform_device_add(musb);
817 if (ret) {
818 dev_err(&pdev->dev, "failed to register musb device\n");
819 goto err2;
820 }
821
822 - pm_runtime_enable(&pdev->dev);
823 -
824 return 0;
825
826 err2:
827 diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
828 index 4c12404..f2c57e0 100644
829 --- a/drivers/usb/serial/cp210x.c
830 +++ b/drivers/usb/serial/cp210x.c
831 @@ -285,7 +285,8 @@ static int cp210x_get_config(struct usb_serial_port *port, u8 request,
832 /* Issue the request, attempting to read 'size' bytes */
833 result = usb_control_msg(serial->dev, usb_rcvctrlpipe(serial->dev, 0),
834 request, REQTYPE_DEVICE_TO_HOST, 0x0000,
835 - port_priv->bInterfaceNumber, buf, size, 300);
836 + port_priv->bInterfaceNumber, buf, size,
837 + USB_CTRL_GET_TIMEOUT);
838
839 /* Convert data into an array of integers */
840 for (i = 0; i < length; i++)
841 @@ -335,12 +336,14 @@ static int cp210x_set_config(struct usb_serial_port *port, u8 request,
842 result = usb_control_msg(serial->dev,
843 usb_sndctrlpipe(serial->dev, 0),
844 request, REQTYPE_HOST_TO_DEVICE, 0x0000,
845 - port_priv->bInterfaceNumber, buf, size, 300);
846 + port_priv->bInterfaceNumber, buf, size,
847 + USB_CTRL_SET_TIMEOUT);
848 } else {
849 result = usb_control_msg(serial->dev,
850 usb_sndctrlpipe(serial->dev, 0),
851 request, REQTYPE_HOST_TO_DEVICE, data[0],
852 - port_priv->bInterfaceNumber, NULL, 0, 300);
853 + port_priv->bInterfaceNumber, NULL, 0,
854 + USB_CTRL_SET_TIMEOUT);
855 }
856
857 kfree(buf);
858 diff --git a/drivers/usb/serial/sierra.c b/drivers/usb/serial/sierra.c
859 index 3781bdd..ef71ba3 100644
860 --- a/drivers/usb/serial/sierra.c
861 +++ b/drivers/usb/serial/sierra.c
862 @@ -221,7 +221,7 @@ static const struct sierra_iface_info typeB_interface_list = {
863 };
864
865 /* 'blacklist' of interfaces not served by this driver */
866 -static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11 };
867 +static const u8 direct_ip_non_serial_ifaces[] = { 7, 8, 9, 10, 11, 19, 20 };
868 static const struct sierra_iface_info direct_ip_interface_blacklist = {
869 .infolen = ARRAY_SIZE(direct_ip_non_serial_ifaces),
870 .ifaceinfo = direct_ip_non_serial_ifaces,
871 @@ -289,7 +289,6 @@ static const struct usb_device_id id_table[] = {
872 { USB_DEVICE(0x1199, 0x6856) }, /* Sierra Wireless AirCard 881 U */
873 { USB_DEVICE(0x1199, 0x6859) }, /* Sierra Wireless AirCard 885 E */
874 { USB_DEVICE(0x1199, 0x685A) }, /* Sierra Wireless AirCard 885 E */
875 - { USB_DEVICE(0x1199, 0x68A2) }, /* Sierra Wireless MC7710 */
876 /* Sierra Wireless C885 */
877 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6880, 0xFF, 0xFF, 0xFF)},
878 /* Sierra Wireless C888, Air Card 501, USB 303, USB 304 */
879 @@ -299,6 +298,9 @@ static const struct usb_device_id id_table[] = {
880 /* Sierra Wireless HSPA Non-Composite Device */
881 { USB_DEVICE_AND_INTERFACE_INFO(0x1199, 0x6892, 0xFF, 0xFF, 0xFF)},
882 { USB_DEVICE(0x1199, 0x6893) }, /* Sierra Wireless Device */
883 + { USB_DEVICE(0x1199, 0x68A2), /* Sierra Wireless MC77xx in QMI mode */
884 + .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
885 + },
886 { USB_DEVICE(0x1199, 0x68A3), /* Sierra Wireless Direct IP modems */
887 .driver_info = (kernel_ulong_t)&direct_ip_interface_blacklist
888 },
889 diff --git a/drivers/uwb/hwa-rc.c b/drivers/uwb/hwa-rc.c
890 index 2babcd4..86685e9 100644
891 --- a/drivers/uwb/hwa-rc.c
892 +++ b/drivers/uwb/hwa-rc.c
893 @@ -645,7 +645,8 @@ void hwarc_neep_cb(struct urb *urb)
894 dev_err(dev, "NEEP: URB error %d\n", urb->status);
895 }
896 result = usb_submit_urb(urb, GFP_ATOMIC);
897 - if (result < 0) {
898 + if (result < 0 && result != -ENODEV && result != -EPERM) {
899 + /* ignoring unrecoverable errors */
900 dev_err(dev, "NEEP: Can't resubmit URB (%d) resetting device\n",
901 result);
902 goto error;
903 diff --git a/drivers/uwb/neh.c b/drivers/uwb/neh.c
904 index 697e56a..47146c8 100644
905 --- a/drivers/uwb/neh.c
906 +++ b/drivers/uwb/neh.c
907 @@ -106,6 +106,7 @@ struct uwb_rc_neh {
908 u8 evt_type;
909 __le16 evt;
910 u8 context;
911 + u8 completed;
912 uwb_rc_cmd_cb_f cb;
913 void *arg;
914
915 @@ -408,6 +409,7 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size
916 struct device *dev = &rc->uwb_dev.dev;
917 struct uwb_rc_neh *neh;
918 struct uwb_rceb *notif;
919 + unsigned long flags;
920
921 if (rceb->bEventContext == 0) {
922 notif = kmalloc(size, GFP_ATOMIC);
923 @@ -421,7 +423,11 @@ static void uwb_rc_neh_grok_event(struct uwb_rc *rc, struct uwb_rceb *rceb, size
924 } else {
925 neh = uwb_rc_neh_lookup(rc, rceb);
926 if (neh) {
927 - del_timer_sync(&neh->timer);
928 + spin_lock_irqsave(&rc->neh_lock, flags);
929 + /* to guard against a timeout */
930 + neh->completed = 1;
931 + del_timer(&neh->timer);
932 + spin_unlock_irqrestore(&rc->neh_lock, flags);
933 uwb_rc_neh_cb(neh, rceb, size);
934 } else
935 dev_warn(dev, "event 0x%02x/%04x/%02x (%zu bytes): nobody cared\n",
936 @@ -567,6 +573,10 @@ static void uwb_rc_neh_timer(unsigned long arg)
937 unsigned long flags;
938
939 spin_lock_irqsave(&rc->neh_lock, flags);
940 + if (neh->completed) {
941 + spin_unlock_irqrestore(&rc->neh_lock, flags);
942 + return;
943 + }
944 if (neh->context)
945 __uwb_rc_neh_rm(rc, neh);
946 else
947 diff --git a/drivers/xen/gntdev.c b/drivers/xen/gntdev.c
948 index f914b26..b4e830e 100644
949 --- a/drivers/xen/gntdev.c
950 +++ b/drivers/xen/gntdev.c
951 @@ -664,7 +664,7 @@ static int gntdev_mmap(struct file *flip, struct vm_area_struct *vma)
952 vma->vm_flags |= VM_RESERVED|VM_DONTEXPAND;
953
954 if (use_ptemod)
955 - vma->vm_flags |= VM_DONTCOPY|VM_PFNMAP;
956 + vma->vm_flags |= VM_DONTCOPY;
957
958 vma->vm_private_data = map;
959
960 diff --git a/drivers/xen/xenbus/xenbus_probe_frontend.c b/drivers/xen/xenbus/xenbus_probe_frontend.c
961 index b6a2690..560f217 100644
962 --- a/drivers/xen/xenbus/xenbus_probe_frontend.c
963 +++ b/drivers/xen/xenbus/xenbus_probe_frontend.c
964 @@ -132,7 +132,7 @@ static int read_backend_details(struct xenbus_device *xendev)
965 return xenbus_read_otherend_details(xendev, "backend-id", "backend");
966 }
967
968 -static int is_device_connecting(struct device *dev, void *data)
969 +static int is_device_connecting(struct device *dev, void *data, bool ignore_nonessential)
970 {
971 struct xenbus_device *xendev = to_xenbus_device(dev);
972 struct device_driver *drv = data;
973 @@ -149,16 +149,41 @@ static int is_device_connecting(struct device *dev, void *data)
974 if (drv && (dev->driver != drv))
975 return 0;
976
977 + if (ignore_nonessential) {
978 + /* With older QEMU, for PVonHVM guests the guest config files
979 + * could contain: vfb = [ 'vnc=1, vnclisten=0.0.0.0']
980 + * which is nonsensical as there is no PV FB (there can be
981 + * a PVKB) running as HVM guest. */
982 +
983 + if ((strncmp(xendev->nodename, "device/vkbd", 11) == 0))
984 + return 0;
985 +
986 + if ((strncmp(xendev->nodename, "device/vfb", 10) == 0))
987 + return 0;
988 + }
989 xendrv = to_xenbus_driver(dev->driver);
990 return (xendev->state < XenbusStateConnected ||
991 (xendev->state == XenbusStateConnected &&
992 xendrv->is_ready && !xendrv->is_ready(xendev)));
993 }
994 +static int essential_device_connecting(struct device *dev, void *data)
995 +{
996 + return is_device_connecting(dev, data, true /* ignore PV[KBB+FB] */);
997 +}
998 +static int non_essential_device_connecting(struct device *dev, void *data)
999 +{
1000 + return is_device_connecting(dev, data, false);
1001 +}
1002
1003 -static int exists_connecting_device(struct device_driver *drv)
1004 +static int exists_essential_connecting_device(struct device_driver *drv)
1005 {
1006 return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv,
1007 - is_device_connecting);
1008 + essential_device_connecting);
1009 +}
1010 +static int exists_non_essential_connecting_device(struct device_driver *drv)
1011 +{
1012 + return bus_for_each_dev(&xenbus_frontend.bus, NULL, drv,
1013 + non_essential_device_connecting);
1014 }
1015
1016 static int print_device_status(struct device *dev, void *data)
1017 @@ -189,6 +214,23 @@ static int print_device_status(struct device *dev, void *data)
1018 /* We only wait for device setup after most initcalls have run. */
1019 static int ready_to_wait_for_devices;
1020
1021 +static bool wait_loop(unsigned long start, unsigned int max_delay,
1022 + unsigned int *seconds_waited)
1023 +{
1024 + if (time_after(jiffies, start + (*seconds_waited+5)*HZ)) {
1025 + if (!*seconds_waited)
1026 + printk(KERN_WARNING "XENBUS: Waiting for "
1027 + "devices to initialise: ");
1028 + *seconds_waited += 5;
1029 + printk("%us...", max_delay - *seconds_waited);
1030 + if (*seconds_waited == max_delay)
1031 + return true;
1032 + }
1033 +
1034 + schedule_timeout_interruptible(HZ/10);
1035 +
1036 + return false;
1037 +}
1038 /*
1039 * On a 5-minute timeout, wait for all devices currently configured. We need
1040 * to do this to guarantee that the filesystems and / or network devices
1041 @@ -212,19 +254,14 @@ static void wait_for_devices(struct xenbus_driver *xendrv)
1042 if (!ready_to_wait_for_devices || !xen_domain())
1043 return;
1044
1045 - while (exists_connecting_device(drv)) {
1046 - if (time_after(jiffies, start + (seconds_waited+5)*HZ)) {
1047 - if (!seconds_waited)
1048 - printk(KERN_WARNING "XENBUS: Waiting for "
1049 - "devices to initialise: ");
1050 - seconds_waited += 5;
1051 - printk("%us...", 300 - seconds_waited);
1052 - if (seconds_waited == 300)
1053 - break;
1054 - }
1055 -
1056 - schedule_timeout_interruptible(HZ/10);
1057 - }
1058 + while (exists_non_essential_connecting_device(drv))
1059 + if (wait_loop(start, 30, &seconds_waited))
1060 + break;
1061 +
1062 + /* Skips PVKB and PVFB check.*/
1063 + while (exists_essential_connecting_device(drv))
1064 + if (wait_loop(start, 270, &seconds_waited))
1065 + break;
1066
1067 if (seconds_waited)
1068 printk("\n");
1069 diff --git a/fs/btrfs/ctree.h b/fs/btrfs/ctree.h
1070 index 3b859a3..66179bc 100644
1071 --- a/fs/btrfs/ctree.h
1072 +++ b/fs/btrfs/ctree.h
1073 @@ -1972,7 +1972,7 @@ BTRFS_SETGET_STACK_FUNCS(root_last_snapshot, struct btrfs_root_item,
1074
1075 static inline bool btrfs_root_readonly(struct btrfs_root *root)
1076 {
1077 - return root->root_item.flags & BTRFS_ROOT_SUBVOL_RDONLY;
1078 + return (root->root_item.flags & cpu_to_le64(BTRFS_ROOT_SUBVOL_RDONLY)) != 0;
1079 }
1080
1081 /* struct btrfs_super_block */
1082 diff --git a/fs/eventpoll.c b/fs/eventpoll.c
1083 index 6879d0c..35a852a 100644
1084 --- a/fs/eventpoll.c
1085 +++ b/fs/eventpoll.c
1086 @@ -988,6 +988,10 @@ static int path_count[PATH_ARR_SIZE];
1087
1088 static int path_count_inc(int nests)
1089 {
1090 + /* Allow an arbitrary number of depth 1 paths */
1091 + if (nests == 0)
1092 + return 0;
1093 +
1094 if (++path_count[nests] > path_limits[nests])
1095 return -1;
1096 return 0;
1097 diff --git a/fs/ext4/extents.c b/fs/ext4/extents.c
1098 index 7fc10ed..611647b 100644
1099 --- a/fs/ext4/extents.c
1100 +++ b/fs/ext4/extents.c
1101 @@ -2846,7 +2846,7 @@ static int ext4_split_extent_at(handle_t *handle,
1102 if (err)
1103 goto fix_extent_len;
1104 /* update the extent length and mark as initialized */
1105 - ex->ee_len = cpu_to_le32(ee_len);
1106 + ex->ee_len = cpu_to_le16(ee_len);
1107 ext4_ext_try_to_merge(inode, path, ex);
1108 err = ext4_ext_dirty(handle, inode, path + depth);
1109 goto out;
1110 diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
1111 index eef6979..36c2e80 100644
1112 --- a/fs/jbd2/commit.c
1113 +++ b/fs/jbd2/commit.c
1114 @@ -683,7 +683,7 @@ start_journal_io:
1115 if (commit_transaction->t_need_data_flush &&
1116 (journal->j_fs_dev != journal->j_dev) &&
1117 (journal->j_flags & JBD2_BARRIER))
1118 - blkdev_issue_flush(journal->j_fs_dev, GFP_KERNEL, NULL);
1119 + blkdev_issue_flush(journal->j_fs_dev, GFP_NOFS, NULL);
1120
1121 /* Done it all: now write the commit record asynchronously. */
1122 if (JBD2_HAS_INCOMPAT_FEATURE(journal,
1123 @@ -819,7 +819,7 @@ wait_for_iobuf:
1124 if (JBD2_HAS_INCOMPAT_FEATURE(journal,
1125 JBD2_FEATURE_INCOMPAT_ASYNC_COMMIT) &&
1126 journal->j_flags & JBD2_BARRIER) {
1127 - blkdev_issue_flush(journal->j_dev, GFP_KERNEL, NULL);
1128 + blkdev_issue_flush(journal->j_dev, GFP_NOFS, NULL);
1129 }
1130
1131 if (err)
1132 diff --git a/fs/lockd/clnt4xdr.c b/fs/lockd/clnt4xdr.c
1133 index f848b52..046bb77 100644
1134 --- a/fs/lockd/clnt4xdr.c
1135 +++ b/fs/lockd/clnt4xdr.c
1136 @@ -241,7 +241,7 @@ static int decode_nlm4_stat(struct xdr_stream *xdr, __be32 *stat)
1137 p = xdr_inline_decode(xdr, 4);
1138 if (unlikely(p == NULL))
1139 goto out_overflow;
1140 - if (unlikely(*p > nlm4_failed))
1141 + if (unlikely(ntohl(*p) > ntohl(nlm4_failed)))
1142 goto out_bad_xdr;
1143 *stat = *p;
1144 return 0;
1145 diff --git a/fs/lockd/clntxdr.c b/fs/lockd/clntxdr.c
1146 index 180ac34..36057ce 100644
1147 --- a/fs/lockd/clntxdr.c
1148 +++ b/fs/lockd/clntxdr.c
1149 @@ -236,7 +236,7 @@ static int decode_nlm_stat(struct xdr_stream *xdr,
1150 p = xdr_inline_decode(xdr, 4);
1151 if (unlikely(p == NULL))
1152 goto out_overflow;
1153 - if (unlikely(*p > nlm_lck_denied_grace_period))
1154 + if (unlikely(ntohl(*p) > ntohl(nlm_lck_denied_grace_period)))
1155 goto out_enum;
1156 *stat = *p;
1157 return 0;
1158 diff --git a/fs/nfsd/nfs3xdr.c b/fs/nfsd/nfs3xdr.c
1159 index 08c6e36..43f46cd 100644
1160 --- a/fs/nfsd/nfs3xdr.c
1161 +++ b/fs/nfsd/nfs3xdr.c
1162 @@ -803,13 +803,13 @@ encode_entry_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name,
1163 return p;
1164 }
1165
1166 -static int
1167 +static __be32
1168 compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
1169 const char *name, int namlen)
1170 {
1171 struct svc_export *exp;
1172 struct dentry *dparent, *dchild;
1173 - int rv = 0;
1174 + __be32 rv = nfserr_noent;
1175
1176 dparent = cd->fh.fh_dentry;
1177 exp = cd->fh.fh_export;
1178 @@ -817,26 +817,20 @@ compose_entry_fh(struct nfsd3_readdirres *cd, struct svc_fh *fhp,
1179 if (isdotent(name, namlen)) {
1180 if (namlen == 2) {
1181 dchild = dget_parent(dparent);
1182 - if (dchild == dparent) {
1183 - /* filesystem root - cannot return filehandle for ".." */
1184 - dput(dchild);
1185 - return -ENOENT;
1186 - }
1187 + /* filesystem root - cannot return filehandle for ".." */
1188 + if (dchild == dparent)
1189 + goto out;
1190 } else
1191 dchild = dget(dparent);
1192 } else
1193 dchild = lookup_one_len(name, dparent, namlen);
1194 if (IS_ERR(dchild))
1195 - return -ENOENT;
1196 - rv = -ENOENT;
1197 + return rv;
1198 if (d_mountpoint(dchild))
1199 goto out;
1200 - rv = fh_compose(fhp, exp, dchild, &cd->fh);
1201 - if (rv)
1202 - goto out;
1203 if (!dchild->d_inode)
1204 goto out;
1205 - rv = 0;
1206 + rv = fh_compose(fhp, exp, dchild, &cd->fh);
1207 out:
1208 dput(dchild);
1209 return rv;
1210 @@ -845,7 +839,7 @@ out:
1211 static __be32 *encode_entryplus_baggage(struct nfsd3_readdirres *cd, __be32 *p, const char *name, int namlen)
1212 {
1213 struct svc_fh fh;
1214 - int err;
1215 + __be32 err;
1216
1217 fh_init(&fh, NFS3_FHSIZE);
1218 err = compose_entry_fh(cd, &fh, name, namlen);
1219 diff --git a/fs/ocfs2/alloc.c b/fs/ocfs2/alloc.c
1220 index ed553c6..76c8165 100644
1221 --- a/fs/ocfs2/alloc.c
1222 +++ b/fs/ocfs2/alloc.c
1223 @@ -1134,7 +1134,7 @@ static int ocfs2_adjust_rightmost_branch(handle_t *handle,
1224 }
1225
1226 el = path_leaf_el(path);
1227 - rec = &el->l_recs[le32_to_cpu(el->l_next_free_rec) - 1];
1228 + rec = &el->l_recs[le16_to_cpu(el->l_next_free_rec) - 1];
1229
1230 ocfs2_adjust_rightmost_records(handle, et, path, rec);
1231
1232 diff --git a/fs/ocfs2/refcounttree.c b/fs/ocfs2/refcounttree.c
1233 index ebfd382..15d29cc 100644
1234 --- a/fs/ocfs2/refcounttree.c
1235 +++ b/fs/ocfs2/refcounttree.c
1236 @@ -1036,14 +1036,14 @@ static int ocfs2_get_refcount_cpos_end(struct ocfs2_caching_info *ci,
1237
1238 tmp_el = left_path->p_node[subtree_root].el;
1239 blkno = left_path->p_node[subtree_root+1].bh->b_blocknr;
1240 - for (i = 0; i < le32_to_cpu(tmp_el->l_next_free_rec); i++) {
1241 + for (i = 0; i < le16_to_cpu(tmp_el->l_next_free_rec); i++) {
1242 if (le64_to_cpu(tmp_el->l_recs[i].e_blkno) == blkno) {
1243 *cpos_end = le32_to_cpu(tmp_el->l_recs[i+1].e_cpos);
1244 break;
1245 }
1246 }
1247
1248 - BUG_ON(i == le32_to_cpu(tmp_el->l_next_free_rec));
1249 + BUG_ON(i == le16_to_cpu(tmp_el->l_next_free_rec));
1250
1251 out:
1252 ocfs2_free_path(left_path);
1253 @@ -1468,7 +1468,7 @@ static int ocfs2_divide_leaf_refcount_block(struct buffer_head *ref_leaf_bh,
1254
1255 trace_ocfs2_divide_leaf_refcount_block(
1256 (unsigned long long)ref_leaf_bh->b_blocknr,
1257 - le32_to_cpu(rl->rl_count), le32_to_cpu(rl->rl_used));
1258 + le16_to_cpu(rl->rl_count), le16_to_cpu(rl->rl_used));
1259
1260 /*
1261 * XXX: Improvement later.
1262 @@ -2411,7 +2411,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb,
1263 rb = (struct ocfs2_refcount_block *)
1264 prev_bh->b_data;
1265
1266 - if (le64_to_cpu(rb->rf_records.rl_used) +
1267 + if (le16_to_cpu(rb->rf_records.rl_used) +
1268 recs_add >
1269 le16_to_cpu(rb->rf_records.rl_count))
1270 ref_blocks++;
1271 @@ -2476,7 +2476,7 @@ static int ocfs2_calc_refcount_meta_credits(struct super_block *sb,
1272 if (prev_bh) {
1273 rb = (struct ocfs2_refcount_block *)prev_bh->b_data;
1274
1275 - if (le64_to_cpu(rb->rf_records.rl_used) + recs_add >
1276 + if (le16_to_cpu(rb->rf_records.rl_used) + recs_add >
1277 le16_to_cpu(rb->rf_records.rl_count))
1278 ref_blocks++;
1279
1280 @@ -3629,7 +3629,7 @@ int ocfs2_refcounted_xattr_delete_need(struct inode *inode,
1281 * one will split a refcount rec, so totally we need
1282 * clusters * 2 new refcount rec.
1283 */
1284 - if (le64_to_cpu(rb->rf_records.rl_used) + clusters * 2 >
1285 + if (le16_to_cpu(rb->rf_records.rl_used) + clusters * 2 >
1286 le16_to_cpu(rb->rf_records.rl_count))
1287 ref_blocks++;
1288
1289 diff --git a/fs/ocfs2/suballoc.c b/fs/ocfs2/suballoc.c
1290 index ba5d97e..f169da4 100644
1291 --- a/fs/ocfs2/suballoc.c
1292 +++ b/fs/ocfs2/suballoc.c
1293 @@ -600,7 +600,7 @@ static void ocfs2_bg_alloc_cleanup(handle_t *handle,
1294 ret = ocfs2_free_clusters(handle, cluster_ac->ac_inode,
1295 cluster_ac->ac_bh,
1296 le64_to_cpu(rec->e_blkno),
1297 - le32_to_cpu(rec->e_leaf_clusters));
1298 + le16_to_cpu(rec->e_leaf_clusters));
1299 if (ret)
1300 mlog_errno(ret);
1301 /* Try all the clusters to free */
1302 @@ -1628,7 +1628,7 @@ static int ocfs2_bg_discontig_fix_by_rec(struct ocfs2_suballoc_result *res,
1303 {
1304 unsigned int bpc = le16_to_cpu(cl->cl_bpc);
1305 unsigned int bitoff = le32_to_cpu(rec->e_cpos) * bpc;
1306 - unsigned int bitcount = le32_to_cpu(rec->e_leaf_clusters) * bpc;
1307 + unsigned int bitcount = le16_to_cpu(rec->e_leaf_clusters) * bpc;
1308
1309 if (res->sr_bit_offset < bitoff)
1310 return 0;
1311 diff --git a/fs/splice.c b/fs/splice.c
1312 index aa866d3..9d89008 100644
1313 --- a/fs/splice.c
1314 +++ b/fs/splice.c
1315 @@ -31,6 +31,7 @@
1316 #include <linux/uio.h>
1317 #include <linux/security.h>
1318 #include <linux/gfp.h>
1319 +#include <linux/socket.h>
1320
1321 /*
1322 * Attempt to steal a page from a pipe buffer. This should perhaps go into
1323 @@ -691,7 +692,9 @@ static int pipe_to_sendpage(struct pipe_inode_info *pipe,
1324 if (!likely(file->f_op && file->f_op->sendpage))
1325 return -EINVAL;
1326
1327 - more = (sd->flags & SPLICE_F_MORE) || sd->len < sd->total_len;
1328 + more = (sd->flags & SPLICE_F_MORE) ? MSG_MORE : 0;
1329 + if (sd->len < sd->total_len)
1330 + more |= MSG_SENDPAGE_NOTLAST;
1331 return file->f_op->sendpage(file, buf->page, buf->offset,
1332 sd->len, &pos, more);
1333 }
1334 diff --git a/include/linux/socket.h b/include/linux/socket.h
1335 index 4ef98e4..635c213 100644
1336 --- a/include/linux/socket.h
1337 +++ b/include/linux/socket.h
1338 @@ -261,7 +261,7 @@ struct ucred {
1339 #define MSG_NOSIGNAL 0x4000 /* Do not generate SIGPIPE */
1340 #define MSG_MORE 0x8000 /* Sender will send more */
1341 #define MSG_WAITFORONE 0x10000 /* recvmmsg(): block until 1+ packets avail */
1342 -
1343 +#define MSG_SENDPAGE_NOTLAST 0x20000 /* sendpage() internal : not the last page */
1344 #define MSG_EOF MSG_FIN
1345
1346 #define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file
1347 diff --git a/mm/swap_state.c b/mm/swap_state.c
1348 index 4668046..10e9198 100644
1349 --- a/mm/swap_state.c
1350 +++ b/mm/swap_state.c
1351 @@ -28,7 +28,7 @@
1352 */
1353 static const struct address_space_operations swap_aops = {
1354 .writepage = swap_writepage,
1355 - .set_page_dirty = __set_page_dirty_nobuffers,
1356 + .set_page_dirty = __set_page_dirty_no_writeback,
1357 .migratepage = migrate_page,
1358 };
1359
1360 diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
1361 index e7c69f4..b04a6ef 100644
1362 --- a/net/ax25/af_ax25.c
1363 +++ b/net/ax25/af_ax25.c
1364 @@ -2006,16 +2006,17 @@ static void __exit ax25_exit(void)
1365 proc_net_remove(&init_net, "ax25_route");
1366 proc_net_remove(&init_net, "ax25");
1367 proc_net_remove(&init_net, "ax25_calls");
1368 - ax25_rt_free();
1369 - ax25_uid_free();
1370 - ax25_dev_free();
1371
1372 - ax25_unregister_sysctl();
1373 unregister_netdevice_notifier(&ax25_dev_notifier);
1374 + ax25_unregister_sysctl();
1375
1376 dev_remove_pack(&ax25_packet_type);
1377
1378 sock_unregister(PF_AX25);
1379 proto_unregister(&ax25_proto);
1380 +
1381 + ax25_rt_free();
1382 + ax25_uid_free();
1383 + ax25_dev_free();
1384 }
1385 module_exit(ax25_exit);
1386 diff --git a/net/bridge/br_multicast.c b/net/bridge/br_multicast.c
1387 index c23a4b1..e78269d 100644
1388 --- a/net/bridge/br_multicast.c
1389 +++ b/net/bridge/br_multicast.c
1390 @@ -241,7 +241,6 @@ static void br_multicast_group_expired(unsigned long data)
1391 hlist_del_rcu(&mp->hlist[mdb->ver]);
1392 mdb->size--;
1393
1394 - del_timer(&mp->query_timer);
1395 call_rcu_bh(&mp->rcu, br_multicast_free_group);
1396
1397 out:
1398 @@ -271,7 +270,6 @@ static void br_multicast_del_pg(struct net_bridge *br,
1399 rcu_assign_pointer(*pp, p->next);
1400 hlist_del_init(&p->mglist);
1401 del_timer(&p->timer);
1402 - del_timer(&p->query_timer);
1403 call_rcu_bh(&p->rcu, br_multicast_free_pg);
1404
1405 if (!mp->ports && !mp->mglist &&
1406 @@ -507,74 +505,6 @@ static struct sk_buff *br_multicast_alloc_query(struct net_bridge *br,
1407 return NULL;
1408 }
1409
1410 -static void br_multicast_send_group_query(struct net_bridge_mdb_entry *mp)
1411 -{
1412 - struct net_bridge *br = mp->br;
1413 - struct sk_buff *skb;
1414 -
1415 - skb = br_multicast_alloc_query(br, &mp->addr);
1416 - if (!skb)
1417 - goto timer;
1418 -
1419 - netif_rx(skb);
1420 -
1421 -timer:
1422 - if (++mp->queries_sent < br->multicast_last_member_count)
1423 - mod_timer(&mp->query_timer,
1424 - jiffies + br->multicast_last_member_interval);
1425 -}
1426 -
1427 -static void br_multicast_group_query_expired(unsigned long data)
1428 -{
1429 - struct net_bridge_mdb_entry *mp = (void *)data;
1430 - struct net_bridge *br = mp->br;
1431 -
1432 - spin_lock(&br->multicast_lock);
1433 - if (!netif_running(br->dev) || !mp->mglist ||
1434 - mp->queries_sent >= br->multicast_last_member_count)
1435 - goto out;
1436 -
1437 - br_multicast_send_group_query(mp);
1438 -
1439 -out:
1440 - spin_unlock(&br->multicast_lock);
1441 -}
1442 -
1443 -static void br_multicast_send_port_group_query(struct net_bridge_port_group *pg)
1444 -{
1445 - struct net_bridge_port *port = pg->port;
1446 - struct net_bridge *br = port->br;
1447 - struct sk_buff *skb;
1448 -
1449 - skb = br_multicast_alloc_query(br, &pg->addr);
1450 - if (!skb)
1451 - goto timer;
1452 -
1453 - br_deliver(port, skb);
1454 -
1455 -timer:
1456 - if (++pg->queries_sent < br->multicast_last_member_count)
1457 - mod_timer(&pg->query_timer,
1458 - jiffies + br->multicast_last_member_interval);
1459 -}
1460 -
1461 -static void br_multicast_port_group_query_expired(unsigned long data)
1462 -{
1463 - struct net_bridge_port_group *pg = (void *)data;
1464 - struct net_bridge_port *port = pg->port;
1465 - struct net_bridge *br = port->br;
1466 -
1467 - spin_lock(&br->multicast_lock);
1468 - if (!netif_running(br->dev) || hlist_unhashed(&pg->mglist) ||
1469 - pg->queries_sent >= br->multicast_last_member_count)
1470 - goto out;
1471 -
1472 - br_multicast_send_port_group_query(pg);
1473 -
1474 -out:
1475 - spin_unlock(&br->multicast_lock);
1476 -}
1477 -
1478 static struct net_bridge_mdb_entry *br_multicast_get_group(
1479 struct net_bridge *br, struct net_bridge_port *port,
1480 struct br_ip *group, int hash)
1481 @@ -690,8 +620,6 @@ rehash:
1482 mp->addr = *group;
1483 setup_timer(&mp->timer, br_multicast_group_expired,
1484 (unsigned long)mp);
1485 - setup_timer(&mp->query_timer, br_multicast_group_query_expired,
1486 - (unsigned long)mp);
1487
1488 hlist_add_head_rcu(&mp->hlist[mdb->ver], &mdb->mhash[hash]);
1489 mdb->size++;
1490 @@ -746,8 +674,6 @@ static int br_multicast_add_group(struct net_bridge *br,
1491 hlist_add_head(&p->mglist, &port->mglist);
1492 setup_timer(&p->timer, br_multicast_port_group_expired,
1493 (unsigned long)p);
1494 - setup_timer(&p->query_timer, br_multicast_port_group_query_expired,
1495 - (unsigned long)p);
1496
1497 rcu_assign_pointer(*pp, p);
1498
1499 @@ -1291,9 +1217,6 @@ static void br_multicast_leave_group(struct net_bridge *br,
1500 time_after(mp->timer.expires, time) :
1501 try_to_del_timer_sync(&mp->timer) >= 0)) {
1502 mod_timer(&mp->timer, time);
1503 -
1504 - mp->queries_sent = 0;
1505 - mod_timer(&mp->query_timer, now);
1506 }
1507
1508 goto out;
1509 @@ -1310,9 +1233,6 @@ static void br_multicast_leave_group(struct net_bridge *br,
1510 time_after(p->timer.expires, time) :
1511 try_to_del_timer_sync(&p->timer) >= 0)) {
1512 mod_timer(&p->timer, time);
1513 -
1514 - p->queries_sent = 0;
1515 - mod_timer(&p->query_timer, now);
1516 }
1517
1518 break;
1519 @@ -1678,7 +1598,6 @@ void br_multicast_stop(struct net_bridge *br)
1520 hlist_for_each_entry_safe(mp, p, n, &mdb->mhash[i],
1521 hlist[ver]) {
1522 del_timer(&mp->timer);
1523 - del_timer(&mp->query_timer);
1524 call_rcu_bh(&mp->rcu, br_multicast_free_group);
1525 }
1526 }
1527 diff --git a/net/bridge/br_private.h b/net/bridge/br_private.h
1528 index 857a021..1ca1b1c 100644
1529 --- a/net/bridge/br_private.h
1530 +++ b/net/bridge/br_private.h
1531 @@ -77,9 +77,7 @@ struct net_bridge_port_group {
1532 struct hlist_node mglist;
1533 struct rcu_head rcu;
1534 struct timer_list timer;
1535 - struct timer_list query_timer;
1536 struct br_ip addr;
1537 - u32 queries_sent;
1538 };
1539
1540 struct net_bridge_mdb_entry
1541 @@ -89,10 +87,8 @@ struct net_bridge_mdb_entry
1542 struct net_bridge_port_group __rcu *ports;
1543 struct rcu_head rcu;
1544 struct timer_list timer;
1545 - struct timer_list query_timer;
1546 struct br_ip addr;
1547 bool mglist;
1548 - u32 queries_sent;
1549 };
1550
1551 struct net_bridge_mdb_htable
1552 diff --git a/net/core/net_namespace.c b/net/core/net_namespace.c
1553 index 0b0211d..2772ed1 100644
1554 --- a/net/core/net_namespace.c
1555 +++ b/net/core/net_namespace.c
1556 @@ -82,21 +82,29 @@ assign:
1557
1558 static int ops_init(const struct pernet_operations *ops, struct net *net)
1559 {
1560 - int err;
1561 + int err = -ENOMEM;
1562 + void *data = NULL;
1563 +
1564 if (ops->id && ops->size) {
1565 - void *data = kzalloc(ops->size, GFP_KERNEL);
1566 + data = kzalloc(ops->size, GFP_KERNEL);
1567 if (!data)
1568 - return -ENOMEM;
1569 + goto out;
1570
1571 err = net_assign_generic(net, *ops->id, data);
1572 - if (err) {
1573 - kfree(data);
1574 - return err;
1575 - }
1576 + if (err)
1577 + goto cleanup;
1578 }
1579 + err = 0;
1580 if (ops->init)
1581 - return ops->init(net);
1582 - return 0;
1583 + err = ops->init(net);
1584 + if (!err)
1585 + return 0;
1586 +
1587 +cleanup:
1588 + kfree(data);
1589 +
1590 +out:
1591 + return err;
1592 }
1593
1594 static void ops_free(const struct pernet_operations *ops, struct net *net)
1595 @@ -446,12 +454,7 @@ static void __unregister_pernet_operations(struct pernet_operations *ops)
1596 static int __register_pernet_operations(struct list_head *list,
1597 struct pernet_operations *ops)
1598 {
1599 - int err = 0;
1600 - err = ops_init(ops, &init_net);
1601 - if (err)
1602 - ops_free(ops, &init_net);
1603 - return err;
1604 -
1605 + return ops_init(ops, &init_net);
1606 }
1607
1608 static void __unregister_pernet_operations(struct pernet_operations *ops)
1609 diff --git a/net/core/skbuff.c b/net/core/skbuff.c
1610 index 46cbd28..4821df8 100644
1611 --- a/net/core/skbuff.c
1612 +++ b/net/core/skbuff.c
1613 @@ -2985,6 +2985,8 @@ static void sock_rmem_free(struct sk_buff *skb)
1614 */
1615 int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
1616 {
1617 + int len = skb->len;
1618 +
1619 if (atomic_read(&sk->sk_rmem_alloc) + skb->truesize >=
1620 (unsigned)sk->sk_rcvbuf)
1621 return -ENOMEM;
1622 @@ -2999,7 +3001,7 @@ int sock_queue_err_skb(struct sock *sk, struct sk_buff *skb)
1623
1624 skb_queue_tail(&sk->sk_error_queue, skb);
1625 if (!sock_flag(sk, SOCK_DEAD))
1626 - sk->sk_data_ready(sk, skb->len);
1627 + sk->sk_data_ready(sk, len);
1628 return 0;
1629 }
1630 EXPORT_SYMBOL(sock_queue_err_skb);
1631 diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
1632 index 46febca..80b988f 100644
1633 --- a/net/ipv4/tcp.c
1634 +++ b/net/ipv4/tcp.c
1635 @@ -860,7 +860,7 @@ wait_for_memory:
1636 }
1637
1638 out:
1639 - if (copied)
1640 + if (copied && !(flags & MSG_SENDPAGE_NOTLAST))
1641 tcp_push(sk, flags, mss_now, tp->nonagle);
1642 return copied;
1643
1644 diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
1645 index 72b1857..c3a9f03 100644
1646 --- a/net/ipv4/tcp_input.c
1647 +++ b/net/ipv4/tcp_input.c
1648 @@ -328,6 +328,7 @@ static void tcp_grow_window(struct sock *sk, struct sk_buff *skb)
1649 incr = __tcp_grow_window(sk, skb);
1650
1651 if (incr) {
1652 + incr = max_t(int, incr, 2 * skb->len);
1653 tp->rcv_ssthresh = min(tp->rcv_ssthresh + incr,
1654 tp->window_clamp);
1655 inet_csk(sk)->icsk_ack.quick |= 1;
1656 @@ -460,8 +461,11 @@ static void tcp_rcv_rtt_update(struct tcp_sock *tp, u32 sample, int win_dep)
1657 if (!win_dep) {
1658 m -= (new_sample >> 3);
1659 new_sample += m;
1660 - } else if (m < new_sample)
1661 - new_sample = m << 3;
1662 + } else {
1663 + m <<= 3;
1664 + if (m < new_sample)
1665 + new_sample = m;
1666 + }
1667 } else {
1668 /* No previous measure. */
1669 new_sample = m << 3;
1670 diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c
1671 index 2257366..f2d74ea 100644
1672 --- a/net/ipv6/mcast.c
1673 +++ b/net/ipv6/mcast.c
1674 @@ -2054,7 +2054,7 @@ static int ip6_mc_add_src(struct inet6_dev *idev, const struct in6_addr *pmca,
1675 if (!delta)
1676 pmc->mca_sfcount[sfmode]--;
1677 for (j=0; j<i; j++)
1678 - (void) ip6_mc_del1_src(pmc, sfmode, &psfsrc[i]);
1679 + ip6_mc_del1_src(pmc, sfmode, &psfsrc[j]);
1680 } else if (isexclude != (pmc->mca_sfcount[MCAST_EXCLUDE] != 0)) {
1681 struct ip6_sf_list *psf;
1682
1683 diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c
1684 index 51587a0..848f963 100644
1685 --- a/net/ipv6/tcp_ipv6.c
1686 +++ b/net/ipv6/tcp_ipv6.c
1687 @@ -1514,6 +1514,10 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
1688 tcp_mtup_init(newsk);
1689 tcp_sync_mss(newsk, dst_mtu(dst));
1690 newtp->advmss = dst_metric_advmss(dst);
1691 + if (tcp_sk(sk)->rx_opt.user_mss &&
1692 + tcp_sk(sk)->rx_opt.user_mss < newtp->advmss)
1693 + newtp->advmss = tcp_sk(sk)->rx_opt.user_mss;
1694 +
1695 tcp_initialize_rcv_mss(newsk);
1696
1697 newinet->inet_daddr = newinet->inet_saddr = LOOPBACK4_IPV6;
1698 diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
1699 index 6ef64ad..24bc620 100644
1700 --- a/net/netlink/af_netlink.c
1701 +++ b/net/netlink/af_netlink.c
1702 @@ -830,12 +830,19 @@ int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
1703 return 0;
1704 }
1705
1706 -int netlink_sendskb(struct sock *sk, struct sk_buff *skb)
1707 +static int __netlink_sendskb(struct sock *sk, struct sk_buff *skb)
1708 {
1709 int len = skb->len;
1710
1711 skb_queue_tail(&sk->sk_receive_queue, skb);
1712 sk->sk_data_ready(sk, len);
1713 + return len;
1714 +}
1715 +
1716 +int netlink_sendskb(struct sock *sk, struct sk_buff *skb)
1717 +{
1718 + int len = __netlink_sendskb(sk, skb);
1719 +
1720 sock_put(sk);
1721 return len;
1722 }
1723 @@ -960,8 +967,7 @@ static inline int netlink_broadcast_deliver(struct sock *sk,
1724 if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
1725 !test_bit(0, &nlk->state)) {
1726 skb_set_owner_r(skb, sk);
1727 - skb_queue_tail(&sk->sk_receive_queue, skb);
1728 - sk->sk_data_ready(sk, skb->len);
1729 + __netlink_sendskb(sk, skb);
1730 return atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf;
1731 }
1732 return -1;
1733 @@ -1682,10 +1688,8 @@ static int netlink_dump(struct sock *sk)
1734
1735 if (sk_filter(sk, skb))
1736 kfree_skb(skb);
1737 - else {
1738 - skb_queue_tail(&sk->sk_receive_queue, skb);
1739 - sk->sk_data_ready(sk, skb->len);
1740 - }
1741 + else
1742 + __netlink_sendskb(sk, skb);
1743 return 0;
1744 }
1745
1746 @@ -1697,10 +1701,8 @@ static int netlink_dump(struct sock *sk)
1747
1748 if (sk_filter(sk, skb))
1749 kfree_skb(skb);
1750 - else {
1751 - skb_queue_tail(&sk->sk_receive_queue, skb);
1752 - sk->sk_data_ready(sk, skb->len);
1753 - }
1754 + else
1755 + __netlink_sendskb(sk, skb);
1756
1757 if (cb->done)
1758 cb->done(cb);
1759 diff --git a/net/phonet/pep.c b/net/phonet/pep.c
1760 index f17fd84..d29a7fb 100644
1761 --- a/net/phonet/pep.c
1762 +++ b/net/phonet/pep.c
1763 @@ -1045,6 +1045,9 @@ static int pep_sendmsg(struct kiocb *iocb, struct sock *sk,
1764 int flags = msg->msg_flags;
1765 int err, done;
1766
1767 + if (len > USHRT_MAX)
1768 + return -EMSGSIZE;
1769 +
1770 if ((msg->msg_flags & ~(MSG_DONTWAIT|MSG_EOR|MSG_NOSIGNAL|
1771 MSG_CMSG_COMPAT)) ||
1772 !(msg->msg_flags & MSG_EOR))
1773 diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
1774 index 6cd8ddf..e1afe0c 100644
1775 --- a/net/sched/sch_gred.c
1776 +++ b/net/sched/sch_gred.c
1777 @@ -544,11 +544,8 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
1778 opt.packets = q->packetsin;
1779 opt.bytesin = q->bytesin;
1780
1781 - if (gred_wred_mode(table)) {
1782 - q->parms.qidlestart =
1783 - table->tab[table->def]->parms.qidlestart;
1784 - q->parms.qavg = table->tab[table->def]->parms.qavg;
1785 - }
1786 + if (gred_wred_mode(table))
1787 + gred_load_wred_set(table, q);
1788
1789 opt.qave = red_calc_qavg(&q->parms, q->parms.qavg);
1790
1791 diff --git a/net/sctp/socket.c b/net/sctp/socket.c
1792 index fa9b5c7..4434853 100644
1793 --- a/net/sctp/socket.c
1794 +++ b/net/sctp/socket.c
1795 @@ -4009,9 +4009,10 @@ static int sctp_getsockopt_disable_fragments(struct sock *sk, int len,
1796 static int sctp_getsockopt_events(struct sock *sk, int len, char __user *optval,
1797 int __user *optlen)
1798 {
1799 - if (len < sizeof(struct sctp_event_subscribe))
1800 + if (len <= 0)
1801 return -EINVAL;
1802 - len = sizeof(struct sctp_event_subscribe);
1803 + if (len > sizeof(struct sctp_event_subscribe))
1804 + len = sizeof(struct sctp_event_subscribe);
1805 if (put_user(len, optlen))
1806 return -EFAULT;
1807 if (copy_to_user(optval, &sctp_sk(sk)->subscribe, len))
1808 diff --git a/net/socket.c b/net/socket.c
1809 index 1ad42d3..cf41afc 100644
1810 --- a/net/socket.c
1811 +++ b/net/socket.c
1812 @@ -791,9 +791,9 @@ static ssize_t sock_sendpage(struct file *file, struct page *page,
1813
1814 sock = file->private_data;
1815
1816 - flags = !(file->f_flags & O_NONBLOCK) ? 0 : MSG_DONTWAIT;
1817 - if (more)
1818 - flags |= MSG_MORE;
1819 + flags = (file->f_flags & O_NONBLOCK) ? MSG_DONTWAIT : 0;
1820 + /* more is a combination of MSG_MORE and MSG_SENDPAGE_NOTLAST */
1821 + flags |= more;
1822
1823 return kernel_sendpage(sock, page, offset, size, flags);
1824 }
1825 diff --git a/net/wireless/util.c b/net/wireless/util.c
1826 index 4d7b83f..9c22330 100644
1827 --- a/net/wireless/util.c
1828 +++ b/net/wireless/util.c
1829 @@ -990,7 +990,7 @@ int cfg80211_can_change_interface(struct cfg80211_registered_device *rdev,
1830 if (rdev->wiphy.software_iftypes & BIT(iftype))
1831 continue;
1832 for (j = 0; j < c->n_limits; j++) {
1833 - if (!(limits[j].types & iftype))
1834 + if (!(limits[j].types & BIT(iftype)))
1835 continue;
1836 if (limits[j].max < num[iftype])
1837 goto cont;
1838 diff --git a/sound/pci/hda/patch_conexant.c b/sound/pci/hda/patch_conexant.c
1839 index 4ad20a6..4cf3266 100644
1840 --- a/sound/pci/hda/patch_conexant.c
1841 +++ b/sound/pci/hda/patch_conexant.c
1842 @@ -4003,9 +4003,14 @@ static void cx_auto_init_output(struct hda_codec *codec)
1843 int i;
1844
1845 mute_outputs(codec, spec->multiout.num_dacs, spec->multiout.dac_nids);
1846 - for (i = 0; i < cfg->hp_outs; i++)
1847 + for (i = 0; i < cfg->hp_outs; i++) {
1848 + unsigned int val = PIN_OUT;
1849 + if (snd_hda_query_pin_caps(codec, cfg->hp_pins[i]) &
1850 + AC_PINCAP_HP_DRV)
1851 + val |= AC_PINCTL_HP_EN;
1852 snd_hda_codec_write(codec, cfg->hp_pins[i], 0,
1853 - AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP);
1854 + AC_VERB_SET_PIN_WIDGET_CONTROL, val);
1855 + }
1856 mute_outputs(codec, cfg->hp_outs, cfg->hp_pins);
1857 mute_outputs(codec, cfg->line_outs, cfg->line_out_pins);
1858 mute_outputs(codec, cfg->speaker_outs, cfg->speaker_pins);
1859 diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
1860 index d25fded..fb69599 100644
1861 --- a/tools/perf/util/hist.c
1862 +++ b/tools/perf/util/hist.c
1863 @@ -165,8 +165,8 @@ struct hist_entry *__hists__add_entry(struct hists *self,
1864 * mis-adjust symbol addresses when computing
1865 * the history counter to increment.
1866 */
1867 - if (he->ms.map != entry->ms.map) {
1868 - he->ms.map = entry->ms.map;
1869 + if (he->ms.map != entry.ms.map) {
1870 + he->ms.map = entry.ms.map;
1871 if (he->ms.map)
1872 he->ms.map->referenced = true;
1873 }

  ViewVC Help
Powered by ViewVC 1.1.20