/[linux-patches]/genpatches-2.6/tags/3.0-30/1010_linux-3.0.11.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1010_linux-3.0.11.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (2 years ago) by mpagano
File size: 64834 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index 36036d1..eaa96c5 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 10
9 +SUBLEVEL = 11
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
14 index 278c1b0..673151c 100644
15 --- a/arch/arm/kernel/head.S
16 +++ b/arch/arm/kernel/head.S
17 @@ -348,7 +348,7 @@ __secondary_data:
18 * r13 = *virtual* address to jump to upon completion
19 */
20 __enable_mmu:
21 -#ifdef CONFIG_ALIGNMENT_TRAP
22 +#if defined(CONFIG_ALIGNMENT_TRAP) && __LINUX_ARM_ARCH__ < 6
23 orr r0, r0, #CR_A
24 #else
25 bic r0, r0, #CR_A
26 diff --git a/drivers/base/core.c b/drivers/base/core.c
27 index bc8729d..78445f4 100644
28 --- a/drivers/base/core.c
29 +++ b/drivers/base/core.c
30 @@ -22,6 +22,7 @@
31 #include <linux/kallsyms.h>
32 #include <linux/mutex.h>
33 #include <linux/async.h>
34 +#include <linux/pm_runtime.h>
35
36 #include "base.h"
37 #include "power/power.h"
38 @@ -1742,6 +1743,8 @@ void device_shutdown(void)
39 */
40 list_del_init(&dev->kobj.entry);
41 spin_unlock(&devices_kset->list_lock);
42 + /* Disable all device's runtime power management */
43 + pm_runtime_disable(dev);
44
45 if (dev->bus && dev->bus->shutdown) {
46 dev_dbg(dev, "shutdown\n");
47 diff --git a/drivers/base/node.c b/drivers/base/node.c
48 index 793f796..5693ece 100644
49 --- a/drivers/base/node.c
50 +++ b/drivers/base/node.c
51 @@ -127,12 +127,13 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
52 nid, K(node_page_state(nid, NR_WRITEBACK)),
53 nid, K(node_page_state(nid, NR_FILE_PAGES)),
54 nid, K(node_page_state(nid, NR_FILE_MAPPED)),
55 - nid, K(node_page_state(nid, NR_ANON_PAGES)
56 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
57 + nid, K(node_page_state(nid, NR_ANON_PAGES)
58 + node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
59 - HPAGE_PMD_NR
60 + HPAGE_PMD_NR),
61 +#else
62 + nid, K(node_page_state(nid, NR_ANON_PAGES)),
63 #endif
64 - ),
65 nid, K(node_page_state(nid, NR_SHMEM)),
66 nid, node_page_state(nid, NR_KERNEL_STACK) *
67 THREAD_SIZE / 1024,
68 @@ -143,13 +144,14 @@ static ssize_t node_read_meminfo(struct sys_device * dev,
69 nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE) +
70 node_page_state(nid, NR_SLAB_UNRECLAIMABLE)),
71 nid, K(node_page_state(nid, NR_SLAB_RECLAIMABLE)),
72 - nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
73 #ifdef CONFIG_TRANSPARENT_HUGEPAGE
74 + nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE))
75 , nid,
76 K(node_page_state(nid, NR_ANON_TRANSPARENT_HUGEPAGES) *
77 - HPAGE_PMD_NR)
78 + HPAGE_PMD_NR));
79 +#else
80 + nid, K(node_page_state(nid, NR_SLAB_UNRECLAIMABLE)));
81 #endif
82 - );
83 n += hugetlb_report_node_meminfo(nid, buf + n);
84 return n;
85 }
86 diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
87 index ce7914c..e0d0e27 100644
88 --- a/drivers/gpu/drm/i915/i915_drv.h
89 +++ b/drivers/gpu/drm/i915/i915_drv.h
90 @@ -541,6 +541,7 @@ typedef struct drm_i915_private {
91 u32 savePIPEB_LINK_M1;
92 u32 savePIPEB_LINK_N1;
93 u32 saveMCHBAR_RENDER_STANDBY;
94 + u32 savePCH_PORT_HOTPLUG;
95
96 struct {
97 /** Bridge to intel-gtt-ko */
98 diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
99 index 5d5def7..8936d40 100644
100 --- a/drivers/gpu/drm/i915/i915_reg.h
101 +++ b/drivers/gpu/drm/i915/i915_reg.h
102 @@ -2544,10 +2544,18 @@
103 #define _CURBBASE 0x700c4
104 #define _CURBPOS 0x700c8
105
106 +#define _CURBCNTR_IVB 0x71080
107 +#define _CURBBASE_IVB 0x71084
108 +#define _CURBPOS_IVB 0x71088
109 +
110 #define CURCNTR(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR)
111 #define CURBASE(pipe) _PIPE(pipe, _CURABASE, _CURBBASE)
112 #define CURPOS(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS)
113
114 +#define CURCNTR_IVB(pipe) _PIPE(pipe, _CURACNTR, _CURBCNTR_IVB)
115 +#define CURBASE_IVB(pipe) _PIPE(pipe, _CURABASE, _CURBBASE_IVB)
116 +#define CURPOS_IVB(pipe) _PIPE(pipe, _CURAPOS, _CURBPOS_IVB)
117 +
118 /* Display A control */
119 #define _DSPACNTR 0x70180
120 #define DISPLAY_PLANE_ENABLE (1<<31)
121 @@ -3133,6 +3141,7 @@
122 #define FDI_LINK_TRAIN_NONE_IVB (3<<8)
123
124 /* both Tx and Rx */
125 +#define FDI_COMPOSITE_SYNC (1<<11)
126 #define FDI_LINK_TRAIN_AUTO (1<<10)
127 #define FDI_SCRAMBLING_ENABLE (0<<7)
128 #define FDI_SCRAMBLING_DISABLE (1<<7)
129 diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
130 index 5257cfc..27693c0 100644
131 --- a/drivers/gpu/drm/i915/i915_suspend.c
132 +++ b/drivers/gpu/drm/i915/i915_suspend.c
133 @@ -814,6 +814,7 @@ int i915_save_state(struct drm_device *dev)
134 dev_priv->saveFDI_RXB_IMR = I915_READ(_FDI_RXB_IMR);
135 dev_priv->saveMCHBAR_RENDER_STANDBY =
136 I915_READ(RSTDBYCTL);
137 + dev_priv->savePCH_PORT_HOTPLUG = I915_READ(PCH_PORT_HOTPLUG);
138 } else {
139 dev_priv->saveIER = I915_READ(IER);
140 dev_priv->saveIMR = I915_READ(IMR);
141 @@ -865,6 +866,7 @@ int i915_restore_state(struct drm_device *dev)
142 I915_WRITE(GTIMR, dev_priv->saveGTIMR);
143 I915_WRITE(_FDI_RXA_IMR, dev_priv->saveFDI_RXA_IMR);
144 I915_WRITE(_FDI_RXB_IMR, dev_priv->saveFDI_RXB_IMR);
145 + I915_WRITE(PCH_PORT_HOTPLUG, dev_priv->savePCH_PORT_HOTPLUG);
146 } else {
147 I915_WRITE(IER, dev_priv->saveIER);
148 I915_WRITE(IMR, dev_priv->saveIMR);
149 diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
150 index cbf4c4c..853bddb 100644
151 --- a/drivers/gpu/drm/i915/intel_display.c
152 +++ b/drivers/gpu/drm/i915/intel_display.c
153 @@ -2340,6 +2340,7 @@ static void ivb_manual_fdi_link_train(struct drm_crtc *crtc)
154 temp |= FDI_LINK_TRAIN_PATTERN_1_IVB;
155 temp &= ~FDI_LINK_TRAIN_VOL_EMP_MASK;
156 temp |= FDI_LINK_TRAIN_400MV_0DB_SNB_B;
157 + temp |= FDI_COMPOSITE_SYNC;
158 I915_WRITE(reg, temp | FDI_TX_ENABLE);
159
160 reg = FDI_RX_CTL(pipe);
161 @@ -2347,6 +2348,7 @@ static void ivb_manual_fdi_link_train(struct drm_crtc *crtc)
162 temp &= ~FDI_LINK_TRAIN_AUTO;
163 temp &= ~FDI_LINK_TRAIN_PATTERN_MASK_CPT;
164 temp |= FDI_LINK_TRAIN_PATTERN_1_CPT;
165 + temp |= FDI_COMPOSITE_SYNC;
166 I915_WRITE(reg, temp | FDI_RX_ENABLE);
167
168 POSTING_READ(reg);
169 @@ -5334,6 +5336,31 @@ static void i9xx_update_cursor(struct drm_crtc *crtc, u32 base)
170 I915_WRITE(CURBASE(pipe), base);
171 }
172
173 +static void ivb_update_cursor(struct drm_crtc *crtc, u32 base)
174 +{
175 + struct drm_device *dev = crtc->dev;
176 + struct drm_i915_private *dev_priv = dev->dev_private;
177 + struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
178 + int pipe = intel_crtc->pipe;
179 + bool visible = base != 0;
180 +
181 + if (intel_crtc->cursor_visible != visible) {
182 + uint32_t cntl = I915_READ(CURCNTR_IVB(pipe));
183 + if (base) {
184 + cntl &= ~CURSOR_MODE;
185 + cntl |= CURSOR_MODE_64_ARGB_AX | MCURSOR_GAMMA_ENABLE;
186 + } else {
187 + cntl &= ~(CURSOR_MODE | MCURSOR_GAMMA_ENABLE);
188 + cntl |= CURSOR_MODE_DISABLE;
189 + }
190 + I915_WRITE(CURCNTR_IVB(pipe), cntl);
191 +
192 + intel_crtc->cursor_visible = visible;
193 + }
194 + /* and commit changes on next vblank */
195 + I915_WRITE(CURBASE_IVB(pipe), base);
196 +}
197 +
198 /* If no-part of the cursor is visible on the framebuffer, then the GPU may hang... */
199 static void intel_crtc_update_cursor(struct drm_crtc *crtc,
200 bool on)
201 @@ -5381,11 +5408,16 @@ static void intel_crtc_update_cursor(struct drm_crtc *crtc,
202 if (!visible && !intel_crtc->cursor_visible)
203 return;
204
205 - I915_WRITE(CURPOS(pipe), pos);
206 - if (IS_845G(dev) || IS_I865G(dev))
207 - i845_update_cursor(crtc, base);
208 - else
209 - i9xx_update_cursor(crtc, base);
210 + if (IS_IVYBRIDGE(dev)) {
211 + I915_WRITE(CURPOS_IVB(pipe), pos);
212 + ivb_update_cursor(crtc, base);
213 + } else {
214 + I915_WRITE(CURPOS(pipe), pos);
215 + if (IS_845G(dev) || IS_I865G(dev))
216 + i845_update_cursor(crtc, base);
217 + else
218 + i9xx_update_cursor(crtc, base);
219 + }
220
221 if (visible)
222 intel_mark_busy(dev, to_intel_framebuffer(crtc->fb)->obj);
223 diff --git a/drivers/media/video/saa7164/saa7164-cards.c b/drivers/media/video/saa7164/saa7164-cards.c
224 index 69822a4..c713691 100644
225 --- a/drivers/media/video/saa7164/saa7164-cards.c
226 +++ b/drivers/media/video/saa7164/saa7164-cards.c
227 @@ -203,6 +203,66 @@ struct saa7164_board saa7164_boards[] = {
228 .i2c_reg_len = REGLEN_8bit,
229 } },
230 },
231 + [SAA7164_BOARD_HAUPPAUGE_HVR2200_4] = {
232 + .name = "Hauppauge WinTV-HVR2200",
233 + .porta = SAA7164_MPEG_DVB,
234 + .portb = SAA7164_MPEG_DVB,
235 + .portc = SAA7164_MPEG_ENCODER,
236 + .portd = SAA7164_MPEG_ENCODER,
237 + .porte = SAA7164_MPEG_VBI,
238 + .portf = SAA7164_MPEG_VBI,
239 + .chiprev = SAA7164_CHIP_REV3,
240 + .unit = {{
241 + .id = 0x1d,
242 + .type = SAA7164_UNIT_EEPROM,
243 + .name = "4K EEPROM",
244 + .i2c_bus_nr = SAA7164_I2C_BUS_0,
245 + .i2c_bus_addr = 0xa0 >> 1,
246 + .i2c_reg_len = REGLEN_8bit,
247 + }, {
248 + .id = 0x04,
249 + .type = SAA7164_UNIT_TUNER,
250 + .name = "TDA18271-1",
251 + .i2c_bus_nr = SAA7164_I2C_BUS_1,
252 + .i2c_bus_addr = 0xc0 >> 1,
253 + .i2c_reg_len = REGLEN_8bit,
254 + }, {
255 + .id = 0x05,
256 + .type = SAA7164_UNIT_ANALOG_DEMODULATOR,
257 + .name = "TDA8290-1",
258 + .i2c_bus_nr = SAA7164_I2C_BUS_1,
259 + .i2c_bus_addr = 0x84 >> 1,
260 + .i2c_reg_len = REGLEN_8bit,
261 + }, {
262 + .id = 0x1b,
263 + .type = SAA7164_UNIT_TUNER,
264 + .name = "TDA18271-2",
265 + .i2c_bus_nr = SAA7164_I2C_BUS_2,
266 + .i2c_bus_addr = 0xc0 >> 1,
267 + .i2c_reg_len = REGLEN_8bit,
268 + }, {
269 + .id = 0x1c,
270 + .type = SAA7164_UNIT_ANALOG_DEMODULATOR,
271 + .name = "TDA8290-2",
272 + .i2c_bus_nr = SAA7164_I2C_BUS_2,
273 + .i2c_bus_addr = 0x84 >> 1,
274 + .i2c_reg_len = REGLEN_8bit,
275 + }, {
276 + .id = 0x1e,
277 + .type = SAA7164_UNIT_DIGITAL_DEMODULATOR,
278 + .name = "TDA10048-1",
279 + .i2c_bus_nr = SAA7164_I2C_BUS_1,
280 + .i2c_bus_addr = 0x10 >> 1,
281 + .i2c_reg_len = REGLEN_8bit,
282 + }, {
283 + .id = 0x1f,
284 + .type = SAA7164_UNIT_DIGITAL_DEMODULATOR,
285 + .name = "TDA10048-2",
286 + .i2c_bus_nr = SAA7164_I2C_BUS_2,
287 + .i2c_bus_addr = 0x12 >> 1,
288 + .i2c_reg_len = REGLEN_8bit,
289 + } },
290 + },
291 [SAA7164_BOARD_HAUPPAUGE_HVR2250] = {
292 .name = "Hauppauge WinTV-HVR2250",
293 .porta = SAA7164_MPEG_DVB,
294 @@ -426,6 +486,10 @@ struct saa7164_subid saa7164_subids[] = {
295 .subvendor = 0x0070,
296 .subdevice = 0x8851,
297 .card = SAA7164_BOARD_HAUPPAUGE_HVR2250_2,
298 + }, {
299 + .subvendor = 0x0070,
300 + .subdevice = 0x8940,
301 + .card = SAA7164_BOARD_HAUPPAUGE_HVR2200_4,
302 },
303 };
304 const unsigned int saa7164_idcount = ARRAY_SIZE(saa7164_subids);
305 @@ -469,6 +533,7 @@ void saa7164_gpio_setup(struct saa7164_dev *dev)
306 case SAA7164_BOARD_HAUPPAUGE_HVR2200:
307 case SAA7164_BOARD_HAUPPAUGE_HVR2200_2:
308 case SAA7164_BOARD_HAUPPAUGE_HVR2200_3:
309 + case SAA7164_BOARD_HAUPPAUGE_HVR2200_4:
310 case SAA7164_BOARD_HAUPPAUGE_HVR2250:
311 case SAA7164_BOARD_HAUPPAUGE_HVR2250_2:
312 case SAA7164_BOARD_HAUPPAUGE_HVR2250_3:
313 @@ -549,6 +614,7 @@ void saa7164_card_setup(struct saa7164_dev *dev)
314 case SAA7164_BOARD_HAUPPAUGE_HVR2200:
315 case SAA7164_BOARD_HAUPPAUGE_HVR2200_2:
316 case SAA7164_BOARD_HAUPPAUGE_HVR2200_3:
317 + case SAA7164_BOARD_HAUPPAUGE_HVR2200_4:
318 case SAA7164_BOARD_HAUPPAUGE_HVR2250:
319 case SAA7164_BOARD_HAUPPAUGE_HVR2250_2:
320 case SAA7164_BOARD_HAUPPAUGE_HVR2250_3:
321 diff --git a/drivers/media/video/saa7164/saa7164-dvb.c b/drivers/media/video/saa7164/saa7164-dvb.c
322 index f65eab6..d377937 100644
323 --- a/drivers/media/video/saa7164/saa7164-dvb.c
324 +++ b/drivers/media/video/saa7164/saa7164-dvb.c
325 @@ -475,6 +475,7 @@ int saa7164_dvb_register(struct saa7164_port *port)
326 case SAA7164_BOARD_HAUPPAUGE_HVR2200:
327 case SAA7164_BOARD_HAUPPAUGE_HVR2200_2:
328 case SAA7164_BOARD_HAUPPAUGE_HVR2200_3:
329 + case SAA7164_BOARD_HAUPPAUGE_HVR2200_4:
330 i2c_bus = &dev->i2c_bus[port->nr + 1];
331 switch (port->nr) {
332 case 0:
333 diff --git a/drivers/media/video/saa7164/saa7164.h b/drivers/media/video/saa7164/saa7164.h
334 index 16745d2..13bd27e 100644
335 --- a/drivers/media/video/saa7164/saa7164.h
336 +++ b/drivers/media/video/saa7164/saa7164.h
337 @@ -83,6 +83,7 @@
338 #define SAA7164_BOARD_HAUPPAUGE_HVR2200_3 6
339 #define SAA7164_BOARD_HAUPPAUGE_HVR2250_2 7
340 #define SAA7164_BOARD_HAUPPAUGE_HVR2250_3 8
341 +#define SAA7164_BOARD_HAUPPAUGE_HVR2200_4 9
342
343 #define SAA7164_MAX_UNITS 8
344 #define SAA7164_TS_NUMBER_OF_LINES 312
345 diff --git a/drivers/misc/Kconfig b/drivers/misc/Kconfig
346 index 3546474..56c05ef 100644
347 --- a/drivers/misc/Kconfig
348 +++ b/drivers/misc/Kconfig
349 @@ -471,7 +471,7 @@ config BMP085
350 module will be called bmp085.
351
352 config PCH_PHUB
353 - tristate "Intel EG20T PCH / OKI SEMICONDUCTOR IOH(ML7213/ML7223) PHUB"
354 + tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) PHUB"
355 depends on PCI
356 help
357 This driver is for PCH(Platform controller Hub) PHUB(Packet Hub) of
358 @@ -479,12 +479,13 @@ config PCH_PHUB
359 processor. The Topcliff has MAC address and Option ROM data in SROM.
360 This driver can access MAC address and Option ROM data in SROM.
361
362 - This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
363 - Output Hub), ML7213 and ML7223.
364 - ML7213 IOH is for IVI(In-Vehicle Infotainment) use and ML7223 IOH is
365 - for MP(Media Phone) use.
366 - ML7213/ML7223 is companion chip for Intel Atom E6xx series.
367 - ML7213/ML7223 is completely compatible for Intel EG20T PCH.
368 + This driver also can be used for LAPIS Semiconductor's IOH,
369 + ML7213/ML7223/ML7831.
370 + ML7213 which is for IVI(In-Vehicle Infotainment) use.
371 + ML7223 IOH is for MP(Media Phone) use.
372 + ML7831 IOH is for general purpose use.
373 + ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
374 + ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
375
376 To compile this driver as a module, choose M here: the module will
377 be called pch_phub.
378 diff --git a/drivers/misc/pch_phub.c b/drivers/misc/pch_phub.c
379 index 5fe79df..97e1a1f 100644
380 --- a/drivers/misc/pch_phub.c
381 +++ b/drivers/misc/pch_phub.c
382 @@ -73,6 +73,9 @@
383 #define PCI_DEVICE_ID_ROHM_ML7223_mPHUB 0x8012 /* for Bus-m */
384 #define PCI_DEVICE_ID_ROHM_ML7223_nPHUB 0x8002 /* for Bus-n */
385
386 +/* Macros for ML7831 */
387 +#define PCI_DEVICE_ID_ROHM_ML7831_PHUB 0x8801
388 +
389 /* SROM ACCESS Macro */
390 #define PCH_WORD_ADDR_MASK (~((1 << 2) - 1))
391
392 @@ -464,7 +467,7 @@ static int pch_phub_write_gbe_mac_addr(struct pch_phub_reg *chip, u8 *data)
393 int retval;
394 int i;
395
396 - if (chip->ioh_type == 1) /* EG20T */
397 + if ((chip->ioh_type == 1) || (chip->ioh_type == 5)) /* EG20T or ML7831*/
398 retval = pch_phub_gbe_serial_rom_conf(chip);
399 else /* ML7223 */
400 retval = pch_phub_gbe_serial_rom_conf_mp(chip);
401 @@ -754,6 +757,22 @@ static int __devinit pch_phub_probe(struct pci_dev *pdev,
402 chip->pch_opt_rom_start_address =\
403 PCH_PHUB_ROM_START_ADDR_ML7223;
404 chip->pch_mac_start_address = PCH_PHUB_MAC_START_ADDR_ML7223;
405 + } else if (id->driver_data == 5) { /* ML7831 */
406 + retval = sysfs_create_file(&pdev->dev.kobj,
407 + &dev_attr_pch_mac.attr);
408 + if (retval)
409 + goto err_sysfs_create;
410 +
411 + retval = sysfs_create_bin_file(&pdev->dev.kobj, &pch_bin_attr);
412 + if (retval)
413 + goto exit_bin_attr;
414 +
415 + /* set the prefech value */
416 + iowrite32(0x000affaa, chip->pch_phub_base_address + 0x14);
417 + /* set the interrupt delay value */
418 + iowrite32(0x25, chip->pch_phub_base_address + 0x44);
419 + chip->pch_opt_rom_start_address = PCH_PHUB_ROM_START_ADDR_EG20T;
420 + chip->pch_mac_start_address = PCH_PHUB_MAC_START_ADDR_EG20T;
421 }
422
423 chip->ioh_type = id->driver_data;
424 @@ -838,6 +857,7 @@ static struct pci_device_id pch_phub_pcidev_id[] = {
425 { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7213_PHUB), 2, },
426 { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7223_mPHUB), 3, },
427 { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7223_nPHUB), 4, },
428 + { PCI_VDEVICE(ROHM, PCI_DEVICE_ID_ROHM_ML7831_PHUB), 5, },
429 { }
430 };
431 MODULE_DEVICE_TABLE(pci, pch_phub_pcidev_id);
432 diff --git a/drivers/misc/spear13xx_pcie_gadget.c b/drivers/misc/spear13xx_pcie_gadget.c
433 index cfbddbe..43d073b 100644
434 --- a/drivers/misc/spear13xx_pcie_gadget.c
435 +++ b/drivers/misc/spear13xx_pcie_gadget.c
436 @@ -903,6 +903,6 @@ static void __exit spear_pcie_gadget_exit(void)
437 }
438 module_exit(spear_pcie_gadget_exit);
439
440 -MODULE_ALIAS("pcie-gadget-spear");
441 +MODULE_ALIAS("platform:pcie-gadget-spear");
442 MODULE_AUTHOR("Pratyush Anand");
443 MODULE_LICENSE("GPL");
444 diff --git a/drivers/net/wireless/libertas/if_spi.c b/drivers/net/wireless/libertas/if_spi.c
445 index 463352c..db39742 100644
446 --- a/drivers/net/wireless/libertas/if_spi.c
447 +++ b/drivers/net/wireless/libertas/if_spi.c
448 @@ -997,6 +997,7 @@ static int if_spi_host_to_card(struct lbs_private *priv,
449 spin_unlock_irqrestore(&card->buffer_lock, flags);
450 break;
451 default:
452 + kfree(packet);
453 netdev_err(priv->dev, "can't transfer buffer of type %d\n",
454 type);
455 err = -EINVAL;
456 diff --git a/drivers/net/wireless/rt2x00/rt2x00.h b/drivers/net/wireless/rt2x00/rt2x00.h
457 index c446db6..8c82211 100644
458 --- a/drivers/net/wireless/rt2x00/rt2x00.h
459 +++ b/drivers/net/wireless/rt2x00/rt2x00.h
460 @@ -922,6 +922,7 @@ struct rt2x00_dev {
461 * Powersaving work
462 */
463 struct delayed_work autowakeup_work;
464 + struct work_struct sleep_work;
465
466 /*
467 * Data queue arrays for RX, TX, Beacon and ATIM.
468 diff --git a/drivers/net/wireless/rt2x00/rt2x00dev.c b/drivers/net/wireless/rt2x00/rt2x00dev.c
469 index 939821b..dffaa8f 100644
470 --- a/drivers/net/wireless/rt2x00/rt2x00dev.c
471 +++ b/drivers/net/wireless/rt2x00/rt2x00dev.c
472 @@ -449,6 +449,23 @@ static u8 *rt2x00lib_find_ie(u8 *data, unsigned int len, u8 ie)
473 return NULL;
474 }
475
476 +static void rt2x00lib_sleep(struct work_struct *work)
477 +{
478 + struct rt2x00_dev *rt2x00dev =
479 + container_of(work, struct rt2x00_dev, sleep_work);
480 +
481 + if (!test_bit(DEVICE_STATE_PRESENT, &rt2x00dev->flags))
482 + return;
483 +
484 + /*
485 + * Check again is powersaving is enabled, to prevent races from delayed
486 + * work execution.
487 + */
488 + if (!test_bit(CONFIG_POWERSAVING, &rt2x00dev->flags))
489 + rt2x00lib_config(rt2x00dev, &rt2x00dev->hw->conf,
490 + IEEE80211_CONF_CHANGE_PS);
491 +}
492 +
493 static void rt2x00lib_rxdone_check_ps(struct rt2x00_dev *rt2x00dev,
494 struct sk_buff *skb,
495 struct rxdone_entry_desc *rxdesc)
496 @@ -496,8 +513,7 @@ static void rt2x00lib_rxdone_check_ps(struct rt2x00_dev *rt2x00dev,
497 cam |= (tim_ie->bitmap_ctrl & 0x01);
498
499 if (!cam && !test_bit(CONFIG_POWERSAVING, &rt2x00dev->flags))
500 - rt2x00lib_config(rt2x00dev, &rt2x00dev->hw->conf,
501 - IEEE80211_CONF_CHANGE_PS);
502 + queue_work(rt2x00dev->workqueue, &rt2x00dev->sleep_work);
503 }
504
505 static int rt2x00lib_rxdone_read_signal(struct rt2x00_dev *rt2x00dev,
506 @@ -1108,6 +1124,7 @@ int rt2x00lib_probe_dev(struct rt2x00_dev *rt2x00dev)
507
508 INIT_WORK(&rt2x00dev->intf_work, rt2x00lib_intf_scheduled);
509 INIT_DELAYED_WORK(&rt2x00dev->autowakeup_work, rt2x00lib_autowakeup);
510 + INIT_WORK(&rt2x00dev->sleep_work, rt2x00lib_sleep);
511
512 /*
513 * Let the driver probe the device to detect the capabilities.
514 @@ -1164,6 +1181,7 @@ void rt2x00lib_remove_dev(struct rt2x00_dev *rt2x00dev)
515 */
516 cancel_work_sync(&rt2x00dev->intf_work);
517 cancel_delayed_work_sync(&rt2x00dev->autowakeup_work);
518 + cancel_work_sync(&rt2x00dev->sleep_work);
519 if (rt2x00_is_usb(rt2x00dev)) {
520 del_timer_sync(&rt2x00dev->txstatus_timer);
521 cancel_work_sync(&rt2x00dev->rxdone_work);
522 diff --git a/drivers/scsi/aacraid/linit.c b/drivers/scsi/aacraid/linit.c
523 index 3382475..c7b6fed 100644
524 --- a/drivers/scsi/aacraid/linit.c
525 +++ b/drivers/scsi/aacraid/linit.c
526 @@ -38,6 +38,7 @@
527 #include <linux/module.h>
528 #include <linux/moduleparam.h>
529 #include <linux/pci.h>
530 +#include <linux/pci-aspm.h>
531 #include <linux/slab.h>
532 #include <linux/mutex.h>
533 #include <linux/spinlock.h>
534 @@ -1108,6 +1109,9 @@ static int __devinit aac_probe_one(struct pci_dev *pdev,
535 unique_id++;
536 }
537
538 + pci_disable_link_state(pdev, PCIE_LINK_STATE_L0S | PCIE_LINK_STATE_L1 |
539 + PCIE_LINK_STATE_CLKPM);
540 +
541 error = pci_enable_device(pdev);
542 if (error)
543 goto out;
544 diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
545 index 6689d5d..56a9f3f 100644
546 --- a/drivers/scsi/hpsa.c
547 +++ b/drivers/scsi/hpsa.c
548 @@ -23,6 +23,7 @@
549 #include <linux/interrupt.h>
550 #include <linux/types.h>
551 #include <linux/pci.h>
552 +#include <linux/pci-aspm.h>
553 #include <linux/kernel.h>
554 #include <linux/slab.h>
555 #include <linux/delay.h>
556 @@ -3887,6 +3888,10 @@ static int __devinit hpsa_pci_init(struct ctlr_info *h)
557 dev_warn(&h->pdev->dev, "controller appears to be disabled\n");
558 return -ENODEV;
559 }
560 +
561 + pci_disable_link_state(h->pdev, PCIE_LINK_STATE_L0S |
562 + PCIE_LINK_STATE_L1 | PCIE_LINK_STATE_CLKPM);
563 +
564 err = pci_enable_device(h->pdev);
565 if (err) {
566 dev_warn(&h->pdev->dev, "unable to enable PCI device\n");
567 diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
568 index 72273a0..b3c6d95 100644
569 --- a/drivers/scsi/scsi_scan.c
570 +++ b/drivers/scsi/scsi_scan.c
571 @@ -319,11 +319,7 @@ static struct scsi_device *scsi_alloc_sdev(struct scsi_target *starget,
572 return sdev;
573
574 out_device_destroy:
575 - scsi_device_set_state(sdev, SDEV_DEL);
576 - transport_destroy_device(&sdev->sdev_gendev);
577 - put_device(&sdev->sdev_dev);
578 - scsi_free_queue(sdev->request_queue);
579 - put_device(&sdev->sdev_gendev);
580 + __scsi_remove_device(sdev);
581 out:
582 if (display_failure_msg)
583 printk(ALLOC_FAILURE_MSG, __func__);
584 diff --git a/drivers/tty/hvc/hvc_dcc.c b/drivers/tty/hvc/hvc_dcc.c
585 index 435f6fa..44fbeba 100644
586 --- a/drivers/tty/hvc/hvc_dcc.c
587 +++ b/drivers/tty/hvc/hvc_dcc.c
588 @@ -46,6 +46,7 @@ static inline char __dcc_getchar(void)
589
590 asm volatile("mrc p14, 0, %0, c0, c5, 0 @ read comms data reg"
591 : "=r" (__c));
592 + isb();
593
594 return __c;
595 }
596 @@ -55,6 +56,7 @@ static inline void __dcc_putchar(char c)
597 asm volatile("mcr p14, 0, %0, c0, c5, 0 @ write a char"
598 : /* no output register */
599 : "r" (c));
600 + isb();
601 }
602
603 static int hvc_dcc_put_chars(uint32_t vt, const char *buf, int count)
604 diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
605 index b3692e6..9789293 100644
606 --- a/drivers/tty/serial/Kconfig
607 +++ b/drivers/tty/serial/Kconfig
608 @@ -1585,7 +1585,7 @@ config SERIAL_IFX6X60
609 Support for the IFX6x60 modem devices on Intel MID platforms.
610
611 config SERIAL_PCH_UART
612 - tristate "Intel EG20T PCH / OKI SEMICONDUCTOR IOH(ML7213/ML7223) UART"
613 + tristate "Intel EG20T PCH/LAPIS Semicon IOH(ML7213/ML7223/ML7831) UART"
614 depends on PCI
615 select SERIAL_CORE
616 help
617 @@ -1593,12 +1593,12 @@ config SERIAL_PCH_UART
618 which is an IOH(Input/Output Hub) for x86 embedded processor.
619 Enabling PCH_DMA, this PCH UART works as DMA mode.
620
621 - This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
622 - Output Hub), ML7213 and ML7223.
623 - ML7213 IOH is for IVI(In-Vehicle Infotainment) use and ML7223 IOH is
624 - for MP(Media Phone) use.
625 - ML7213/ML7223 is companion chip for Intel Atom E6xx series.
626 - ML7213/ML7223 is completely compatible for Intel EG20T PCH.
627 + This driver also can be used for LAPIS Semiconductor IOH(Input/
628 + Output Hub), ML7213, ML7223 and ML7831.
629 + ML7213 IOH is for IVI(In-Vehicle Infotainment) use, ML7223 IOH is
630 + for MP(Media Phone) use and ML7831 IOH is for general purpose use.
631 + ML7213/ML7223/ML7831 is companion chip for Intel Atom E6xx series.
632 + ML7213/ML7223/ML7831 is completely compatible for Intel EG20T PCH.
633
634 config SERIAL_MSM_SMD
635 bool "Enable tty device interface for some SMD ports"
636 diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
637 index 4652109..902588b 100644
638 --- a/drivers/tty/serial/pch_uart.c
639 +++ b/drivers/tty/serial/pch_uart.c
640 @@ -256,6 +256,8 @@ enum pch_uart_num_t {
641 pch_ml7213_uart2,
642 pch_ml7223_uart0,
643 pch_ml7223_uart1,
644 + pch_ml7831_uart0,
645 + pch_ml7831_uart1,
646 };
647
648 static struct pch_uart_driver_data drv_dat[] = {
649 @@ -268,6 +270,8 @@ static struct pch_uart_driver_data drv_dat[] = {
650 [pch_ml7213_uart2] = {PCH_UART_2LINE, 2},
651 [pch_ml7223_uart0] = {PCH_UART_8LINE, 0},
652 [pch_ml7223_uart1] = {PCH_UART_2LINE, 1},
653 + [pch_ml7831_uart0] = {PCH_UART_8LINE, 0},
654 + [pch_ml7831_uart1] = {PCH_UART_2LINE, 1},
655 };
656
657 static unsigned int default_baud = 9600;
658 @@ -625,6 +629,7 @@ static void pch_request_dma(struct uart_port *port)
659 dev_err(priv->port.dev, "%s:dma_request_channel FAILS(Rx)\n",
660 __func__);
661 dma_release_channel(priv->chan_tx);
662 + priv->chan_tx = NULL;
663 return;
664 }
665
666 @@ -1212,8 +1217,7 @@ static void pch_uart_shutdown(struct uart_port *port)
667 dev_err(priv->port.dev,
668 "pch_uart_hal_set_fifo Failed(ret=%d)\n", ret);
669
670 - if (priv->use_dma_flag)
671 - pch_free_dma(port);
672 + pch_free_dma(port);
673
674 free_irq(priv->port.irq, priv);
675 }
676 @@ -1277,6 +1281,7 @@ static void pch_uart_set_termios(struct uart_port *port,
677 if (rtn)
678 goto out;
679
680 + pch_uart_set_mctrl(&priv->port, priv->port.mctrl);
681 /* Don't rewrite B0 */
682 if (tty_termios_baud_rate(termios))
683 tty_termios_encode_baud_rate(termios, baud, baud);
684 @@ -1545,6 +1550,10 @@ static DEFINE_PCI_DEVICE_TABLE(pch_uart_pci_id) = {
685 .driver_data = pch_ml7223_uart0},
686 {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x800D),
687 .driver_data = pch_ml7223_uart1},
688 + {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8811),
689 + .driver_data = pch_ml7831_uart0},
690 + {PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8812),
691 + .driver_data = pch_ml7831_uart1},
692 {0,},
693 };
694
695 diff --git a/drivers/tty/tty_ldisc.c b/drivers/tty/tty_ldisc.c
696 index ef925d5..a76c808 100644
697 --- a/drivers/tty/tty_ldisc.c
698 +++ b/drivers/tty/tty_ldisc.c
699 @@ -36,6 +36,7 @@
700
701 #include <linux/kmod.h>
702 #include <linux/nsproxy.h>
703 +#include <linux/ratelimit.h>
704
705 /*
706 * This guards the refcounted line discipline lists. The lock
707 @@ -548,15 +549,16 @@ static void tty_ldisc_flush_works(struct tty_struct *tty)
708 /**
709 * tty_ldisc_wait_idle - wait for the ldisc to become idle
710 * @tty: tty to wait for
711 + * @timeout: for how long to wait at most
712 *
713 * Wait for the line discipline to become idle. The discipline must
714 * have been halted for this to guarantee it remains idle.
715 */
716 -static int tty_ldisc_wait_idle(struct tty_struct *tty)
717 +static int tty_ldisc_wait_idle(struct tty_struct *tty, long timeout)
718 {
719 - int ret;
720 + long ret;
721 ret = wait_event_timeout(tty_ldisc_idle,
722 - atomic_read(&tty->ldisc->users) == 1, 5 * HZ);
723 + atomic_read(&tty->ldisc->users) == 1, timeout);
724 if (ret < 0)
725 return ret;
726 return ret > 0 ? 0 : -EBUSY;
727 @@ -666,7 +668,7 @@ int tty_set_ldisc(struct tty_struct *tty, int ldisc)
728
729 tty_ldisc_flush_works(tty);
730
731 - retval = tty_ldisc_wait_idle(tty);
732 + retval = tty_ldisc_wait_idle(tty, 5 * HZ);
733
734 tty_lock();
735 mutex_lock(&tty->ldisc_mutex);
736 @@ -763,8 +765,6 @@ static int tty_ldisc_reinit(struct tty_struct *tty, int ldisc)
737 if (IS_ERR(ld))
738 return -1;
739
740 - WARN_ON_ONCE(tty_ldisc_wait_idle(tty));
741 -
742 tty_ldisc_close(tty, tty->ldisc);
743 tty_ldisc_put(tty->ldisc);
744 tty->ldisc = NULL;
745 @@ -839,7 +839,7 @@ void tty_ldisc_hangup(struct tty_struct *tty)
746 tty_unlock();
747 cancel_work_sync(&tty->buf.work);
748 mutex_unlock(&tty->ldisc_mutex);
749 -
750 +retry:
751 tty_lock();
752 mutex_lock(&tty->ldisc_mutex);
753
754 @@ -848,6 +848,22 @@ void tty_ldisc_hangup(struct tty_struct *tty)
755 it means auditing a lot of other paths so this is
756 a FIXME */
757 if (tty->ldisc) { /* Not yet closed */
758 + if (atomic_read(&tty->ldisc->users) != 1) {
759 + char cur_n[TASK_COMM_LEN], tty_n[64];
760 + long timeout = 3 * HZ;
761 + tty_unlock();
762 +
763 + while (tty_ldisc_wait_idle(tty, timeout) == -EBUSY) {
764 + timeout = MAX_SCHEDULE_TIMEOUT;
765 + printk_ratelimited(KERN_WARNING
766 + "%s: waiting (%s) for %s took too long, but we keep waiting...\n",
767 + __func__, get_task_comm(cur_n, current),
768 + tty_name(tty, tty_n));
769 + }
770 + mutex_unlock(&tty->ldisc_mutex);
771 + goto retry;
772 + }
773 +
774 if (reset == 0) {
775
776 if (!tty_ldisc_reinit(tty, tty->termios->c_line))
777 diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
778 index 5112f57..2ffcaa0 100644
779 --- a/drivers/usb/class/cdc-acm.c
780 +++ b/drivers/usb/class/cdc-acm.c
781 @@ -539,7 +539,6 @@ static void acm_port_down(struct acm *acm)
782 {
783 int i;
784
785 - mutex_lock(&open_mutex);
786 if (acm->dev) {
787 usb_autopm_get_interface(acm->control);
788 acm_set_control(acm, acm->ctrlout = 0);
789 @@ -551,14 +550,15 @@ static void acm_port_down(struct acm *acm)
790 acm->control->needs_remote_wakeup = 0;
791 usb_autopm_put_interface(acm->control);
792 }
793 - mutex_unlock(&open_mutex);
794 }
795
796 static void acm_tty_hangup(struct tty_struct *tty)
797 {
798 struct acm *acm = tty->driver_data;
799 tty_port_hangup(&acm->port);
800 + mutex_lock(&open_mutex);
801 acm_port_down(acm);
802 + mutex_unlock(&open_mutex);
803 }
804
805 static void acm_tty_close(struct tty_struct *tty, struct file *filp)
806 @@ -569,8 +569,9 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
807 shutdown */
808 if (!acm)
809 return;
810 +
811 + mutex_lock(&open_mutex);
812 if (tty_port_close_start(&acm->port, tty, filp) == 0) {
813 - mutex_lock(&open_mutex);
814 if (!acm->dev) {
815 tty_port_tty_set(&acm->port, NULL);
816 acm_tty_unregister(acm);
817 @@ -582,6 +583,7 @@ static void acm_tty_close(struct tty_struct *tty, struct file *filp)
818 acm_port_down(acm);
819 tty_port_close_end(&acm->port, tty);
820 tty_port_tty_set(&acm->port, NULL);
821 + mutex_unlock(&open_mutex);
822 }
823
824 static int acm_tty_write(struct tty_struct *tty,
825 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
826 index a428aa0..210e359 100644
827 --- a/drivers/usb/core/hub.c
828 +++ b/drivers/usb/core/hub.c
829 @@ -813,6 +813,12 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
830 USB_PORT_FEAT_C_PORT_LINK_STATE);
831 }
832
833 + if ((portchange & USB_PORT_STAT_C_BH_RESET) &&
834 + hub_is_superspeed(hub->hdev)) {
835 + need_debounce_delay = true;
836 + clear_port_feature(hub->hdev, port1,
837 + USB_PORT_FEAT_C_BH_PORT_RESET);
838 + }
839 /* We can forget about a "removed" device when there's a
840 * physical disconnect or the connect status changes.
841 */
842 diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
843 index d6a8d82..ecf12e1 100644
844 --- a/drivers/usb/core/quirks.c
845 +++ b/drivers/usb/core/quirks.c
846 @@ -50,15 +50,42 @@ static const struct usb_device_id usb_quirk_list[] = {
847 /* Logitech Webcam B/C500 */
848 { USB_DEVICE(0x046d, 0x0807), .driver_info = USB_QUIRK_RESET_RESUME },
849
850 + /* Logitech Webcam C600 */
851 + { USB_DEVICE(0x046d, 0x0808), .driver_info = USB_QUIRK_RESET_RESUME },
852 +
853 /* Logitech Webcam Pro 9000 */
854 { USB_DEVICE(0x046d, 0x0809), .driver_info = USB_QUIRK_RESET_RESUME },
855
856 + /* Logitech Webcam C905 */
857 + { USB_DEVICE(0x046d, 0x080a), .driver_info = USB_QUIRK_RESET_RESUME },
858 +
859 + /* Logitech Webcam C210 */
860 + { USB_DEVICE(0x046d, 0x0819), .driver_info = USB_QUIRK_RESET_RESUME },
861 +
862 + /* Logitech Webcam C260 */
863 + { USB_DEVICE(0x046d, 0x081a), .driver_info = USB_QUIRK_RESET_RESUME },
864 +
865 /* Logitech Webcam C310 */
866 { USB_DEVICE(0x046d, 0x081b), .driver_info = USB_QUIRK_RESET_RESUME },
867
868 + /* Logitech Webcam C910 */
869 + { USB_DEVICE(0x046d, 0x0821), .driver_info = USB_QUIRK_RESET_RESUME },
870 +
871 + /* Logitech Webcam C160 */
872 + { USB_DEVICE(0x046d, 0x0824), .driver_info = USB_QUIRK_RESET_RESUME },
873 +
874 /* Logitech Webcam C270 */
875 { USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME },
876
877 + /* Logitech Quickcam Pro 9000 */
878 + { USB_DEVICE(0x046d, 0x0990), .driver_info = USB_QUIRK_RESET_RESUME },
879 +
880 + /* Logitech Quickcam E3500 */
881 + { USB_DEVICE(0x046d, 0x09a4), .driver_info = USB_QUIRK_RESET_RESUME },
882 +
883 + /* Logitech Quickcam Vision Pro */
884 + { USB_DEVICE(0x046d, 0x09a6), .driver_info = USB_QUIRK_RESET_RESUME },
885 +
886 /* Logitech Harmony 700-series */
887 { USB_DEVICE(0x046d, 0xc122), .driver_info = USB_QUIRK_DELAY_INIT },
888
889 diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
890 index 063c630..fb2d0c2 100644
891 --- a/drivers/usb/host/ehci-sched.c
892 +++ b/drivers/usb/host/ehci-sched.c
893 @@ -1483,10 +1483,15 @@ iso_stream_schedule (
894
895 /* NOTE: assumes URB_ISO_ASAP, to limit complexity/bugs */
896
897 - /* find a uframe slot with enough bandwidth */
898 - next = start + period;
899 - for (; start < next; start++) {
900 -
901 + /* find a uframe slot with enough bandwidth.
902 + * Early uframes are more precious because full-speed
903 + * iso IN transfers can't use late uframes,
904 + * and therefore they should be allocated last.
905 + */
906 + next = start;
907 + start += period;
908 + do {
909 + start--;
910 /* check schedule: enough space? */
911 if (stream->highspeed) {
912 if (itd_slot_ok(ehci, mod, start,
913 @@ -1499,7 +1504,7 @@ iso_stream_schedule (
914 start, sched, period))
915 break;
916 }
917 - }
918 + } while (start > next);
919
920 /* no room in the schedule */
921 if (start == next) {
922 diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
923 index 629a968..a495d48 100644
924 --- a/drivers/usb/host/pci-quirks.c
925 +++ b/drivers/usb/host/pci-quirks.c
926 @@ -626,7 +626,7 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
927 void __iomem *base, *op_reg_base;
928 u32 hcc_params, cap, val;
929 u8 offset, cap_length;
930 - int wait_time, delta, count = 256/4;
931 + int wait_time, count = 256/4;
932
933 if (!mmio_resource_enabled(pdev, 0))
934 return;
935 @@ -672,11 +672,10 @@ static void __devinit quirk_usb_disable_ehci(struct pci_dev *pdev)
936 writel(val, op_reg_base + EHCI_USBCMD);
937
938 wait_time = 2000;
939 - delta = 100;
940 do {
941 writel(0x3f, op_reg_base + EHCI_USBSTS);
942 - udelay(delta);
943 - wait_time -= delta;
944 + udelay(100);
945 + wait_time -= 100;
946 val = readl(op_reg_base + EHCI_USBSTS);
947 if ((val == ~(u32)0) || (val & EHCI_USBSTS_HALTED)) {
948 break;
949 diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
950 index 104620b..ffeee57 100644
951 --- a/drivers/usb/host/xhci-mem.c
952 +++ b/drivers/usb/host/xhci-mem.c
953 @@ -875,7 +875,6 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
954 struct xhci_virt_device *dev;
955 struct xhci_ep_ctx *ep0_ctx;
956 struct xhci_slot_ctx *slot_ctx;
957 - struct xhci_input_control_ctx *ctrl_ctx;
958 u32 port_num;
959 struct usb_device *top_dev;
960
961 @@ -887,12 +886,8 @@ int xhci_setup_addressable_virt_dev(struct xhci_hcd *xhci, struct usb_device *ud
962 return -EINVAL;
963 }
964 ep0_ctx = xhci_get_ep_ctx(xhci, dev->in_ctx, 0);
965 - ctrl_ctx = xhci_get_input_control_ctx(xhci, dev->in_ctx);
966 slot_ctx = xhci_get_slot_ctx(xhci, dev->in_ctx);
967
968 - /* 2) New slot context and endpoint 0 context are valid*/
969 - ctrl_ctx->add_flags = cpu_to_le32(SLOT_FLAG | EP0_FLAG);
970 -
971 /* 3) Only the control endpoint is valid - one endpoint context */
972 slot_ctx->dev_info |= cpu_to_le32(LAST_CTX(1) | (u32) udev->route);
973 switch (udev->speed) {
974 diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
975 index b20d2f7..b4b0691 100644
976 --- a/drivers/usb/host/xhci-ring.c
977 +++ b/drivers/usb/host/xhci-ring.c
978 @@ -819,23 +819,24 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
979 struct xhci_ring *ring;
980 struct xhci_td *cur_td;
981 int ret, i, j;
982 + unsigned long flags;
983
984 ep = (struct xhci_virt_ep *) arg;
985 xhci = ep->xhci;
986
987 - spin_lock(&xhci->lock);
988 + spin_lock_irqsave(&xhci->lock, flags);
989
990 ep->stop_cmds_pending--;
991 if (xhci->xhc_state & XHCI_STATE_DYING) {
992 xhci_dbg(xhci, "Stop EP timer ran, but another timer marked "
993 "xHCI as DYING, exiting.\n");
994 - spin_unlock(&xhci->lock);
995 + spin_unlock_irqrestore(&xhci->lock, flags);
996 return;
997 }
998 if (!(ep->stop_cmds_pending == 0 && (ep->ep_state & EP_HALT_PENDING))) {
999 xhci_dbg(xhci, "Stop EP timer ran, but no command pending, "
1000 "exiting.\n");
1001 - spin_unlock(&xhci->lock);
1002 + spin_unlock_irqrestore(&xhci->lock, flags);
1003 return;
1004 }
1005
1006 @@ -847,11 +848,11 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
1007 xhci->xhc_state |= XHCI_STATE_DYING;
1008 /* Disable interrupts from the host controller and start halting it */
1009 xhci_quiesce(xhci);
1010 - spin_unlock(&xhci->lock);
1011 + spin_unlock_irqrestore(&xhci->lock, flags);
1012
1013 ret = xhci_halt(xhci);
1014
1015 - spin_lock(&xhci->lock);
1016 + spin_lock_irqsave(&xhci->lock, flags);
1017 if (ret < 0) {
1018 /* This is bad; the host is not responding to commands and it's
1019 * not allowing itself to be halted. At least interrupts are
1020 @@ -899,7 +900,7 @@ void xhci_stop_endpoint_command_watchdog(unsigned long arg)
1021 }
1022 }
1023 }
1024 - spin_unlock(&xhci->lock);
1025 + spin_unlock_irqrestore(&xhci->lock, flags);
1026 xhci_dbg(xhci, "Calling usb_hc_died()\n");
1027 usb_hc_died(xhci_to_hcd(xhci)->primary_hcd);
1028 xhci_dbg(xhci, "xHCI host controller is dead.\n");
1029 diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
1030 index fb61e9d..1f0e198 100644
1031 --- a/drivers/usb/host/xhci.c
1032 +++ b/drivers/usb/host/xhci.c
1033 @@ -749,7 +749,7 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1034 u32 command, temp = 0;
1035 struct usb_hcd *hcd = xhci_to_hcd(xhci);
1036 struct usb_hcd *secondary_hcd;
1037 - int retval;
1038 + int retval = 0;
1039
1040 /* Wait a bit if either of the roothubs need to settle from the
1041 * transition into bus suspend.
1042 @@ -759,6 +759,9 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1043 xhci->bus_state[1].next_statechange))
1044 msleep(100);
1045
1046 + set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
1047 + set_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags);
1048 +
1049 spin_lock_irq(&xhci->lock);
1050 if (xhci->quirks & XHCI_RESET_ON_RESUME)
1051 hibernated = true;
1052 @@ -828,20 +831,13 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated)
1053 return retval;
1054 xhci_dbg(xhci, "Start the primary HCD\n");
1055 retval = xhci_run(hcd->primary_hcd);
1056 - if (retval)
1057 - goto failed_restart;
1058 -
1059 - xhci_dbg(xhci, "Start the secondary HCD\n");
1060 - retval = xhci_run(secondary_hcd);
1061 if (!retval) {
1062 - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
1063 - set_bit(HCD_FLAG_HW_ACCESSIBLE,
1064 - &xhci->shared_hcd->flags);
1065 + xhci_dbg(xhci, "Start the secondary HCD\n");
1066 + retval = xhci_run(secondary_hcd);
1067 }
1068 -failed_restart:
1069 hcd->state = HC_STATE_SUSPENDED;
1070 xhci->shared_hcd->state = HC_STATE_SUSPENDED;
1071 - return retval;
1072 + goto done;
1073 }
1074
1075 /* step 4: set Run/Stop bit */
1076 @@ -860,11 +856,14 @@ failed_restart:
1077 * Running endpoints by ringing their doorbells
1078 */
1079
1080 - set_bit(HCD_FLAG_HW_ACCESSIBLE, &hcd->flags);
1081 - set_bit(HCD_FLAG_HW_ACCESSIBLE, &xhci->shared_hcd->flags);
1082 -
1083 spin_unlock_irq(&xhci->lock);
1084 - return 0;
1085 +
1086 + done:
1087 + if (retval == 0) {
1088 + usb_hcd_resume_root_hub(hcd);
1089 + usb_hcd_resume_root_hub(xhci->shared_hcd);
1090 + }
1091 + return retval;
1092 }
1093 #endif /* CONFIG_PM */
1094
1095 @@ -2875,6 +2874,10 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1096 /* Otherwise, update the control endpoint ring enqueue pointer. */
1097 else
1098 xhci_copy_ep0_dequeue_into_input_ctx(xhci, udev);
1099 + ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
1100 + ctrl_ctx->add_flags = cpu_to_le32(SLOT_FLAG | EP0_FLAG);
1101 + ctrl_ctx->drop_flags = 0;
1102 +
1103 xhci_dbg(xhci, "Slot ID %d Input Context:\n", udev->slot_id);
1104 xhci_dbg_ctx(xhci, virt_dev->in_ctx, 2);
1105
1106 @@ -2956,7 +2959,6 @@ int xhci_address_device(struct usb_hcd *hcd, struct usb_device *udev)
1107 virt_dev->address = (le32_to_cpu(slot_ctx->dev_state) & DEV_ADDR_MASK)
1108 + 1;
1109 /* Zero the input context control for later use */
1110 - ctrl_ctx = xhci_get_input_control_ctx(xhci, virt_dev->in_ctx);
1111 ctrl_ctx->add_flags = 0;
1112 ctrl_ctx->drop_flags = 0;
1113
1114 diff --git a/drivers/usb/serial/ark3116.c b/drivers/usb/serial/ark3116.c
1115 index 5cdb9d9..18e875b 100644
1116 --- a/drivers/usb/serial/ark3116.c
1117 +++ b/drivers/usb/serial/ark3116.c
1118 @@ -42,7 +42,7 @@ static int debug;
1119 * Version information
1120 */
1121
1122 -#define DRIVER_VERSION "v0.6"
1123 +#define DRIVER_VERSION "v0.7"
1124 #define DRIVER_AUTHOR "Bart Hartgers <bart.hartgers+ark3116@gmail.com>"
1125 #define DRIVER_DESC "USB ARK3116 serial/IrDA driver"
1126 #define DRIVER_DEV_DESC "ARK3116 RS232/IrDA"
1127 @@ -380,10 +380,6 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
1128 goto err_out;
1129 }
1130
1131 - /* setup termios */
1132 - if (tty)
1133 - ark3116_set_termios(tty, port, NULL);
1134 -
1135 /* remove any data still left: also clears error state */
1136 ark3116_read_reg(serial, UART_RX, buf);
1137
1138 @@ -406,6 +402,10 @@ static int ark3116_open(struct tty_struct *tty, struct usb_serial_port *port)
1139 /* enable DMA */
1140 ark3116_write_reg(port->serial, UART_FCR, UART_FCR_DMA_SELECT);
1141
1142 + /* setup termios */
1143 + if (tty)
1144 + ark3116_set_termios(tty, port, NULL);
1145 +
1146 err_out:
1147 kfree(buf);
1148 return result;
1149 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1150 index 1b51d43..486769c 100644
1151 --- a/drivers/usb/serial/ftdi_sio.c
1152 +++ b/drivers/usb/serial/ftdi_sio.c
1153 @@ -2080,13 +2080,19 @@ static void ftdi_set_termios(struct tty_struct *tty,
1154
1155 cflag = termios->c_cflag;
1156
1157 - /* FIXME -For this cut I don't care if the line is really changing or
1158 - not - so just do the change regardless - should be able to
1159 - compare old_termios and tty->termios */
1160 + if (old_termios->c_cflag == termios->c_cflag
1161 + && old_termios->c_ispeed == termios->c_ispeed
1162 + && old_termios->c_ospeed == termios->c_ospeed)
1163 + goto no_c_cflag_changes;
1164 +
1165 /* NOTE These routines can get interrupted by
1166 ftdi_sio_read_bulk_callback - need to examine what this means -
1167 don't see any problems yet */
1168
1169 + if ((old_termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)) ==
1170 + (termios->c_cflag & (CSIZE|PARODD|PARENB|CMSPAR|CSTOPB)))
1171 + goto no_data_parity_stop_changes;
1172 +
1173 /* Set number of data bits, parity, stop bits */
1174
1175 urb_value = 0;
1176 @@ -2127,6 +2133,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
1177 }
1178
1179 /* Now do the baudrate */
1180 +no_data_parity_stop_changes:
1181 if ((cflag & CBAUD) == B0) {
1182 /* Disable flow control */
1183 if (usb_control_msg(dev, usb_sndctrlpipe(dev, 0),
1184 @@ -2154,6 +2161,7 @@ static void ftdi_set_termios(struct tty_struct *tty,
1185
1186 /* Set flow control */
1187 /* Note device also supports DTR/CD (ugh) and Xon/Xoff in hardware */
1188 +no_c_cflag_changes:
1189 if (cflag & CRTSCTS) {
1190 dbg("%s Setting to CRTSCTS flow control", __func__);
1191 if (usb_control_msg(dev,
1192 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1193 index 89ae1f6..3a47cbe 100644
1194 --- a/drivers/usb/serial/option.c
1195 +++ b/drivers/usb/serial/option.c
1196 @@ -156,6 +156,7 @@ static void option_instat_callback(struct urb *urb);
1197 #define HUAWEI_PRODUCT_K4511 0x14CC
1198 #define HUAWEI_PRODUCT_ETS1220 0x1803
1199 #define HUAWEI_PRODUCT_E353 0x1506
1200 +#define HUAWEI_PRODUCT_E173S 0x1C05
1201
1202 #define QUANTA_VENDOR_ID 0x0408
1203 #define QUANTA_PRODUCT_Q101 0xEA02
1204 @@ -316,6 +317,9 @@ static void option_instat_callback(struct urb *urb);
1205 #define ZTE_PRODUCT_AC8710 0xfff1
1206 #define ZTE_PRODUCT_AC2726 0xfff5
1207 #define ZTE_PRODUCT_AC8710T 0xffff
1208 +#define ZTE_PRODUCT_MC2718 0xffe8
1209 +#define ZTE_PRODUCT_AD3812 0xffeb
1210 +#define ZTE_PRODUCT_MC2716 0xffed
1211
1212 #define BENQ_VENDOR_ID 0x04a5
1213 #define BENQ_PRODUCT_H10 0x4068
1214 @@ -500,6 +504,18 @@ static const struct option_blacklist_info zte_k3765_z_blacklist = {
1215 .reserved = BIT(4),
1216 };
1217
1218 +static const struct option_blacklist_info zte_ad3812_z_blacklist = {
1219 + .sendsetup = BIT(0) | BIT(1) | BIT(2),
1220 +};
1221 +
1222 +static const struct option_blacklist_info zte_mc2718_z_blacklist = {
1223 + .sendsetup = BIT(1) | BIT(2) | BIT(3) | BIT(4),
1224 +};
1225 +
1226 +static const struct option_blacklist_info zte_mc2716_z_blacklist = {
1227 + .sendsetup = BIT(1) | BIT(2) | BIT(3),
1228 +};
1229 +
1230 static const struct option_blacklist_info huawei_cdc12_blacklist = {
1231 .reserved = BIT(1) | BIT(2),
1232 };
1233 @@ -622,6 +638,7 @@ static const struct usb_device_id option_ids[] = {
1234 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) },
1235 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) },
1236 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) },
1237 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E173S, 0xff, 0xff, 0xff) },
1238 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff),
1239 .driver_info = (kernel_ulong_t) &huawei_cdc12_blacklist },
1240 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff),
1241 @@ -1043,6 +1060,12 @@ static const struct usb_device_id option_ids[] = {
1242 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710, 0xff, 0xff, 0xff) },
1243 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC2726, 0xff, 0xff, 0xff) },
1244 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AC8710T, 0xff, 0xff, 0xff) },
1245 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2718, 0xff, 0xff, 0xff),
1246 + .driver_info = (kernel_ulong_t)&zte_mc2718_z_blacklist },
1247 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_AD3812, 0xff, 0xff, 0xff),
1248 + .driver_info = (kernel_ulong_t)&zte_ad3812_z_blacklist },
1249 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, ZTE_PRODUCT_MC2716, 0xff, 0xff, 0xff),
1250 + .driver_info = (kernel_ulong_t)&zte_mc2716_z_blacklist },
1251 { USB_DEVICE(BENQ_VENDOR_ID, BENQ_PRODUCT_H10) },
1252 { USB_DEVICE(DLINK_VENDOR_ID, DLINK_PRODUCT_DWM_652) },
1253 { USB_DEVICE(ALINK_VENDOR_ID, DLINK_PRODUCT_DWM_652_U5) }, /* Yes, ALINK_VENDOR_ID */
1254 diff --git a/drivers/usb/serial/pl2303.c b/drivers/usb/serial/pl2303.c
1255 index 614fabc..d44c669 100644
1256 --- a/drivers/usb/serial/pl2303.c
1257 +++ b/drivers/usb/serial/pl2303.c
1258 @@ -91,7 +91,6 @@ static const struct usb_device_id id_table[] = {
1259 { USB_DEVICE(SONY_VENDOR_ID, SONY_QN3USB_PRODUCT_ID) },
1260 { USB_DEVICE(SANWA_VENDOR_ID, SANWA_PRODUCT_ID) },
1261 { USB_DEVICE(ADLINK_VENDOR_ID, ADLINK_ND6530_PRODUCT_ID) },
1262 - { USB_DEVICE(WINCHIPHEAD_VENDOR_ID, WINCHIPHEAD_USBSER_PRODUCT_ID) },
1263 { USB_DEVICE(SMART_VENDOR_ID, SMART_PRODUCT_ID) },
1264 { } /* Terminating entry */
1265 };
1266 diff --git a/drivers/usb/serial/pl2303.h b/drivers/usb/serial/pl2303.h
1267 index 3d10d7f..c38b8c0 100644
1268 --- a/drivers/usb/serial/pl2303.h
1269 +++ b/drivers/usb/serial/pl2303.h
1270 @@ -145,10 +145,6 @@
1271 #define ADLINK_VENDOR_ID 0x0b63
1272 #define ADLINK_ND6530_PRODUCT_ID 0x6530
1273
1274 -/* WinChipHead USB->RS 232 adapter */
1275 -#define WINCHIPHEAD_VENDOR_ID 0x4348
1276 -#define WINCHIPHEAD_USBSER_PRODUCT_ID 0x5523
1277 -
1278 /* SMART USB Serial Adapter */
1279 #define SMART_VENDOR_ID 0x0b8c
1280 #define SMART_PRODUCT_ID 0x2303
1281 diff --git a/drivers/usb/storage/protocol.c b/drivers/usb/storage/protocol.c
1282 index fc310f7..0fded39 100644
1283 --- a/drivers/usb/storage/protocol.c
1284 +++ b/drivers/usb/storage/protocol.c
1285 @@ -58,7 +58,9 @@
1286
1287 void usb_stor_pad12_command(struct scsi_cmnd *srb, struct us_data *us)
1288 {
1289 - /* Pad the SCSI command with zeros out to 12 bytes
1290 + /*
1291 + * Pad the SCSI command with zeros out to 12 bytes. If the
1292 + * command already is 12 bytes or longer, leave it alone.
1293 *
1294 * NOTE: This only works because a scsi_cmnd struct field contains
1295 * a unsigned char cmnd[16], so we know we have storage available
1296 @@ -66,9 +68,6 @@ void usb_stor_pad12_command(struct scsi_cmnd *srb, struct us_data *us)
1297 for (; srb->cmd_len<12; srb->cmd_len++)
1298 srb->cmnd[srb->cmd_len] = 0;
1299
1300 - /* set command length to 12 bytes */
1301 - srb->cmd_len = 12;
1302 -
1303 /* send the command to the transport layer */
1304 usb_stor_invoke_transport(srb, us);
1305 }
1306 diff --git a/fs/nfs/dir.c b/fs/nfs/dir.c
1307 index f91c62d..462a006 100644
1308 --- a/fs/nfs/dir.c
1309 +++ b/fs/nfs/dir.c
1310 @@ -1458,12 +1458,12 @@ static struct dentry *nfs_atomic_lookup(struct inode *dir, struct dentry *dentry
1311 res = NULL;
1312 goto out;
1313 /* This turned out not to be a regular file */
1314 + case -EISDIR:
1315 case -ENOTDIR:
1316 goto no_open;
1317 case -ELOOP:
1318 if (!(nd->intent.open.flags & O_NOFOLLOW))
1319 goto no_open;
1320 - /* case -EISDIR: */
1321 /* case -EINVAL: */
1322 default:
1323 res = ERR_CAST(inode);
1324 diff --git a/fs/nfs/file.c b/fs/nfs/file.c
1325 index 2f093ed..dd2f130 100644
1326 --- a/fs/nfs/file.c
1327 +++ b/fs/nfs/file.c
1328 @@ -887,3 +887,35 @@ static int nfs_setlease(struct file *file, long arg, struct file_lock **fl)
1329 file->f_path.dentry->d_name.name, arg);
1330 return -EINVAL;
1331 }
1332 +
1333 +#ifdef CONFIG_NFS_V4
1334 +static int
1335 +nfs4_file_open(struct inode *inode, struct file *filp)
1336 +{
1337 + /*
1338 + * NFSv4 opens are handled in d_lookup and d_revalidate. If we get to
1339 + * this point, then something is very wrong
1340 + */
1341 + dprintk("NFS: %s called! inode=%p filp=%p\n", __func__, inode, filp);
1342 + return -ENOTDIR;
1343 +}
1344 +
1345 +const struct file_operations nfs4_file_operations = {
1346 + .llseek = nfs_file_llseek,
1347 + .read = do_sync_read,
1348 + .write = do_sync_write,
1349 + .aio_read = nfs_file_read,
1350 + .aio_write = nfs_file_write,
1351 + .mmap = nfs_file_mmap,
1352 + .open = nfs4_file_open,
1353 + .flush = nfs_file_flush,
1354 + .release = nfs_file_release,
1355 + .fsync = nfs_file_fsync,
1356 + .lock = nfs_lock,
1357 + .flock = nfs_flock,
1358 + .splice_read = nfs_file_splice_read,
1359 + .splice_write = nfs_file_splice_write,
1360 + .check_flags = nfs_check_flags,
1361 + .setlease = nfs_setlease,
1362 +};
1363 +#endif /* CONFIG_NFS_V4 */
1364 diff --git a/fs/nfs/inode.c b/fs/nfs/inode.c
1365 index 6f4850d..c48f9f6 100644
1366 --- a/fs/nfs/inode.c
1367 +++ b/fs/nfs/inode.c
1368 @@ -291,7 +291,7 @@ nfs_fhget(struct super_block *sb, struct nfs_fh *fh, struct nfs_fattr *fattr)
1369 */
1370 inode->i_op = NFS_SB(sb)->nfs_client->rpc_ops->file_inode_ops;
1371 if (S_ISREG(inode->i_mode)) {
1372 - inode->i_fop = &nfs_file_operations;
1373 + inode->i_fop = NFS_SB(sb)->nfs_client->rpc_ops->file_ops;
1374 inode->i_data.a_ops = &nfs_file_aops;
1375 inode->i_data.backing_dev_info = &NFS_SB(sb)->backing_dev_info;
1376 } else if (S_ISDIR(inode->i_mode)) {
1377 diff --git a/fs/nfs/nfs3proc.c b/fs/nfs/nfs3proc.c
1378 index 38053d8..771741f 100644
1379 --- a/fs/nfs/nfs3proc.c
1380 +++ b/fs/nfs/nfs3proc.c
1381 @@ -853,6 +853,7 @@ const struct nfs_rpc_ops nfs_v3_clientops = {
1382 .dentry_ops = &nfs_dentry_operations,
1383 .dir_inode_ops = &nfs3_dir_inode_operations,
1384 .file_inode_ops = &nfs3_file_inode_operations,
1385 + .file_ops = &nfs_file_operations,
1386 .getroot = nfs3_proc_get_root,
1387 .getattr = nfs3_proc_getattr,
1388 .setattr = nfs3_proc_setattr,
1389 diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
1390 index 92cfd2e..a2a7d0a 100644
1391 --- a/fs/nfs/nfs4proc.c
1392 +++ b/fs/nfs/nfs4proc.c
1393 @@ -6008,6 +6008,7 @@ const struct nfs_rpc_ops nfs_v4_clientops = {
1394 .dentry_ops = &nfs4_dentry_operations,
1395 .dir_inode_ops = &nfs4_dir_inode_operations,
1396 .file_inode_ops = &nfs4_file_inode_operations,
1397 + .file_ops = &nfs4_file_operations,
1398 .getroot = nfs4_proc_get_root,
1399 .getattr = nfs4_proc_getattr,
1400 .setattr = nfs4_proc_setattr,
1401 diff --git a/fs/nfs/proc.c b/fs/nfs/proc.c
1402 index ac40b85..f48125d 100644
1403 --- a/fs/nfs/proc.c
1404 +++ b/fs/nfs/proc.c
1405 @@ -710,6 +710,7 @@ const struct nfs_rpc_ops nfs_v2_clientops = {
1406 .dentry_ops = &nfs_dentry_operations,
1407 .dir_inode_ops = &nfs_dir_inode_operations,
1408 .file_inode_ops = &nfs_file_inode_operations,
1409 + .file_ops = &nfs_file_operations,
1410 .getroot = nfs_proc_get_root,
1411 .getattr = nfs_proc_getattr,
1412 .setattr = nfs_proc_setattr,
1413 diff --git a/fs/xfs/linux-2.6/xfs_buf.h b/fs/xfs/linux-2.6/xfs_buf.h
1414 index 50a7d5f..36d6ee4 100644
1415 --- a/fs/xfs/linux-2.6/xfs_buf.h
1416 +++ b/fs/xfs/linux-2.6/xfs_buf.h
1417 @@ -346,7 +346,6 @@ extern struct list_head *xfs_get_buftarg_list(void);
1418 #define xfs_getsize_buftarg(buftarg) block_size((buftarg)->bt_bdev)
1419 #define xfs_readonly_buftarg(buftarg) bdev_read_only((buftarg)->bt_bdev)
1420
1421 -#define xfs_binval(buftarg) xfs_flush_buftarg(buftarg, 1)
1422 #define XFS_bflush(buftarg) xfs_flush_buftarg(buftarg, 1)
1423
1424 #endif /* __XFS_BUF_H__ */
1425 diff --git a/fs/xfs/linux-2.6/xfs_file.c b/fs/xfs/linux-2.6/xfs_file.c
1426 index 7f782af2..b679198 100644
1427 --- a/fs/xfs/linux-2.6/xfs_file.c
1428 +++ b/fs/xfs/linux-2.6/xfs_file.c
1429 @@ -309,7 +309,19 @@ xfs_file_aio_read(
1430 if (XFS_FORCED_SHUTDOWN(mp))
1431 return -EIO;
1432
1433 - if (unlikely(ioflags & IO_ISDIRECT)) {
1434 + /*
1435 + * Locking is a bit tricky here. If we take an exclusive lock
1436 + * for direct IO, we effectively serialise all new concurrent
1437 + * read IO to this file and block it behind IO that is currently in
1438 + * progress because IO in progress holds the IO lock shared. We only
1439 + * need to hold the lock exclusive to blow away the page cache, so
1440 + * only take lock exclusively if the page cache needs invalidation.
1441 + * This allows the normal direct IO case of no page cache pages to
1442 + * proceeed concurrently without serialisation.
1443 + */
1444 + xfs_rw_ilock(ip, XFS_IOLOCK_SHARED);
1445 + if ((ioflags & IO_ISDIRECT) && inode->i_mapping->nrpages) {
1446 + xfs_rw_iunlock(ip, XFS_IOLOCK_SHARED);
1447 xfs_rw_ilock(ip, XFS_IOLOCK_EXCL);
1448
1449 if (inode->i_mapping->nrpages) {
1450 @@ -322,8 +334,7 @@ xfs_file_aio_read(
1451 }
1452 }
1453 xfs_rw_ilock_demote(ip, XFS_IOLOCK_EXCL);
1454 - } else
1455 - xfs_rw_ilock(ip, XFS_IOLOCK_SHARED);
1456 + }
1457
1458 trace_xfs_file_read(ip, size, iocb->ki_pos, ioflags);
1459
1460 @@ -658,6 +669,7 @@ xfs_file_aio_write_checks(
1461 xfs_fsize_t new_size;
1462 int error = 0;
1463
1464 + xfs_rw_ilock(ip, XFS_ILOCK_EXCL);
1465 error = generic_write_checks(file, pos, count, S_ISBLK(inode->i_mode));
1466 if (error) {
1467 xfs_rw_iunlock(ip, XFS_ILOCK_EXCL | *iolock);
1468 @@ -749,14 +761,24 @@ xfs_file_dio_aio_write(
1469 *iolock = XFS_IOLOCK_EXCL;
1470 else
1471 *iolock = XFS_IOLOCK_SHARED;
1472 - xfs_rw_ilock(ip, XFS_ILOCK_EXCL | *iolock);
1473 + xfs_rw_ilock(ip, *iolock);
1474
1475 ret = xfs_file_aio_write_checks(file, &pos, &count, iolock);
1476 if (ret)
1477 return ret;
1478
1479 + /*
1480 + * Recheck if there are cached pages that need invalidate after we got
1481 + * the iolock to protect against other threads adding new pages while
1482 + * we were waiting for the iolock.
1483 + */
1484 + if (mapping->nrpages && *iolock == XFS_IOLOCK_SHARED) {
1485 + xfs_rw_iunlock(ip, *iolock);
1486 + *iolock = XFS_IOLOCK_EXCL;
1487 + xfs_rw_ilock(ip, *iolock);
1488 + }
1489 +
1490 if (mapping->nrpages) {
1491 - WARN_ON(*iolock != XFS_IOLOCK_EXCL);
1492 ret = -xfs_flushinval_pages(ip, (pos & PAGE_CACHE_MASK), -1,
1493 FI_REMAPF_LOCKED);
1494 if (ret)
1495 @@ -801,7 +823,7 @@ xfs_file_buffered_aio_write(
1496 size_t count = ocount;
1497
1498 *iolock = XFS_IOLOCK_EXCL;
1499 - xfs_rw_ilock(ip, XFS_ILOCK_EXCL | *iolock);
1500 + xfs_rw_ilock(ip, *iolock);
1501
1502 ret = xfs_file_aio_write_checks(file, &pos, &count, iolock);
1503 if (ret)
1504 diff --git a/fs/xfs/linux-2.6/xfs_iops.c b/fs/xfs/linux-2.6/xfs_iops.c
1505 index d44d92c..f5b697b 100644
1506 --- a/fs/xfs/linux-2.6/xfs_iops.c
1507 +++ b/fs/xfs/linux-2.6/xfs_iops.c
1508 @@ -69,9 +69,8 @@ xfs_synchronize_times(
1509 }
1510
1511 /*
1512 - * If the linux inode is valid, mark it dirty.
1513 - * Used when committing a dirty inode into a transaction so that
1514 - * the inode will get written back by the linux code
1515 + * If the linux inode is valid, mark it dirty, else mark the dirty state
1516 + * in the XFS inode to make sure we pick it up when reclaiming the inode.
1517 */
1518 void
1519 xfs_mark_inode_dirty_sync(
1520 @@ -81,6 +80,10 @@ xfs_mark_inode_dirty_sync(
1521
1522 if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))
1523 mark_inode_dirty_sync(inode);
1524 + else {
1525 + barrier();
1526 + ip->i_update_core = 1;
1527 + }
1528 }
1529
1530 void
1531 @@ -91,6 +94,11 @@ xfs_mark_inode_dirty(
1532
1533 if (!(inode->i_state & (I_WILL_FREE|I_FREEING)))
1534 mark_inode_dirty(inode);
1535 + else {
1536 + barrier();
1537 + ip->i_update_core = 1;
1538 + }
1539 +
1540 }
1541
1542 /*
1543 @@ -456,7 +464,7 @@ xfs_vn_getattr(
1544 trace_xfs_getattr(ip);
1545
1546 if (XFS_FORCED_SHUTDOWN(mp))
1547 - return XFS_ERROR(EIO);
1548 + return -XFS_ERROR(EIO);
1549
1550 stat->size = XFS_ISIZE(ip);
1551 stat->dev = inode->i_sb->s_dev;
1552 diff --git a/fs/xfs/linux-2.6/xfs_super.c b/fs/xfs/linux-2.6/xfs_super.c
1553 index 347cae9..28de70b 100644
1554 --- a/fs/xfs/linux-2.6/xfs_super.c
1555 +++ b/fs/xfs/linux-2.6/xfs_super.c
1556 @@ -878,33 +878,17 @@ xfs_log_inode(
1557 struct xfs_trans *tp;
1558 int error;
1559
1560 - xfs_iunlock(ip, XFS_ILOCK_SHARED);
1561 tp = xfs_trans_alloc(mp, XFS_TRANS_FSYNC_TS);
1562 error = xfs_trans_reserve(tp, 0, XFS_FSYNC_TS_LOG_RES(mp), 0, 0, 0);
1563 -
1564 if (error) {
1565 xfs_trans_cancel(tp, 0);
1566 - /* we need to return with the lock hold shared */
1567 - xfs_ilock(ip, XFS_ILOCK_SHARED);
1568 return error;
1569 }
1570
1571 xfs_ilock(ip, XFS_ILOCK_EXCL);
1572 -
1573 - /*
1574 - * Note - it's possible that we might have pushed ourselves out of the
1575 - * way during trans_reserve which would flush the inode. But there's
1576 - * no guarantee that the inode buffer has actually gone out yet (it's
1577 - * delwri). Plus the buffer could be pinned anyway if it's part of
1578 - * an inode in another recent transaction. So we play it safe and
1579 - * fire off the transaction anyway.
1580 - */
1581 - xfs_trans_ijoin(tp, ip);
1582 + xfs_trans_ijoin_ref(tp, ip, XFS_ILOCK_EXCL);
1583 xfs_trans_log_inode(tp, ip, XFS_ILOG_CORE);
1584 - error = xfs_trans_commit(tp, 0);
1585 - xfs_ilock_demote(ip, XFS_ILOCK_EXCL);
1586 -
1587 - return error;
1588 + return xfs_trans_commit(tp, 0);
1589 }
1590
1591 STATIC int
1592 @@ -919,7 +903,9 @@ xfs_fs_write_inode(
1593 trace_xfs_write_inode(ip);
1594
1595 if (XFS_FORCED_SHUTDOWN(mp))
1596 - return XFS_ERROR(EIO);
1597 + return -XFS_ERROR(EIO);
1598 + if (!ip->i_update_core)
1599 + return 0;
1600
1601 if (wbc->sync_mode == WB_SYNC_ALL) {
1602 /*
1603 @@ -930,12 +916,10 @@ xfs_fs_write_inode(
1604 * of synchronous log foces dramatically.
1605 */
1606 xfs_ioend_wait(ip);
1607 - xfs_ilock(ip, XFS_ILOCK_SHARED);
1608 - if (ip->i_update_core) {
1609 - error = xfs_log_inode(ip);
1610 - if (error)
1611 - goto out_unlock;
1612 - }
1613 + error = xfs_log_inode(ip);
1614 + if (error)
1615 + goto out;
1616 + return 0;
1617 } else {
1618 /*
1619 * We make this non-blocking if the inode is contended, return
1620 diff --git a/fs/xfs/quota/xfs_qm.c b/fs/xfs/quota/xfs_qm.c
1621 index b94dace..e70c7fc 100644
1622 --- a/fs/xfs/quota/xfs_qm.c
1623 +++ b/fs/xfs/quota/xfs_qm.c
1624 @@ -714,7 +714,8 @@ xfs_qm_dqattach_one(
1625 * disk and we didn't ask it to allocate;
1626 * ESRCH if quotas got turned off suddenly.
1627 */
1628 - error = xfs_qm_dqget(ip->i_mount, ip, id, type, XFS_QMOPT_DOWARN, &dqp);
1629 + error = xfs_qm_dqget(ip->i_mount, ip, id, type,
1630 + doalloc | XFS_QMOPT_DOWARN, &dqp);
1631 if (error)
1632 return error;
1633
1634 diff --git a/fs/xfs/xfs_buf_item.c b/fs/xfs/xfs_buf_item.c
1635 index a7342e8..7888a75 100644
1636 --- a/fs/xfs/xfs_buf_item.c
1637 +++ b/fs/xfs/xfs_buf_item.c
1638 @@ -1023,7 +1023,6 @@ xfs_buf_iodone_callbacks(
1639 XFS_BUF_UNDELAYWRITE(bp);
1640
1641 trace_xfs_buf_error_relse(bp, _RET_IP_);
1642 - xfs_force_shutdown(mp, SHUTDOWN_META_IO_ERROR);
1643
1644 do_callbacks:
1645 xfs_buf_do_callbacks(bp);
1646 diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c
1647 index b49b823..9afdd49 100644
1648 --- a/fs/xfs/xfs_mount.c
1649 +++ b/fs/xfs/xfs_mount.c
1650 @@ -44,9 +44,6 @@
1651 #include "xfs_trace.h"
1652
1653
1654 -STATIC void xfs_unmountfs_wait(xfs_mount_t *);
1655 -
1656 -
1657 #ifdef HAVE_PERCPU_SB
1658 STATIC void xfs_icsb_balance_counter(xfs_mount_t *, xfs_sb_field_t,
1659 int);
1660 @@ -1507,11 +1504,6 @@ xfs_unmountfs(
1661 */
1662 xfs_log_force(mp, XFS_LOG_SYNC);
1663
1664 - xfs_binval(mp->m_ddev_targp);
1665 - if (mp->m_rtdev_targp) {
1666 - xfs_binval(mp->m_rtdev_targp);
1667 - }
1668 -
1669 /*
1670 * Unreserve any blocks we have so that when we unmount we don't account
1671 * the reserved free space as used. This is really only necessary for
1672 @@ -1537,7 +1529,16 @@ xfs_unmountfs(
1673 xfs_warn(mp, "Unable to update superblock counters. "
1674 "Freespace may not be correct on next mount.");
1675 xfs_unmountfs_writesb(mp);
1676 - xfs_unmountfs_wait(mp); /* wait for async bufs */
1677 +
1678 + /*
1679 + * Make sure all buffers have been flushed and completed before
1680 + * unmounting the log.
1681 + */
1682 + error = xfs_flush_buftarg(mp->m_ddev_targp, 1);
1683 + if (error)
1684 + xfs_warn(mp, "%d busy buffers during unmount.", error);
1685 + xfs_wait_buftarg(mp->m_ddev_targp);
1686 +
1687 xfs_log_unmount_write(mp);
1688 xfs_log_unmount(mp);
1689 xfs_uuid_unmount(mp);
1690 @@ -1548,16 +1549,6 @@ xfs_unmountfs(
1691 xfs_free_perag(mp);
1692 }
1693
1694 -STATIC void
1695 -xfs_unmountfs_wait(xfs_mount_t *mp)
1696 -{
1697 - if (mp->m_logdev_targp != mp->m_ddev_targp)
1698 - xfs_wait_buftarg(mp->m_logdev_targp);
1699 - if (mp->m_rtdev_targp)
1700 - xfs_wait_buftarg(mp->m_rtdev_targp);
1701 - xfs_wait_buftarg(mp->m_ddev_targp);
1702 -}
1703 -
1704 int
1705 xfs_fs_writable(xfs_mount_t *mp)
1706 {
1707 diff --git a/fs/xfs/xfs_vnodeops.c b/fs/xfs/xfs_vnodeops.c
1708 index 6197207..6cc4d41 100644
1709 --- a/fs/xfs/xfs_vnodeops.c
1710 +++ b/fs/xfs/xfs_vnodeops.c
1711 @@ -535,7 +535,7 @@ xfs_readlink(
1712 char *link)
1713 {
1714 xfs_mount_t *mp = ip->i_mount;
1715 - int pathlen;
1716 + xfs_fsize_t pathlen;
1717 int error = 0;
1718
1719 trace_xfs_readlink(ip);
1720 @@ -545,13 +545,19 @@ xfs_readlink(
1721
1722 xfs_ilock(ip, XFS_ILOCK_SHARED);
1723
1724 - ASSERT((ip->i_d.di_mode & S_IFMT) == S_IFLNK);
1725 - ASSERT(ip->i_d.di_size <= MAXPATHLEN);
1726 -
1727 pathlen = ip->i_d.di_size;
1728 if (!pathlen)
1729 goto out;
1730
1731 + if (pathlen < 0 || pathlen > MAXPATHLEN) {
1732 + xfs_alert(mp, "%s: inode (%llu) bad symlink length (%lld)",
1733 + __func__, (unsigned long long) ip->i_ino,
1734 + (long long) pathlen);
1735 + ASSERT(0);
1736 + return XFS_ERROR(EFSCORRUPTED);
1737 + }
1738 +
1739 +
1740 if (ip->i_df.if_flags & XFS_IFINLINE) {
1741 memcpy(link, ip->i_df.if_u1.if_data, pathlen);
1742 link[pathlen] = '\0';
1743 diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
1744 index b522370..acdc370 100644
1745 --- a/include/linux/nfs_fs.h
1746 +++ b/include/linux/nfs_fs.h
1747 @@ -410,6 +410,9 @@ extern const struct inode_operations nfs_file_inode_operations;
1748 extern const struct inode_operations nfs3_file_inode_operations;
1749 #endif /* CONFIG_NFS_V3 */
1750 extern const struct file_operations nfs_file_operations;
1751 +#ifdef CONFIG_NFS_V4
1752 +extern const struct file_operations nfs4_file_operations;
1753 +#endif /* CONFIG_NFS_V4 */
1754 extern const struct address_space_operations nfs_file_aops;
1755 extern const struct address_space_operations nfs_dir_aops;
1756
1757 diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
1758 index be2eba7..0012fc3 100644
1759 --- a/include/linux/nfs_xdr.h
1760 +++ b/include/linux/nfs_xdr.h
1761 @@ -1149,6 +1149,7 @@ struct nfs_rpc_ops {
1762 const struct dentry_operations *dentry_ops;
1763 const struct inode_operations *dir_inode_ops;
1764 const struct inode_operations *file_inode_ops;
1765 + const struct file_operations *file_ops;
1766
1767 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1768 struct nfs_fsinfo *);
1769 diff --git a/kernel/irq/spurious.c b/kernel/irq/spurious.c
1770 index aa57d5d..b5f4742 100644
1771 --- a/kernel/irq/spurious.c
1772 +++ b/kernel/irq/spurious.c
1773 @@ -115,7 +115,7 @@ static int misrouted_irq(int irq)
1774 struct irq_desc *desc;
1775 int i, ok = 0;
1776
1777 - if (atomic_inc_return(&irq_poll_active) == 1)
1778 + if (atomic_inc_return(&irq_poll_active) != 1)
1779 goto out;
1780
1781 irq_poll_cpu = smp_processor_id();
1782 diff --git a/net/ipv6/ip6_tunnel.c b/net/ipv6/ip6_tunnel.c
1783 index 36c2842..848e494 100644
1784 --- a/net/ipv6/ip6_tunnel.c
1785 +++ b/net/ipv6/ip6_tunnel.c
1786 @@ -289,6 +289,8 @@ static struct ip6_tnl *ip6_tnl_create(struct net *net, struct ip6_tnl_parm *p)
1787 if ((err = register_netdevice(dev)) < 0)
1788 goto failed_free;
1789
1790 + strcpy(t->parms.name, dev->name);
1791 +
1792 dev_hold(dev);
1793 ip6_tnl_link(ip6n, t);
1794 return t;
1795 @@ -1397,7 +1399,6 @@ ip6_tnl_dev_init_gen(struct net_device *dev)
1796 struct ip6_tnl *t = netdev_priv(dev);
1797
1798 t->dev = dev;
1799 - strcpy(t->parms.name, dev->name);
1800 dev->tstats = alloc_percpu(struct pcpu_tstats);
1801 if (!dev->tstats)
1802 return -ENOMEM;
1803 @@ -1477,6 +1478,7 @@ static void __net_exit ip6_tnl_destroy_tunnels(struct ip6_tnl_net *ip6n)
1804 static int __net_init ip6_tnl_init_net(struct net *net)
1805 {
1806 struct ip6_tnl_net *ip6n = net_generic(net, ip6_tnl_net_id);
1807 + struct ip6_tnl *t = NULL;
1808 int err;
1809
1810 ip6n->tnls[0] = ip6n->tnls_wc;
1811 @@ -1497,6 +1499,10 @@ static int __net_init ip6_tnl_init_net(struct net *net)
1812 err = register_netdev(ip6n->fb_tnl_dev);
1813 if (err < 0)
1814 goto err_register;
1815 +
1816 + t = netdev_priv(ip6n->fb_tnl_dev);
1817 +
1818 + strcpy(t->parms.name, ip6n->fb_tnl_dev->name);
1819 return 0;
1820
1821 err_register:
1822 diff --git a/net/mac80211/rx.c b/net/mac80211/rx.c
1823 index 7fa8c6b..378bd67 100644
1824 --- a/net/mac80211/rx.c
1825 +++ b/net/mac80211/rx.c
1826 @@ -140,8 +140,9 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
1827 pos++;
1828
1829 /* IEEE80211_RADIOTAP_RATE */
1830 - if (status->flag & RX_FLAG_HT) {
1831 + if (!rate || status->flag & RX_FLAG_HT) {
1832 /*
1833 + * Without rate information don't add it. If we have,
1834 * MCS information is a separate field in radiotap,
1835 * added below. The byte here is needed as padding
1836 * for the channel though, so initialise it to 0.
1837 @@ -162,12 +163,14 @@ ieee80211_add_rx_radiotap_header(struct ieee80211_local *local,
1838 else if (status->flag & RX_FLAG_HT)
1839 put_unaligned_le16(IEEE80211_CHAN_DYN | IEEE80211_CHAN_2GHZ,
1840 pos);
1841 - else if (rate->flags & IEEE80211_RATE_ERP_G)
1842 + else if (rate && rate->flags & IEEE80211_RATE_ERP_G)
1843 put_unaligned_le16(IEEE80211_CHAN_OFDM | IEEE80211_CHAN_2GHZ,
1844 pos);
1845 - else
1846 + else if (rate)
1847 put_unaligned_le16(IEEE80211_CHAN_CCK | IEEE80211_CHAN_2GHZ,
1848 pos);
1849 + else
1850 + put_unaligned_le16(IEEE80211_CHAN_2GHZ, pos);
1851 pos += 2;
1852
1853 /* IEEE80211_RADIOTAP_DBM_ANTSIGNAL */
1854 diff --git a/net/mac80211/util.c b/net/mac80211/util.c
1855 index d3fe2d2..2124db8 100644
1856 --- a/net/mac80211/util.c
1857 +++ b/net/mac80211/util.c
1858 @@ -1047,6 +1047,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1859 skb = ieee80211_probereq_get(&local->hw, &sdata->vif,
1860 ssid, ssid_len,
1861 buf, buf_len);
1862 + if (!skb)
1863 + goto out;
1864
1865 if (dst) {
1866 mgmt = (struct ieee80211_mgmt *) skb->data;
1867 @@ -1055,6 +1057,8 @@ struct sk_buff *ieee80211_build_probe_req(struct ieee80211_sub_if_data *sdata,
1868 }
1869
1870 IEEE80211_SKB_CB(skb)->flags |= IEEE80211_TX_INTFL_DONT_ENCRYPT;
1871 +
1872 + out:
1873 kfree(buf);
1874
1875 return skb;
1876 diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
1877 index 1ac9443..3dac76f 100644
1878 --- a/net/wireless/nl80211.c
1879 +++ b/net/wireless/nl80211.c
1880 @@ -126,8 +126,7 @@ static const struct nla_policy nl80211_policy[NL80211_ATTR_MAX+1] = {
1881 [NL80211_ATTR_MESH_CONFIG] = { .type = NLA_NESTED },
1882 [NL80211_ATTR_SUPPORT_MESH_AUTH] = { .type = NLA_FLAG },
1883
1884 - [NL80211_ATTR_HT_CAPABILITY] = { .type = NLA_BINARY,
1885 - .len = NL80211_HT_CAPABILITY_LEN },
1886 + [NL80211_ATTR_HT_CAPABILITY] = { .len = NL80211_HT_CAPABILITY_LEN },
1887
1888 [NL80211_ATTR_MGMT_SUBTYPE] = { .type = NLA_U8 },
1889 [NL80211_ATTR_IE] = { .type = NLA_BINARY,
1890 diff --git a/net/wireless/reg.c b/net/wireless/reg.c
1891 index 379574c..213103e 100644
1892 --- a/net/wireless/reg.c
1893 +++ b/net/wireless/reg.c
1894 @@ -2254,6 +2254,9 @@ void /* __init_or_exit */ regulatory_exit(void)
1895
1896 kfree(last_request);
1897
1898 + last_request = NULL;
1899 + dev_set_uevent_suppress(&reg_pdev->dev, true);
1900 +
1901 platform_device_unregister(reg_pdev);
1902
1903 spin_lock_bh(&reg_pending_beacons_lock);

  ViewVC Help
Powered by ViewVC 1.1.20