/[linux-patches]/genpatches-2.6/tags/3.0-30/1020_linux-3.0.21.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1020_linux-3.0.21.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (23 months, 1 week ago) by mpagano
File size: 107248 byte(s)
3.0-30 release
1 diff --git a/Makefile b/Makefile
2 index c060c58..d5f0598 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 0
8 -SUBLEVEL = 20
9 +SUBLEVEL = 21
10 EXTRAVERSION =
11 NAME = Sneaky Weasel
12
13 diff --git a/arch/arm/kernel/ptrace.c b/arch/arm/kernel/ptrace.c
14 index 9726006..172ae01 100644
15 --- a/arch/arm/kernel/ptrace.c
16 +++ b/arch/arm/kernel/ptrace.c
17 @@ -719,10 +719,13 @@ static int vfp_set(struct task_struct *target,
18 {
19 int ret;
20 struct thread_info *thread = task_thread_info(target);
21 - struct vfp_hard_struct new_vfp = thread->vfpstate.hard;
22 + struct vfp_hard_struct new_vfp;
23 const size_t user_fpregs_offset = offsetof(struct user_vfp, fpregs);
24 const size_t user_fpscr_offset = offsetof(struct user_vfp, fpscr);
25
26 + vfp_sync_hwstate(thread);
27 + new_vfp = thread->vfpstate.hard;
28 +
29 ret = user_regset_copyin(&pos, &count, &kbuf, &ubuf,
30 &new_vfp.fpregs,
31 user_fpregs_offset,
32 @@ -743,9 +746,8 @@ static int vfp_set(struct task_struct *target,
33 if (ret)
34 return ret;
35
36 - vfp_sync_hwstate(thread);
37 - thread->vfpstate.hard = new_vfp;
38 vfp_flush_hwstate(thread);
39 + thread->vfpstate.hard = new_vfp;
40
41 return 0;
42 }
43 diff --git a/arch/arm/kernel/signal.c b/arch/arm/kernel/signal.c
44 index 0340224..9e617bd 100644
45 --- a/arch/arm/kernel/signal.c
46 +++ b/arch/arm/kernel/signal.c
47 @@ -227,6 +227,8 @@ static int restore_vfp_context(struct vfp_sigframe __user *frame)
48 if (magic != VFP_MAGIC || size != VFP_STORAGE_SIZE)
49 return -EINVAL;
50
51 + vfp_flush_hwstate(thread);
52 +
53 /*
54 * Copy the floating point registers. There can be unused
55 * registers see asm/hwcap.h for details.
56 @@ -251,9 +253,6 @@ static int restore_vfp_context(struct vfp_sigframe __user *frame)
57 __get_user_error(h->fpinst, &frame->ufp_exc.fpinst, err);
58 __get_user_error(h->fpinst2, &frame->ufp_exc.fpinst2, err);
59
60 - if (!err)
61 - vfp_flush_hwstate(thread);
62 -
63 return err ? -EFAULT : 0;
64 }
65
66 diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
67 index 130034b..dfffbbf 100644
68 --- a/arch/arm/mach-omap2/gpmc.c
69 +++ b/arch/arm/mach-omap2/gpmc.c
70 @@ -528,7 +528,13 @@ int gpmc_cs_configure(int cs, int cmd, int wval)
71
72 case GPMC_CONFIG_DEV_SIZE:
73 regval = gpmc_cs_read_reg(cs, GPMC_CS_CONFIG1);
74 +
75 + /* clear 2 target bits */
76 + regval &= ~GPMC_CONFIG1_DEVICESIZE(3);
77 +
78 + /* set the proper value */
79 regval |= GPMC_CONFIG1_DEVICESIZE(wval);
80 +
81 gpmc_cs_write_reg(cs, GPMC_CS_CONFIG1, regval);
82 break;
83
84 diff --git a/drivers/cpufreq/powernow-k8.c b/drivers/cpufreq/powernow-k8.c
85 index bce576d..ad683ec 100644
86 --- a/drivers/cpufreq/powernow-k8.c
87 +++ b/drivers/cpufreq/powernow-k8.c
88 @@ -54,6 +54,9 @@ static DEFINE_PER_CPU(struct powernow_k8_data *, powernow_data);
89
90 static int cpu_family = CPU_OPTERON;
91
92 +/* array to map SW pstate number to acpi state */
93 +static u32 ps_to_as[8];
94 +
95 /* core performance boost */
96 static bool cpb_capable, cpb_enabled;
97 static struct msr __percpu *msrs;
98 @@ -80,9 +83,9 @@ static u32 find_khz_freq_from_fid(u32 fid)
99 }
100
101 static u32 find_khz_freq_from_pstate(struct cpufreq_frequency_table *data,
102 - u32 pstate)
103 + u32 pstate)
104 {
105 - return data[pstate].frequency;
106 + return data[ps_to_as[pstate]].frequency;
107 }
108
109 /* Return the vco fid for an input fid
110 @@ -926,23 +929,27 @@ static int fill_powernow_table_pstate(struct powernow_k8_data *data,
111 invalidate_entry(powernow_table, i);
112 continue;
113 }
114 - rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
115 - if (!(hi & HW_PSTATE_VALID_MASK)) {
116 - pr_debug("invalid pstate %d, ignoring\n", index);
117 - invalidate_entry(powernow_table, i);
118 - continue;
119 - }
120
121 - powernow_table[i].index = index;
122 + ps_to_as[index] = i;
123
124 /* Frequency may be rounded for these */
125 if ((boot_cpu_data.x86 == 0x10 && boot_cpu_data.x86_model < 10)
126 || boot_cpu_data.x86 == 0x11) {
127 +
128 + rdmsr(MSR_PSTATE_DEF_BASE + index, lo, hi);
129 + if (!(hi & HW_PSTATE_VALID_MASK)) {
130 + pr_debug("invalid pstate %d, ignoring\n", index);
131 + invalidate_entry(powernow_table, i);
132 + continue;
133 + }
134 +
135 powernow_table[i].frequency =
136 freq_from_fid_did(lo & 0x3f, (lo >> 6) & 7);
137 } else
138 powernow_table[i].frequency =
139 data->acpi_data.states[i].core_frequency * 1000;
140 +
141 + powernow_table[i].index = index;
142 }
143 return 0;
144 }
145 @@ -1189,7 +1196,8 @@ static int powernowk8_target(struct cpufreq_policy *pol,
146 powernow_k8_acpi_pst_values(data, newstate);
147
148 if (cpu_family == CPU_HW_PSTATE)
149 - ret = transition_frequency_pstate(data, newstate);
150 + ret = transition_frequency_pstate(data,
151 + data->powernow_table[newstate].index);
152 else
153 ret = transition_frequency_fidvid(data, newstate);
154 if (ret) {
155 @@ -1202,7 +1210,7 @@ static int powernowk8_target(struct cpufreq_policy *pol,
156
157 if (cpu_family == CPU_HW_PSTATE)
158 pol->cur = find_khz_freq_from_pstate(data->powernow_table,
159 - newstate);
160 + data->powernow_table[newstate].index);
161 else
162 pol->cur = find_khz_freq_from_fid(data->currfid);
163 ret = 0;
164 diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c
165 index 36144f8..9e9318a 100644
166 --- a/drivers/dma/at_hdmac.c
167 +++ b/drivers/dma/at_hdmac.c
168 @@ -1279,7 +1279,7 @@ static int __init at_dma_probe(struct platform_device *pdev)
169
170 tasklet_init(&atchan->tasklet, atc_tasklet,
171 (unsigned long)atchan);
172 - atc_enable_irq(atchan);
173 + atc_enable_chan_irq(atdma, i);
174 }
175
176 /* set base routines */
177 @@ -1348,7 +1348,7 @@ static int __exit at_dma_remove(struct platform_device *pdev)
178 struct at_dma_chan *atchan = to_at_dma_chan(chan);
179
180 /* Disable interrupts */
181 - atc_disable_irq(atchan);
182 + atc_disable_chan_irq(atdma, chan->chan_id);
183 tasklet_disable(&atchan->tasklet);
184
185 tasklet_kill(&atchan->tasklet);
186 diff --git a/drivers/dma/at_hdmac_regs.h b/drivers/dma/at_hdmac_regs.h
187 index 087dbf1..19ed470 100644
188 --- a/drivers/dma/at_hdmac_regs.h
189 +++ b/drivers/dma/at_hdmac_regs.h
190 @@ -319,28 +319,27 @@ static void atc_dump_lli(struct at_dma_chan *atchan, struct at_lli *lli)
191 }
192
193
194 -static void atc_setup_irq(struct at_dma_chan *atchan, int on)
195 +static void atc_setup_irq(struct at_dma *atdma, int chan_id, int on)
196 {
197 - struct at_dma *atdma = to_at_dma(atchan->chan_common.device);
198 - u32 ebci;
199 + u32 ebci;
200
201 /* enable interrupts on buffer transfer completion & error */
202 - ebci = AT_DMA_BTC(atchan->chan_common.chan_id)
203 - | AT_DMA_ERR(atchan->chan_common.chan_id);
204 + ebci = AT_DMA_BTC(chan_id)
205 + | AT_DMA_ERR(chan_id);
206 if (on)
207 dma_writel(atdma, EBCIER, ebci);
208 else
209 dma_writel(atdma, EBCIDR, ebci);
210 }
211
212 -static inline void atc_enable_irq(struct at_dma_chan *atchan)
213 +static void atc_enable_chan_irq(struct at_dma *atdma, int chan_id)
214 {
215 - atc_setup_irq(atchan, 1);
216 + atc_setup_irq(atdma, chan_id, 1);
217 }
218
219 -static inline void atc_disable_irq(struct at_dma_chan *atchan)
220 +static void atc_disable_chan_irq(struct at_dma *atdma, int chan_id)
221 {
222 - atc_setup_irq(atchan, 0);
223 + atc_setup_irq(atdma, chan_id, 0);
224 }
225
226
227 diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c
228 index ee76c8e..7f97c30 100644
229 --- a/drivers/firewire/ohci.c
230 +++ b/drivers/firewire/ohci.c
231 @@ -262,6 +262,7 @@ static inline struct fw_ohci *fw_ohci(struct fw_card *card)
232 static char ohci_driver_name[] = KBUILD_MODNAME;
233
234 #define PCI_DEVICE_ID_AGERE_FW643 0x5901
235 +#define PCI_DEVICE_ID_CREATIVE_SB1394 0x4001
236 #define PCI_DEVICE_ID_JMICRON_JMB38X_FW 0x2380
237 #define PCI_DEVICE_ID_TI_TSB12LV22 0x8009
238 #define PCI_VENDOR_ID_PINNACLE_SYSTEMS 0x11bd
239 @@ -285,6 +286,9 @@ static const struct {
240 {PCI_VENDOR_ID_ATT, PCI_DEVICE_ID_AGERE_FW643, 6,
241 QUIRK_NO_MSI},
242
243 + {PCI_VENDOR_ID_CREATIVE, PCI_DEVICE_ID_CREATIVE_SB1394, PCI_ANY_ID,
244 + QUIRK_RESET_PACKET},
245 +
246 {PCI_VENDOR_ID_JMICRON, PCI_DEVICE_ID_JMICRON_JMB38X_FW, PCI_ANY_ID,
247 QUIRK_NO_MSI},
248
249 @@ -295,7 +299,7 @@ static const struct {
250 QUIRK_NO_MSI},
251
252 {PCI_VENDOR_ID_RICOH, PCI_ANY_ID, PCI_ANY_ID,
253 - QUIRK_CYCLE_TIMER},
254 + QUIRK_CYCLE_TIMER | QUIRK_NO_MSI},
255
256 {PCI_VENDOR_ID_TI, PCI_DEVICE_ID_TI_TSB12LV22, PCI_ANY_ID,
257 QUIRK_CYCLE_TIMER | QUIRK_RESET_PACKET | QUIRK_NO_1394A},
258 diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
259 index 335564e..b570415 100644
260 --- a/drivers/gpu/drm/i915/i915_drv.h
261 +++ b/drivers/gpu/drm/i915/i915_drv.h
262 @@ -325,6 +325,8 @@ typedef struct drm_i915_private {
263 struct timer_list hangcheck_timer;
264 int hangcheck_count;
265 uint32_t last_acthd;
266 + uint32_t last_acthd_bsd;
267 + uint32_t last_acthd_blt;
268 uint32_t last_instdone;
269 uint32_t last_instdone1;
270
271 diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c
272 index 3635647..997db7f 100644
273 --- a/drivers/gpu/drm/i915/i915_irq.c
274 +++ b/drivers/gpu/drm/i915/i915_irq.c
275 @@ -1665,7 +1665,7 @@ void i915_hangcheck_elapsed(unsigned long data)
276 {
277 struct drm_device *dev = (struct drm_device *)data;
278 drm_i915_private_t *dev_priv = dev->dev_private;
279 - uint32_t acthd, instdone, instdone1;
280 + uint32_t acthd, instdone, instdone1, acthd_bsd, acthd_blt;
281 bool err = false;
282
283 /* If all work is done then ACTHD clearly hasn't advanced. */
284 @@ -1679,16 +1679,21 @@ void i915_hangcheck_elapsed(unsigned long data)
285 }
286
287 if (INTEL_INFO(dev)->gen < 4) {
288 - acthd = I915_READ(ACTHD);
289 instdone = I915_READ(INSTDONE);
290 instdone1 = 0;
291 } else {
292 - acthd = I915_READ(ACTHD_I965);
293 instdone = I915_READ(INSTDONE_I965);
294 instdone1 = I915_READ(INSTDONE1);
295 }
296 + acthd = intel_ring_get_active_head(&dev_priv->ring[RCS]);
297 + acthd_bsd = HAS_BSD(dev) ?
298 + intel_ring_get_active_head(&dev_priv->ring[VCS]) : 0;
299 + acthd_blt = HAS_BLT(dev) ?
300 + intel_ring_get_active_head(&dev_priv->ring[BCS]) : 0;
301
302 if (dev_priv->last_acthd == acthd &&
303 + dev_priv->last_acthd_bsd == acthd_bsd &&
304 + dev_priv->last_acthd_blt == acthd_blt &&
305 dev_priv->last_instdone == instdone &&
306 dev_priv->last_instdone1 == instdone1) {
307 if (dev_priv->hangcheck_count++ > 1) {
308 @@ -1720,6 +1725,8 @@ void i915_hangcheck_elapsed(unsigned long data)
309 dev_priv->hangcheck_count = 0;
310
311 dev_priv->last_acthd = acthd;
312 + dev_priv->last_acthd_bsd = acthd_bsd;
313 + dev_priv->last_acthd_blt = acthd_blt;
314 dev_priv->last_instdone = instdone;
315 dev_priv->last_instdone1 = instdone1;
316 }
317 diff --git a/drivers/gpu/drm/i915/i915_suspend.c b/drivers/gpu/drm/i915/i915_suspend.c
318 index cf15533..bc7dcaa 100644
319 --- a/drivers/gpu/drm/i915/i915_suspend.c
320 +++ b/drivers/gpu/drm/i915/i915_suspend.c
321 @@ -34,6 +34,10 @@ static bool i915_pipe_enabled(struct drm_device *dev, enum pipe pipe)
322 struct drm_i915_private *dev_priv = dev->dev_private;
323 u32 dpll_reg;
324
325 + /* On IVB, 3rd pipe shares PLL with another one */
326 + if (pipe > 1)
327 + return false;
328 +
329 if (HAS_PCH_SPLIT(dev))
330 dpll_reg = (pipe == PIPE_A) ? _PCH_DPLL_A : _PCH_DPLL_B;
331 else
332 diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
333 index 14264a8..bf9fea9 100644
334 --- a/drivers/gpu/drm/i915/intel_dp.c
335 +++ b/drivers/gpu/drm/i915/intel_dp.c
336 @@ -1554,6 +1554,7 @@ intel_dp_link_down(struct intel_dp *intel_dp)
337 intel_wait_for_vblank(dev, to_intel_crtc(crtc)->pipe);
338 }
339
340 + DP &= ~DP_AUDIO_OUTPUT_ENABLE;
341 I915_WRITE(intel_dp->output_reg, DP & ~DP_PORT_EN);
342 POSTING_READ(intel_dp->output_reg);
343 }
344 diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
345 index aa0a8e8..236bbe0 100644
346 --- a/drivers/gpu/drm/i915/intel_hdmi.c
347 +++ b/drivers/gpu/drm/i915/intel_hdmi.c
348 @@ -158,6 +158,10 @@ static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
349 struct drm_i915_private *dev_priv = dev->dev_private;
350 struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
351 u32 temp;
352 + u32 enable_bits = SDVO_ENABLE;
353 +
354 + if (intel_hdmi->has_audio)
355 + enable_bits |= SDVO_AUDIO_ENABLE;
356
357 temp = I915_READ(intel_hdmi->sdvox_reg);
358
359 @@ -170,9 +174,9 @@ static void intel_hdmi_dpms(struct drm_encoder *encoder, int mode)
360 }
361
362 if (mode != DRM_MODE_DPMS_ON) {
363 - temp &= ~SDVO_ENABLE;
364 + temp &= ~enable_bits;
365 } else {
366 - temp |= SDVO_ENABLE;
367 + temp |= enable_bits;
368 }
369
370 I915_WRITE(intel_hdmi->sdvox_reg, temp);
371 diff --git a/drivers/gpu/drm/i915/intel_tv.c b/drivers/gpu/drm/i915/intel_tv.c
372 index 113e4e7..f57b08b 100644
373 --- a/drivers/gpu/drm/i915/intel_tv.c
374 +++ b/drivers/gpu/drm/i915/intel_tv.c
375 @@ -417,7 +417,7 @@ static const struct tv_mode tv_modes[] = {
376 {
377 .name = "NTSC-M",
378 .clock = 108000,
379 - .refresh = 29970,
380 + .refresh = 59940,
381 .oversample = TV_OVERSAMPLE_8X,
382 .component_only = 0,
383 /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 3.580MHz */
384 @@ -460,7 +460,7 @@ static const struct tv_mode tv_modes[] = {
385 {
386 .name = "NTSC-443",
387 .clock = 108000,
388 - .refresh = 29970,
389 + .refresh = 59940,
390 .oversample = TV_OVERSAMPLE_8X,
391 .component_only = 0,
392 /* 525 Lines, 60 Fields, 15.734KHz line, Sub-Carrier 4.43MHz */
393 @@ -502,7 +502,7 @@ static const struct tv_mode tv_modes[] = {
394 {
395 .name = "NTSC-J",
396 .clock = 108000,
397 - .refresh = 29970,
398 + .refresh = 59940,
399 .oversample = TV_OVERSAMPLE_8X,
400 .component_only = 0,
401
402 @@ -545,7 +545,7 @@ static const struct tv_mode tv_modes[] = {
403 {
404 .name = "PAL-M",
405 .clock = 108000,
406 - .refresh = 29970,
407 + .refresh = 59940,
408 .oversample = TV_OVERSAMPLE_8X,
409 .component_only = 0,
410
411 @@ -589,7 +589,7 @@ static const struct tv_mode tv_modes[] = {
412 /* 625 Lines, 50 Fields, 15.625KHz line, Sub-Carrier 4.434MHz */
413 .name = "PAL-N",
414 .clock = 108000,
415 - .refresh = 25000,
416 + .refresh = 50000,
417 .oversample = TV_OVERSAMPLE_8X,
418 .component_only = 0,
419
420 @@ -634,7 +634,7 @@ static const struct tv_mode tv_modes[] = {
421 /* 625 Lines, 50 Fields, 15.625KHz line, Sub-Carrier 4.434MHz */
422 .name = "PAL",
423 .clock = 108000,
424 - .refresh = 25000,
425 + .refresh = 50000,
426 .oversample = TV_OVERSAMPLE_8X,
427 .component_only = 0,
428
429 @@ -821,7 +821,7 @@ static const struct tv_mode tv_modes[] = {
430 {
431 .name = "1080i@50Hz",
432 .clock = 148800,
433 - .refresh = 25000,
434 + .refresh = 50000,
435 .oversample = TV_OVERSAMPLE_2X,
436 .component_only = 1,
437
438 @@ -847,7 +847,7 @@ static const struct tv_mode tv_modes[] = {
439 {
440 .name = "1080i@60Hz",
441 .clock = 148800,
442 - .refresh = 30000,
443 + .refresh = 60000,
444 .oversample = TV_OVERSAMPLE_2X,
445 .component_only = 1,
446
447 diff --git a/drivers/gpu/drm/nouveau/nouveau_gem.c b/drivers/gpu/drm/nouveau/nouveau_gem.c
448 index b52e460..cee78b2 100644
449 --- a/drivers/gpu/drm/nouveau/nouveau_gem.c
450 +++ b/drivers/gpu/drm/nouveau/nouveau_gem.c
451 @@ -315,6 +315,25 @@ retry:
452 }
453
454 static int
455 +validate_sync(struct nouveau_channel *chan, struct nouveau_bo *nvbo)
456 +{
457 + struct nouveau_fence *fence = NULL;
458 + int ret = 0;
459 +
460 + spin_lock(&nvbo->bo.bdev->fence_lock);
461 + if (nvbo->bo.sync_obj)
462 + fence = nouveau_fence_ref(nvbo->bo.sync_obj);
463 + spin_unlock(&nvbo->bo.bdev->fence_lock);
464 +
465 + if (fence) {
466 + ret = nouveau_fence_sync(fence, chan);
467 + nouveau_fence_unref(&fence);
468 + }
469 +
470 + return ret;
471 +}
472 +
473 +static int
474 validate_list(struct nouveau_channel *chan, struct list_head *list,
475 struct drm_nouveau_gem_pushbuf_bo *pbbo, uint64_t user_pbbo_ptr)
476 {
477 @@ -327,7 +346,7 @@ validate_list(struct nouveau_channel *chan, struct list_head *list,
478 list_for_each_entry(nvbo, list, entry) {
479 struct drm_nouveau_gem_pushbuf_bo *b = &pbbo[nvbo->pbbo_index];
480
481 - ret = nouveau_fence_sync(nvbo->bo.sync_obj, chan);
482 + ret = validate_sync(chan, nvbo);
483 if (unlikely(ret)) {
484 NV_ERROR(dev, "fail pre-validate sync\n");
485 return ret;
486 @@ -350,7 +369,7 @@ validate_list(struct nouveau_channel *chan, struct list_head *list,
487 return ret;
488 }
489
490 - ret = nouveau_fence_sync(nvbo->bo.sync_obj, chan);
491 + ret = validate_sync(chan, nvbo);
492 if (unlikely(ret)) {
493 NV_ERROR(dev, "fail post-validate sync\n");
494 return ret;
495 diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
496 index 9541995..071ded1 100644
497 --- a/drivers/gpu/drm/radeon/atombios_crtc.c
498 +++ b/drivers/gpu/drm/radeon/atombios_crtc.c
499 @@ -1173,7 +1173,7 @@ static int dce4_crtc_do_set_base(struct drm_crtc *crtc,
500 WREG32(EVERGREEN_GRPH_ENABLE + radeon_crtc->crtc_offset, 1);
501
502 WREG32(EVERGREEN_DESKTOP_HEIGHT + radeon_crtc->crtc_offset,
503 - crtc->mode.vdisplay);
504 + target_fb->height);
505 x &= ~3;
506 y &= ~1;
507 WREG32(EVERGREEN_VIEWPORT_START + radeon_crtc->crtc_offset,
508 @@ -1342,7 +1342,7 @@ static int avivo_crtc_do_set_base(struct drm_crtc *crtc,
509 WREG32(AVIVO_D1GRPH_ENABLE + radeon_crtc->crtc_offset, 1);
510
511 WREG32(AVIVO_D1MODE_DESKTOP_HEIGHT + radeon_crtc->crtc_offset,
512 - crtc->mode.vdisplay);
513 + target_fb->height);
514 x &= ~3;
515 y &= ~1;
516 WREG32(AVIVO_D1MODE_VIEWPORT_START + radeon_crtc->crtc_offset,
517 diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
518 index 5d0c123..e87893c 100644
519 --- a/drivers/gpu/drm/radeon/radeon_device.c
520 +++ b/drivers/gpu/drm/radeon/radeon_device.c
521 @@ -857,6 +857,8 @@ int radeon_suspend_kms(struct drm_device *dev, pm_message_t state)
522 if (dev->switch_power_state == DRM_SWITCH_POWER_OFF)
523 return 0;
524
525 + drm_kms_helper_poll_disable(dev);
526 +
527 /* turn off display hw */
528 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
529 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
530 @@ -943,6 +945,8 @@ int radeon_resume_kms(struct drm_device *dev)
531 list_for_each_entry(connector, &dev->mode_config.connector_list, head) {
532 drm_helper_connector_dpms(connector, DRM_MODE_DPMS_ON);
533 }
534 +
535 + drm_kms_helper_poll_enable(dev);
536 return 0;
537 }
538
539 diff --git a/drivers/hwmon/w83627ehf.c b/drivers/hwmon/w83627ehf.c
540 index 6284515..359bb1e 100644
541 --- a/drivers/hwmon/w83627ehf.c
542 +++ b/drivers/hwmon/w83627ehf.c
543 @@ -2104,9 +2104,29 @@ static int __devinit w83627ehf_probe(struct platform_device *pdev)
544 fan4min = 0;
545 fan5pin = 0;
546 } else if (sio_data->kind == nct6776) {
547 - fan3pin = !(superio_inb(sio_data->sioreg, 0x24) & 0x40);
548 - fan4pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x01);
549 - fan5pin = !!(superio_inb(sio_data->sioreg, 0x1C) & 0x02);
550 + bool gpok = superio_inb(sio_data->sioreg, 0x27) & 0x80;
551 + u8 regval;
552 +
553 + superio_select(sio_data->sioreg, W83627EHF_LD_HWM);
554 + regval = superio_inb(sio_data->sioreg, SIO_REG_ENABLE);
555 +
556 + if (regval & 0x80)
557 + fan3pin = gpok;
558 + else
559 + fan3pin = !(superio_inb(sio_data->sioreg, 0x24) & 0x40);
560 +
561 + if (regval & 0x40)
562 + fan4pin = gpok;
563 + else
564 + fan4pin = !!(superio_inb(sio_data->sioreg, 0x1C)
565 + & 0x01);
566 +
567 + if (regval & 0x20)
568 + fan5pin = gpok;
569 + else
570 + fan5pin = !!(superio_inb(sio_data->sioreg, 0x1C)
571 + & 0x02);
572 +
573 fan4min = fan4pin;
574 } else if (sio_data->kind == w83667hg || sio_data->kind == w83667hg_b) {
575 fan3pin = 1;
576 diff --git a/drivers/infiniband/core/addr.c b/drivers/infiniband/core/addr.c
577 index 8e21d45..f2a84c6 100644
578 --- a/drivers/infiniband/core/addr.c
579 +++ b/drivers/infiniband/core/addr.c
580 @@ -215,7 +215,9 @@ static int addr4_resolve(struct sockaddr_in *src_in,
581
582 neigh = neigh_lookup(&arp_tbl, &rt->rt_gateway, rt->dst.dev);
583 if (!neigh || !(neigh->nud_state & NUD_VALID)) {
584 - neigh_event_send(rt->dst.neighbour, NULL);
585 + rcu_read_lock();
586 + neigh_event_send(dst_get_neighbour(&rt->dst), NULL);
587 + rcu_read_unlock();
588 ret = -ENODATA;
589 if (neigh)
590 goto release;
591 @@ -273,14 +275,16 @@ static int addr6_resolve(struct sockaddr_in6 *src_in,
592 goto put;
593 }
594
595 - neigh = dst->neighbour;
596 + rcu_read_lock();
597 + neigh = dst_get_neighbour(dst);
598 if (!neigh || !(neigh->nud_state & NUD_VALID)) {
599 - neigh_event_send(dst->neighbour, NULL);
600 + if (neigh)
601 + neigh_event_send(neigh, NULL);
602 ret = -ENODATA;
603 - goto put;
604 + } else {
605 + ret = rdma_copy_addr(addr, dst->dev, neigh->ha);
606 }
607 -
608 - ret = rdma_copy_addr(addr, dst->dev, neigh->ha);
609 + rcu_read_unlock();
610 put:
611 dst_release(dst);
612 return ret;
613 diff --git a/drivers/infiniband/hw/cxgb3/iwch_cm.c b/drivers/infiniband/hw/cxgb3/iwch_cm.c
614 index 2332dc2..e55ce7a 100644
615 --- a/drivers/infiniband/hw/cxgb3/iwch_cm.c
616 +++ b/drivers/infiniband/hw/cxgb3/iwch_cm.c
617 @@ -1328,6 +1328,7 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
618 struct iwch_ep *child_ep, *parent_ep = ctx;
619 struct cpl_pass_accept_req *req = cplhdr(skb);
620 unsigned int hwtid = GET_TID(req);
621 + struct neighbour *neigh;
622 struct dst_entry *dst;
623 struct l2t_entry *l2t;
624 struct rtable *rt;
625 @@ -1364,7 +1365,10 @@ static int pass_accept_req(struct t3cdev *tdev, struct sk_buff *skb, void *ctx)
626 goto reject;
627 }
628 dst = &rt->dst;
629 - l2t = t3_l2t_get(tdev, dst->neighbour, dst->neighbour->dev);
630 + rcu_read_lock();
631 + neigh = dst_get_neighbour(dst);
632 + l2t = t3_l2t_get(tdev, neigh, neigh->dev);
633 + rcu_read_unlock();
634 if (!l2t) {
635 printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n",
636 __func__);
637 @@ -1874,10 +1878,11 @@ static int is_loopback_dst(struct iw_cm_id *cm_id)
638
639 int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
640 {
641 - int err = 0;
642 struct iwch_dev *h = to_iwch_dev(cm_id->device);
643 + struct neighbour *neigh;
644 struct iwch_ep *ep;
645 struct rtable *rt;
646 + int err = 0;
647
648 if (is_loopback_dst(cm_id)) {
649 err = -ENOSYS;
650 @@ -1933,9 +1938,12 @@ int iwch_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
651 }
652 ep->dst = &rt->dst;
653
654 + rcu_read_lock();
655 + neigh = dst_get_neighbour(ep->dst);
656 +
657 /* get a l2t entry */
658 - ep->l2t = t3_l2t_get(ep->com.tdev, ep->dst->neighbour,
659 - ep->dst->neighbour->dev);
660 + ep->l2t = t3_l2t_get(ep->com.tdev, neigh, neigh->dev);
661 + rcu_read_unlock();
662 if (!ep->l2t) {
663 printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__);
664 err = -ENOMEM;
665 diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/cm.c
666 index 31fb440..daa93e9 100644
667 --- a/drivers/infiniband/hw/cxgb4/cm.c
668 +++ b/drivers/infiniband/hw/cxgb4/cm.c
669 @@ -1325,6 +1325,7 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
670 unsigned int stid = GET_POPEN_TID(ntohl(req->tos_stid));
671 struct tid_info *t = dev->rdev.lldi.tids;
672 unsigned int hwtid = GET_TID(req);
673 + struct neighbour *neigh;
674 struct dst_entry *dst;
675 struct l2t_entry *l2t;
676 struct rtable *rt;
677 @@ -1357,11 +1358,12 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
678 goto reject;
679 }
680 dst = &rt->dst;
681 - if (dst->neighbour->dev->flags & IFF_LOOPBACK) {
682 + rcu_read_lock();
683 + neigh = dst_get_neighbour(dst);
684 + if (neigh->dev->flags & IFF_LOOPBACK) {
685 pdev = ip_dev_find(&init_net, peer_ip);
686 BUG_ON(!pdev);
687 - l2t = cxgb4_l2t_get(dev->rdev.lldi.l2t, dst->neighbour,
688 - pdev, 0);
689 + l2t = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh, pdev, 0);
690 mtu = pdev->mtu;
691 tx_chan = cxgb4_port_chan(pdev);
692 smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1;
693 @@ -1372,18 +1374,18 @@ static int pass_accept_req(struct c4iw_dev *dev, struct sk_buff *skb)
694 rss_qid = dev->rdev.lldi.rxq_ids[cxgb4_port_idx(pdev) * step];
695 dev_put(pdev);
696 } else {
697 - l2t = cxgb4_l2t_get(dev->rdev.lldi.l2t, dst->neighbour,
698 - dst->neighbour->dev, 0);
699 + l2t = cxgb4_l2t_get(dev->rdev.lldi.l2t, neigh, neigh->dev, 0);
700 mtu = dst_mtu(dst);
701 - tx_chan = cxgb4_port_chan(dst->neighbour->dev);
702 - smac_idx = (cxgb4_port_viid(dst->neighbour->dev) & 0x7F) << 1;
703 + tx_chan = cxgb4_port_chan(neigh->dev);
704 + smac_idx = (cxgb4_port_viid(neigh->dev) & 0x7F) << 1;
705 step = dev->rdev.lldi.ntxq / dev->rdev.lldi.nchan;
706 - txq_idx = cxgb4_port_idx(dst->neighbour->dev) * step;
707 - ctrlq_idx = cxgb4_port_idx(dst->neighbour->dev);
708 + txq_idx = cxgb4_port_idx(neigh->dev) * step;
709 + ctrlq_idx = cxgb4_port_idx(neigh->dev);
710 step = dev->rdev.lldi.nrxq / dev->rdev.lldi.nchan;
711 rss_qid = dev->rdev.lldi.rxq_ids[
712 - cxgb4_port_idx(dst->neighbour->dev) * step];
713 + cxgb4_port_idx(neigh->dev) * step];
714 }
715 + rcu_read_unlock();
716 if (!l2t) {
717 printk(KERN_ERR MOD "%s - failed to allocate l2t entry!\n",
718 __func__);
719 @@ -1847,6 +1849,7 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
720 struct c4iw_ep *ep;
721 struct rtable *rt;
722 struct net_device *pdev;
723 + struct neighbour *neigh;
724 int step;
725
726 if ((conn_param->ord > c4iw_max_read_depth) ||
727 @@ -1908,14 +1911,16 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
728 }
729 ep->dst = &rt->dst;
730
731 + rcu_read_lock();
732 + neigh = dst_get_neighbour(ep->dst);
733 +
734 /* get a l2t entry */
735 - if (ep->dst->neighbour->dev->flags & IFF_LOOPBACK) {
736 + if (neigh->dev->flags & IFF_LOOPBACK) {
737 PDBG("%s LOOPBACK\n", __func__);
738 pdev = ip_dev_find(&init_net,
739 cm_id->remote_addr.sin_addr.s_addr);
740 ep->l2t = cxgb4_l2t_get(ep->com.dev->rdev.lldi.l2t,
741 - ep->dst->neighbour,
742 - pdev, 0);
743 + neigh, pdev, 0);
744 ep->mtu = pdev->mtu;
745 ep->tx_chan = cxgb4_port_chan(pdev);
746 ep->smac_idx = (cxgb4_port_viid(pdev) & 0x7F) << 1;
747 @@ -1930,21 +1935,20 @@ int c4iw_connect(struct iw_cm_id *cm_id, struct iw_cm_conn_param *conn_param)
748 dev_put(pdev);
749 } else {
750 ep->l2t = cxgb4_l2t_get(ep->com.dev->rdev.lldi.l2t,
751 - ep->dst->neighbour,
752 - ep->dst->neighbour->dev, 0);
753 + neigh, neigh->dev, 0);
754 ep->mtu = dst_mtu(ep->dst);
755 - ep->tx_chan = cxgb4_port_chan(ep->dst->neighbour->dev);
756 - ep->smac_idx = (cxgb4_port_viid(ep->dst->neighbour->dev) &
757 - 0x7F) << 1;
758 + ep->tx_chan = cxgb4_port_chan(neigh->dev);
759 + ep->smac_idx = (cxgb4_port_viid(neigh->dev) & 0x7F) << 1;
760 step = ep->com.dev->rdev.lldi.ntxq /
761 ep->com.dev->rdev.lldi.nchan;
762 - ep->txq_idx = cxgb4_port_idx(ep->dst->neighbour->dev) * step;
763 - ep->ctrlq_idx = cxgb4_port_idx(ep->dst->neighbour->dev);
764 + ep->txq_idx = cxgb4_port_idx(neigh->dev) * step;
765 + ep->ctrlq_idx = cxgb4_port_idx(neigh->dev);
766 step = ep->com.dev->rdev.lldi.nrxq /
767 ep->com.dev->rdev.lldi.nchan;
768 ep->rss_qid = ep->com.dev->rdev.lldi.rxq_ids[
769 - cxgb4_port_idx(ep->dst->neighbour->dev) * step];
770 + cxgb4_port_idx(neigh->dev) * step];
771 }
772 + rcu_read_unlock();
773 if (!ep->l2t) {
774 printk(KERN_ERR MOD "%s - cannot alloc l2e.\n", __func__);
775 err = -ENOMEM;
776 diff --git a/drivers/infiniband/hw/mlx4/mad.c b/drivers/infiniband/hw/mlx4/mad.c
777 index 57ffa50..44fc310 100644
778 --- a/drivers/infiniband/hw/mlx4/mad.c
779 +++ b/drivers/infiniband/hw/mlx4/mad.c
780 @@ -255,12 +255,9 @@ int mlx4_ib_process_mad(struct ib_device *ibdev, int mad_flags, u8 port_num,
781 return IB_MAD_RESULT_SUCCESS;
782
783 /*
784 - * Don't process SMInfo queries or vendor-specific
785 - * MADs -- the SMA can't handle them.
786 + * Don't process SMInfo queries -- the SMA can't handle them.
787 */
788 - if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO ||
789 - ((in_mad->mad_hdr.attr_id & IB_SMP_ATTR_VENDOR_MASK) ==
790 - IB_SMP_ATTR_VENDOR_MASK))
791 + if (in_mad->mad_hdr.attr_id == IB_SMP_ATTR_SM_INFO)
792 return IB_MAD_RESULT_SUCCESS;
793 } else if (in_mad->mad_hdr.mgmt_class == IB_MGMT_CLASS_PERF_MGMT ||
794 in_mad->mad_hdr.mgmt_class == MLX4_IB_VENDOR_CLASS1 ||
795 diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
796 index 2001f20..23c04ff 100644
797 --- a/drivers/infiniband/hw/mlx4/qp.c
798 +++ b/drivers/infiniband/hw/mlx4/qp.c
799 @@ -1301,7 +1301,7 @@ static int build_mlx_header(struct mlx4_ib_sqp *sqp, struct ib_send_wr *wr,
800 int is_eth;
801 int is_vlan = 0;
802 int is_grh;
803 - u16 vlan;
804 + u16 vlan = 0;
805
806 send_size = 0;
807 for (i = 0; i < wr->num_sge; ++i)
808 diff --git a/drivers/infiniband/hw/nes/nes_cm.c b/drivers/infiniband/hw/nes/nes_cm.c
809 index e74cdf9..a1f74f6 100644
810 --- a/drivers/infiniband/hw/nes/nes_cm.c
811 +++ b/drivers/infiniband/hw/nes/nes_cm.c
812 @@ -1150,9 +1150,11 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip, int arpi
813 neigh_release(neigh);
814 }
815
816 - if ((neigh == NULL) || (!(neigh->nud_state & NUD_VALID)))
817 - neigh_event_send(rt->dst.neighbour, NULL);
818 -
819 + if ((neigh == NULL) || (!(neigh->nud_state & NUD_VALID))) {
820 + rcu_read_lock();
821 + neigh_event_send(dst_get_neighbour(&rt->dst), NULL);
822 + rcu_read_unlock();
823 + }
824 ip_rt_put(rt);
825 return rc;
826 }
827 diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
828 index 86addca..a98c414 100644
829 --- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
830 +++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
831 @@ -555,14 +555,17 @@ static int path_rec_start(struct net_device *dev,
832 return 0;
833 }
834
835 +/* called with rcu_read_lock */
836 static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
837 {
838 struct ipoib_dev_priv *priv = netdev_priv(dev);
839 struct ipoib_path *path;
840 struct ipoib_neigh *neigh;
841 + struct neighbour *n;
842 unsigned long flags;
843
844 - neigh = ipoib_neigh_alloc(skb_dst(skb)->neighbour, skb->dev);
845 + n = dst_get_neighbour(skb_dst(skb));
846 + neigh = ipoib_neigh_alloc(n, skb->dev);
847 if (!neigh) {
848 ++dev->stats.tx_dropped;
849 dev_kfree_skb_any(skb);
850 @@ -571,9 +574,9 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
851
852 spin_lock_irqsave(&priv->lock, flags);
853
854 - path = __path_find(dev, skb_dst(skb)->neighbour->ha + 4);
855 + path = __path_find(dev, n->ha + 4);
856 if (!path) {
857 - path = path_rec_create(dev, skb_dst(skb)->neighbour->ha + 4);
858 + path = path_rec_create(dev, n->ha + 4);
859 if (!path)
860 goto err_path;
861
862 @@ -607,7 +610,7 @@ static void neigh_add_path(struct sk_buff *skb, struct net_device *dev)
863 }
864 } else {
865 spin_unlock_irqrestore(&priv->lock, flags);
866 - ipoib_send(dev, skb, path->ah, IPOIB_QPN(skb_dst(skb)->neighbour->ha));
867 + ipoib_send(dev, skb, path->ah, IPOIB_QPN(n->ha));
868 return;
869 }
870 } else {
871 @@ -634,20 +637,24 @@ err_drop:
872 spin_unlock_irqrestore(&priv->lock, flags);
873 }
874
875 +/* called with rcu_read_lock */
876 static void ipoib_path_lookup(struct sk_buff *skb, struct net_device *dev)
877 {
878 struct ipoib_dev_priv *priv = netdev_priv(skb->dev);
879 + struct dst_entry *dst = skb_dst(skb);
880 + struct neighbour *n;
881
882 /* Look up path record for unicasts */
883 - if (skb_dst(skb)->neighbour->ha[4] != 0xff) {
884 + n = dst_get_neighbour(dst);
885 + if (n->ha[4] != 0xff) {
886 neigh_add_path(skb, dev);
887 return;
888 }
889
890 /* Add in the P_Key for multicasts */
891 - skb_dst(skb)->neighbour->ha[8] = (priv->pkey >> 8) & 0xff;
892 - skb_dst(skb)->neighbour->ha[9] = priv->pkey & 0xff;
893 - ipoib_mcast_send(dev, skb_dst(skb)->neighbour->ha + 4, skb);
894 + n->ha[8] = (priv->pkey >> 8) & 0xff;
895 + n->ha[9] = priv->pkey & 0xff;
896 + ipoib_mcast_send(dev, n->ha + 4, skb);
897 }
898
899 static void unicast_arp_send(struct sk_buff *skb, struct net_device *dev,
900 @@ -712,18 +719,23 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
901 {
902 struct ipoib_dev_priv *priv = netdev_priv(dev);
903 struct ipoib_neigh *neigh;
904 + struct neighbour *n = NULL;
905 unsigned long flags;
906
907 - if (likely(skb_dst(skb) && skb_dst(skb)->neighbour)) {
908 - if (unlikely(!*to_ipoib_neigh(skb_dst(skb)->neighbour))) {
909 + rcu_read_lock();
910 + if (likely(skb_dst(skb)))
911 + n = dst_get_neighbour(skb_dst(skb));
912 +
913 + if (likely(n)) {
914 + if (unlikely(!*to_ipoib_neigh(n))) {
915 ipoib_path_lookup(skb, dev);
916 - return NETDEV_TX_OK;
917 + goto unlock;
918 }
919
920 - neigh = *to_ipoib_neigh(skb_dst(skb)->neighbour);
921 + neigh = *to_ipoib_neigh(n);
922
923 if (unlikely((memcmp(&neigh->dgid.raw,
924 - skb_dst(skb)->neighbour->ha + 4,
925 + n->ha + 4,
926 sizeof(union ib_gid))) ||
927 (neigh->dev != dev))) {
928 spin_lock_irqsave(&priv->lock, flags);
929 @@ -740,17 +752,17 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
930 ipoib_neigh_free(dev, neigh);
931 spin_unlock_irqrestore(&priv->lock, flags);
932 ipoib_path_lookup(skb, dev);
933 - return NETDEV_TX_OK;
934 + goto unlock;
935 }
936
937 if (ipoib_cm_get(neigh)) {
938 if (ipoib_cm_up(neigh)) {
939 ipoib_cm_send(dev, skb, ipoib_cm_get(neigh));
940 - return NETDEV_TX_OK;
941 + goto unlock;
942 }
943 } else if (neigh->ah) {
944 - ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(skb_dst(skb)->neighbour->ha));
945 - return NETDEV_TX_OK;
946 + ipoib_send(dev, skb, neigh->ah, IPOIB_QPN(n->ha));
947 + goto unlock;
948 }
949
950 if (skb_queue_len(&neigh->queue) < IPOIB_MAX_PATH_REC_QUEUE) {
951 @@ -784,13 +796,14 @@ static int ipoib_start_xmit(struct sk_buff *skb, struct net_device *dev)
952 phdr->hwaddr + 4);
953 dev_kfree_skb_any(skb);
954 ++dev->stats.tx_dropped;
955 - return NETDEV_TX_OK;
956 + goto unlock;
957 }
958
959 unicast_arp_send(skb, dev, phdr);
960 }
961 }
962 -
963 +unlock:
964 + rcu_read_unlock();
965 return NETDEV_TX_OK;
966 }
967
968 @@ -812,6 +825,8 @@ static int ipoib_hard_header(struct sk_buff *skb,
969 const void *daddr, const void *saddr, unsigned len)
970 {
971 struct ipoib_header *header;
972 + struct dst_entry *dst;
973 + struct neighbour *n;
974
975 header = (struct ipoib_header *) skb_push(skb, sizeof *header);
976
977 @@ -823,7 +838,11 @@ static int ipoib_hard_header(struct sk_buff *skb,
978 * destination address onto the front of the skb so we can
979 * figure out where to send the packet later.
980 */
981 - if ((!skb_dst(skb) || !skb_dst(skb)->neighbour) && daddr) {
982 + dst = skb_dst(skb);
983 + n = NULL;
984 + if (dst)
985 + n = dst_get_neighbour_raw(dst);
986 + if ((!dst || !n) && daddr) {
987 struct ipoib_pseudoheader *phdr =
988 (struct ipoib_pseudoheader *) skb_push(skb, sizeof *phdr);
989 memcpy(phdr->hwaddr, daddr, INFINIBAND_ALEN);
990 diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
991 index 3871ac6..a8d2a89 100644
992 --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
993 +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
994 @@ -258,11 +258,15 @@ static int ipoib_mcast_join_finish(struct ipoib_mcast *mcast,
995 netif_tx_lock_bh(dev);
996 while (!skb_queue_empty(&mcast->pkt_queue)) {
997 struct sk_buff *skb = skb_dequeue(&mcast->pkt_queue);
998 + struct dst_entry *dst = skb_dst(skb);
999 + struct neighbour *n = NULL;
1000 +
1001 netif_tx_unlock_bh(dev);
1002
1003 skb->dev = dev;
1004 -
1005 - if (!skb_dst(skb) || !skb_dst(skb)->neighbour) {
1006 + if (dst)
1007 + n = dst_get_neighbour_raw(dst);
1008 + if (!dst || !n) {
1009 /* put pseudoheader back on for next time */
1010 skb_push(skb, sizeof (struct ipoib_pseudoheader));
1011 }
1012 @@ -715,11 +719,15 @@ void ipoib_mcast_send(struct net_device *dev, void *mgid, struct sk_buff *skb)
1013
1014 out:
1015 if (mcast && mcast->ah) {
1016 - if (skb_dst(skb) &&
1017 - skb_dst(skb)->neighbour &&
1018 - !*to_ipoib_neigh(skb_dst(skb)->neighbour)) {
1019 - struct ipoib_neigh *neigh = ipoib_neigh_alloc(skb_dst(skb)->neighbour,
1020 - skb->dev);
1021 + struct dst_entry *dst = skb_dst(skb);
1022 + struct neighbour *n = NULL;
1023 +
1024 + rcu_read_lock();
1025 + if (dst)
1026 + n = dst_get_neighbour(dst);
1027 + if (n && !*to_ipoib_neigh(n)) {
1028 + struct ipoib_neigh *neigh = ipoib_neigh_alloc(n,
1029 + skb->dev);
1030
1031 if (neigh) {
1032 kref_get(&mcast->ah->ref);
1033 @@ -727,7 +735,7 @@ out:
1034 list_add_tail(&neigh->list, &mcast->neigh_list);
1035 }
1036 }
1037 -
1038 + rcu_read_unlock();
1039 spin_unlock_irqrestore(&priv->lock, flags);
1040 ipoib_send(dev, skb, mcast->ah, IB_MULTICAST_QPN);
1041 return;
1042 diff --git a/drivers/misc/cb710/core.c b/drivers/misc/cb710/core.c
1043 index efec413..b1f16d6 100644
1044 --- a/drivers/misc/cb710/core.c
1045 +++ b/drivers/misc/cb710/core.c
1046 @@ -244,6 +244,7 @@ static int __devinit cb710_probe(struct pci_dev *pdev,
1047 if (err)
1048 return err;
1049
1050 + spin_lock_init(&chip->irq_lock);
1051 chip->pdev = pdev;
1052 chip->iobase = pcim_iomap_table(pdev)[0];
1053
1054 diff --git a/drivers/net/cxgb3/cxgb3_offload.c b/drivers/net/cxgb3/cxgb3_offload.c
1055 index 3f2e12c..015b515 100644
1056 --- a/drivers/net/cxgb3/cxgb3_offload.c
1057 +++ b/drivers/net/cxgb3/cxgb3_offload.c
1058 @@ -971,7 +971,7 @@ static int nb_callback(struct notifier_block *self, unsigned long event,
1059 case (NETEVENT_REDIRECT):{
1060 struct netevent_redirect *nr = ctx;
1061 cxgb_redirect(nr->old, nr->new);
1062 - cxgb_neigh_update(nr->new->neighbour);
1063 + cxgb_neigh_update(dst_get_neighbour(nr->new));
1064 break;
1065 }
1066 default:
1067 @@ -1116,8 +1116,8 @@ static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
1068 struct l2t_entry *e;
1069 struct t3c_tid_entry *te;
1070
1071 - olddev = old->neighbour->dev;
1072 - newdev = new->neighbour->dev;
1073 + olddev = dst_get_neighbour(old)->dev;
1074 + newdev = dst_get_neighbour(new)->dev;
1075 if (!is_offloading(olddev))
1076 return;
1077 if (!is_offloading(newdev)) {
1078 @@ -1134,7 +1134,7 @@ static void cxgb_redirect(struct dst_entry *old, struct dst_entry *new)
1079 }
1080
1081 /* Add new L2T entry */
1082 - e = t3_l2t_get(tdev, new->neighbour, newdev);
1083 + e = t3_l2t_get(tdev, dst_get_neighbour(new), newdev);
1084 if (!e) {
1085 printk(KERN_ERR "%s: couldn't allocate new l2t entry!\n",
1086 __func__);
1087 diff --git a/drivers/pcmcia/ds.c b/drivers/pcmcia/ds.c
1088 index 749c2a1..1932029 100644
1089 --- a/drivers/pcmcia/ds.c
1090 +++ b/drivers/pcmcia/ds.c
1091 @@ -1269,10 +1269,8 @@ static int pcmcia_bus_add(struct pcmcia_socket *skt)
1092
1093 static int pcmcia_bus_early_resume(struct pcmcia_socket *skt)
1094 {
1095 - if (!verify_cis_cache(skt)) {
1096 - pcmcia_put_socket(skt);
1097 + if (!verify_cis_cache(skt))
1098 return 0;
1099 - }
1100
1101 dev_dbg(&skt->dev, "cis mismatch - different card\n");
1102
1103 diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c
1104 index fd69da3..e2c9ac5 100644
1105 --- a/drivers/s390/net/qeth_l3_main.c
1106 +++ b/drivers/s390/net/qeth_l3_main.c
1107 @@ -2742,9 +2742,14 @@ static int qeth_l3_do_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
1108 int inline qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
1109 {
1110 int cast_type = RTN_UNSPEC;
1111 -
1112 - if (skb_dst(skb) && skb_dst(skb)->neighbour) {
1113 - cast_type = skb_dst(skb)->neighbour->type;
1114 + struct neighbour *n = NULL;
1115 + struct dst_entry *dst;
1116 +
1117 + dst = skb_dst(skb);
1118 + if (dst)
1119 + n = dst_get_neighbour(dst);
1120 + if (n) {
1121 + cast_type = n->type;
1122 if ((cast_type == RTN_BROADCAST) ||
1123 (cast_type == RTN_MULTICAST) ||
1124 (cast_type == RTN_ANYCAST))
1125 @@ -2787,6 +2792,9 @@ int inline qeth_l3_get_cast_type(struct qeth_card *card, struct sk_buff *skb)
1126 static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
1127 struct sk_buff *skb, int ipv, int cast_type)
1128 {
1129 + struct neighbour *n = NULL;
1130 + struct dst_entry *dst;
1131 +
1132 memset(hdr, 0, sizeof(struct qeth_hdr));
1133 hdr->hdr.l3.id = QETH_HEADER_TYPE_LAYER3;
1134 hdr->hdr.l3.ext_flags = 0;
1135 @@ -2804,13 +2812,16 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
1136 }
1137
1138 hdr->hdr.l3.length = skb->len - sizeof(struct qeth_hdr);
1139 + dst = skb_dst(skb);
1140 + if (dst)
1141 + n = dst_get_neighbour(dst);
1142 if (ipv == 4) {
1143 /* IPv4 */
1144 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags4(cast_type);
1145 memset(hdr->hdr.l3.dest_addr, 0, 12);
1146 - if ((skb_dst(skb)) && (skb_dst(skb)->neighbour)) {
1147 + if (n) {
1148 *((u32 *) (&hdr->hdr.l3.dest_addr[12])) =
1149 - *((u32 *) skb_dst(skb)->neighbour->primary_key);
1150 + *((u32 *) n->primary_key);
1151 } else {
1152 /* fill in destination address used in ip header */
1153 *((u32 *) (&hdr->hdr.l3.dest_addr[12])) =
1154 @@ -2821,9 +2832,9 @@ static void qeth_l3_fill_header(struct qeth_card *card, struct qeth_hdr *hdr,
1155 hdr->hdr.l3.flags = qeth_l3_get_qeth_hdr_flags6(cast_type);
1156 if (card->info.type == QETH_CARD_TYPE_IQD)
1157 hdr->hdr.l3.flags &= ~QETH_HDR_PASSTHRU;
1158 - if ((skb_dst(skb)) && (skb_dst(skb)->neighbour)) {
1159 + if (n) {
1160 memcpy(hdr->hdr.l3.dest_addr,
1161 - skb_dst(skb)->neighbour->primary_key, 16);
1162 + n->primary_key, 16);
1163 } else {
1164 /* fill in destination address used in ip header */
1165 memcpy(hdr->hdr.l3.dest_addr,
1166 diff --git a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
1167 index b2d6611..143f268 100644
1168 --- a/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
1169 +++ b/drivers/scsi/cxgbi/cxgb3i/cxgb3i.c
1170 @@ -985,7 +985,7 @@ static int init_act_open(struct cxgbi_sock *csk)
1171 csk->saddr.sin_addr.s_addr = chba->ipv4addr;
1172
1173 csk->rss_qid = 0;
1174 - csk->l2t = t3_l2t_get(t3dev, dst->neighbour, ndev);
1175 + csk->l2t = t3_l2t_get(t3dev, dst_get_neighbour(dst), ndev);
1176 if (!csk->l2t) {
1177 pr_err("NO l2t available.\n");
1178 return -EINVAL;
1179 diff --git a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
1180 index f3a4cd7..ae13c49 100644
1181 --- a/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
1182 +++ b/drivers/scsi/cxgbi/cxgb4i/cxgb4i.c
1183 @@ -1160,7 +1160,7 @@ static int init_act_open(struct cxgbi_sock *csk)
1184 cxgbi_sock_set_flag(csk, CTPF_HAS_ATID);
1185 cxgbi_sock_get(csk);
1186
1187 - csk->l2t = cxgb4_l2t_get(lldi->l2t, csk->dst->neighbour, ndev, 0);
1188 + csk->l2t = cxgb4_l2t_get(lldi->l2t, dst_get_neighbour(csk->dst), ndev, 0);
1189 if (!csk->l2t) {
1190 pr_err("%s, cannot alloc l2t.\n", ndev->name);
1191 goto rel_resource;
1192 diff --git a/drivers/scsi/cxgbi/libcxgbi.c b/drivers/scsi/cxgbi/libcxgbi.c
1193 index a2a9c7c..77ac217 100644
1194 --- a/drivers/scsi/cxgbi/libcxgbi.c
1195 +++ b/drivers/scsi/cxgbi/libcxgbi.c
1196 @@ -492,7 +492,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
1197 goto err_out;
1198 }
1199 dst = &rt->dst;
1200 - ndev = dst->neighbour->dev;
1201 + ndev = dst_get_neighbour(dst)->dev;
1202
1203 if (rt->rt_flags & (RTCF_MULTICAST | RTCF_BROADCAST)) {
1204 pr_info("multi-cast route %pI4, port %u, dev %s.\n",
1205 @@ -506,7 +506,7 @@ static struct cxgbi_sock *cxgbi_check_route(struct sockaddr *dst_addr)
1206 ndev = ip_dev_find(&init_net, daddr->sin_addr.s_addr);
1207 mtu = ndev->mtu;
1208 pr_info("rt dev %s, loopback -> %s, mtu %u.\n",
1209 - dst->neighbour->dev->name, ndev->name, mtu);
1210 + dst_get_neighbour(dst)->dev->name, ndev->name, mtu);
1211 }
1212
1213 cdev = cxgbi_device_find_by_netdev(ndev, &port);
1214 diff --git a/drivers/staging/asus_oled/asus_oled.c b/drivers/staging/asus_oled/asus_oled.c
1215 index 7bb7da7..63bafbb 100644
1216 --- a/drivers/staging/asus_oled/asus_oled.c
1217 +++ b/drivers/staging/asus_oled/asus_oled.c
1218 @@ -355,7 +355,14 @@ static void send_data(struct asus_oled_dev *odev)
1219
1220 static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
1221 {
1222 - while (count-- > 0 && val) {
1223 + odev->last_val = val;
1224 +
1225 + if (val == 0) {
1226 + odev->buf_offs += count;
1227 + return 0;
1228 + }
1229 +
1230 + while (count-- > 0) {
1231 size_t x = odev->buf_offs % odev->width;
1232 size_t y = odev->buf_offs / odev->width;
1233 size_t i;
1234 @@ -406,7 +413,6 @@ static int append_values(struct asus_oled_dev *odev, uint8_t val, size_t count)
1235 ;
1236 }
1237
1238 - odev->last_val = val;
1239 odev->buf_offs++;
1240 }
1241
1242 @@ -805,10 +811,9 @@ error:
1243
1244 static void __exit asus_oled_exit(void)
1245 {
1246 + usb_deregister(&oled_driver);
1247 class_remove_file(oled_class, &class_attr_version.attr);
1248 class_destroy(oled_class);
1249 -
1250 - usb_deregister(&oled_driver);
1251 }
1252
1253 module_init(asus_oled_init);
1254 diff --git a/drivers/staging/rtl8712/usb_intf.c b/drivers/staging/rtl8712/usb_intf.c
1255 index 6cb7e28..6d88d1a 100644
1256 --- a/drivers/staging/rtl8712/usb_intf.c
1257 +++ b/drivers/staging/rtl8712/usb_intf.c
1258 @@ -86,6 +86,7 @@ static struct usb_device_id rtl871x_usb_id_tbl[] = {
1259 {USB_DEVICE(0x0DF6, 0x0045)},
1260 {USB_DEVICE(0x0DF6, 0x0059)}, /* 11n mode disable */
1261 {USB_DEVICE(0x0DF6, 0x004B)},
1262 + {USB_DEVICE(0x0DF6, 0x005B)},
1263 {USB_DEVICE(0x0DF6, 0x005D)},
1264 {USB_DEVICE(0x0DF6, 0x0063)},
1265 /* Sweex */
1266 diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c
1267 index b662db3..98e12d3 100644
1268 --- a/drivers/target/target_core_pr.c
1269 +++ b/drivers/target/target_core_pr.c
1270 @@ -471,6 +471,7 @@ static int core_scsi3_pr_seq_non_holder(
1271 case READ_MEDIA_SERIAL_NUMBER:
1272 case REPORT_LUNS:
1273 case REQUEST_SENSE:
1274 + case PERSISTENT_RESERVE_IN:
1275 ret = 0; /*/ Allowed CDBs */
1276 break;
1277 default:
1278 @@ -3079,7 +3080,7 @@ static int core_scsi3_pro_preempt(
1279 if (!(calling_it_nexus))
1280 core_scsi3_ua_allocate(pr_reg_nacl,
1281 pr_res_mapped_lun, 0x2A,
1282 - ASCQ_2AH_RESERVATIONS_PREEMPTED);
1283 + ASCQ_2AH_REGISTRATIONS_PREEMPTED);
1284 }
1285 spin_unlock(&pr_tmpl->registration_lock);
1286 /*
1287 @@ -3191,7 +3192,7 @@ static int core_scsi3_pro_preempt(
1288 * additional sense code set to REGISTRATIONS PREEMPTED;
1289 */
1290 core_scsi3_ua_allocate(pr_reg_nacl, pr_res_mapped_lun, 0x2A,
1291 - ASCQ_2AH_RESERVATIONS_PREEMPTED);
1292 + ASCQ_2AH_REGISTRATIONS_PREEMPTED);
1293 }
1294 spin_unlock(&pr_tmpl->registration_lock);
1295 /*
1296 diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
1297 index bb86655..d3a7342 100644
1298 --- a/drivers/target/target_core_transport.c
1299 +++ b/drivers/target/target_core_transport.c
1300 @@ -5709,8 +5709,8 @@ int transport_send_check_condition_and_sense(
1301 /* CURRENT ERROR */
1302 buffer[offset] = 0x70;
1303 buffer[offset+SPC_ADD_SENSE_LEN_OFFSET] = 10;
1304 - /* ABORTED COMMAND */
1305 - buffer[offset+SPC_SENSE_KEY_OFFSET] = ABORTED_COMMAND;
1306 + /* ILLEGAL REQUEST */
1307 + buffer[offset+SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST;
1308 /* INVALID FIELD IN CDB */
1309 buffer[offset+SPC_ASC_KEY_OFFSET] = 0x24;
1310 break;
1311 @@ -5718,8 +5718,8 @@ int transport_send_check_condition_and_sense(
1312 /* CURRENT ERROR */
1313 buffer[offset] = 0x70;
1314 buffer[offset+SPC_ADD_SENSE_LEN_OFFSET] = 10;
1315 - /* ABORTED COMMAND */
1316 - buffer[offset+SPC_SENSE_KEY_OFFSET] = ABORTED_COMMAND;
1317 + /* ILLEGAL REQUEST */
1318 + buffer[offset+SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST;
1319 /* INVALID FIELD IN PARAMETER LIST */
1320 buffer[offset+SPC_ASC_KEY_OFFSET] = 0x26;
1321 break;
1322 diff --git a/drivers/tty/vt/vt_ioctl.c b/drivers/tty/vt/vt_ioctl.c
1323 index 5e096f4..65447c5 100644
1324 --- a/drivers/tty/vt/vt_ioctl.c
1325 +++ b/drivers/tty/vt/vt_ioctl.c
1326 @@ -1463,7 +1463,6 @@ compat_kdfontop_ioctl(struct compat_console_font_op __user *fontop,
1327 if (!perm && op->op != KD_FONT_OP_GET)
1328 return -EPERM;
1329 op->data = compat_ptr(((struct compat_console_font_op *)op)->data);
1330 - op->flags |= KD_FONT_FLAG_OLD;
1331 i = con_font_op(vc, op);
1332 if (i)
1333 return i;
1334 diff --git a/drivers/usb/gadget/f_loopback.c b/drivers/usb/gadget/f_loopback.c
1335 index b37960f..0e64a47 100644
1336 --- a/drivers/usb/gadget/f_loopback.c
1337 +++ b/drivers/usb/gadget/f_loopback.c
1338 @@ -373,7 +373,7 @@ int __init loopback_add(struct usb_composite_dev *cdev, bool autoresume)
1339
1340 /* support autoresume for remote wakeup testing */
1341 if (autoresume)
1342 - sourcesink_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
1343 + loopback_driver.bmAttributes |= USB_CONFIG_ATT_WAKEUP;
1344
1345 /* support OTG systems */
1346 if (gadget_is_otg(cdev->gadget)) {
1347 diff --git a/drivers/usb/host/pci-quirks.c b/drivers/usb/host/pci-quirks.c
1348 index 23e04fb..20f2f21 100644
1349 --- a/drivers/usb/host/pci-quirks.c
1350 +++ b/drivers/usb/host/pci-quirks.c
1351 @@ -866,6 +866,12 @@ hc_init:
1352
1353 static void __devinit quirk_usb_early_handoff(struct pci_dev *pdev)
1354 {
1355 + /* Skip Netlogic mips SoC's internal PCI USB controller.
1356 + * This device does not need/support EHCI/OHCI handoff
1357 + */
1358 + if (pdev->vendor == 0x184e) /* vendor Netlogic */
1359 + return;
1360 +
1361 if (pdev->class == PCI_CLASS_SERIAL_USB_UHCI)
1362 quirk_usb_handoff_uhci(pdev);
1363 else if (pdev->class == PCI_CLASS_SERIAL_USB_OHCI)
1364 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1365 index a872cc2..78c7d42 100644
1366 --- a/drivers/usb/serial/ftdi_sio.c
1367 +++ b/drivers/usb/serial/ftdi_sio.c
1368 @@ -838,6 +838,7 @@ static struct usb_device_id id_table_combined [] = {
1369 { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LOGBOOKML_PID) },
1370 { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_LS_LOGBOOK_PID) },
1371 { USB_DEVICE(FTDI_VID, FTDI_SCIENCESCOPE_HS_LOGBOOK_PID) },
1372 + { USB_DEVICE(FTDI_VID, FTDI_CINTERION_MC55I_PID) },
1373 { USB_DEVICE(FTDI_VID, FTDI_DOTEC_PID) },
1374 { USB_DEVICE(QIHARDWARE_VID, MILKYMISTONE_JTAGSERIAL_PID),
1375 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1376 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1377 index 76d4f31..4eb7715 100644
1378 --- a/drivers/usb/serial/ftdi_sio_ids.h
1379 +++ b/drivers/usb/serial/ftdi_sio_ids.h
1380 @@ -1187,3 +1187,10 @@
1381 */
1382 /* ZigBee controller */
1383 #define FTDI_RF_R106 0x8A28
1384 +
1385 +/*
1386 + * Product: HCP HIT GPRS modem
1387 + * Manufacturer: HCP d.o.o.
1388 + * ATI command output: Cinterion MC55i
1389 + */
1390 +#define FTDI_CINTERION_MC55I_PID 0xA951
1391 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1392 index 2a9ed6e..338d082 100644
1393 --- a/drivers/usb/serial/option.c
1394 +++ b/drivers/usb/serial/option.c
1395 @@ -855,6 +855,18 @@ static const struct usb_device_id option_ids[] = {
1396 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0083, 0xff, 0xff, 0xff) },
1397 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0086, 0xff, 0xff, 0xff) },
1398 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0087, 0xff, 0xff, 0xff) },
1399 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0088, 0xff, 0xff, 0xff) },
1400 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0089, 0xff, 0xff, 0xff) },
1401 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0090, 0xff, 0xff, 0xff) },
1402 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0091, 0xff, 0xff, 0xff) },
1403 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0092, 0xff, 0xff, 0xff) },
1404 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0093, 0xff, 0xff, 0xff) },
1405 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0094, 0xff, 0xff, 0xff) },
1406 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0095, 0xff, 0xff, 0xff) },
1407 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0096, 0xff, 0xff, 0xff) },
1408 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0097, 0xff, 0xff, 0xff) },
1409 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0098, 0xff, 0xff, 0xff) },
1410 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0099, 0xff, 0xff, 0xff) },
1411 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0104, 0xff, 0xff, 0xff),
1412 .driver_info = (kernel_ulong_t)&net_intf4_blacklist },
1413 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0105, 0xff, 0xff, 0xff) },
1414 @@ -883,7 +895,6 @@ static const struct usb_device_id option_ids[] = {
1415 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0151, 0xff, 0xff, 0xff) },
1416 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0152, 0xff, 0xff, 0xff) },
1417 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0153, 0xff, 0xff, 0xff) },
1418 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0154, 0xff, 0xff, 0xff) },
1419 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0155, 0xff, 0xff, 0xff) },
1420 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0156, 0xff, 0xff, 0xff) },
1421 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0157, 0xff, 0xff, 0xff) },
1422 @@ -892,6 +903,12 @@ static const struct usb_device_id option_ids[] = {
1423 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0160, 0xff, 0xff, 0xff) },
1424 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0161, 0xff, 0xff, 0xff) },
1425 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0162, 0xff, 0xff, 0xff) },
1426 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0164, 0xff, 0xff, 0xff) },
1427 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) },
1428 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0168, 0xff, 0xff, 0xff) },
1429 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0170, 0xff, 0xff, 0xff) },
1430 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0176, 0xff, 0xff, 0xff) },
1431 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0178, 0xff, 0xff, 0xff) },
1432 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1008, 0xff, 0xff, 0xff) },
1433 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1010, 0xff, 0xff, 0xff) },
1434 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1012, 0xff, 0xff, 0xff) },
1435 @@ -1066,6 +1083,116 @@ static const struct usb_device_id option_ids[] = {
1436 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1298, 0xff, 0xff, 0xff) },
1437 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1299, 0xff, 0xff, 0xff) },
1438 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1300, 0xff, 0xff, 0xff) },
1439 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1401, 0xff, 0xff, 0xff) },
1440 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1402, 0xff, 0xff, 0xff) },
1441 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1403, 0xff, 0xff, 0xff) },
1442 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1404, 0xff, 0xff, 0xff) },
1443 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1405, 0xff, 0xff, 0xff) },
1444 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1406, 0xff, 0xff, 0xff) },
1445 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1407, 0xff, 0xff, 0xff) },
1446 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1408, 0xff, 0xff, 0xff) },
1447 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1409, 0xff, 0xff, 0xff) },
1448 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1410, 0xff, 0xff, 0xff) },
1449 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1411, 0xff, 0xff, 0xff) },
1450 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1412, 0xff, 0xff, 0xff) },
1451 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1413, 0xff, 0xff, 0xff) },
1452 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1414, 0xff, 0xff, 0xff) },
1453 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1415, 0xff, 0xff, 0xff) },
1454 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1416, 0xff, 0xff, 0xff) },
1455 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1417, 0xff, 0xff, 0xff) },
1456 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1418, 0xff, 0xff, 0xff) },
1457 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1419, 0xff, 0xff, 0xff) },
1458 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1420, 0xff, 0xff, 0xff) },
1459 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1421, 0xff, 0xff, 0xff) },
1460 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1422, 0xff, 0xff, 0xff) },
1461 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1423, 0xff, 0xff, 0xff) },
1462 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1424, 0xff, 0xff, 0xff) },
1463 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1425, 0xff, 0xff, 0xff) },
1464 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1426, 0xff, 0xff, 0xff) },
1465 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1427, 0xff, 0xff, 0xff) },
1466 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1428, 0xff, 0xff, 0xff) },
1467 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1429, 0xff, 0xff, 0xff) },
1468 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1430, 0xff, 0xff, 0xff) },
1469 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1431, 0xff, 0xff, 0xff) },
1470 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1432, 0xff, 0xff, 0xff) },
1471 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1433, 0xff, 0xff, 0xff) },
1472 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1434, 0xff, 0xff, 0xff) },
1473 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1435, 0xff, 0xff, 0xff) },
1474 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1436, 0xff, 0xff, 0xff) },
1475 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1437, 0xff, 0xff, 0xff) },
1476 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1438, 0xff, 0xff, 0xff) },
1477 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1439, 0xff, 0xff, 0xff) },
1478 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1440, 0xff, 0xff, 0xff) },
1479 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1441, 0xff, 0xff, 0xff) },
1480 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1442, 0xff, 0xff, 0xff) },
1481 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1443, 0xff, 0xff, 0xff) },
1482 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1444, 0xff, 0xff, 0xff) },
1483 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1445, 0xff, 0xff, 0xff) },
1484 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1446, 0xff, 0xff, 0xff) },
1485 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1447, 0xff, 0xff, 0xff) },
1486 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1448, 0xff, 0xff, 0xff) },
1487 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1449, 0xff, 0xff, 0xff) },
1488 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1450, 0xff, 0xff, 0xff) },
1489 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1451, 0xff, 0xff, 0xff) },
1490 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1452, 0xff, 0xff, 0xff) },
1491 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1453, 0xff, 0xff, 0xff) },
1492 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1454, 0xff, 0xff, 0xff) },
1493 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1455, 0xff, 0xff, 0xff) },
1494 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1456, 0xff, 0xff, 0xff) },
1495 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1457, 0xff, 0xff, 0xff) },
1496 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1458, 0xff, 0xff, 0xff) },
1497 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1459, 0xff, 0xff, 0xff) },
1498 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1460, 0xff, 0xff, 0xff) },
1499 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1461, 0xff, 0xff, 0xff) },
1500 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1462, 0xff, 0xff, 0xff) },
1501 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1463, 0xff, 0xff, 0xff) },
1502 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1464, 0xff, 0xff, 0xff) },
1503 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1465, 0xff, 0xff, 0xff) },
1504 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1466, 0xff, 0xff, 0xff) },
1505 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1467, 0xff, 0xff, 0xff) },
1506 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1468, 0xff, 0xff, 0xff) },
1507 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1469, 0xff, 0xff, 0xff) },
1508 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1470, 0xff, 0xff, 0xff) },
1509 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1471, 0xff, 0xff, 0xff) },
1510 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1472, 0xff, 0xff, 0xff) },
1511 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1473, 0xff, 0xff, 0xff) },
1512 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1474, 0xff, 0xff, 0xff) },
1513 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1475, 0xff, 0xff, 0xff) },
1514 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1476, 0xff, 0xff, 0xff) },
1515 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1477, 0xff, 0xff, 0xff) },
1516 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1478, 0xff, 0xff, 0xff) },
1517 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1479, 0xff, 0xff, 0xff) },
1518 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1480, 0xff, 0xff, 0xff) },
1519 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1481, 0xff, 0xff, 0xff) },
1520 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1482, 0xff, 0xff, 0xff) },
1521 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1483, 0xff, 0xff, 0xff) },
1522 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1484, 0xff, 0xff, 0xff) },
1523 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1485, 0xff, 0xff, 0xff) },
1524 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1486, 0xff, 0xff, 0xff) },
1525 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1487, 0xff, 0xff, 0xff) },
1526 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1488, 0xff, 0xff, 0xff) },
1527 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1489, 0xff, 0xff, 0xff) },
1528 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1490, 0xff, 0xff, 0xff) },
1529 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1491, 0xff, 0xff, 0xff) },
1530 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1492, 0xff, 0xff, 0xff) },
1531 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1493, 0xff, 0xff, 0xff) },
1532 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1494, 0xff, 0xff, 0xff) },
1533 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1495, 0xff, 0xff, 0xff) },
1534 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1496, 0xff, 0xff, 0xff) },
1535 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1497, 0xff, 0xff, 0xff) },
1536 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1498, 0xff, 0xff, 0xff) },
1537 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1499, 0xff, 0xff, 0xff) },
1538 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1500, 0xff, 0xff, 0xff) },
1539 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1501, 0xff, 0xff, 0xff) },
1540 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1502, 0xff, 0xff, 0xff) },
1541 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1503, 0xff, 0xff, 0xff) },
1542 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1504, 0xff, 0xff, 0xff) },
1543 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1505, 0xff, 0xff, 0xff) },
1544 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1506, 0xff, 0xff, 0xff) },
1545 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1507, 0xff, 0xff, 0xff) },
1546 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1508, 0xff, 0xff, 0xff) },
1547 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1509, 0xff, 0xff, 0xff) },
1548 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1510, 0xff, 0xff, 0xff) },
1549 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0014, 0xff, 0xff, 0xff) }, /* ZTE CDMA products */
1550 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0027, 0xff, 0xff, 0xff) },
1551 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0059, 0xff, 0xff, 0xff) },
1552 diff --git a/drivers/video/atmel_lcdfb.c b/drivers/video/atmel_lcdfb.c
1553 index 4484c72..c2ceae4 100644
1554 --- a/drivers/video/atmel_lcdfb.c
1555 +++ b/drivers/video/atmel_lcdfb.c
1556 @@ -1085,7 +1085,7 @@ static int atmel_lcdfb_suspend(struct platform_device *pdev, pm_message_t mesg)
1557 */
1558 lcdc_writel(sinfo, ATMEL_LCDC_IDR, ~0UL);
1559
1560 - sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_VAL);
1561 + sinfo->saved_lcdcon = lcdc_readl(sinfo, ATMEL_LCDC_CONTRAST_CTR);
1562 lcdc_writel(sinfo, ATMEL_LCDC_CONTRAST_CTR, 0);
1563 if (sinfo->atmel_lcdfb_power_control)
1564 sinfo->atmel_lcdfb_power_control(0);
1565 diff --git a/fs/cifs/sess.c b/fs/cifs/sess.c
1566 index d3e6196..0cfae19 100644
1567 --- a/fs/cifs/sess.c
1568 +++ b/fs/cifs/sess.c
1569 @@ -244,16 +244,15 @@ static void ascii_ssetup_strings(char **pbcc_area, struct cifs_ses *ses,
1570 /* copy user */
1571 /* BB what about null user mounts - check that we do this BB */
1572 /* copy user */
1573 - if (ses->user_name != NULL)
1574 + if (ses->user_name != NULL) {
1575 strncpy(bcc_ptr, ses->user_name, MAX_USERNAME_SIZE);
1576 + bcc_ptr += strnlen(ses->user_name, MAX_USERNAME_SIZE);
1577 + }
1578 /* else null user mount */
1579 -
1580 - bcc_ptr += strnlen(ses->user_name, MAX_USERNAME_SIZE);
1581 *bcc_ptr = 0;
1582 bcc_ptr++; /* account for null termination */
1583
1584 /* copy domain */
1585 -
1586 if (ses->domainName != NULL) {
1587 strncpy(bcc_ptr, ses->domainName, 256);
1588 bcc_ptr += strnlen(ses->domainName, 256);
1589 diff --git a/fs/ecryptfs/read_write.c b/fs/ecryptfs/read_write.c
1590 index 54eb14c..608c1c3 100644
1591 --- a/fs/ecryptfs/read_write.c
1592 +++ b/fs/ecryptfs/read_write.c
1593 @@ -130,7 +130,7 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
1594 pgoff_t ecryptfs_page_idx = (pos >> PAGE_CACHE_SHIFT);
1595 size_t start_offset_in_page = (pos & ~PAGE_CACHE_MASK);
1596 size_t num_bytes = (PAGE_CACHE_SIZE - start_offset_in_page);
1597 - size_t total_remaining_bytes = ((offset + size) - pos);
1598 + loff_t total_remaining_bytes = ((offset + size) - pos);
1599
1600 if (fatal_signal_pending(current)) {
1601 rc = -EINTR;
1602 @@ -141,7 +141,7 @@ int ecryptfs_write(struct inode *ecryptfs_inode, char *data, loff_t offset,
1603 num_bytes = total_remaining_bytes;
1604 if (pos < offset) {
1605 /* remaining zeros to write, up to destination offset */
1606 - size_t total_remaining_zeros = (offset - pos);
1607 + loff_t total_remaining_zeros = (offset - pos);
1608
1609 if (num_bytes > total_remaining_zeros)
1610 num_bytes = total_remaining_zeros;
1611 diff --git a/fs/proc/base.c b/fs/proc/base.c
1612 index 7b28f27..22794e8 100644
1613 --- a/fs/proc/base.c
1614 +++ b/fs/proc/base.c
1615 @@ -775,6 +775,13 @@ static int mem_open(struct inode* inode, struct file* file)
1616 if (IS_ERR(mm))
1617 return PTR_ERR(mm);
1618
1619 + if (mm) {
1620 + /* ensure this mm_struct can't be freed */
1621 + atomic_inc(&mm->mm_count);
1622 + /* but do not pin its memory */
1623 + mmput(mm);
1624 + }
1625 +
1626 /* OK to pass negative loff_t, we can catch out-of-range */
1627 file->f_mode |= FMODE_UNSIGNED_OFFSET;
1628 file->private_data = mm;
1629 @@ -782,57 +789,13 @@ static int mem_open(struct inode* inode, struct file* file)
1630 return 0;
1631 }
1632
1633 -static ssize_t mem_read(struct file * file, char __user * buf,
1634 - size_t count, loff_t *ppos)
1635 +static ssize_t mem_rw(struct file *file, char __user *buf,
1636 + size_t count, loff_t *ppos, int write)
1637 {
1638 - int ret;
1639 - char *page;
1640 - unsigned long src = *ppos;
1641 struct mm_struct *mm = file->private_data;
1642 -
1643 - if (!mm)
1644 - return 0;
1645 -
1646 - page = (char *)__get_free_page(GFP_TEMPORARY);
1647 - if (!page)
1648 - return -ENOMEM;
1649 -
1650 - ret = 0;
1651 -
1652 - while (count > 0) {
1653 - int this_len, retval;
1654 -
1655 - this_len = (count > PAGE_SIZE) ? PAGE_SIZE : count;
1656 - retval = access_remote_vm(mm, src, page, this_len, 0);
1657 - if (!retval) {
1658 - if (!ret)
1659 - ret = -EIO;
1660 - break;
1661 - }
1662 -
1663 - if (copy_to_user(buf, page, retval)) {
1664 - ret = -EFAULT;
1665 - break;
1666 - }
1667 -
1668 - ret += retval;
1669 - src += retval;
1670 - buf += retval;
1671 - count -= retval;
1672 - }
1673 - *ppos = src;
1674 -
1675 - free_page((unsigned long) page);
1676 - return ret;
1677 -}
1678 -
1679 -static ssize_t mem_write(struct file * file, const char __user *buf,
1680 - size_t count, loff_t *ppos)
1681 -{
1682 - int copied;
1683 + unsigned long addr = *ppos;
1684 + ssize_t copied;
1685 char *page;
1686 - unsigned long dst = *ppos;
1687 - struct mm_struct *mm = file->private_data;
1688
1689 if (!mm)
1690 return 0;
1691 @@ -842,31 +805,54 @@ static ssize_t mem_write(struct file * file, const char __user *buf,
1692 return -ENOMEM;
1693
1694 copied = 0;
1695 + if (!atomic_inc_not_zero(&mm->mm_users))
1696 + goto free;
1697 +
1698 while (count > 0) {
1699 - int this_len, retval;
1700 + int this_len = min_t(int, count, PAGE_SIZE);
1701
1702 - this_len = (count > PAGE_SIZE) ? PAGE_SIZE : count;
1703 - if (copy_from_user(page, buf, this_len)) {
1704 + if (write && copy_from_user(page, buf, this_len)) {
1705 copied = -EFAULT;
1706 break;
1707 }
1708 - retval = access_remote_vm(mm, dst, page, this_len, 1);
1709 - if (!retval) {
1710 +
1711 + this_len = access_remote_vm(mm, addr, page, this_len, write);
1712 + if (!this_len) {
1713 if (!copied)
1714 copied = -EIO;
1715 break;
1716 }
1717 - copied += retval;
1718 - buf += retval;
1719 - dst += retval;
1720 - count -= retval;
1721 +
1722 + if (!write && copy_to_user(buf, page, this_len)) {
1723 + copied = -EFAULT;
1724 + break;
1725 + }
1726 +
1727 + buf += this_len;
1728 + addr += this_len;
1729 + copied += this_len;
1730 + count -= this_len;
1731 }
1732 - *ppos = dst;
1733 + *ppos = addr;
1734
1735 + mmput(mm);
1736 +free:
1737 free_page((unsigned long) page);
1738 return copied;
1739 }
1740
1741 +static ssize_t mem_read(struct file *file, char __user *buf,
1742 + size_t count, loff_t *ppos)
1743 +{
1744 + return mem_rw(file, buf, count, ppos, 0);
1745 +}
1746 +
1747 +static ssize_t mem_write(struct file *file, const char __user *buf,
1748 + size_t count, loff_t *ppos)
1749 +{
1750 + return mem_rw(file, (char __user*)buf, count, ppos, 1);
1751 +}
1752 +
1753 loff_t mem_lseek(struct file *file, loff_t offset, int orig)
1754 {
1755 switch (orig) {
1756 @@ -886,8 +872,8 @@ loff_t mem_lseek(struct file *file, loff_t offset, int orig)
1757 static int mem_release(struct inode *inode, struct file *file)
1758 {
1759 struct mm_struct *mm = file->private_data;
1760 -
1761 - mmput(mm);
1762 + if (mm)
1763 + mmdrop(mm);
1764 return 0;
1765 }
1766
1767 diff --git a/fs/udf/super.c b/fs/udf/super.c
1768 index 7b27b06..7f0e18a 100644
1769 --- a/fs/udf/super.c
1770 +++ b/fs/udf/super.c
1771 @@ -1830,6 +1830,12 @@ static void udf_close_lvid(struct super_block *sb)
1772 le16_to_cpu(lvid->descTag.descCRCLength)));
1773
1774 lvid->descTag.tagChecksum = udf_tag_checksum(&lvid->descTag);
1775 + /*
1776 + * We set buffer uptodate unconditionally here to avoid spurious
1777 + * warnings from mark_buffer_dirty() when previous EIO has marked
1778 + * the buffer as !uptodate
1779 + */
1780 + set_buffer_uptodate(bh);
1781 mark_buffer_dirty(bh);
1782 sbi->s_lvid_dirty = 0;
1783 mutex_unlock(&sbi->s_alloc_mutex);
1784 diff --git a/include/net/arp.h b/include/net/arp.h
1785 index 91f0568..fb0eb90 100644
1786 --- a/include/net/arp.h
1787 +++ b/include/net/arp.h
1788 @@ -16,6 +16,7 @@ extern void arp_send(int type, int ptype, __be32 dest_ip,
1789 const unsigned char *dest_hw,
1790 const unsigned char *src_hw, const unsigned char *th);
1791 extern int arp_bind_neighbour(struct dst_entry *dst);
1792 +extern struct neighbour *__arp_bind_neighbour(struct dst_entry *dst, __be32 nexthop);
1793 extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir);
1794 extern void arp_ifdown(struct net_device *dev);
1795
1796 diff --git a/include/net/dst.h b/include/net/dst.h
1797 index e12ddfb..d020134 100644
1798 --- a/include/net/dst.h
1799 +++ b/include/net/dst.h
1800 @@ -37,7 +37,7 @@ struct dst_entry {
1801 unsigned long _metrics;
1802 unsigned long expires;
1803 struct dst_entry *path;
1804 - struct neighbour *neighbour;
1805 + struct neighbour __rcu *_neighbour;
1806 struct hh_cache *hh;
1807 #ifdef CONFIG_XFRM
1808 struct xfrm_state *xfrm;
1809 @@ -86,6 +86,21 @@ struct dst_entry {
1810 };
1811 };
1812
1813 +static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst)
1814 +{
1815 + return rcu_dereference(dst->_neighbour);
1816 +}
1817 +
1818 +static inline struct neighbour *dst_get_neighbour_raw(struct dst_entry *dst)
1819 +{
1820 + return rcu_dereference_raw(dst->_neighbour);
1821 +}
1822 +
1823 +static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh)
1824 +{
1825 + rcu_assign_pointer(dst->_neighbour, neigh);
1826 +}
1827 +
1828 extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old);
1829 extern const u32 dst_default_metrics[RTAX_MAX];
1830
1831 @@ -371,8 +386,14 @@ static inline void dst_rcu_free(struct rcu_head *head)
1832
1833 static inline void dst_confirm(struct dst_entry *dst)
1834 {
1835 - if (dst)
1836 - neigh_confirm(dst->neighbour);
1837 + if (dst) {
1838 + struct neighbour *n;
1839 +
1840 + rcu_read_lock();
1841 + n = dst_get_neighbour(dst);
1842 + neigh_confirm(n);
1843 + rcu_read_unlock();
1844 + }
1845 }
1846
1847 static inline void dst_link_failure(struct sk_buff *skb)
1848 diff --git a/kernel/kprobes.c b/kernel/kprobes.c
1849 index e0f0bdd..749340c 100644
1850 --- a/kernel/kprobes.c
1851 +++ b/kernel/kprobes.c
1852 @@ -1660,8 +1660,12 @@ static int __kprobes pre_handler_kretprobe(struct kprobe *p,
1853 ri->rp = rp;
1854 ri->task = current;
1855
1856 - if (rp->entry_handler && rp->entry_handler(ri, regs))
1857 + if (rp->entry_handler && rp->entry_handler(ri, regs)) {
1858 + raw_spin_lock_irqsave(&rp->lock, flags);
1859 + hlist_add_head(&ri->hlist, &rp->free_instances);
1860 + raw_spin_unlock_irqrestore(&rp->lock, flags);
1861 return 0;
1862 + }
1863
1864 arch_prepare_kretprobe(ri, regs);
1865
1866 diff --git a/kernel/panic.c b/kernel/panic.c
1867 index 6923167..8e48cf6 100644
1868 --- a/kernel/panic.c
1869 +++ b/kernel/panic.c
1870 @@ -236,8 +236,16 @@ void add_taint(unsigned flag)
1871 * Also we want to keep up lockdep for staging development and
1872 * post-warning case.
1873 */
1874 - if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off())
1875 - printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
1876 + switch (flag) {
1877 + case TAINT_CRAP:
1878 + case TAINT_WARN:
1879 + case TAINT_FIRMWARE_WORKAROUND:
1880 + break;
1881 +
1882 + default:
1883 + if (__debug_locks_off())
1884 + printk(KERN_WARNING "Disabling lock debugging due to kernel taint\n");
1885 + }
1886
1887 set_bit(flag, &tainted_mask);
1888 }
1889 diff --git a/kernel/sched_rt.c b/kernel/sched_rt.c
1890 index 17f2319..ac79f9e3 100644
1891 --- a/kernel/sched_rt.c
1892 +++ b/kernel/sched_rt.c
1893 @@ -1390,6 +1390,11 @@ static int push_rt_task(struct rq *rq)
1894 if (!next_task)
1895 return 0;
1896
1897 +#ifdef __ARCH_WANT_INTERRUPTS_ON_CTXSW
1898 + if (unlikely(task_running(rq, next_task)))
1899 + return 0;
1900 +#endif
1901 +
1902 retry:
1903 if (unlikely(next_task == rq->curr)) {
1904 WARN_ON(1);
1905 diff --git a/mm/compaction.c b/mm/compaction.c
1906 index 6cc604b..c4bc5ac 100644
1907 --- a/mm/compaction.c
1908 +++ b/mm/compaction.c
1909 @@ -320,12 +320,34 @@ static isolate_migrate_t isolate_migratepages(struct zone *zone,
1910 } else if (!locked)
1911 spin_lock_irq(&zone->lru_lock);
1912
1913 + /*
1914 + * migrate_pfn does not necessarily start aligned to a
1915 + * pageblock. Ensure that pfn_valid is called when moving
1916 + * into a new MAX_ORDER_NR_PAGES range in case of large
1917 + * memory holes within the zone
1918 + */
1919 + if ((low_pfn & (MAX_ORDER_NR_PAGES - 1)) == 0) {
1920 + if (!pfn_valid(low_pfn)) {
1921 + low_pfn += MAX_ORDER_NR_PAGES - 1;
1922 + continue;
1923 + }
1924 + }
1925 +
1926 if (!pfn_valid_within(low_pfn))
1927 continue;
1928 nr_scanned++;
1929
1930 - /* Get the page and skip if free */
1931 + /*
1932 + * Get the page and ensure the page is within the same zone.
1933 + * See the comment in isolate_freepages about overlapping
1934 + * nodes. It is deliberate that the new zone lock is not taken
1935 + * as memory compaction should not move pages between nodes.
1936 + */
1937 page = pfn_to_page(low_pfn);
1938 + if (page_zone(page) != zone)
1939 + continue;
1940 +
1941 + /* Skip if free */
1942 if (PageBuddy(page))
1943 continue;
1944
1945 diff --git a/mm/filemap.c b/mm/filemap.c
1946 index 3c981ba..b7d8603 100644
1947 --- a/mm/filemap.c
1948 +++ b/mm/filemap.c
1949 @@ -1379,15 +1379,12 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
1950 unsigned long seg = 0;
1951 size_t count;
1952 loff_t *ppos = &iocb->ki_pos;
1953 - struct blk_plug plug;
1954
1955 count = 0;
1956 retval = generic_segment_checks(iov, &nr_segs, &count, VERIFY_WRITE);
1957 if (retval)
1958 return retval;
1959
1960 - blk_start_plug(&plug);
1961 -
1962 /* coalesce the iovecs and go direct-to-BIO for O_DIRECT */
1963 if (filp->f_flags & O_DIRECT) {
1964 loff_t size;
1965 @@ -1403,8 +1400,12 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
1966 retval = filemap_write_and_wait_range(mapping, pos,
1967 pos + iov_length(iov, nr_segs) - 1);
1968 if (!retval) {
1969 + struct blk_plug plug;
1970 +
1971 + blk_start_plug(&plug);
1972 retval = mapping->a_ops->direct_IO(READ, iocb,
1973 iov, pos, nr_segs);
1974 + blk_finish_plug(&plug);
1975 }
1976 if (retval > 0) {
1977 *ppos = pos + retval;
1978 @@ -1460,7 +1461,6 @@ generic_file_aio_read(struct kiocb *iocb, const struct iovec *iov,
1979 break;
1980 }
1981 out:
1982 - blk_finish_plug(&plug);
1983 return retval;
1984 }
1985 EXPORT_SYMBOL(generic_file_aio_read);
1986 diff --git a/mm/filemap_xip.c b/mm/filemap_xip.c
1987 index 93356cd..dee9429 100644
1988 --- a/mm/filemap_xip.c
1989 +++ b/mm/filemap_xip.c
1990 @@ -263,7 +263,12 @@ found:
1991 xip_pfn);
1992 if (err == -ENOMEM)
1993 return VM_FAULT_OOM;
1994 - BUG_ON(err);
1995 + /*
1996 + * err == -EBUSY is fine, we've raced against another thread
1997 + * that faulted-in the same page
1998 + */
1999 + if (err != -EBUSY)
2000 + BUG_ON(err);
2001 return VM_FAULT_NOPAGE;
2002 } else {
2003 int err, ret = VM_FAULT_OOM;
2004 diff --git a/mm/huge_memory.c b/mm/huge_memory.c
2005 index cc5acf9..78a83e7 100644
2006 --- a/mm/huge_memory.c
2007 +++ b/mm/huge_memory.c
2008 @@ -2020,7 +2020,7 @@ static void collect_mm_slot(struct mm_slot *mm_slot)
2009 {
2010 struct mm_struct *mm = mm_slot->mm;
2011
2012 - VM_BUG_ON(!spin_is_locked(&khugepaged_mm_lock));
2013 + VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&khugepaged_mm_lock));
2014
2015 if (khugepaged_test_exit(mm)) {
2016 /* free mm_slot */
2017 @@ -2048,7 +2048,7 @@ static unsigned int khugepaged_scan_mm_slot(unsigned int pages,
2018 int progress = 0;
2019
2020 VM_BUG_ON(!pages);
2021 - VM_BUG_ON(!spin_is_locked(&khugepaged_mm_lock));
2022 + VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&khugepaged_mm_lock));
2023
2024 if (khugepaged_scan.mm_slot)
2025 mm_slot = khugepaged_scan.mm_slot;
2026 diff --git a/mm/swap.c b/mm/swap.c
2027 index 87627f1..4a1fc6d 100644
2028 --- a/mm/swap.c
2029 +++ b/mm/swap.c
2030 @@ -667,7 +667,7 @@ void lru_add_page_tail(struct zone* zone,
2031 VM_BUG_ON(!PageHead(page));
2032 VM_BUG_ON(PageCompound(page_tail));
2033 VM_BUG_ON(PageLRU(page_tail));
2034 - VM_BUG_ON(!spin_is_locked(&zone->lru_lock));
2035 + VM_BUG_ON(NR_CPUS != 1 && !spin_is_locked(&zone->lru_lock));
2036
2037 SetPageLRU(page_tail);
2038
2039 diff --git a/net/atm/clip.c b/net/atm/clip.c
2040 index 1d4be60..5889074 100644
2041 --- a/net/atm/clip.c
2042 +++ b/net/atm/clip.c
2043 @@ -364,33 +364,37 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
2044 struct net_device *dev)
2045 {
2046 struct clip_priv *clip_priv = PRIV(dev);
2047 + struct dst_entry *dst = skb_dst(skb);
2048 struct atmarp_entry *entry;
2049 + struct neighbour *n;
2050 struct atm_vcc *vcc;
2051 int old;
2052 unsigned long flags;
2053
2054 pr_debug("(skb %p)\n", skb);
2055 - if (!skb_dst(skb)) {
2056 + if (!dst) {
2057 pr_err("skb_dst(skb) == NULL\n");
2058 dev_kfree_skb(skb);
2059 dev->stats.tx_dropped++;
2060 return NETDEV_TX_OK;
2061 }
2062 - if (!skb_dst(skb)->neighbour) {
2063 + n = dst_get_neighbour(dst);
2064 + if (!n) {
2065 #if 0
2066 - skb_dst(skb)->neighbour = clip_find_neighbour(skb_dst(skb), 1);
2067 - if (!skb_dst(skb)->neighbour) {
2068 + n = clip_find_neighbour(skb_dst(skb), 1);
2069 + if (!n) {
2070 dev_kfree_skb(skb); /* lost that one */
2071 dev->stats.tx_dropped++;
2072 return 0;
2073 }
2074 + dst_set_neighbour(dst, n);
2075 #endif
2076 pr_err("NO NEIGHBOUR !\n");
2077 dev_kfree_skb(skb);
2078 dev->stats.tx_dropped++;
2079 return NETDEV_TX_OK;
2080 }
2081 - entry = NEIGH2ENTRY(skb_dst(skb)->neighbour);
2082 + entry = NEIGH2ENTRY(n);
2083 if (!entry->vccs) {
2084 if (time_after(jiffies, entry->expires)) {
2085 /* should be resolved */
2086 @@ -407,7 +411,7 @@ static netdev_tx_t clip_start_xmit(struct sk_buff *skb,
2087 }
2088 pr_debug("neigh %p, vccs %p\n", entry, entry->vccs);
2089 ATM_SKB(skb)->vcc = vcc = entry->vccs->vcc;
2090 - pr_debug("using neighbour %p, vcc %p\n", skb_dst(skb)->neighbour, vcc);
2091 + pr_debug("using neighbour %p, vcc %p\n", n, vcc);
2092 if (entry->vccs->encap) {
2093 void *here;
2094
2095 diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c
2096 index 56149ec..3dc7f54 100644
2097 --- a/net/bridge/br_netfilter.c
2098 +++ b/net/bridge/br_netfilter.c
2099 @@ -343,24 +343,26 @@ static int br_nf_pre_routing_finish_ipv6(struct sk_buff *skb)
2100 static int br_nf_pre_routing_finish_bridge(struct sk_buff *skb)
2101 {
2102 struct nf_bridge_info *nf_bridge = skb->nf_bridge;
2103 + struct neighbour *neigh;
2104 struct dst_entry *dst;
2105
2106 skb->dev = bridge_parent(skb->dev);
2107 if (!skb->dev)
2108 goto free_skb;
2109 dst = skb_dst(skb);
2110 + neigh = dst_get_neighbour(dst);
2111 if (dst->hh) {
2112 neigh_hh_bridge(dst->hh, skb);
2113 skb->dev = nf_bridge->physindev;
2114 return br_handle_frame_finish(skb);
2115 - } else if (dst->neighbour) {
2116 + } else if (neigh) {
2117 /* the neighbour function below overwrites the complete
2118 * MAC header, so we save the Ethernet source address and
2119 * protocol number. */
2120 skb_copy_from_linear_data_offset(skb, -(ETH_HLEN-ETH_ALEN), skb->nf_bridge->data, ETH_HLEN-ETH_ALEN);
2121 /* tell br_dev_xmit to continue with forwarding */
2122 nf_bridge->mask |= BRNF_BRIDGED_DNAT;
2123 - return dst->neighbour->output(skb);
2124 + return neigh->output(skb);
2125 }
2126 free_skb:
2127 kfree_skb(skb);
2128 diff --git a/net/core/dst.c b/net/core/dst.c
2129 index 6135f36..8246d47 100644
2130 --- a/net/core/dst.c
2131 +++ b/net/core/dst.c
2132 @@ -171,7 +171,7 @@ void *dst_alloc(struct dst_ops *ops, struct net_device *dev,
2133 dst_init_metrics(dst, dst_default_metrics, true);
2134 dst->expires = 0UL;
2135 dst->path = dst;
2136 - dst->neighbour = NULL;
2137 + RCU_INIT_POINTER(dst->_neighbour, NULL);
2138 dst->hh = NULL;
2139 #ifdef CONFIG_XFRM
2140 dst->xfrm = NULL;
2141 @@ -231,7 +231,7 @@ struct dst_entry *dst_destroy(struct dst_entry * dst)
2142 smp_rmb();
2143
2144 again:
2145 - neigh = dst->neighbour;
2146 + neigh = rcu_dereference_protected(dst->_neighbour, 1);
2147 hh = dst->hh;
2148 child = dst->child;
2149
2150 @@ -240,7 +240,7 @@ again:
2151 hh_cache_put(hh);
2152
2153 if (neigh) {
2154 - dst->neighbour = NULL;
2155 + RCU_INIT_POINTER(dst->_neighbour, NULL);
2156 neigh_release(neigh);
2157 }
2158
2159 @@ -367,14 +367,19 @@ static void dst_ifdown(struct dst_entry *dst, struct net_device *dev,
2160 if (!unregister) {
2161 dst->input = dst->output = dst_discard;
2162 } else {
2163 + struct neighbour *neigh;
2164 +
2165 dst->dev = dev_net(dst->dev)->loopback_dev;
2166 dev_hold(dst->dev);
2167 dev_put(dev);
2168 - if (dst->neighbour && dst->neighbour->dev == dev) {
2169 - dst->neighbour->dev = dst->dev;
2170 + rcu_read_lock();
2171 + neigh = dst_get_neighbour(dst);
2172 + if (neigh && neigh->dev == dev) {
2173 + neigh->dev = dst->dev;
2174 dev_hold(dst->dev);
2175 dev_put(dev);
2176 }
2177 + rcu_read_unlock();
2178 }
2179 }
2180
2181 diff --git a/net/core/neighbour.c b/net/core/neighbour.c
2182 index 16db887..8c54aff 100644
2183 --- a/net/core/neighbour.c
2184 +++ b/net/core/neighbour.c
2185 @@ -1173,12 +1173,17 @@ int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
2186
2187 while (neigh->nud_state & NUD_VALID &&
2188 (skb = __skb_dequeue(&neigh->arp_queue)) != NULL) {
2189 - struct neighbour *n1 = neigh;
2190 + struct dst_entry *dst = skb_dst(skb);
2191 + struct neighbour *n2, *n1 = neigh;
2192 write_unlock_bh(&neigh->lock);
2193 +
2194 + rcu_read_lock();
2195 /* On shaper/eql skb->dst->neighbour != neigh :( */
2196 - if (skb_dst(skb) && skb_dst(skb)->neighbour)
2197 - n1 = skb_dst(skb)->neighbour;
2198 + if (dst && (n2 = dst_get_neighbour(dst)) != NULL)
2199 + n1 = n2;
2200 n1->output(skb);
2201 + rcu_read_unlock();
2202 +
2203 write_lock_bh(&neigh->lock);
2204 }
2205 skb_queue_purge(&neigh->arp_queue);
2206 @@ -1300,10 +1305,10 @@ EXPORT_SYMBOL(neigh_compat_output);
2207 int neigh_resolve_output(struct sk_buff *skb)
2208 {
2209 struct dst_entry *dst = skb_dst(skb);
2210 - struct neighbour *neigh;
2211 + struct neighbour *neigh = dst_get_neighbour(dst);
2212 int rc = 0;
2213
2214 - if (!dst || !(neigh = dst->neighbour))
2215 + if (!dst)
2216 goto discard;
2217
2218 __skb_pull(skb, skb_network_offset(skb));
2219 @@ -1333,7 +1338,7 @@ out:
2220 return rc;
2221 discard:
2222 NEIGH_PRINTK1("neigh_resolve_output: dst=%p neigh=%p\n",
2223 - dst, dst ? dst->neighbour : NULL);
2224 + dst, neigh);
2225 out_kfree_skb:
2226 rc = -EINVAL;
2227 kfree_skb(skb);
2228 @@ -1347,7 +1352,7 @@ int neigh_connected_output(struct sk_buff *skb)
2229 {
2230 int err;
2231 struct dst_entry *dst = skb_dst(skb);
2232 - struct neighbour *neigh = dst->neighbour;
2233 + struct neighbour *neigh = dst_get_neighbour(dst);
2234 struct net_device *dev = neigh->dev;
2235 unsigned int seq;
2236
2237 diff --git a/net/decnet/dn_neigh.c b/net/decnet/dn_neigh.c
2238 index 602dade..9810610 100644
2239 --- a/net/decnet/dn_neigh.c
2240 +++ b/net/decnet/dn_neigh.c
2241 @@ -208,7 +208,7 @@ static int dn_neigh_output_packet(struct sk_buff *skb)
2242 {
2243 struct dst_entry *dst = skb_dst(skb);
2244 struct dn_route *rt = (struct dn_route *)dst;
2245 - struct neighbour *neigh = dst->neighbour;
2246 + struct neighbour *neigh = dst_get_neighbour(dst);
2247 struct net_device *dev = neigh->dev;
2248 char mac_addr[ETH_ALEN];
2249
2250 @@ -227,7 +227,7 @@ static int dn_neigh_output_packet(struct sk_buff *skb)
2251 static int dn_long_output(struct sk_buff *skb)
2252 {
2253 struct dst_entry *dst = skb_dst(skb);
2254 - struct neighbour *neigh = dst->neighbour;
2255 + struct neighbour *neigh = dst_get_neighbour(dst);
2256 struct net_device *dev = neigh->dev;
2257 int headroom = dev->hard_header_len + sizeof(struct dn_long_packet) + 3;
2258 unsigned char *data;
2259 @@ -274,7 +274,7 @@ static int dn_long_output(struct sk_buff *skb)
2260 static int dn_short_output(struct sk_buff *skb)
2261 {
2262 struct dst_entry *dst = skb_dst(skb);
2263 - struct neighbour *neigh = dst->neighbour;
2264 + struct neighbour *neigh = dst_get_neighbour(dst);
2265 struct net_device *dev = neigh->dev;
2266 int headroom = dev->hard_header_len + sizeof(struct dn_short_packet) + 2;
2267 struct dn_short_packet *sp;
2268 @@ -318,7 +318,7 @@ static int dn_short_output(struct sk_buff *skb)
2269 static int dn_phase3_output(struct sk_buff *skb)
2270 {
2271 struct dst_entry *dst = skb_dst(skb);
2272 - struct neighbour *neigh = dst->neighbour;
2273 + struct neighbour *neigh = dst_get_neighbour(dst);
2274 struct net_device *dev = neigh->dev;
2275 int headroom = dev->hard_header_len + sizeof(struct dn_short_packet) + 2;
2276 struct dn_short_packet *sp;
2277 diff --git a/net/decnet/dn_route.c b/net/decnet/dn_route.c
2278 index 74544bc..b91b603 100644
2279 --- a/net/decnet/dn_route.c
2280 +++ b/net/decnet/dn_route.c
2281 @@ -241,9 +241,11 @@ static int dn_dst_gc(struct dst_ops *ops)
2282 */
2283 static void dn_dst_update_pmtu(struct dst_entry *dst, u32 mtu)
2284 {
2285 + struct neighbour *n = dst_get_neighbour(dst);
2286 u32 min_mtu = 230;
2287 - struct dn_dev *dn = dst->neighbour ?
2288 - rcu_dereference_raw(dst->neighbour->dev->dn_ptr) : NULL;
2289 + struct dn_dev *dn;
2290 +
2291 + dn = n ? rcu_dereference_raw(n->dev->dn_ptr) : NULL;
2292
2293 if (dn && dn->use_long == 0)
2294 min_mtu -= 6;
2295 @@ -715,7 +717,7 @@ static int dn_output(struct sk_buff *skb)
2296
2297 int err = -EINVAL;
2298
2299 - if ((neigh = dst->neighbour) == NULL)
2300 + if ((neigh = dst_get_neighbour(dst)) == NULL)
2301 goto error;
2302
2303 skb->dev = dev;
2304 @@ -750,7 +752,7 @@ static int dn_forward(struct sk_buff *skb)
2305 struct dst_entry *dst = skb_dst(skb);
2306 struct dn_dev *dn_db = rcu_dereference(dst->dev->dn_ptr);
2307 struct dn_route *rt;
2308 - struct neighbour *neigh = dst->neighbour;
2309 + struct neighbour *neigh = dst_get_neighbour(dst);
2310 int header_len;
2311 #ifdef CONFIG_NETFILTER
2312 struct net_device *dev = skb->dev;
2313 @@ -833,11 +835,11 @@ static int dn_rt_set_next_hop(struct dn_route *rt, struct dn_fib_res *res)
2314 }
2315 rt->rt_type = res->type;
2316
2317 - if (dev != NULL && rt->dst.neighbour == NULL) {
2318 + if (dev != NULL && dst_get_neighbour(&rt->dst) == NULL) {
2319 n = __neigh_lookup_errno(&dn_neigh_table, &rt->rt_gateway, dev);
2320 if (IS_ERR(n))
2321 return PTR_ERR(n);
2322 - rt->dst.neighbour = n;
2323 + dst_set_neighbour(&rt->dst, n);
2324 }
2325
2326 if (dst_metric(&rt->dst, RTAX_MTU) > rt->dst.dev->mtu)
2327 @@ -1144,7 +1146,7 @@ make_route:
2328 rt->rt_dst_map = fld.daddr;
2329 rt->rt_src_map = fld.saddr;
2330
2331 - rt->dst.neighbour = neigh;
2332 + dst_set_neighbour(&rt->dst, neigh);
2333 neigh = NULL;
2334
2335 rt->dst.lastuse = jiffies;
2336 @@ -1416,7 +1418,7 @@ make_route:
2337 rt->fld.flowidn_iif = in_dev->ifindex;
2338 rt->fld.flowidn_mark = fld.flowidn_mark;
2339
2340 - rt->dst.neighbour = neigh;
2341 + dst_set_neighbour(&rt->dst, neigh);
2342 rt->dst.lastuse = jiffies;
2343 rt->dst.output = dn_rt_bug;
2344 switch(res.type) {
2345 diff --git a/net/ipv4/arp.c b/net/ipv4/arp.c
2346 index 1b74d3b..1d5675e 100644
2347 --- a/net/ipv4/arp.c
2348 +++ b/net/ipv4/arp.c
2349 @@ -518,26 +518,32 @@ EXPORT_SYMBOL(arp_find);
2350
2351 /* END OF OBSOLETE FUNCTIONS */
2352
2353 +struct neighbour *__arp_bind_neighbour(struct dst_entry *dst, __be32 nexthop)
2354 +{
2355 + struct net_device *dev = dst->dev;
2356 +
2357 + if (dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT))
2358 + nexthop = 0;
2359 + return __neigh_lookup_errno(
2360 +#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
2361 + dev->type == ARPHRD_ATM ?
2362 + clip_tbl_hook :
2363 +#endif
2364 + &arp_tbl, &nexthop, dev);
2365 +}
2366 +
2367 int arp_bind_neighbour(struct dst_entry *dst)
2368 {
2369 struct net_device *dev = dst->dev;
2370 - struct neighbour *n = dst->neighbour;
2371 + struct neighbour *n = dst_get_neighbour(dst);
2372
2373 if (dev == NULL)
2374 return -EINVAL;
2375 if (n == NULL) {
2376 - __be32 nexthop = ((struct rtable *)dst)->rt_gateway;
2377 - if (dev->flags & (IFF_LOOPBACK | IFF_POINTOPOINT))
2378 - nexthop = 0;
2379 - n = __neigh_lookup_errno(
2380 -#if defined(CONFIG_ATM_CLIP) || defined(CONFIG_ATM_CLIP_MODULE)
2381 - dev->type == ARPHRD_ATM ?
2382 - clip_tbl_hook :
2383 -#endif
2384 - &arp_tbl, &nexthop, dev);
2385 + n = __arp_bind_neighbour(dst, ((struct rtable *)dst)->rt_gateway);
2386 if (IS_ERR(n))
2387 return PTR_ERR(n);
2388 - dst->neighbour = n;
2389 + dst_set_neighbour(dst, n);
2390 }
2391 return 0;
2392 }
2393 diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
2394 index 8871067..d7bb94c 100644
2395 --- a/net/ipv4/ip_gre.c
2396 +++ b/net/ipv4/ip_gre.c
2397 @@ -731,9 +731,9 @@ static netdev_tx_t ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev
2398 }
2399 #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
2400 else if (skb->protocol == htons(ETH_P_IPV6)) {
2401 + struct neighbour *neigh = dst_get_neighbour(skb_dst(skb));
2402 const struct in6_addr *addr6;
2403 int addr_type;
2404 - struct neighbour *neigh = skb_dst(skb)->neighbour;
2405
2406 if (neigh == NULL)
2407 goto tx_error;
2408 diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c
2409 index 0c99db4..51a3eec 100644
2410 --- a/net/ipv4/ip_output.c
2411 +++ b/net/ipv4/ip_output.c
2412 @@ -182,6 +182,8 @@ static inline int ip_finish_output2(struct sk_buff *skb)
2413 struct rtable *rt = (struct rtable *)dst;
2414 struct net_device *dev = dst->dev;
2415 unsigned int hh_len = LL_RESERVED_SPACE(dev);
2416 + struct neighbour *neigh;
2417 + int res;
2418
2419 if (rt->rt_type == RTN_MULTICAST) {
2420 IP_UPD_PO_STATS(dev_net(dev), IPSTATS_MIB_OUTMCAST, skb->len);
2421 @@ -203,10 +205,22 @@ static inline int ip_finish_output2(struct sk_buff *skb)
2422 skb = skb2;
2423 }
2424
2425 - if (dst->hh)
2426 - return neigh_hh_output(dst->hh, skb);
2427 - else if (dst->neighbour)
2428 - return dst->neighbour->output(skb);
2429 + rcu_read_lock();
2430 + if (dst->hh) {
2431 + int res = neigh_hh_output(dst->hh, skb);
2432 +
2433 + rcu_read_unlock();
2434 + return res;
2435 + } else {
2436 + neigh = dst_get_neighbour(dst);
2437 + if (neigh) {
2438 + res = neigh->output(skb);
2439 +
2440 + rcu_read_unlock();
2441 + return res;
2442 + }
2443 + rcu_read_unlock();
2444 + }
2445
2446 if (net_ratelimit())
2447 printk(KERN_DEBUG "ip_finish_output2: No header cache and no neighbour!\n");
2448 diff --git a/net/ipv4/route.c b/net/ipv4/route.c
2449 index 4845bfe..65ff2e5 100644
2450 --- a/net/ipv4/route.c
2451 +++ b/net/ipv4/route.c
2452 @@ -416,7 +416,13 @@ static int rt_cache_seq_show(struct seq_file *seq, void *v)
2453 "HHUptod\tSpecDst");
2454 else {
2455 struct rtable *r = v;
2456 - int len;
2457 + struct neighbour *n;
2458 + int len, HHUptod;
2459 +
2460 + rcu_read_lock();
2461 + n = dst_get_neighbour(&r->dst);
2462 + HHUptod = (n && (n->nud_state & NUD_CONNECTED)) ? 1 : 0;
2463 + rcu_read_unlock();
2464
2465 seq_printf(seq, "%s\t%08X\t%08X\t%8X\t%d\t%u\t%d\t"
2466 "%08X\t%d\t%u\t%u\t%02X\t%d\t%1d\t%08X%n",
2467 @@ -431,8 +437,7 @@ static int rt_cache_seq_show(struct seq_file *seq, void *v)
2468 dst_metric(&r->dst, RTAX_RTTVAR)),
2469 r->rt_key_tos,
2470 r->dst.hh ? atomic_read(&r->dst.hh->hh_refcnt) : -1,
2471 - r->dst.hh ? (r->dst.hh->hh_output ==
2472 - dev_queue_xmit) : 0,
2473 + HHUptod,
2474 r->rt_spec_dst, &len);
2475
2476 seq_printf(seq, "%*s\n", 127 - len, "");
2477 @@ -1688,23 +1693,25 @@ static int check_peer_redir(struct dst_entry *dst, struct inet_peer *peer)
2478 {
2479 struct rtable *rt = (struct rtable *) dst;
2480 __be32 orig_gw = rt->rt_gateway;
2481 + struct neighbour *n, *old_n;
2482
2483 dst_confirm(&rt->dst);
2484
2485 - neigh_release(rt->dst.neighbour);
2486 - rt->dst.neighbour = NULL;
2487 -
2488 rt->rt_gateway = peer->redirect_learned.a4;
2489 - if (arp_bind_neighbour(&rt->dst) ||
2490 - !(rt->dst.neighbour->nud_state & NUD_VALID)) {
2491 - if (rt->dst.neighbour)
2492 - neigh_event_send(rt->dst.neighbour, NULL);
2493 + n = __arp_bind_neighbour(&rt->dst, rt->rt_gateway);
2494 + if (IS_ERR(n))
2495 + return PTR_ERR(n);
2496 + old_n = xchg(&rt->dst._neighbour, n);
2497 + if (old_n)
2498 + neigh_release(old_n);
2499 + if (!n || !(n->nud_state & NUD_VALID)) {
2500 + if (n)
2501 + neigh_event_send(n, NULL);
2502 rt->rt_gateway = orig_gw;
2503 return -EAGAIN;
2504 } else {
2505 rt->rt_flags |= RTCF_REDIRECTED;
2506 - call_netevent_notifiers(NETEVENT_NEIGH_UPDATE,
2507 - rt->dst.neighbour);
2508 + call_netevent_notifiers(NETEVENT_NEIGH_UPDATE, n);
2509 }
2510 return 0;
2511 }
2512 diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c
2513 index 498b927..0f335c6 100644
2514 --- a/net/ipv6/addrconf.c
2515 +++ b/net/ipv6/addrconf.c
2516 @@ -656,7 +656,7 @@ ipv6_add_addr(struct inet6_dev *idev, const struct in6_addr *addr, int pfxlen,
2517 * layer address of our nexhop router
2518 */
2519
2520 - if (rt->rt6i_nexthop == NULL)
2521 + if (dst_get_neighbour_raw(&rt->dst) == NULL)
2522 ifa->flags &= ~IFA_F_OPTIMISTIC;
2523
2524 ifa->idev = idev;
2525 diff --git a/net/ipv6/ip6_fib.c b/net/ipv6/ip6_fib.c
2526 index 4076a0b..0f9b37a 100644
2527 --- a/net/ipv6/ip6_fib.c
2528 +++ b/net/ipv6/ip6_fib.c
2529 @@ -1455,7 +1455,7 @@ static int fib6_age(struct rt6_info *rt, void *arg)
2530 RT6_TRACE("aging clone %p\n", rt);
2531 return -1;
2532 } else if ((rt->rt6i_flags & RTF_GATEWAY) &&
2533 - (!(rt->rt6i_nexthop->flags & NTF_ROUTER))) {
2534 + (!(dst_get_neighbour_raw(&rt->dst)->flags & NTF_ROUTER))) {
2535 RT6_TRACE("purging route %p via non-router but gateway\n",
2536 rt);
2537 return -1;
2538 diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c
2539 index e17596b..9cbf176 100644
2540 --- a/net/ipv6/ip6_output.c
2541 +++ b/net/ipv6/ip6_output.c
2542 @@ -100,6 +100,8 @@ static int ip6_finish_output2(struct sk_buff *skb)
2543 {
2544 struct dst_entry *dst = skb_dst(skb);
2545 struct net_device *dev = dst->dev;
2546 + struct neighbour *neigh;
2547 + int res;
2548
2549 skb->protocol = htons(ETH_P_IPV6);
2550 skb->dev = dev;
2551 @@ -134,10 +136,22 @@ static int ip6_finish_output2(struct sk_buff *skb)
2552 skb->len);
2553 }
2554
2555 - if (dst->hh)
2556 - return neigh_hh_output(dst->hh, skb);
2557 - else if (dst->neighbour)
2558 - return dst->neighbour->output(skb);
2559 + rcu_read_lock();
2560 + if (dst->hh) {
2561 + res = neigh_hh_output(dst->hh, skb);
2562 +
2563 + rcu_read_unlock();
2564 + return res;
2565 + } else {
2566 + neigh = dst_get_neighbour(dst);
2567 + if (neigh) {
2568 + res = neigh->output(skb);
2569 +
2570 + rcu_read_unlock();
2571 + return res;
2572 + }
2573 + rcu_read_unlock();
2574 + }
2575
2576 IP6_INC_STATS_BH(dev_net(dst->dev),
2577 ip6_dst_idev(dst), IPSTATS_MIB_OUTNOROUTES);
2578 @@ -385,6 +399,7 @@ int ip6_forward(struct sk_buff *skb)
2579 struct ipv6hdr *hdr = ipv6_hdr(skb);
2580 struct inet6_skb_parm *opt = IP6CB(skb);
2581 struct net *net = dev_net(dst->dev);
2582 + struct neighbour *n;
2583 u32 mtu;
2584
2585 if (net->ipv6.devconf_all->forwarding == 0)
2586 @@ -459,11 +474,10 @@ int ip6_forward(struct sk_buff *skb)
2587 send redirects to source routed frames.
2588 We don't send redirects to frames decapsulated from IPsec.
2589 */
2590 - if (skb->dev == dst->dev && dst->neighbour && opt->srcrt == 0 &&
2591 - !skb_sec_path(skb)) {
2592 + n = dst_get_neighbour(dst);
2593 + if (skb->dev == dst->dev && n && opt->srcrt == 0 && !skb_sec_path(skb)) {
2594 struct in6_addr *target = NULL;
2595 struct rt6_info *rt;
2596 - struct neighbour *n = dst->neighbour;
2597
2598 /*
2599 * incoming and outgoing devices are the same
2600 @@ -949,8 +963,11 @@ out:
2601 static int ip6_dst_lookup_tail(struct sock *sk,
2602 struct dst_entry **dst, struct flowi6 *fl6)
2603 {
2604 - int err;
2605 struct net *net = sock_net(sk);
2606 +#ifdef CONFIG_IPV6_OPTIMISTIC_DAD
2607 + struct neighbour *n;
2608 +#endif
2609 + int err;
2610
2611 if (*dst == NULL)
2612 *dst = ip6_route_output(net, sk, fl6);
2613 @@ -976,11 +993,14 @@ static int ip6_dst_lookup_tail(struct sock *sk,
2614 * dst entry and replace it instead with the
2615 * dst entry of the nexthop router
2616 */
2617 - if ((*dst)->neighbour && !((*dst)->neighbour->nud_state & NUD_VALID)) {
2618 + rcu_read_lock();
2619 + n = dst_get_neighbour(*dst);
2620 + if (n && !(n->nud_state & NUD_VALID)) {
2621 struct inet6_ifaddr *ifp;
2622 struct flowi6 fl_gw6;
2623 int redirect;
2624
2625 + rcu_read_unlock();
2626 ifp = ipv6_get_ifaddr(net, &fl6->saddr,
2627 (*dst)->dev, 1);
2628
2629 @@ -1000,6 +1020,8 @@ static int ip6_dst_lookup_tail(struct sock *sk,
2630 if ((err = (*dst)->error))
2631 goto out_err_release;
2632 }
2633 + } else {
2634 + rcu_read_unlock();
2635 }
2636 #endif
2637
2638 diff --git a/net/ipv6/ndisc.c b/net/ipv6/ndisc.c
2639 index 7596f07..10a8d41 100644
2640 --- a/net/ipv6/ndisc.c
2641 +++ b/net/ipv6/ndisc.c
2642 @@ -1244,7 +1244,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
2643 rt = rt6_get_dflt_router(&ipv6_hdr(skb)->saddr, skb->dev);
2644
2645 if (rt)
2646 - neigh = rt->rt6i_nexthop;
2647 + neigh = dst_get_neighbour(&rt->dst);
2648
2649 if (rt && lifetime == 0) {
2650 neigh_clone(neigh);
2651 @@ -1265,7 +1265,7 @@ static void ndisc_router_discovery(struct sk_buff *skb)
2652 return;
2653 }
2654
2655 - neigh = rt->rt6i_nexthop;
2656 + neigh = dst_get_neighbour(&rt->dst);
2657 if (neigh == NULL) {
2658 ND_PRINTK0(KERN_ERR
2659 "ICMPv6 RA: %s() got default router without neighbour.\n",
2660 diff --git a/net/ipv6/route.c b/net/ipv6/route.c
2661 index 0ef1f08..e70e902 100644
2662 --- a/net/ipv6/route.c
2663 +++ b/net/ipv6/route.c
2664 @@ -356,7 +356,7 @@ out:
2665 #ifdef CONFIG_IPV6_ROUTER_PREF
2666 static void rt6_probe(struct rt6_info *rt)
2667 {
2668 - struct neighbour *neigh = rt ? rt->rt6i_nexthop : NULL;
2669 + struct neighbour *neigh;
2670 /*
2671 * Okay, this does not seem to be appropriate
2672 * for now, however, we need to check if it
2673 @@ -365,8 +365,10 @@ static void rt6_probe(struct rt6_info *rt)
2674 * Router Reachability Probe MUST be rate-limited
2675 * to no more than one per minute.
2676 */
2677 + rcu_read_lock();
2678 + neigh = rt ? dst_get_neighbour(&rt->dst) : NULL;
2679 if (!neigh || (neigh->nud_state & NUD_VALID))
2680 - return;
2681 + goto out;
2682 read_lock_bh(&neigh->lock);
2683 if (!(neigh->nud_state & NUD_VALID) &&
2684 time_after(jiffies, neigh->updated + rt->rt6i_idev->cnf.rtr_probe_interval)) {
2685 @@ -379,8 +381,11 @@ static void rt6_probe(struct rt6_info *rt)
2686 target = (struct in6_addr *)&neigh->primary_key;
2687 addrconf_addr_solict_mult(target, &mcaddr);
2688 ndisc_send_ns(rt->rt6i_dev, NULL, target, &mcaddr, NULL);
2689 - } else
2690 + } else {
2691 read_unlock_bh(&neigh->lock);
2692 + }
2693 +out:
2694 + rcu_read_unlock();
2695 }
2696 #else
2697 static inline void rt6_probe(struct rt6_info *rt)
2698 @@ -404,8 +409,11 @@ static inline int rt6_check_dev(struct rt6_info *rt, int oif)
2699
2700 static inline int rt6_check_neigh(struct rt6_info *rt)
2701 {
2702 - struct neighbour *neigh = rt->rt6i_nexthop;
2703 + struct neighbour *neigh;
2704 int m;
2705 +
2706 + rcu_read_lock();
2707 + neigh = dst_get_neighbour(&rt->dst);
2708 if (rt->rt6i_flags & RTF_NONEXTHOP ||
2709 !(rt->rt6i_flags & RTF_GATEWAY))
2710 m = 1;
2711 @@ -422,6 +430,7 @@ static inline int rt6_check_neigh(struct rt6_info *rt)
2712 read_unlock_bh(&neigh->lock);
2713 } else
2714 m = 0;
2715 + rcu_read_unlock();
2716 return m;
2717 }
2718
2719 @@ -745,8 +754,7 @@ static struct rt6_info *rt6_alloc_cow(struct rt6_info *ort, const struct in6_add
2720 dst_free(&rt->dst);
2721 return NULL;
2722 }
2723 - rt->rt6i_nexthop = neigh;
2724 -
2725 + dst_set_neighbour(&rt->dst, neigh);
2726 }
2727
2728 return rt;
2729 @@ -760,7 +768,7 @@ static struct rt6_info *rt6_alloc_clone(struct rt6_info *ort, const struct in6_a
2730 rt->rt6i_dst.plen = 128;
2731 rt->rt6i_flags |= RTF_CACHE;
2732 rt->dst.flags |= DST_HOST;
2733 - rt->rt6i_nexthop = neigh_clone(ort->rt6i_nexthop);
2734 + dst_set_neighbour(&rt->dst, neigh_clone(dst_get_neighbour_raw(&ort->dst)));
2735 }
2736 return rt;
2737 }
2738 @@ -794,7 +802,7 @@ restart:
2739 dst_hold(&rt->dst);
2740 read_unlock_bh(&table->tb6_lock);
2741
2742 - if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP))
2743 + if (!dst_get_neighbour_raw(&rt->dst) && !(rt->rt6i_flags & RTF_NONEXTHOP))
2744 nrt = rt6_alloc_cow(rt, &fl6->daddr, &fl6->saddr);
2745 else if (!(rt->dst.flags & DST_HOST))
2746 nrt = rt6_alloc_clone(rt, &fl6->daddr);
2747 @@ -1058,7 +1066,7 @@ struct dst_entry *icmp6_dst_alloc(struct net_device *dev,
2748 }
2749
2750 rt->rt6i_idev = idev;
2751 - rt->rt6i_nexthop = neigh;
2752 + dst_set_neighbour(&rt->dst, neigh);
2753 atomic_set(&rt->dst.__refcnt, 1);
2754 dst_metric_set(&rt->dst, RTAX_HOPLIMIT, 255);
2755 rt->dst.output = ip6_output;
2756 @@ -1338,12 +1346,12 @@ int ip6_route_add(struct fib6_config *cfg)
2757 rt->rt6i_prefsrc.plen = 0;
2758
2759 if (cfg->fc_flags & (RTF_GATEWAY | RTF_NONEXTHOP)) {
2760 - rt->rt6i_nexthop = __neigh_lookup_errno(&nd_tbl, &rt->rt6i_gateway, dev);
2761 - if (IS_ERR(rt->rt6i_nexthop)) {
2762 - err = PTR_ERR(rt->rt6i_nexthop);
2763 - rt->rt6i_nexthop = NULL;
2764 + struct neighbour *neigh = __neigh_lookup_errno(&nd_tbl, &rt->rt6i_gateway, dev);
2765 + if (IS_ERR(neigh)) {
2766 + err = PTR_ERR(neigh);
2767 goto out;
2768 }
2769 + dst_set_neighbour(&rt->dst, neigh);
2770 }
2771
2772 rt->rt6i_flags = cfg->fc_flags;
2773 @@ -1574,7 +1582,7 @@ void rt6_redirect(const struct in6_addr *dest, const struct in6_addr *src,
2774 dst_confirm(&rt->dst);
2775
2776 /* Duplicate redirect: silently ignore. */
2777 - if (neigh == rt->dst.neighbour)
2778 + if (neigh == dst_get_neighbour_raw(&rt->dst))
2779 goto out;
2780
2781 nrt = ip6_rt_copy(rt);
2782 @@ -1590,7 +1598,7 @@ void rt6_redirect(const struct in6_addr *dest, const struct in6_addr *src,
2783 nrt->dst.flags |= DST_HOST;
2784
2785 ipv6_addr_copy(&nrt->rt6i_gateway, (struct in6_addr*)neigh->primary_key);
2786 - nrt->rt6i_nexthop = neigh_clone(neigh);
2787 + dst_set_neighbour(&nrt->dst, neigh_clone(neigh));
2788
2789 if (ip6_ins_rt(nrt))
2790 goto out;
2791 @@ -1670,7 +1678,7 @@ again:
2792 1. It is connected route. Action: COW
2793 2. It is gatewayed route or NONEXTHOP route. Action: clone it.
2794 */
2795 - if (!rt->rt6i_nexthop && !(rt->rt6i_flags & RTF_NONEXTHOP))
2796 + if (!dst_get_neighbour_raw(&rt->dst) && !(rt->rt6i_flags & RTF_NONEXTHOP))
2797 nrt = rt6_alloc_cow(rt, daddr, saddr);
2798 else
2799 nrt = rt6_alloc_clone(rt, daddr);
2800 @@ -2035,7 +2043,7 @@ struct rt6_info *addrconf_dst_alloc(struct inet6_dev *idev,
2801
2802 return ERR_CAST(neigh);
2803 }
2804 - rt->rt6i_nexthop = neigh;
2805 + dst_set_neighbour(&rt->dst, neigh);
2806
2807 ipv6_addr_copy(&rt->rt6i_dst.addr, addr);
2808 rt->rt6i_dst.plen = 128;
2809 @@ -2312,6 +2320,7 @@ static int rt6_fill_node(struct net *net,
2810 struct nlmsghdr *nlh;
2811 long expires;
2812 u32 table;
2813 + struct neighbour *n;
2814
2815 if (prefix) { /* user wants prefix routes only */
2816 if (!(rt->rt6i_flags & RTF_PREFIX_RT)) {
2817 @@ -2400,8 +2409,11 @@ static int rt6_fill_node(struct net *net,
2818 if (rtnetlink_put_metrics(skb, dst_metrics_ptr(&rt->dst)) < 0)
2819 goto nla_put_failure;
2820
2821 - if (rt->dst.neighbour)
2822 - NLA_PUT(skb, RTA_GATEWAY, 16, &rt->dst.neighbour->primary_key);
2823 + rcu_read_lock();
2824 + n = dst_get_neighbour(&rt->dst);
2825 + if (n)
2826 + NLA_PUT(skb, RTA_GATEWAY, 16, &n->primary_key);
2827 + rcu_read_unlock();
2828
2829 if (rt->dst.dev)
2830 NLA_PUT_U32(skb, RTA_OIF, rt->rt6i_dev->ifindex);
2831 @@ -2585,6 +2597,7 @@ struct rt6_proc_arg
2832 static int rt6_info_route(struct rt6_info *rt, void *p_arg)
2833 {
2834 struct seq_file *m = p_arg;
2835 + struct neighbour *n;
2836
2837 seq_printf(m, "%pi6 %02x ", &rt->rt6i_dst.addr, rt->rt6i_dst.plen);
2838
2839 @@ -2593,12 +2606,14 @@ static int rt6_info_route(struct rt6_info *rt, void *p_arg)
2840 #else
2841 seq_puts(m, "00000000000000000000000000000000 00 ");
2842 #endif
2843 -
2844 - if (rt->rt6i_nexthop) {
2845 - seq_printf(m, "%pi6", rt->rt6i_nexthop->primary_key);
2846 + rcu_read_lock();
2847 + n = dst_get_neighbour(&rt->dst);
2848 + if (n) {
2849 + seq_printf(m, "%pi6", n->primary_key);
2850 } else {
2851 seq_puts(m, "00000000000000000000000000000000");
2852 }
2853 + rcu_read_unlock();
2854 seq_printf(m, " %08x %08x %08x %08x %8s\n",
2855 rt->rt6i_metric, atomic_read(&rt->dst.__refcnt),
2856 rt->dst.__use, rt->rt6i_flags,
2857 diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
2858 index 38490d5..f56acd0 100644
2859 --- a/net/ipv6/sit.c
2860 +++ b/net/ipv6/sit.c
2861 @@ -679,7 +679,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
2862 struct neighbour *neigh = NULL;
2863
2864 if (skb_dst(skb))
2865 - neigh = skb_dst(skb)->neighbour;
2866 + neigh = dst_get_neighbour(skb_dst(skb));
2867
2868 if (neigh == NULL) {
2869 if (net_ratelimit())
2870 @@ -704,7 +704,7 @@ static netdev_tx_t ipip6_tunnel_xmit(struct sk_buff *skb,
2871 struct neighbour *neigh = NULL;
2872
2873 if (skb_dst(skb))
2874 - neigh = skb_dst(skb)->neighbour;
2875 + neigh = dst_get_neighbour(skb_dst(skb));
2876
2877 if (neigh == NULL) {
2878 if (net_ratelimit())
2879 diff --git a/net/sched/sch_teql.c b/net/sched/sch_teql.c
2880 index 45cd300..4f4c52c 100644
2881 --- a/net/sched/sch_teql.c
2882 +++ b/net/sched/sch_teql.c
2883 @@ -225,11 +225,11 @@ static int teql_qdisc_init(struct Qdisc *sch, struct nlattr *opt)
2884
2885
2886 static int
2887 -__teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *dev)
2888 +__teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res,
2889 + struct net_device *dev, struct netdev_queue *txq,
2890 + struct neighbour *mn)
2891 {
2892 - struct netdev_queue *dev_queue = netdev_get_tx_queue(dev, 0);
2893 - struct teql_sched_data *q = qdisc_priv(dev_queue->qdisc);
2894 - struct neighbour *mn = skb_dst(skb)->neighbour;
2895 + struct teql_sched_data *q = qdisc_priv(txq->qdisc);
2896 struct neighbour *n = q->ncache;
2897
2898 if (mn->tbl == NULL)
2899 @@ -262,17 +262,26 @@ __teql_resolve(struct sk_buff *skb, struct sk_buff *skb_res, struct net_device *
2900 }
2901
2902 static inline int teql_resolve(struct sk_buff *skb,
2903 - struct sk_buff *skb_res, struct net_device *dev)
2904 + struct sk_buff *skb_res,
2905 + struct net_device *dev,
2906 + struct netdev_queue *txq)
2907 {
2908 - struct netdev_queue *txq = netdev_get_tx_queue(dev, 0);
2909 + struct dst_entry *dst = skb_dst(skb);
2910 + struct neighbour *mn;
2911 + int res;
2912 +
2913 if (txq->qdisc == &noop_qdisc)
2914 return -ENODEV;
2915
2916 - if (dev->header_ops == NULL ||
2917 - skb_dst(skb) == NULL ||
2918 - skb_dst(skb)->neighbour == NULL)
2919 + if (!dev->header_ops || !dst)
2920 return 0;
2921 - return __teql_resolve(skb, skb_res, dev);
2922 +
2923 + rcu_read_lock();
2924 + mn = dst_get_neighbour(dst);
2925 + res = mn ? __teql_resolve(skb, skb_res, dev, txq, mn) : 0;
2926 + rcu_read_unlock();
2927 +
2928 + return res;
2929 }
2930
2931 static netdev_tx_t teql_master_xmit(struct sk_buff *skb, struct net_device *dev)
2932 @@ -307,7 +316,7 @@ restart:
2933 continue;
2934 }
2935
2936 - switch (teql_resolve(skb, skb_res, slave)) {
2937 + switch (teql_resolve(skb, skb_res, slave, slave_txq)) {
2938 case 0:
2939 if (__netif_tx_trylock(slave_txq)) {
2940 unsigned int length = qdisc_pkt_len(skb);
2941 diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
2942 index 5ce74a3..7803eb6 100644
2943 --- a/net/xfrm/xfrm_policy.c
2944 +++ b/net/xfrm/xfrm_policy.c
2945 @@ -1497,7 +1497,7 @@ static struct dst_entry *xfrm_bundle_create(struct xfrm_policy *policy,
2946 goto free_dst;
2947
2948 /* Copy neighbour for reachability confirmation */
2949 - dst0->neighbour = neigh_clone(dst->neighbour);
2950 + dst_set_neighbour(dst0, neigh_clone(dst_get_neighbour(dst)));
2951
2952 xfrm_init_path((struct xfrm_dst *)dst0, dst, nfheader_len);
2953 xfrm_init_pmtu(dst_prev);
2954 diff --git a/sound/pci/hda/hda_codec.c b/sound/pci/hda/hda_codec.c
2955 index 2195851..67d341f 100644
2956 --- a/sound/pci/hda/hda_codec.c
2957 +++ b/sound/pci/hda/hda_codec.c
2958 @@ -1328,7 +1328,7 @@ void snd_hda_codec_setup_stream(struct hda_codec *codec, hda_nid_t nid,
2959 for (i = 0; i < c->cvt_setups.used; i++) {
2960 p = snd_array_elem(&c->cvt_setups, i);
2961 if (!p->active && p->stream_tag == stream_tag &&
2962 - get_wcaps_type(get_wcaps(codec, p->nid)) == type)
2963 + get_wcaps_type(get_wcaps(c, p->nid)) == type)
2964 p->dirty = 1;
2965 }
2966 }
2967 diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
2968 index 4a0f666..6d0cae4 100644
2969 --- a/sound/soc/codecs/wm8962.c
2970 +++ b/sound/soc/codecs/wm8962.c
2971 @@ -2975,13 +2975,13 @@ static int wm8962_hw_params(struct snd_pcm_substream *substream,
2972 case SNDRV_PCM_FORMAT_S16_LE:
2973 break;
2974 case SNDRV_PCM_FORMAT_S20_3LE:
2975 - aif0 |= 0x40;
2976 + aif0 |= 0x4;
2977 break;
2978 case SNDRV_PCM_FORMAT_S24_LE:
2979 - aif0 |= 0x80;
2980 + aif0 |= 0x8;
2981 break;
2982 case SNDRV_PCM_FORMAT_S32_LE:
2983 - aif0 |= 0xc0;
2984 + aif0 |= 0xc;
2985 break;
2986 default:
2987 return -EINVAL;
2988 diff --git a/sound/soc/codecs/wm_hubs.c b/sound/soc/codecs/wm_hubs.c
2989 index 9e370d1..8712a9f 100644
2990 --- a/sound/soc/codecs/wm_hubs.c
2991 +++ b/sound/soc/codecs/wm_hubs.c
2992 @@ -562,14 +562,14 @@ SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER1, 0, 1, 0),
2993 };
2994
2995 static const struct snd_kcontrol_new line2_mix[] = {
2996 -SOC_DAPM_SINGLE("IN2R Switch", WM8993_LINE_MIXER2, 2, 1, 0),
2997 -SOC_DAPM_SINGLE("IN2L Switch", WM8993_LINE_MIXER2, 1, 1, 0),
2998 +SOC_DAPM_SINGLE("IN1L Switch", WM8993_LINE_MIXER2, 2, 1, 0),
2999 +SOC_DAPM_SINGLE("IN1R Switch", WM8993_LINE_MIXER2, 1, 1, 0),
3000 SOC_DAPM_SINGLE("Output Switch", WM8993_LINE_MIXER2, 0, 1, 0),
3001 };
3002
3003 static const struct snd_kcontrol_new line2n_mix[] = {
3004 -SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER2, 6, 1, 0),
3005 -SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 5, 1, 0),
3006 +SOC_DAPM_SINGLE("Left Output Switch", WM8993_LINE_MIXER2, 5, 1, 0),
3007 +SOC_DAPM_SINGLE("Right Output Switch", WM8993_LINE_MIXER2, 6, 1, 0),
3008 };
3009
3010 static const struct snd_kcontrol_new line2p_mix[] = {
3011 @@ -589,6 +589,8 @@ SND_SOC_DAPM_INPUT("IN2RP:VXRP"),
3012 SND_SOC_DAPM_MICBIAS("MICBIAS2", WM8993_POWER_MANAGEMENT_1, 5, 0),
3013 SND_SOC_DAPM_MICBIAS("MICBIAS1", WM8993_POWER_MANAGEMENT_1, 4, 0),
3014
3015 +SND_SOC_DAPM_SUPPLY("LINEOUT_VMID_BUF", WM8993_ANTIPOP1, 7, 0, NULL, 0),
3016 +
3017 SND_SOC_DAPM_MIXER("IN1L PGA", WM8993_POWER_MANAGEMENT_2, 6, 0,
3018 in1l_pga, ARRAY_SIZE(in1l_pga)),
3019 SND_SOC_DAPM_MIXER("IN1R PGA", WM8993_POWER_MANAGEMENT_2, 4, 0,
3020 @@ -794,9 +796,11 @@ static const struct snd_soc_dapm_route lineout1_diff_routes[] = {
3021 };
3022
3023 static const struct snd_soc_dapm_route lineout1_se_routes[] = {
3024 + { "LINEOUT1N Mixer", NULL, "LINEOUT_VMID_BUF" },
3025 { "LINEOUT1N Mixer", "Left Output Switch", "Left Output PGA" },
3026 { "LINEOUT1N Mixer", "Right Output Switch", "Right Output PGA" },
3027
3028 + { "LINEOUT1P Mixer", NULL, "LINEOUT_VMID_BUF" },
3029 { "LINEOUT1P Mixer", "Left Output Switch", "Left Output PGA" },
3030
3031 { "LINEOUT1N Driver", NULL, "LINEOUT1N Mixer" },
3032 @@ -804,8 +808,8 @@ static const struct snd_soc_dapm_route lineout1_se_routes[] = {
3033 };
3034
3035 static const struct snd_soc_dapm_route lineout2_diff_routes[] = {
3036 - { "LINEOUT2 Mixer", "IN2L Switch", "IN2L PGA" },
3037 - { "LINEOUT2 Mixer", "IN2R Switch", "IN2R PGA" },
3038 + { "LINEOUT2 Mixer", "IN1L Switch", "IN1L PGA" },
3039 + { "LINEOUT2 Mixer", "IN1R Switch", "IN1R PGA" },
3040 { "LINEOUT2 Mixer", "Output Switch", "Right Output PGA" },
3041
3042 { "LINEOUT2N Driver", NULL, "LINEOUT2 Mixer" },
3043 @@ -813,9 +817,11 @@ static const struct snd_soc_dapm_route lineout2_diff_routes[] = {
3044 };
3045
3046 static const struct snd_soc_dapm_route lineout2_se_routes[] = {
3047 + { "LINEOUT2N Mixer", NULL, "LINEOUT_VMID_BUF" },
3048 { "LINEOUT2N Mixer", "Left Output Switch", "Left Output PGA" },
3049 { "LINEOUT2N Mixer", "Right Output Switch", "Right Output PGA" },
3050
3051 + { "LINEOUT2P Mixer", NULL, "LINEOUT_VMID_BUF" },
3052 { "LINEOUT2P Mixer", "Right Output Switch", "Right Output PGA" },
3053
3054 { "LINEOUT2N Driver", NULL, "LINEOUT2N Mixer" },
3055 diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
3056 index 493ae7c..e2bfe1d 100644
3057 --- a/sound/soc/soc-core.c
3058 +++ b/sound/soc/soc-core.c
3059 @@ -30,6 +30,7 @@
3060 #include <linux/bitops.h>
3061 #include <linux/debugfs.h>
3062 #include <linux/platform_device.h>
3063 +#include <linux/ctype.h>
3064 #include <linux/slab.h>
3065 #include <sound/ac97_codec.h>
3066 #include <sound/core.h>
3067 @@ -1931,9 +1932,20 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
3068 "%s", card->name);
3069 snprintf(card->snd_card->longname, sizeof(card->snd_card->longname),
3070 "%s", card->long_name ? card->long_name : card->name);
3071 - if (card->driver_name)
3072 - strlcpy(card->snd_card->driver, card->driver_name,
3073 - sizeof(card->snd_card->driver));
3074 + snprintf(card->snd_card->driver, sizeof(card->snd_card->driver),
3075 + "%s", card->driver_name ? card->driver_name : card->name);
3076 + for (i = 0; i < ARRAY_SIZE(card->snd_card->driver); i++) {
3077 + switch (card->snd_card->driver[i]) {
3078 + case '_':
3079 + case '-':
3080 + case '\0':
3081 + break;
3082 + default:
3083 + if (!isalnum(card->snd_card->driver[i]))
3084 + card->snd_card->driver[i] = '_';
3085 + break;
3086 + }
3087 + }
3088
3089 if (card->late_probe) {
3090 ret = card->late_probe(card);

  ViewVC Help
Powered by ViewVC 1.1.20