diff options
author | Arnd Bergmann <arnd@arndb.de> | 2012-05-15 04:41:07 -0400 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2012-05-15 04:41:07 -0400 |
commit | 423b742bec02b6c8d4e060517ce05b4cd3fd91c1 (patch) | |
tree | 3d4e090581970646d0afc92166bd490cc4977021 /drivers | |
parent | be944f1e79063e4f27b46c74f10c86b2387afa9f (diff) | |
parent | f5520363532690f56e12126029864d9383d5203f (diff) |
Merge branch 'kirkwood_boards_for_v3.5' of git://git.infradead.org/users/jcooper/linux into next/boards
* 'kirkwood_boards_for_v3.5' of git://git.infradead.org/users/jcooper/linux:
ARM: kirkwood: Add support for RaidSonic IB-NAS6210/6220 using devicetree
kirkwood: Add iconnect support
orion/kirkwood: create a generic function for gpio led blinking
kirkwood/orion: fix orion_gpio_set_blink
ARM: kirkwood: Define DNS-320/DNS-325 NAND in fdt
kirkwood: Allow nand to be configured via. devicetree
mtd: Add orion_nand devicetree bindings
ARM: kirkwood: Basic support for DNS-320 and DNS-325
Includes an update to v3.4-rc7
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers')
55 files changed, 415 insertions, 391 deletions
diff --git a/drivers/base/regmap/regmap.c b/drivers/base/regmap/regmap.c index 7a3f535e481c..bb80853ff27a 100644 --- a/drivers/base/regmap/regmap.c +++ b/drivers/base/regmap/regmap.c | |||
@@ -775,9 +775,11 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val, | |||
775 | map->format.parse_val(val + i); | 775 | map->format.parse_val(val + i); |
776 | } else { | 776 | } else { |
777 | for (i = 0; i < val_count; i++) { | 777 | for (i = 0; i < val_count; i++) { |
778 | ret = regmap_read(map, reg + i, val + (i * val_bytes)); | 778 | unsigned int ival; |
779 | ret = regmap_read(map, reg + i, &ival); | ||
779 | if (ret != 0) | 780 | if (ret != 0) |
780 | return ret; | 781 | return ret; |
782 | memcpy(val + (i * val_bytes), &ival, val_bytes); | ||
781 | } | 783 | } |
782 | } | 784 | } |
783 | 785 | ||
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c index abfaacaaf346..946166e13953 100644 --- a/drivers/block/drbd/drbd_nl.c +++ b/drivers/block/drbd/drbd_nl.c | |||
@@ -2297,7 +2297,7 @@ static void drbd_connector_callback(struct cn_msg *req, struct netlink_skb_parms | |||
2297 | return; | 2297 | return; |
2298 | } | 2298 | } |
2299 | 2299 | ||
2300 | if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) { | 2300 | if (!capable(CAP_SYS_ADMIN)) { |
2301 | retcode = ERR_PERM; | 2301 | retcode = ERR_PERM; |
2302 | goto fail; | 2302 | goto fail; |
2303 | } | 2303 | } |
diff --git a/drivers/gpio/gpio-omap.c b/drivers/gpio/gpio-omap.c index 1adc2ec1e383..4461540653a8 100644 --- a/drivers/gpio/gpio-omap.c +++ b/drivers/gpio/gpio-omap.c | |||
@@ -965,18 +965,15 @@ static void omap_gpio_mod_init(struct gpio_bank *bank) | |||
965 | } | 965 | } |
966 | 966 | ||
967 | _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->irqenable_inv); | 967 | _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->irqenable_inv); |
968 | _gpio_rmw(base, bank->regs->irqstatus, l, | 968 | _gpio_rmw(base, bank->regs->irqstatus, l, !bank->regs->irqenable_inv); |
969 | bank->regs->irqenable_inv == false); | ||
970 | _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->debounce_en != 0); | ||
971 | _gpio_rmw(base, bank->regs->irqenable, l, bank->regs->ctrl != 0); | ||
972 | if (bank->regs->debounce_en) | 969 | if (bank->regs->debounce_en) |
973 | _gpio_rmw(base, bank->regs->debounce_en, 0, 1); | 970 | __raw_writel(0, base + bank->regs->debounce_en); |
974 | 971 | ||
975 | /* Save OE default value (0xffffffff) in the context */ | 972 | /* Save OE default value (0xffffffff) in the context */ |
976 | bank->context.oe = __raw_readl(bank->base + bank->regs->direction); | 973 | bank->context.oe = __raw_readl(bank->base + bank->regs->direction); |
977 | /* Initialize interface clk ungated, module enabled */ | 974 | /* Initialize interface clk ungated, module enabled */ |
978 | if (bank->regs->ctrl) | 975 | if (bank->regs->ctrl) |
979 | _gpio_rmw(base, bank->regs->ctrl, 0, 1); | 976 | __raw_writel(0, base + bank->regs->ctrl); |
980 | } | 977 | } |
981 | 978 | ||
982 | static __devinit void | 979 | static __devinit void |
diff --git a/drivers/gpio/gpio-pch.c b/drivers/gpio/gpio-pch.c index e8729cc2ba2b..2cd958e0b822 100644 --- a/drivers/gpio/gpio-pch.c +++ b/drivers/gpio/gpio-pch.c | |||
@@ -230,16 +230,12 @@ static void pch_gpio_setup(struct pch_gpio *chip) | |||
230 | 230 | ||
231 | static int pch_irq_type(struct irq_data *d, unsigned int type) | 231 | static int pch_irq_type(struct irq_data *d, unsigned int type) |
232 | { | 232 | { |
233 | u32 im; | ||
234 | u32 __iomem *im_reg; | ||
235 | u32 ien; | ||
236 | u32 im_pos; | ||
237 | int ch; | ||
238 | unsigned long flags; | ||
239 | u32 val; | ||
240 | int irq = d->irq; | ||
241 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | 233 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); |
242 | struct pch_gpio *chip = gc->private; | 234 | struct pch_gpio *chip = gc->private; |
235 | u32 im, im_pos, val; | ||
236 | u32 __iomem *im_reg; | ||
237 | unsigned long flags; | ||
238 | int ch, irq = d->irq; | ||
243 | 239 | ||
244 | ch = irq - chip->irq_base; | 240 | ch = irq - chip->irq_base; |
245 | if (irq <= chip->irq_base + 7) { | 241 | if (irq <= chip->irq_base + 7) { |
@@ -270,30 +266,22 @@ static int pch_irq_type(struct irq_data *d, unsigned int type) | |||
270 | case IRQ_TYPE_LEVEL_LOW: | 266 | case IRQ_TYPE_LEVEL_LOW: |
271 | val = PCH_LEVEL_L; | 267 | val = PCH_LEVEL_L; |
272 | break; | 268 | break; |
273 | case IRQ_TYPE_PROBE: | ||
274 | goto end; | ||
275 | default: | 269 | default: |
276 | dev_warn(chip->dev, "%s: unknown type(%dd)", | 270 | goto unlock; |
277 | __func__, type); | ||
278 | goto end; | ||
279 | } | 271 | } |
280 | 272 | ||
281 | /* Set interrupt mode */ | 273 | /* Set interrupt mode */ |
282 | im = ioread32(im_reg) & ~(PCH_IM_MASK << (im_pos * 4)); | 274 | im = ioread32(im_reg) & ~(PCH_IM_MASK << (im_pos * 4)); |
283 | iowrite32(im | (val << (im_pos * 4)), im_reg); | 275 | iowrite32(im | (val << (im_pos * 4)), im_reg); |
284 | 276 | ||
285 | /* iclr */ | 277 | /* And the handler */ |
286 | iowrite32(BIT(ch), &chip->reg->iclr); | 278 | if (type & (IRQ_TYPE_LEVEL_LOW | IRQ_TYPE_LEVEL_HIGH)) |
279 | __irq_set_handler_locked(d->irq, handle_level_irq); | ||
280 | else if (type & (IRQ_TYPE_EDGE_FALLING | IRQ_TYPE_EDGE_RISING)) | ||
281 | __irq_set_handler_locked(d->irq, handle_edge_irq); | ||
287 | 282 | ||
288 | /* IMASKCLR */ | 283 | unlock: |
289 | iowrite32(BIT(ch), &chip->reg->imaskclr); | ||
290 | |||
291 | /* Enable interrupt */ | ||
292 | ien = ioread32(&chip->reg->ien); | ||
293 | iowrite32(ien | BIT(ch), &chip->reg->ien); | ||
294 | end: | ||
295 | spin_unlock_irqrestore(&chip->spinlock, flags); | 284 | spin_unlock_irqrestore(&chip->spinlock, flags); |
296 | |||
297 | return 0; | 285 | return 0; |
298 | } | 286 | } |
299 | 287 | ||
@@ -313,18 +301,24 @@ static void pch_irq_mask(struct irq_data *d) | |||
313 | iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->imask); | 301 | iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->imask); |
314 | } | 302 | } |
315 | 303 | ||
304 | static void pch_irq_ack(struct irq_data *d) | ||
305 | { | ||
306 | struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); | ||
307 | struct pch_gpio *chip = gc->private; | ||
308 | |||
309 | iowrite32(1 << (d->irq - chip->irq_base), &chip->reg->iclr); | ||
310 | } | ||
311 | |||
316 | static irqreturn_t pch_gpio_handler(int irq, void *dev_id) | 312 | static irqreturn_t pch_gpio_handler(int irq, void *dev_id) |
317 | { | 313 | { |
318 | struct pch_gpio *chip = dev_id; | 314 | struct pch_gpio *chip = dev_id; |
319 | u32 reg_val = ioread32(&chip->reg->istatus); | 315 | u32 reg_val = ioread32(&chip->reg->istatus); |
320 | int i; | 316 | int i, ret = IRQ_NONE; |
321 | int ret = IRQ_NONE; | ||
322 | 317 | ||
323 | for (i = 0; i < gpio_pins[chip->ioh]; i++) { | 318 | for (i = 0; i < gpio_pins[chip->ioh]; i++) { |
324 | if (reg_val & BIT(i)) { | 319 | if (reg_val & BIT(i)) { |
325 | dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", | 320 | dev_dbg(chip->dev, "%s:[%d]:irq=%d status=0x%x\n", |
326 | __func__, i, irq, reg_val); | 321 | __func__, i, irq, reg_val); |
327 | iowrite32(BIT(i), &chip->reg->iclr); | ||
328 | generic_handle_irq(chip->irq_base + i); | 322 | generic_handle_irq(chip->irq_base + i); |
329 | ret = IRQ_HANDLED; | 323 | ret = IRQ_HANDLED; |
330 | } | 324 | } |
@@ -343,6 +337,7 @@ static __devinit void pch_gpio_alloc_generic_chip(struct pch_gpio *chip, | |||
343 | gc->private = chip; | 337 | gc->private = chip; |
344 | ct = gc->chip_types; | 338 | ct = gc->chip_types; |
345 | 339 | ||
340 | ct->chip.irq_ack = pch_irq_ack; | ||
346 | ct->chip.irq_mask = pch_irq_mask; | 341 | ct->chip.irq_mask = pch_irq_mask; |
347 | ct->chip.irq_unmask = pch_irq_unmask; | 342 | ct->chip.irq_unmask = pch_irq_unmask; |
348 | ct->chip.irq_set_type = pch_irq_type; | 343 | ct->chip.irq_set_type = pch_irq_type; |
@@ -357,6 +352,7 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev, | |||
357 | s32 ret; | 352 | s32 ret; |
358 | struct pch_gpio *chip; | 353 | struct pch_gpio *chip; |
359 | int irq_base; | 354 | int irq_base; |
355 | u32 msk; | ||
360 | 356 | ||
361 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); | 357 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); |
362 | if (chip == NULL) | 358 | if (chip == NULL) |
@@ -408,8 +404,13 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev, | |||
408 | } | 404 | } |
409 | chip->irq_base = irq_base; | 405 | chip->irq_base = irq_base; |
410 | 406 | ||
407 | /* Mask all interrupts, but enable them */ | ||
408 | msk = (1 << gpio_pins[chip->ioh]) - 1; | ||
409 | iowrite32(msk, &chip->reg->imask); | ||
410 | iowrite32(msk, &chip->reg->ien); | ||
411 | |||
411 | ret = request_irq(pdev->irq, pch_gpio_handler, | 412 | ret = request_irq(pdev->irq, pch_gpio_handler, |
412 | IRQF_SHARED, KBUILD_MODNAME, chip); | 413 | IRQF_SHARED, KBUILD_MODNAME, chip); |
413 | if (ret != 0) { | 414 | if (ret != 0) { |
414 | dev_err(&pdev->dev, | 415 | dev_err(&pdev->dev, |
415 | "%s request_irq failed\n", __func__); | 416 | "%s request_irq failed\n", __func__); |
@@ -418,8 +419,6 @@ static int __devinit pch_gpio_probe(struct pci_dev *pdev, | |||
418 | 419 | ||
419 | pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); | 420 | pch_gpio_alloc_generic_chip(chip, irq_base, gpio_pins[chip->ioh]); |
420 | 421 | ||
421 | /* Initialize interrupt ien register */ | ||
422 | iowrite32(0, &chip->reg->ien); | ||
423 | end: | 422 | end: |
424 | return 0; | 423 | return 0; |
425 | 424 | ||
diff --git a/drivers/gpio/gpio-samsung.c b/drivers/gpio/gpio-samsung.c index 19d6fc0229c3..e991d9171961 100644 --- a/drivers/gpio/gpio-samsung.c +++ b/drivers/gpio/gpio-samsung.c | |||
@@ -452,12 +452,14 @@ static struct samsung_gpio_cfg s3c24xx_gpiocfg_banka = { | |||
452 | }; | 452 | }; |
453 | #endif | 453 | #endif |
454 | 454 | ||
455 | #if defined(CONFIG_ARCH_EXYNOS4) || defined(CONFIG_ARCH_EXYNOS5) | ||
455 | static struct samsung_gpio_cfg exynos_gpio_cfg = { | 456 | static struct samsung_gpio_cfg exynos_gpio_cfg = { |
456 | .set_pull = exynos_gpio_setpull, | 457 | .set_pull = exynos_gpio_setpull, |
457 | .get_pull = exynos_gpio_getpull, | 458 | .get_pull = exynos_gpio_getpull, |
458 | .set_config = samsung_gpio_setcfg_4bit, | 459 | .set_config = samsung_gpio_setcfg_4bit, |
459 | .get_config = samsung_gpio_getcfg_4bit, | 460 | .get_config = samsung_gpio_getcfg_4bit, |
460 | }; | 461 | }; |
462 | #endif | ||
461 | 463 | ||
462 | #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) | 464 | #if defined(CONFIG_CPU_S5P6440) || defined(CONFIG_CPU_S5P6450) |
463 | static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { | 465 | static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { |
@@ -2123,8 +2125,8 @@ static struct samsung_gpio_chip s5pv210_gpios_4bit[] = { | |||
2123 | * uses the above macro and depends on the banks being listed in order here. | 2125 | * uses the above macro and depends on the banks being listed in order here. |
2124 | */ | 2126 | */ |
2125 | 2127 | ||
2126 | static struct samsung_gpio_chip exynos4_gpios_1[] = { | ||
2127 | #ifdef CONFIG_ARCH_EXYNOS4 | 2128 | #ifdef CONFIG_ARCH_EXYNOS4 |
2129 | static struct samsung_gpio_chip exynos4_gpios_1[] = { | ||
2128 | { | 2130 | { |
2129 | .chip = { | 2131 | .chip = { |
2130 | .base = EXYNOS4_GPA0(0), | 2132 | .base = EXYNOS4_GPA0(0), |
@@ -2222,11 +2224,11 @@ static struct samsung_gpio_chip exynos4_gpios_1[] = { | |||
2222 | .label = "GPF3", | 2224 | .label = "GPF3", |
2223 | }, | 2225 | }, |
2224 | }, | 2226 | }, |
2225 | #endif | ||
2226 | }; | 2227 | }; |
2228 | #endif | ||
2227 | 2229 | ||
2228 | static struct samsung_gpio_chip exynos4_gpios_2[] = { | ||
2229 | #ifdef CONFIG_ARCH_EXYNOS4 | 2230 | #ifdef CONFIG_ARCH_EXYNOS4 |
2231 | static struct samsung_gpio_chip exynos4_gpios_2[] = { | ||
2230 | { | 2232 | { |
2231 | .chip = { | 2233 | .chip = { |
2232 | .base = EXYNOS4_GPJ0(0), | 2234 | .base = EXYNOS4_GPJ0(0), |
@@ -2367,11 +2369,11 @@ static struct samsung_gpio_chip exynos4_gpios_2[] = { | |||
2367 | .to_irq = samsung_gpiolib_to_irq, | 2369 | .to_irq = samsung_gpiolib_to_irq, |
2368 | }, | 2370 | }, |
2369 | }, | 2371 | }, |
2370 | #endif | ||
2371 | }; | 2372 | }; |
2373 | #endif | ||
2372 | 2374 | ||
2373 | static struct samsung_gpio_chip exynos4_gpios_3[] = { | ||
2374 | #ifdef CONFIG_ARCH_EXYNOS4 | 2375 | #ifdef CONFIG_ARCH_EXYNOS4 |
2376 | static struct samsung_gpio_chip exynos4_gpios_3[] = { | ||
2375 | { | 2377 | { |
2376 | .chip = { | 2378 | .chip = { |
2377 | .base = EXYNOS4_GPZ(0), | 2379 | .base = EXYNOS4_GPZ(0), |
@@ -2379,8 +2381,8 @@ static struct samsung_gpio_chip exynos4_gpios_3[] = { | |||
2379 | .label = "GPZ", | 2381 | .label = "GPZ", |
2380 | }, | 2382 | }, |
2381 | }, | 2383 | }, |
2382 | #endif | ||
2383 | }; | 2384 | }; |
2385 | #endif | ||
2384 | 2386 | ||
2385 | #ifdef CONFIG_ARCH_EXYNOS5 | 2387 | #ifdef CONFIG_ARCH_EXYNOS5 |
2386 | static struct samsung_gpio_chip exynos5_gpios_1[] = { | 2388 | static struct samsung_gpio_chip exynos5_gpios_1[] = { |
@@ -2719,7 +2721,9 @@ static __init int samsung_gpiolib_init(void) | |||
2719 | { | 2721 | { |
2720 | struct samsung_gpio_chip *chip; | 2722 | struct samsung_gpio_chip *chip; |
2721 | int i, nr_chips; | 2723 | int i, nr_chips; |
2724 | #if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250) | ||
2722 | void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4; | 2725 | void __iomem *gpio_base1, *gpio_base2, *gpio_base3, *gpio_base4; |
2726 | #endif | ||
2723 | int group = 0; | 2727 | int group = 0; |
2724 | 2728 | ||
2725 | samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); | 2729 | samsung_gpiolib_set_cfg(samsung_gpio_cfgs, ARRAY_SIZE(samsung_gpio_cfgs)); |
@@ -2971,6 +2975,7 @@ static __init int samsung_gpiolib_init(void) | |||
2971 | 2975 | ||
2972 | return 0; | 2976 | return 0; |
2973 | 2977 | ||
2978 | #if defined(CONFIG_CPU_EXYNOS4210) || defined(CONFIG_SOC_EXYNOS5250) | ||
2974 | err_ioremap4: | 2979 | err_ioremap4: |
2975 | iounmap(gpio_base3); | 2980 | iounmap(gpio_base3); |
2976 | err_ioremap3: | 2981 | err_ioremap3: |
@@ -2979,6 +2984,7 @@ err_ioremap2: | |||
2979 | iounmap(gpio_base1); | 2984 | iounmap(gpio_base1); |
2980 | err_ioremap1: | 2985 | err_ioremap1: |
2981 | return -ENOMEM; | 2986 | return -ENOMEM; |
2987 | #endif | ||
2982 | } | 2988 | } |
2983 | core_initcall(samsung_gpiolib_init); | 2989 | core_initcall(samsung_gpiolib_init); |
2984 | 2990 | ||
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.c b/drivers/gpu/drm/i915/intel_ringbuffer.c index 80fce51e2f43..62892a826ede 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.c +++ b/drivers/gpu/drm/i915/intel_ringbuffer.c | |||
@@ -398,10 +398,8 @@ static int init_render_ring(struct intel_ring_buffer *ring) | |||
398 | return ret; | 398 | return ret; |
399 | } | 399 | } |
400 | 400 | ||
401 | if (INTEL_INFO(dev)->gen >= 6) { | ||
402 | I915_WRITE(INSTPM, | ||
403 | INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING); | ||
404 | 401 | ||
402 | if (IS_GEN6(dev)) { | ||
405 | /* From the Sandybridge PRM, volume 1 part 3, page 24: | 403 | /* From the Sandybridge PRM, volume 1 part 3, page 24: |
406 | * "If this bit is set, STCunit will have LRA as replacement | 404 | * "If this bit is set, STCunit will have LRA as replacement |
407 | * policy. [...] This bit must be reset. LRA replacement | 405 | * policy. [...] This bit must be reset. LRA replacement |
@@ -411,6 +409,11 @@ static int init_render_ring(struct intel_ring_buffer *ring) | |||
411 | CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT); | 409 | CM0_STC_EVICT_DISABLE_LRA_SNB << CM0_MASK_SHIFT); |
412 | } | 410 | } |
413 | 411 | ||
412 | if (INTEL_INFO(dev)->gen >= 6) { | ||
413 | I915_WRITE(INSTPM, | ||
414 | INSTPM_FORCE_ORDERING << 16 | INSTPM_FORCE_ORDERING); | ||
415 | } | ||
416 | |||
414 | return ret; | 417 | return ret; |
415 | } | 418 | } |
416 | 419 | ||
diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c index 232d77d07d8b..ae5e748f39bb 100644 --- a/drivers/gpu/drm/i915/intel_sdvo.c +++ b/drivers/gpu/drm/i915/intel_sdvo.c | |||
@@ -1220,8 +1220,14 @@ static bool intel_sdvo_get_capabilities(struct intel_sdvo *intel_sdvo, struct in | |||
1220 | 1220 | ||
1221 | static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo) | 1221 | static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo) |
1222 | { | 1222 | { |
1223 | struct drm_device *dev = intel_sdvo->base.base.dev; | ||
1223 | u8 response[2]; | 1224 | u8 response[2]; |
1224 | 1225 | ||
1226 | /* HW Erratum: SDVO Hotplug is broken on all i945G chips, there's noise | ||
1227 | * on the line. */ | ||
1228 | if (IS_I945G(dev) || IS_I945GM(dev)) | ||
1229 | return false; | ||
1230 | |||
1225 | return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, | 1231 | return intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_HOT_PLUG_SUPPORT, |
1226 | &response, 2) && response[0]; | 1232 | &response, 2) && response[0]; |
1227 | } | 1233 | } |
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.c b/drivers/gpu/drm/nouveau/nouveau_i2c.c index e2be95af2e52..77e564667b5c 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.c +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.c | |||
@@ -29,10 +29,6 @@ | |||
29 | #include "nouveau_i2c.h" | 29 | #include "nouveau_i2c.h" |
30 | #include "nouveau_hw.h" | 30 | #include "nouveau_hw.h" |
31 | 31 | ||
32 | #define T_TIMEOUT 2200000 | ||
33 | #define T_RISEFALL 1000 | ||
34 | #define T_HOLD 5000 | ||
35 | |||
36 | static void | 32 | static void |
37 | i2c_drive_scl(void *data, int state) | 33 | i2c_drive_scl(void *data, int state) |
38 | { | 34 | { |
@@ -113,175 +109,6 @@ i2c_sense_sda(void *data) | |||
113 | return 0; | 109 | return 0; |
114 | } | 110 | } |
115 | 111 | ||
116 | static void | ||
117 | i2c_delay(struct nouveau_i2c_chan *port, u32 nsec) | ||
118 | { | ||
119 | udelay((nsec + 500) / 1000); | ||
120 | } | ||
121 | |||
122 | static bool | ||
123 | i2c_raise_scl(struct nouveau_i2c_chan *port) | ||
124 | { | ||
125 | u32 timeout = T_TIMEOUT / T_RISEFALL; | ||
126 | |||
127 | i2c_drive_scl(port, 1); | ||
128 | do { | ||
129 | i2c_delay(port, T_RISEFALL); | ||
130 | } while (!i2c_sense_scl(port) && --timeout); | ||
131 | |||
132 | return timeout != 0; | ||
133 | } | ||
134 | |||
135 | static int | ||
136 | i2c_start(struct nouveau_i2c_chan *port) | ||
137 | { | ||
138 | int ret = 0; | ||
139 | |||
140 | port->state = i2c_sense_scl(port); | ||
141 | port->state |= i2c_sense_sda(port) << 1; | ||
142 | if (port->state != 3) { | ||
143 | i2c_drive_scl(port, 0); | ||
144 | i2c_drive_sda(port, 1); | ||
145 | if (!i2c_raise_scl(port)) | ||
146 | ret = -EBUSY; | ||
147 | } | ||
148 | |||
149 | i2c_drive_sda(port, 0); | ||
150 | i2c_delay(port, T_HOLD); | ||
151 | i2c_drive_scl(port, 0); | ||
152 | i2c_delay(port, T_HOLD); | ||
153 | return ret; | ||
154 | } | ||
155 | |||
156 | static void | ||
157 | i2c_stop(struct nouveau_i2c_chan *port) | ||
158 | { | ||
159 | i2c_drive_scl(port, 0); | ||
160 | i2c_drive_sda(port, 0); | ||
161 | i2c_delay(port, T_RISEFALL); | ||
162 | |||
163 | i2c_drive_scl(port, 1); | ||
164 | i2c_delay(port, T_HOLD); | ||
165 | i2c_drive_sda(port, 1); | ||
166 | i2c_delay(port, T_HOLD); | ||
167 | } | ||
168 | |||
169 | static int | ||
170 | i2c_bitw(struct nouveau_i2c_chan *port, int sda) | ||
171 | { | ||
172 | i2c_drive_sda(port, sda); | ||
173 | i2c_delay(port, T_RISEFALL); | ||
174 | |||
175 | if (!i2c_raise_scl(port)) | ||
176 | return -ETIMEDOUT; | ||
177 | i2c_delay(port, T_HOLD); | ||
178 | |||
179 | i2c_drive_scl(port, 0); | ||
180 | i2c_delay(port, T_HOLD); | ||
181 | return 0; | ||
182 | } | ||
183 | |||
184 | static int | ||
185 | i2c_bitr(struct nouveau_i2c_chan *port) | ||
186 | { | ||
187 | int sda; | ||
188 | |||
189 | i2c_drive_sda(port, 1); | ||
190 | i2c_delay(port, T_RISEFALL); | ||
191 | |||
192 | if (!i2c_raise_scl(port)) | ||
193 | return -ETIMEDOUT; | ||
194 | i2c_delay(port, T_HOLD); | ||
195 | |||
196 | sda = i2c_sense_sda(port); | ||
197 | |||
198 | i2c_drive_scl(port, 0); | ||
199 | i2c_delay(port, T_HOLD); | ||
200 | return sda; | ||
201 | } | ||
202 | |||
203 | static int | ||
204 | i2c_get_byte(struct nouveau_i2c_chan *port, u8 *byte, bool last) | ||
205 | { | ||
206 | int i, bit; | ||
207 | |||
208 | *byte = 0; | ||
209 | for (i = 7; i >= 0; i--) { | ||
210 | bit = i2c_bitr(port); | ||
211 | if (bit < 0) | ||
212 | return bit; | ||
213 | *byte |= bit << i; | ||
214 | } | ||
215 | |||
216 | return i2c_bitw(port, last ? 1 : 0); | ||
217 | } | ||
218 | |||
219 | static int | ||
220 | i2c_put_byte(struct nouveau_i2c_chan *port, u8 byte) | ||
221 | { | ||
222 | int i, ret; | ||
223 | for (i = 7; i >= 0; i--) { | ||
224 | ret = i2c_bitw(port, !!(byte & (1 << i))); | ||
225 | if (ret < 0) | ||
226 | return ret; | ||
227 | } | ||
228 | |||
229 | ret = i2c_bitr(port); | ||
230 | if (ret == 1) /* nack */ | ||
231 | ret = -EIO; | ||
232 | return ret; | ||
233 | } | ||
234 | |||
235 | static int | ||
236 | i2c_addr(struct nouveau_i2c_chan *port, struct i2c_msg *msg) | ||
237 | { | ||
238 | u32 addr = msg->addr << 1; | ||
239 | if (msg->flags & I2C_M_RD) | ||
240 | addr |= 1; | ||
241 | return i2c_put_byte(port, addr); | ||
242 | } | ||
243 | |||
244 | static int | ||
245 | i2c_bit_xfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num) | ||
246 | { | ||
247 | struct nouveau_i2c_chan *port = (struct nouveau_i2c_chan *)adap; | ||
248 | struct i2c_msg *msg = msgs; | ||
249 | int ret = 0, mcnt = num; | ||
250 | |||
251 | while (!ret && mcnt--) { | ||
252 | u8 remaining = msg->len; | ||
253 | u8 *ptr = msg->buf; | ||
254 | |||
255 | ret = i2c_start(port); | ||
256 | if (ret == 0) | ||
257 | ret = i2c_addr(port, msg); | ||
258 | |||
259 | if (msg->flags & I2C_M_RD) { | ||
260 | while (!ret && remaining--) | ||
261 | ret = i2c_get_byte(port, ptr++, !remaining); | ||
262 | } else { | ||
263 | while (!ret && remaining--) | ||
264 | ret = i2c_put_byte(port, *ptr++); | ||
265 | } | ||
266 | |||
267 | msg++; | ||
268 | } | ||
269 | |||
270 | i2c_stop(port); | ||
271 | return (ret < 0) ? ret : num; | ||
272 | } | ||
273 | |||
274 | static u32 | ||
275 | i2c_bit_func(struct i2c_adapter *adap) | ||
276 | { | ||
277 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | ||
278 | } | ||
279 | |||
280 | const struct i2c_algorithm nouveau_i2c_bit_algo = { | ||
281 | .master_xfer = i2c_bit_xfer, | ||
282 | .functionality = i2c_bit_func | ||
283 | }; | ||
284 | |||
285 | static const uint32_t nv50_i2c_port[] = { | 112 | static const uint32_t nv50_i2c_port[] = { |
286 | 0x00e138, 0x00e150, 0x00e168, 0x00e180, | 113 | 0x00e138, 0x00e150, 0x00e168, 0x00e180, |
287 | 0x00e254, 0x00e274, 0x00e764, 0x00e780, | 114 | 0x00e254, 0x00e274, 0x00e764, 0x00e780, |
@@ -384,12 +211,10 @@ nouveau_i2c_init(struct drm_device *dev) | |||
384 | case 0: /* NV04:NV50 */ | 211 | case 0: /* NV04:NV50 */ |
385 | port->drive = entry[0]; | 212 | port->drive = entry[0]; |
386 | port->sense = entry[1]; | 213 | port->sense = entry[1]; |
387 | port->adapter.algo = &nouveau_i2c_bit_algo; | ||
388 | break; | 214 | break; |
389 | case 4: /* NV4E */ | 215 | case 4: /* NV4E */ |
390 | port->drive = 0x600800 + entry[1]; | 216 | port->drive = 0x600800 + entry[1]; |
391 | port->sense = port->drive; | 217 | port->sense = port->drive; |
392 | port->adapter.algo = &nouveau_i2c_bit_algo; | ||
393 | break; | 218 | break; |
394 | case 5: /* NV50- */ | 219 | case 5: /* NV50- */ |
395 | port->drive = entry[0] & 0x0f; | 220 | port->drive = entry[0] & 0x0f; |
@@ -402,7 +227,6 @@ nouveau_i2c_init(struct drm_device *dev) | |||
402 | port->drive = 0x00d014 + (port->drive * 0x20); | 227 | port->drive = 0x00d014 + (port->drive * 0x20); |
403 | port->sense = port->drive; | 228 | port->sense = port->drive; |
404 | } | 229 | } |
405 | port->adapter.algo = &nouveau_i2c_bit_algo; | ||
406 | break; | 230 | break; |
407 | case 6: /* NV50- DP AUX */ | 231 | case 6: /* NV50- DP AUX */ |
408 | port->drive = entry[0]; | 232 | port->drive = entry[0]; |
@@ -413,7 +237,7 @@ nouveau_i2c_init(struct drm_device *dev) | |||
413 | break; | 237 | break; |
414 | } | 238 | } |
415 | 239 | ||
416 | if (!port->adapter.algo) { | 240 | if (!port->adapter.algo && !port->drive) { |
417 | NV_ERROR(dev, "I2C%d: type %d index %x/%x unknown\n", | 241 | NV_ERROR(dev, "I2C%d: type %d index %x/%x unknown\n", |
418 | i, port->type, port->drive, port->sense); | 242 | i, port->type, port->drive, port->sense); |
419 | kfree(port); | 243 | kfree(port); |
@@ -429,7 +253,26 @@ nouveau_i2c_init(struct drm_device *dev) | |||
429 | port->dcb = ROM32(entry[0]); | 253 | port->dcb = ROM32(entry[0]); |
430 | i2c_set_adapdata(&port->adapter, i2c); | 254 | i2c_set_adapdata(&port->adapter, i2c); |
431 | 255 | ||
432 | ret = i2c_add_adapter(&port->adapter); | 256 | if (port->adapter.algo != &nouveau_dp_i2c_algo) { |
257 | port->adapter.algo_data = &port->bit; | ||
258 | port->bit.udelay = 10; | ||
259 | port->bit.timeout = usecs_to_jiffies(2200); | ||
260 | port->bit.data = port; | ||
261 | port->bit.setsda = i2c_drive_sda; | ||
262 | port->bit.setscl = i2c_drive_scl; | ||
263 | port->bit.getsda = i2c_sense_sda; | ||
264 | port->bit.getscl = i2c_sense_scl; | ||
265 | |||
266 | i2c_drive_scl(port, 0); | ||
267 | i2c_drive_sda(port, 1); | ||
268 | i2c_drive_scl(port, 1); | ||
269 | |||
270 | ret = i2c_bit_add_bus(&port->adapter); | ||
271 | } else { | ||
272 | port->adapter.algo = &nouveau_dp_i2c_algo; | ||
273 | ret = i2c_add_adapter(&port->adapter); | ||
274 | } | ||
275 | |||
433 | if (ret) { | 276 | if (ret) { |
434 | NV_ERROR(dev, "I2C%d: failed register: %d\n", i, ret); | 277 | NV_ERROR(dev, "I2C%d: failed register: %d\n", i, ret); |
435 | kfree(port); | 278 | kfree(port); |
diff --git a/drivers/gpu/drm/nouveau/nouveau_i2c.h b/drivers/gpu/drm/nouveau/nouveau_i2c.h index 4d2e4e9031be..1d083893a4d7 100644 --- a/drivers/gpu/drm/nouveau/nouveau_i2c.h +++ b/drivers/gpu/drm/nouveau/nouveau_i2c.h | |||
@@ -34,6 +34,7 @@ | |||
34 | struct nouveau_i2c_chan { | 34 | struct nouveau_i2c_chan { |
35 | struct i2c_adapter adapter; | 35 | struct i2c_adapter adapter; |
36 | struct drm_device *dev; | 36 | struct drm_device *dev; |
37 | struct i2c_algo_bit_data bit; | ||
37 | struct list_head head; | 38 | struct list_head head; |
38 | u8 index; | 39 | u8 index; |
39 | u8 type; | 40 | u8 type; |
diff --git a/drivers/leds/leds-netxbig.c b/drivers/leds/leds-netxbig.c index d8433f2d53bc..73973fdbd8be 100644 --- a/drivers/leds/leds-netxbig.c +++ b/drivers/leds/leds-netxbig.c | |||
@@ -112,7 +112,7 @@ err_free_addr: | |||
112 | return err; | 112 | return err; |
113 | } | 113 | } |
114 | 114 | ||
115 | static void __devexit gpio_ext_free(struct netxbig_gpio_ext *gpio_ext) | 115 | static void gpio_ext_free(struct netxbig_gpio_ext *gpio_ext) |
116 | { | 116 | { |
117 | int i; | 117 | int i; |
118 | 118 | ||
@@ -294,7 +294,7 @@ static ssize_t netxbig_led_sata_show(struct device *dev, | |||
294 | 294 | ||
295 | static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store); | 295 | static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store); |
296 | 296 | ||
297 | static void __devexit delete_netxbig_led(struct netxbig_led_data *led_dat) | 297 | static void delete_netxbig_led(struct netxbig_led_data *led_dat) |
298 | { | 298 | { |
299 | if (led_dat->mode_val[NETXBIG_LED_SATA] != NETXBIG_LED_INVALID_MODE) | 299 | if (led_dat->mode_val[NETXBIG_LED_SATA] != NETXBIG_LED_INVALID_MODE) |
300 | device_remove_file(led_dat->cdev.dev, &dev_attr_sata); | 300 | device_remove_file(led_dat->cdev.dev, &dev_attr_sata); |
diff --git a/drivers/leds/leds-ns2.c b/drivers/leds/leds-ns2.c index 2f0a14421a73..01cf89ec6944 100644 --- a/drivers/leds/leds-ns2.c +++ b/drivers/leds/leds-ns2.c | |||
@@ -255,7 +255,7 @@ err_free_cmd: | |||
255 | return ret; | 255 | return ret; |
256 | } | 256 | } |
257 | 257 | ||
258 | static void __devexit delete_ns2_led(struct ns2_led_data *led_dat) | 258 | static void delete_ns2_led(struct ns2_led_data *led_dat) |
259 | { | 259 | { |
260 | device_remove_file(led_dat->cdev.dev, &dev_attr_sata); | 260 | device_remove_file(led_dat->cdev.dev, &dev_attr_sata); |
261 | led_classdev_unregister(&led_dat->cdev); | 261 | led_classdev_unregister(&led_dat->cdev); |
diff --git a/drivers/md/dm-log-userspace-transfer.c b/drivers/md/dm-log-userspace-transfer.c index 1f23e048f077..08d9a207259a 100644 --- a/drivers/md/dm-log-userspace-transfer.c +++ b/drivers/md/dm-log-userspace-transfer.c | |||
@@ -134,7 +134,7 @@ static void cn_ulog_callback(struct cn_msg *msg, struct netlink_skb_parms *nsp) | |||
134 | { | 134 | { |
135 | struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); | 135 | struct dm_ulog_request *tfr = (struct dm_ulog_request *)(msg + 1); |
136 | 136 | ||
137 | if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) | 137 | if (!capable(CAP_SYS_ADMIN)) |
138 | return; | 138 | return; |
139 | 139 | ||
140 | spin_lock(&receiving_list_lock); | 140 | spin_lock(&receiving_list_lock); |
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 922a3385eead..754f38f8a692 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -718,8 +718,8 @@ static int parse_hw_handler(struct dm_arg_set *as, struct multipath *m) | |||
718 | return 0; | 718 | return 0; |
719 | 719 | ||
720 | m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); | 720 | m->hw_handler_name = kstrdup(dm_shift_arg(as), GFP_KERNEL); |
721 | request_module("scsi_dh_%s", m->hw_handler_name); | 721 | if (!try_then_request_module(scsi_dh_handler_exist(m->hw_handler_name), |
722 | if (scsi_dh_handler_exist(m->hw_handler_name) == 0) { | 722 | "scsi_dh_%s", m->hw_handler_name)) { |
723 | ti->error = "unknown hardware handler type"; | 723 | ti->error = "unknown hardware handler type"; |
724 | ret = -EINVAL; | 724 | ret = -EINVAL; |
725 | goto fail; | 725 | goto fail; |
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 213ae32a0fc4..2fd87b544a93 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
@@ -279,8 +279,10 @@ static void __cell_release(struct cell *cell, struct bio_list *inmates) | |||
279 | 279 | ||
280 | hlist_del(&cell->list); | 280 | hlist_del(&cell->list); |
281 | 281 | ||
282 | bio_list_add(inmates, cell->holder); | 282 | if (inmates) { |
283 | bio_list_merge(inmates, &cell->bios); | 283 | bio_list_add(inmates, cell->holder); |
284 | bio_list_merge(inmates, &cell->bios); | ||
285 | } | ||
284 | 286 | ||
285 | mempool_free(cell, prison->cell_pool); | 287 | mempool_free(cell, prison->cell_pool); |
286 | } | 288 | } |
@@ -303,9 +305,10 @@ static void cell_release(struct cell *cell, struct bio_list *bios) | |||
303 | */ | 305 | */ |
304 | static void __cell_release_singleton(struct cell *cell, struct bio *bio) | 306 | static void __cell_release_singleton(struct cell *cell, struct bio *bio) |
305 | { | 307 | { |
306 | hlist_del(&cell->list); | ||
307 | BUG_ON(cell->holder != bio); | 308 | BUG_ON(cell->holder != bio); |
308 | BUG_ON(!bio_list_empty(&cell->bios)); | 309 | BUG_ON(!bio_list_empty(&cell->bios)); |
310 | |||
311 | __cell_release(cell, NULL); | ||
309 | } | 312 | } |
310 | 313 | ||
311 | static void cell_release_singleton(struct cell *cell, struct bio *bio) | 314 | static void cell_release_singleton(struct cell *cell, struct bio *bio) |
@@ -1177,6 +1180,7 @@ static void no_space(struct cell *cell) | |||
1177 | static void process_discard(struct thin_c *tc, struct bio *bio) | 1180 | static void process_discard(struct thin_c *tc, struct bio *bio) |
1178 | { | 1181 | { |
1179 | int r; | 1182 | int r; |
1183 | unsigned long flags; | ||
1180 | struct pool *pool = tc->pool; | 1184 | struct pool *pool = tc->pool; |
1181 | struct cell *cell, *cell2; | 1185 | struct cell *cell, *cell2; |
1182 | struct cell_key key, key2; | 1186 | struct cell_key key, key2; |
@@ -1218,7 +1222,9 @@ static void process_discard(struct thin_c *tc, struct bio *bio) | |||
1218 | m->bio = bio; | 1222 | m->bio = bio; |
1219 | 1223 | ||
1220 | if (!ds_add_work(&pool->all_io_ds, &m->list)) { | 1224 | if (!ds_add_work(&pool->all_io_ds, &m->list)) { |
1225 | spin_lock_irqsave(&pool->lock, flags); | ||
1221 | list_add(&m->list, &pool->prepared_discards); | 1226 | list_add(&m->list, &pool->prepared_discards); |
1227 | spin_unlock_irqrestore(&pool->lock, flags); | ||
1222 | wake_worker(pool); | 1228 | wake_worker(pool); |
1223 | } | 1229 | } |
1224 | } else { | 1230 | } else { |
@@ -2626,8 +2632,10 @@ static int thin_endio(struct dm_target *ti, | |||
2626 | if (h->all_io_entry) { | 2632 | if (h->all_io_entry) { |
2627 | INIT_LIST_HEAD(&work); | 2633 | INIT_LIST_HEAD(&work); |
2628 | ds_dec(h->all_io_entry, &work); | 2634 | ds_dec(h->all_io_entry, &work); |
2635 | spin_lock_irqsave(&pool->lock, flags); | ||
2629 | list_for_each_entry_safe(m, tmp, &work, list) | 2636 | list_for_each_entry_safe(m, tmp, &work, list) |
2630 | list_add(&m->list, &pool->prepared_discards); | 2637 | list_add(&m->list, &pool->prepared_discards); |
2638 | spin_unlock_irqrestore(&pool->lock, flags); | ||
2631 | } | 2639 | } |
2632 | 2640 | ||
2633 | mempool_free(h, pool->endio_hook_pool); | 2641 | mempool_free(h, pool->endio_hook_pool); |
@@ -2759,6 +2767,6 @@ static void dm_thin_exit(void) | |||
2759 | module_init(dm_thin_init); | 2767 | module_init(dm_thin_init); |
2760 | module_exit(dm_thin_exit); | 2768 | module_exit(dm_thin_exit); |
2761 | 2769 | ||
2762 | MODULE_DESCRIPTION(DM_NAME "device-mapper thin provisioning target"); | 2770 | MODULE_DESCRIPTION(DM_NAME " thin provisioning target"); |
2763 | MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>"); | 2771 | MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>"); |
2764 | MODULE_LICENSE("GPL"); | 2772 | MODULE_LICENSE("GPL"); |
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index 1d3bfb26080c..0f50ef38b87b 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c | |||
@@ -13,6 +13,7 @@ | |||
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/module.h> | 14 | #include <linux/module.h> |
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/of.h> | ||
16 | #include <linux/mtd/mtd.h> | 17 | #include <linux/mtd/mtd.h> |
17 | #include <linux/mtd/nand.h> | 18 | #include <linux/mtd/nand.h> |
18 | #include <linux/mtd/partitions.h> | 19 | #include <linux/mtd/partitions.h> |
@@ -74,11 +75,13 @@ static void orion_nand_read_buf(struct mtd_info *mtd, uint8_t *buf, int len) | |||
74 | static int __init orion_nand_probe(struct platform_device *pdev) | 75 | static int __init orion_nand_probe(struct platform_device *pdev) |
75 | { | 76 | { |
76 | struct mtd_info *mtd; | 77 | struct mtd_info *mtd; |
78 | struct mtd_part_parser_data ppdata = {}; | ||
77 | struct nand_chip *nc; | 79 | struct nand_chip *nc; |
78 | struct orion_nand_data *board; | 80 | struct orion_nand_data *board; |
79 | struct resource *res; | 81 | struct resource *res; |
80 | void __iomem *io_base; | 82 | void __iomem *io_base; |
81 | int ret = 0; | 83 | int ret = 0; |
84 | u32 val = 0; | ||
82 | 85 | ||
83 | nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL); | 86 | nc = kzalloc(sizeof(struct nand_chip) + sizeof(struct mtd_info), GFP_KERNEL); |
84 | if (!nc) { | 87 | if (!nc) { |
@@ -101,7 +104,32 @@ static int __init orion_nand_probe(struct platform_device *pdev) | |||
101 | goto no_res; | 104 | goto no_res; |
102 | } | 105 | } |
103 | 106 | ||
104 | board = pdev->dev.platform_data; | 107 | if (pdev->dev.of_node) { |
108 | board = devm_kzalloc(&pdev->dev, sizeof(struct orion_nand_data), | ||
109 | GFP_KERNEL); | ||
110 | if (!board) { | ||
111 | printk(KERN_ERR "orion_nand: failed to allocate board structure.\n"); | ||
112 | ret = -ENOMEM; | ||
113 | goto no_res; | ||
114 | } | ||
115 | if (!of_property_read_u32(pdev->dev.of_node, "cle", &val)) | ||
116 | board->cle = (u8)val; | ||
117 | else | ||
118 | board->cle = 0; | ||
119 | if (!of_property_read_u32(pdev->dev.of_node, "ale", &val)) | ||
120 | board->ale = (u8)val; | ||
121 | else | ||
122 | board->ale = 1; | ||
123 | if (!of_property_read_u32(pdev->dev.of_node, | ||
124 | "bank-width", &val)) | ||
125 | board->width = (u8)val * 8; | ||
126 | else | ||
127 | board->width = 8; | ||
128 | if (!of_property_read_u32(pdev->dev.of_node, | ||
129 | "chip-delay", &val)) | ||
130 | board->chip_delay = (u8)val; | ||
131 | } else | ||
132 | board = pdev->dev.platform_data; | ||
105 | 133 | ||
106 | mtd->priv = nc; | 134 | mtd->priv = nc; |
107 | mtd->owner = THIS_MODULE; | 135 | mtd->owner = THIS_MODULE; |
@@ -115,6 +143,10 @@ static int __init orion_nand_probe(struct platform_device *pdev) | |||
115 | if (board->chip_delay) | 143 | if (board->chip_delay) |
116 | nc->chip_delay = board->chip_delay; | 144 | nc->chip_delay = board->chip_delay; |
117 | 145 | ||
146 | WARN(board->width > 16, | ||
147 | "%d bit bus width out of range", | ||
148 | board->width); | ||
149 | |||
118 | if (board->width == 16) | 150 | if (board->width == 16) |
119 | nc->options |= NAND_BUSWIDTH_16; | 151 | nc->options |= NAND_BUSWIDTH_16; |
120 | 152 | ||
@@ -129,8 +161,9 @@ static int __init orion_nand_probe(struct platform_device *pdev) | |||
129 | } | 161 | } |
130 | 162 | ||
131 | mtd->name = "orion_nand"; | 163 | mtd->name = "orion_nand"; |
132 | ret = mtd_device_parse_register(mtd, NULL, NULL, board->parts, | 164 | ppdata.of_node = pdev->dev.of_node; |
133 | board->nr_parts); | 165 | ret = mtd_device_parse_register(mtd, NULL, &ppdata, |
166 | board->parts, board->nr_parts); | ||
134 | if (ret) { | 167 | if (ret) { |
135 | nand_release(mtd); | 168 | nand_release(mtd); |
136 | goto no_dev; | 169 | goto no_dev; |
@@ -161,11 +194,19 @@ static int __devexit orion_nand_remove(struct platform_device *pdev) | |||
161 | return 0; | 194 | return 0; |
162 | } | 195 | } |
163 | 196 | ||
197 | #ifdef CONFIG_OF | ||
198 | static struct of_device_id orion_nand_of_match_table[] = { | ||
199 | { .compatible = "mrvl,orion-nand", }, | ||
200 | {}, | ||
201 | }; | ||
202 | #endif | ||
203 | |||
164 | static struct platform_driver orion_nand_driver = { | 204 | static struct platform_driver orion_nand_driver = { |
165 | .remove = __devexit_p(orion_nand_remove), | 205 | .remove = __devexit_p(orion_nand_remove), |
166 | .driver = { | 206 | .driver = { |
167 | .name = "orion_nand", | 207 | .name = "orion_nand", |
168 | .owner = THIS_MODULE, | 208 | .owner = THIS_MODULE, |
209 | .of_match_table = of_match_ptr(orion_nand_of_match_table), | ||
169 | }, | 210 | }, |
170 | }; | 211 | }; |
171 | 212 | ||
diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c index 793b00138275..3463b469e657 100644 --- a/drivers/net/bonding/bond_3ad.c +++ b/drivers/net/bonding/bond_3ad.c | |||
@@ -2173,9 +2173,10 @@ re_arm: | |||
2173 | * received frames (loopback). Since only the payload is given to this | 2173 | * received frames (loopback). Since only the payload is given to this |
2174 | * function, it check for loopback. | 2174 | * function, it check for loopback. |
2175 | */ | 2175 | */ |
2176 | static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) | 2176 | static int bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) |
2177 | { | 2177 | { |
2178 | struct port *port; | 2178 | struct port *port; |
2179 | int ret = RX_HANDLER_ANOTHER; | ||
2179 | 2180 | ||
2180 | if (length >= sizeof(struct lacpdu)) { | 2181 | if (length >= sizeof(struct lacpdu)) { |
2181 | 2182 | ||
@@ -2184,11 +2185,12 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2184 | if (!port->slave) { | 2185 | if (!port->slave) { |
2185 | pr_warning("%s: Warning: port of slave %s is uninitialized\n", | 2186 | pr_warning("%s: Warning: port of slave %s is uninitialized\n", |
2186 | slave->dev->name, slave->dev->master->name); | 2187 | slave->dev->name, slave->dev->master->name); |
2187 | return; | 2188 | return ret; |
2188 | } | 2189 | } |
2189 | 2190 | ||
2190 | switch (lacpdu->subtype) { | 2191 | switch (lacpdu->subtype) { |
2191 | case AD_TYPE_LACPDU: | 2192 | case AD_TYPE_LACPDU: |
2193 | ret = RX_HANDLER_CONSUMED; | ||
2192 | pr_debug("Received LACPDU on port %d\n", | 2194 | pr_debug("Received LACPDU on port %d\n", |
2193 | port->actor_port_number); | 2195 | port->actor_port_number); |
2194 | /* Protect against concurrent state machines */ | 2196 | /* Protect against concurrent state machines */ |
@@ -2198,6 +2200,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2198 | break; | 2200 | break; |
2199 | 2201 | ||
2200 | case AD_TYPE_MARKER: | 2202 | case AD_TYPE_MARKER: |
2203 | ret = RX_HANDLER_CONSUMED; | ||
2201 | // No need to convert fields to Little Endian since we don't use the marker's fields. | 2204 | // No need to convert fields to Little Endian since we don't use the marker's fields. |
2202 | 2205 | ||
2203 | switch (((struct bond_marker *)lacpdu)->tlv_type) { | 2206 | switch (((struct bond_marker *)lacpdu)->tlv_type) { |
@@ -2219,6 +2222,7 @@ static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u | |||
2219 | } | 2222 | } |
2220 | } | 2223 | } |
2221 | } | 2224 | } |
2225 | return ret; | ||
2222 | } | 2226 | } |
2223 | 2227 | ||
2224 | /** | 2228 | /** |
@@ -2456,18 +2460,20 @@ out: | |||
2456 | return NETDEV_TX_OK; | 2460 | return NETDEV_TX_OK; |
2457 | } | 2461 | } |
2458 | 2462 | ||
2459 | void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, | 2463 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, |
2460 | struct slave *slave) | 2464 | struct slave *slave) |
2461 | { | 2465 | { |
2466 | int ret = RX_HANDLER_ANOTHER; | ||
2462 | if (skb->protocol != PKT_TYPE_LACPDU) | 2467 | if (skb->protocol != PKT_TYPE_LACPDU) |
2463 | return; | 2468 | return ret; |
2464 | 2469 | ||
2465 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) | 2470 | if (!pskb_may_pull(skb, sizeof(struct lacpdu))) |
2466 | return; | 2471 | return ret; |
2467 | 2472 | ||
2468 | read_lock(&bond->lock); | 2473 | read_lock(&bond->lock); |
2469 | bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); | 2474 | ret = bond_3ad_rx_indication((struct lacpdu *) skb->data, slave, skb->len); |
2470 | read_unlock(&bond->lock); | 2475 | read_unlock(&bond->lock); |
2476 | return ret; | ||
2471 | } | 2477 | } |
2472 | 2478 | ||
2473 | /* | 2479 | /* |
diff --git a/drivers/net/bonding/bond_3ad.h b/drivers/net/bonding/bond_3ad.h index 235b2cc58b28..5ee7e3c45db7 100644 --- a/drivers/net/bonding/bond_3ad.h +++ b/drivers/net/bonding/bond_3ad.h | |||
@@ -274,7 +274,7 @@ void bond_3ad_adapter_duplex_changed(struct slave *slave); | |||
274 | void bond_3ad_handle_link_change(struct slave *slave, char link); | 274 | void bond_3ad_handle_link_change(struct slave *slave, char link); |
275 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); | 275 | int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); |
276 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); | 276 | int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); |
277 | void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, | 277 | int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, |
278 | struct slave *slave); | 278 | struct slave *slave); |
279 | int bond_3ad_set_carrier(struct bonding *bond); | 279 | int bond_3ad_set_carrier(struct bonding *bond); |
280 | void bond_3ad_update_lacp_rate(struct bonding *bond); | 280 | void bond_3ad_update_lacp_rate(struct bonding *bond); |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 62d2409bb293..bc13b3d77432 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1444,8 +1444,9 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
1444 | struct sk_buff *skb = *pskb; | 1444 | struct sk_buff *skb = *pskb; |
1445 | struct slave *slave; | 1445 | struct slave *slave; |
1446 | struct bonding *bond; | 1446 | struct bonding *bond; |
1447 | void (*recv_probe)(struct sk_buff *, struct bonding *, | 1447 | int (*recv_probe)(struct sk_buff *, struct bonding *, |
1448 | struct slave *); | 1448 | struct slave *); |
1449 | int ret = RX_HANDLER_ANOTHER; | ||
1449 | 1450 | ||
1450 | skb = skb_share_check(skb, GFP_ATOMIC); | 1451 | skb = skb_share_check(skb, GFP_ATOMIC); |
1451 | if (unlikely(!skb)) | 1452 | if (unlikely(!skb)) |
@@ -1464,8 +1465,12 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
1464 | struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); | 1465 | struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC); |
1465 | 1466 | ||
1466 | if (likely(nskb)) { | 1467 | if (likely(nskb)) { |
1467 | recv_probe(nskb, bond, slave); | 1468 | ret = recv_probe(nskb, bond, slave); |
1468 | dev_kfree_skb(nskb); | 1469 | dev_kfree_skb(nskb); |
1470 | if (ret == RX_HANDLER_CONSUMED) { | ||
1471 | consume_skb(skb); | ||
1472 | return ret; | ||
1473 | } | ||
1469 | } | 1474 | } |
1470 | } | 1475 | } |
1471 | 1476 | ||
@@ -1487,7 +1492,7 @@ static rx_handler_result_t bond_handle_frame(struct sk_buff **pskb) | |||
1487 | memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN); | 1492 | memcpy(eth_hdr(skb)->h_dest, bond->dev->dev_addr, ETH_ALEN); |
1488 | } | 1493 | } |
1489 | 1494 | ||
1490 | return RX_HANDLER_ANOTHER; | 1495 | return ret; |
1491 | } | 1496 | } |
1492 | 1497 | ||
1493 | /* enslave device <slave> to bond device <master> */ | 1498 | /* enslave device <slave> to bond device <master> */ |
@@ -2723,7 +2728,7 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32 | |||
2723 | } | 2728 | } |
2724 | } | 2729 | } |
2725 | 2730 | ||
2726 | static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, | 2731 | static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, |
2727 | struct slave *slave) | 2732 | struct slave *slave) |
2728 | { | 2733 | { |
2729 | struct arphdr *arp; | 2734 | struct arphdr *arp; |
@@ -2731,7 +2736,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, | |||
2731 | __be32 sip, tip; | 2736 | __be32 sip, tip; |
2732 | 2737 | ||
2733 | if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) | 2738 | if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) |
2734 | return; | 2739 | return RX_HANDLER_ANOTHER; |
2735 | 2740 | ||
2736 | read_lock(&bond->lock); | 2741 | read_lock(&bond->lock); |
2737 | 2742 | ||
@@ -2776,6 +2781,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, | |||
2776 | 2781 | ||
2777 | out_unlock: | 2782 | out_unlock: |
2778 | read_unlock(&bond->lock); | 2783 | read_unlock(&bond->lock); |
2784 | return RX_HANDLER_ANOTHER; | ||
2779 | } | 2785 | } |
2780 | 2786 | ||
2781 | /* | 2787 | /* |
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c index e077d2508727..6af310195bae 100644 --- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | |||
@@ -9122,13 +9122,34 @@ static int __devinit bnx2x_prev_unload_common(struct bnx2x *bp) | |||
9122 | return bnx2x_prev_mcp_done(bp); | 9122 | return bnx2x_prev_mcp_done(bp); |
9123 | } | 9123 | } |
9124 | 9124 | ||
9125 | /* previous driver DMAE transaction may have occurred when pre-boot stage ended | ||
9126 | * and boot began, or when kdump kernel was loaded. Either case would invalidate | ||
9127 | * the addresses of the transaction, resulting in was-error bit set in the pci | ||
9128 | * causing all hw-to-host pcie transactions to timeout. If this happened we want | ||
9129 | * to clear the interrupt which detected this from the pglueb and the was done | ||
9130 | * bit | ||
9131 | */ | ||
9132 | static void __devinit bnx2x_prev_interrupted_dmae(struct bnx2x *bp) | ||
9133 | { | ||
9134 | u32 val = REG_RD(bp, PGLUE_B_REG_PGLUE_B_INT_STS); | ||
9135 | if (val & PGLUE_B_PGLUE_B_INT_STS_REG_WAS_ERROR_ATTN) { | ||
9136 | BNX2X_ERR("was error bit was found to be set in pglueb upon startup. Clearing"); | ||
9137 | REG_WR(bp, PGLUE_B_REG_WAS_ERROR_PF_7_0_CLR, 1 << BP_FUNC(bp)); | ||
9138 | } | ||
9139 | } | ||
9140 | |||
9125 | static int __devinit bnx2x_prev_unload(struct bnx2x *bp) | 9141 | static int __devinit bnx2x_prev_unload(struct bnx2x *bp) |
9126 | { | 9142 | { |
9127 | int time_counter = 10; | 9143 | int time_counter = 10; |
9128 | u32 rc, fw, hw_lock_reg, hw_lock_val; | 9144 | u32 rc, fw, hw_lock_reg, hw_lock_val; |
9129 | BNX2X_DEV_INFO("Entering Previous Unload Flow\n"); | 9145 | BNX2X_DEV_INFO("Entering Previous Unload Flow\n"); |
9130 | 9146 | ||
9131 | /* Release previously held locks */ | 9147 | /* clear hw from errors which may have resulted from an interrupted |
9148 | * dmae transaction. | ||
9149 | */ | ||
9150 | bnx2x_prev_interrupted_dmae(bp); | ||
9151 | |||
9152 | /* Release previously held locks */ | ||
9132 | hw_lock_reg = (BP_FUNC(bp) <= 5) ? | 9153 | hw_lock_reg = (BP_FUNC(bp) <= 5) ? |
9133 | (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) : | 9154 | (MISC_REG_DRIVER_CONTROL_1 + BP_FUNC(bp) * 8) : |
9134 | (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8); | 9155 | (MISC_REG_DRIVER_CONTROL_7 + (BP_FUNC(bp) - 6) * 8); |
diff --git a/drivers/net/ethernet/ibm/ehea/ehea_main.c b/drivers/net/ethernet/ibm/ehea/ehea_main.c index c9069a28832b..f4d2da0db1b1 100644 --- a/drivers/net/ethernet/ibm/ehea/ehea_main.c +++ b/drivers/net/ethernet/ibm/ehea/ehea_main.c | |||
@@ -3335,6 +3335,8 @@ static int __devinit ehea_probe_adapter(struct platform_device *dev, | |||
3335 | goto out_shutdown_ports; | 3335 | goto out_shutdown_ports; |
3336 | } | 3336 | } |
3337 | 3337 | ||
3338 | /* Handle any events that might be pending. */ | ||
3339 | tasklet_hi_schedule(&adapter->neq_tasklet); | ||
3338 | 3340 | ||
3339 | ret = 0; | 3341 | ret = 0; |
3340 | goto out; | 3342 | goto out; |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 4348b6fd44fa..37caa8885c2a 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
@@ -3380,7 +3380,7 @@ static void e1000_dump(struct e1000_adapter *adapter) | |||
3380 | for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { | 3380 | for (i = 0; tx_ring->desc && (i < tx_ring->count); i++) { |
3381 | struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i); | 3381 | struct e1000_tx_desc *tx_desc = E1000_TX_DESC(*tx_ring, i); |
3382 | struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i]; | 3382 | struct e1000_buffer *buffer_info = &tx_ring->buffer_info[i]; |
3383 | struct my_u { u64 a; u64 b; }; | 3383 | struct my_u { __le64 a; __le64 b; }; |
3384 | struct my_u *u = (struct my_u *)tx_desc; | 3384 | struct my_u *u = (struct my_u *)tx_desc; |
3385 | const char *type; | 3385 | const char *type; |
3386 | 3386 | ||
@@ -3424,7 +3424,7 @@ rx_ring_summary: | |||
3424 | for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) { | 3424 | for (i = 0; rx_ring->desc && (i < rx_ring->count); i++) { |
3425 | struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i); | 3425 | struct e1000_rx_desc *rx_desc = E1000_RX_DESC(*rx_ring, i); |
3426 | struct e1000_buffer *buffer_info = &rx_ring->buffer_info[i]; | 3426 | struct e1000_buffer *buffer_info = &rx_ring->buffer_info[i]; |
3427 | struct my_u { u64 a; u64 b; }; | 3427 | struct my_u { __le64 a; __le64 b; }; |
3428 | struct my_u *u = (struct my_u *)rx_desc; | 3428 | struct my_u *u = (struct my_u *)rx_desc; |
3429 | const char *type; | 3429 | const char *type; |
3430 | 3430 | ||
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c index 5ec31598ee47..8683ca4748c8 100644 --- a/drivers/net/ethernet/intel/igb/igb_main.c +++ b/drivers/net/ethernet/intel/igb/igb_main.c | |||
@@ -1111,9 +1111,12 @@ msi_only: | |||
1111 | adapter->flags |= IGB_FLAG_HAS_MSI; | 1111 | adapter->flags |= IGB_FLAG_HAS_MSI; |
1112 | out: | 1112 | out: |
1113 | /* Notify the stack of the (possibly) reduced queue counts. */ | 1113 | /* Notify the stack of the (possibly) reduced queue counts. */ |
1114 | rtnl_lock(); | ||
1114 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); | 1115 | netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); |
1115 | return netif_set_real_num_rx_queues(adapter->netdev, | 1116 | err = netif_set_real_num_rx_queues(adapter->netdev, |
1116 | adapter->num_rx_queues); | 1117 | adapter->num_rx_queues); |
1118 | rtnl_unlock(); | ||
1119 | return err; | ||
1117 | } | 1120 | } |
1118 | 1121 | ||
1119 | /** | 1122 | /** |
@@ -2771,8 +2774,6 @@ void igb_configure_tx_ring(struct igb_adapter *adapter, | |||
2771 | 2774 | ||
2772 | txdctl |= E1000_TXDCTL_QUEUE_ENABLE; | 2775 | txdctl |= E1000_TXDCTL_QUEUE_ENABLE; |
2773 | wr32(E1000_TXDCTL(reg_idx), txdctl); | 2776 | wr32(E1000_TXDCTL(reg_idx), txdctl); |
2774 | |||
2775 | netdev_tx_reset_queue(txring_txq(ring)); | ||
2776 | } | 2777 | } |
2777 | 2778 | ||
2778 | /** | 2779 | /** |
@@ -3282,6 +3283,8 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring) | |||
3282 | igb_unmap_and_free_tx_resource(tx_ring, buffer_info); | 3283 | igb_unmap_and_free_tx_resource(tx_ring, buffer_info); |
3283 | } | 3284 | } |
3284 | 3285 | ||
3286 | netdev_tx_reset_queue(txring_txq(tx_ring)); | ||
3287 | |||
3285 | size = sizeof(struct igb_tx_buffer) * tx_ring->count; | 3288 | size = sizeof(struct igb_tx_buffer) * tx_ring->count; |
3286 | memset(tx_ring->tx_buffer_info, 0, size); | 3289 | memset(tx_ring->tx_buffer_info, 0, size); |
3287 | 3290 | ||
@@ -6796,18 +6799,7 @@ static int igb_resume(struct device *dev) | |||
6796 | pci_enable_wake(pdev, PCI_D3hot, 0); | 6799 | pci_enable_wake(pdev, PCI_D3hot, 0); |
6797 | pci_enable_wake(pdev, PCI_D3cold, 0); | 6800 | pci_enable_wake(pdev, PCI_D3cold, 0); |
6798 | 6801 | ||
6799 | if (!rtnl_is_locked()) { | 6802 | if (igb_init_interrupt_scheme(adapter)) { |
6800 | /* | ||
6801 | * shut up ASSERT_RTNL() warning in | ||
6802 | * netif_set_real_num_tx/rx_queues. | ||
6803 | */ | ||
6804 | rtnl_lock(); | ||
6805 | err = igb_init_interrupt_scheme(adapter); | ||
6806 | rtnl_unlock(); | ||
6807 | } else { | ||
6808 | err = igb_init_interrupt_scheme(adapter); | ||
6809 | } | ||
6810 | if (err) { | ||
6811 | dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); | 6803 | dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); |
6812 | return -ENOMEM; | 6804 | return -ENOMEM; |
6813 | } | 6805 | } |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h index 74e192107f9a..81b155589532 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h | |||
@@ -574,9 +574,6 @@ extern struct ixgbe_info ixgbe_82599_info; | |||
574 | extern struct ixgbe_info ixgbe_X540_info; | 574 | extern struct ixgbe_info ixgbe_X540_info; |
575 | #ifdef CONFIG_IXGBE_DCB | 575 | #ifdef CONFIG_IXGBE_DCB |
576 | extern const struct dcbnl_rtnl_ops dcbnl_ops; | 576 | extern const struct dcbnl_rtnl_ops dcbnl_ops; |
577 | extern int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *src_dcb_cfg, | ||
578 | struct ixgbe_dcb_config *dst_dcb_cfg, | ||
579 | int tc_max); | ||
580 | #endif | 577 | #endif |
581 | 578 | ||
582 | extern char ixgbe_driver_name[]; | 579 | extern char ixgbe_driver_name[]; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c index 652e4b09546d..32e5c02ff6d0 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_dcb_nl.c | |||
@@ -44,18 +44,26 @@ | |||
44 | #define DCB_NO_HW_CHG 1 /* DCB configuration did not change */ | 44 | #define DCB_NO_HW_CHG 1 /* DCB configuration did not change */ |
45 | #define DCB_HW_CHG 2 /* DCB configuration changed, no reset */ | 45 | #define DCB_HW_CHG 2 /* DCB configuration changed, no reset */ |
46 | 46 | ||
47 | int ixgbe_copy_dcb_cfg(struct ixgbe_dcb_config *scfg, | 47 | static int ixgbe_copy_dcb_cfg(struct ixgbe_adapter *adapter, int tc_max) |
48 | struct ixgbe_dcb_config *dcfg, int tc_max) | ||
49 | { | 48 | { |
49 | struct ixgbe_dcb_config *scfg = &adapter->temp_dcb_cfg; | ||
50 | struct ixgbe_dcb_config *dcfg = &adapter->dcb_cfg; | ||
50 | struct tc_configuration *src = NULL; | 51 | struct tc_configuration *src = NULL; |
51 | struct tc_configuration *dst = NULL; | 52 | struct tc_configuration *dst = NULL; |
52 | int i, j; | 53 | int i, j; |
53 | int tx = DCB_TX_CONFIG; | 54 | int tx = DCB_TX_CONFIG; |
54 | int rx = DCB_RX_CONFIG; | 55 | int rx = DCB_RX_CONFIG; |
55 | int changes = 0; | 56 | int changes = 0; |
57 | #ifdef IXGBE_FCOE | ||
58 | struct dcb_app app = { | ||
59 | .selector = DCB_APP_IDTYPE_ETHTYPE, | ||
60 | .protocol = ETH_P_FCOE, | ||
61 | }; | ||
62 | u8 up = dcb_getapp(adapter->netdev, &app); | ||
56 | 63 | ||
57 | if (!scfg || !dcfg) | 64 | if (up && !(up & (1 << adapter->fcoe.up))) |
58 | return changes; | 65 | changes |= BIT_APP_UPCHG; |
66 | #endif | ||
59 | 67 | ||
60 | for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) { | 68 | for (i = DCB_PG_ATTR_TC_0; i < tc_max + DCB_PG_ATTR_TC_0; i++) { |
61 | src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0]; | 69 | src = &scfg->tc_config[i - DCB_PG_ATTR_TC_0]; |
@@ -332,28 +340,12 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) | |||
332 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 340 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
333 | int ret = DCB_NO_HW_CHG; | 341 | int ret = DCB_NO_HW_CHG; |
334 | int i; | 342 | int i; |
335 | #ifdef IXGBE_FCOE | ||
336 | struct dcb_app app = { | ||
337 | .selector = DCB_APP_IDTYPE_ETHTYPE, | ||
338 | .protocol = ETH_P_FCOE, | ||
339 | }; | ||
340 | u8 up; | ||
341 | |||
342 | /* In IEEE mode, use the IEEE Ethertype selector value */ | ||
343 | if (adapter->dcbx_cap & DCB_CAP_DCBX_VER_IEEE) { | ||
344 | app.selector = IEEE_8021QAZ_APP_SEL_ETHERTYPE; | ||
345 | up = dcb_ieee_getapp_mask(netdev, &app); | ||
346 | } else { | ||
347 | up = dcb_getapp(netdev, &app); | ||
348 | } | ||
349 | #endif | ||
350 | 343 | ||
351 | /* Fail command if not in CEE mode */ | 344 | /* Fail command if not in CEE mode */ |
352 | if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) | 345 | if (!(adapter->dcbx_cap & DCB_CAP_DCBX_VER_CEE)) |
353 | return ret; | 346 | return ret; |
354 | 347 | ||
355 | adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(&adapter->temp_dcb_cfg, | 348 | adapter->dcb_set_bitmap |= ixgbe_copy_dcb_cfg(adapter, |
356 | &adapter->dcb_cfg, | ||
357 | MAX_TRAFFIC_CLASS); | 349 | MAX_TRAFFIC_CLASS); |
358 | if (!adapter->dcb_set_bitmap) | 350 | if (!adapter->dcb_set_bitmap) |
359 | return ret; | 351 | return ret; |
@@ -440,8 +432,13 @@ static u8 ixgbe_dcbnl_set_all(struct net_device *netdev) | |||
440 | * FCoE is using changes. This happens if the APP info | 432 | * FCoE is using changes. This happens if the APP info |
441 | * changes or the up2tc mapping is updated. | 433 | * changes or the up2tc mapping is updated. |
442 | */ | 434 | */ |
443 | if ((up && !(up & (1 << adapter->fcoe.up))) || | 435 | if (adapter->dcb_set_bitmap & BIT_APP_UPCHG) { |
444 | (adapter->dcb_set_bitmap & BIT_APP_UPCHG)) { | 436 | struct dcb_app app = { |
437 | .selector = DCB_APP_IDTYPE_ETHTYPE, | ||
438 | .protocol = ETH_P_FCOE, | ||
439 | }; | ||
440 | u8 up = dcb_getapp(netdev, &app); | ||
441 | |||
445 | adapter->fcoe.up = ffs(up) - 1; | 442 | adapter->fcoe.up = ffs(up) - 1; |
446 | ixgbe_dcbnl_devreset(netdev); | 443 | ixgbe_dcbnl_devreset(netdev); |
447 | ret = DCB_HW_CHG_RST; | 444 | ret = DCB_HW_CHG_RST; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c index 31a2bf76a346..cfe7d269590c 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c | |||
@@ -1780,6 +1780,8 @@ static u16 ixgbe_clean_test_rings(struct ixgbe_ring *rx_ring, | |||
1780 | rx_desc = IXGBE_RX_DESC(rx_ring, rx_ntc); | 1780 | rx_desc = IXGBE_RX_DESC(rx_ring, rx_ntc); |
1781 | } | 1781 | } |
1782 | 1782 | ||
1783 | netdev_tx_reset_queue(txring_txq(tx_ring)); | ||
1784 | |||
1783 | /* re-map buffers to ring, store next to clean values */ | 1785 | /* re-map buffers to ring, store next to clean values */ |
1784 | ixgbe_alloc_rx_buffers(rx_ring, count); | 1786 | ixgbe_alloc_rx_buffers(rx_ring, count); |
1785 | rx_ring->next_to_clean = rx_ntc; | 1787 | rx_ring->next_to_clean = rx_ntc; |
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c index 88f6b2e9b72d..467948e9ecd9 100644 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | |||
@@ -2671,8 +2671,6 @@ void ixgbe_configure_tx_ring(struct ixgbe_adapter *adapter, | |||
2671 | /* enable queue */ | 2671 | /* enable queue */ |
2672 | IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl); | 2672 | IXGBE_WRITE_REG(hw, IXGBE_TXDCTL(reg_idx), txdctl); |
2673 | 2673 | ||
2674 | netdev_tx_reset_queue(txring_txq(ring)); | ||
2675 | |||
2676 | /* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */ | 2674 | /* TXDCTL.EN will return 0 on 82598 if link is down, so skip it */ |
2677 | if (hw->mac.type == ixgbe_mac_82598EB && | 2675 | if (hw->mac.type == ixgbe_mac_82598EB && |
2678 | !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP)) | 2676 | !(IXGBE_READ_REG(hw, IXGBE_LINKS) & IXGBE_LINKS_UP)) |
@@ -4167,6 +4165,8 @@ static void ixgbe_clean_tx_ring(struct ixgbe_ring *tx_ring) | |||
4167 | ixgbe_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); | 4165 | ixgbe_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); |
4168 | } | 4166 | } |
4169 | 4167 | ||
4168 | netdev_tx_reset_queue(txring_txq(tx_ring)); | ||
4169 | |||
4170 | size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count; | 4170 | size = sizeof(struct ixgbe_tx_buffer) * tx_ring->count; |
4171 | memset(tx_ring->tx_buffer_info, 0, size); | 4171 | memset(tx_ring->tx_buffer_info, 0, size); |
4172 | 4172 | ||
@@ -4418,8 +4418,8 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter) | |||
4418 | adapter->dcb_cfg.pfc_mode_enable = false; | 4418 | adapter->dcb_cfg.pfc_mode_enable = false; |
4419 | adapter->dcb_set_bitmap = 0x00; | 4419 | adapter->dcb_set_bitmap = 0x00; |
4420 | adapter->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE; | 4420 | adapter->dcbx_cap = DCB_CAP_DCBX_HOST | DCB_CAP_DCBX_VER_CEE; |
4421 | ixgbe_copy_dcb_cfg(&adapter->dcb_cfg, &adapter->temp_dcb_cfg, | 4421 | memcpy(&adapter->temp_dcb_cfg, &adapter->dcb_cfg, |
4422 | MAX_TRAFFIC_CLASS); | 4422 | sizeof(adapter->temp_dcb_cfg)); |
4423 | 4423 | ||
4424 | #endif | 4424 | #endif |
4425 | 4425 | ||
@@ -4866,10 +4866,12 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) | |||
4866 | netif_device_detach(netdev); | 4866 | netif_device_detach(netdev); |
4867 | 4867 | ||
4868 | if (netif_running(netdev)) { | 4868 | if (netif_running(netdev)) { |
4869 | rtnl_lock(); | ||
4869 | ixgbe_down(adapter); | 4870 | ixgbe_down(adapter); |
4870 | ixgbe_free_irq(adapter); | 4871 | ixgbe_free_irq(adapter); |
4871 | ixgbe_free_all_tx_resources(adapter); | 4872 | ixgbe_free_all_tx_resources(adapter); |
4872 | ixgbe_free_all_rx_resources(adapter); | 4873 | ixgbe_free_all_rx_resources(adapter); |
4874 | rtnl_unlock(); | ||
4873 | } | 4875 | } |
4874 | 4876 | ||
4875 | ixgbe_clear_interrupt_scheme(adapter); | 4877 | ixgbe_clear_interrupt_scheme(adapter); |
diff --git a/drivers/net/ethernet/micrel/ks8851.c b/drivers/net/ethernet/micrel/ks8851.c index f8dda009d3c0..5e313e9a252f 100644 --- a/drivers/net/ethernet/micrel/ks8851.c +++ b/drivers/net/ethernet/micrel/ks8851.c | |||
@@ -618,10 +618,8 @@ static void ks8851_irq_work(struct work_struct *work) | |||
618 | netif_dbg(ks, intr, ks->netdev, | 618 | netif_dbg(ks, intr, ks->netdev, |
619 | "%s: status 0x%04x\n", __func__, status); | 619 | "%s: status 0x%04x\n", __func__, status); |
620 | 620 | ||
621 | if (status & IRQ_LCI) { | 621 | if (status & IRQ_LCI) |
622 | /* should do something about checking link status */ | ||
623 | handled |= IRQ_LCI; | 622 | handled |= IRQ_LCI; |
624 | } | ||
625 | 623 | ||
626 | if (status & IRQ_LDI) { | 624 | if (status & IRQ_LDI) { |
627 | u16 pmecr = ks8851_rdreg16(ks, KS_PMECR); | 625 | u16 pmecr = ks8851_rdreg16(ks, KS_PMECR); |
@@ -684,6 +682,9 @@ static void ks8851_irq_work(struct work_struct *work) | |||
684 | 682 | ||
685 | mutex_unlock(&ks->lock); | 683 | mutex_unlock(&ks->lock); |
686 | 684 | ||
685 | if (status & IRQ_LCI) | ||
686 | mii_check_link(&ks->mii); | ||
687 | |||
687 | if (status & IRQ_TXI) | 688 | if (status & IRQ_TXI) |
688 | netif_wake_queue(ks->netdev); | 689 | netif_wake_queue(ks->netdev); |
689 | 690 | ||
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c index f54509377efa..ce6b44d1f252 100644 --- a/drivers/net/ethernet/realtek/r8169.c +++ b/drivers/net/ethernet/realtek/r8169.c | |||
@@ -61,8 +61,12 @@ | |||
61 | #define R8169_MSG_DEFAULT \ | 61 | #define R8169_MSG_DEFAULT \ |
62 | (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN) | 62 | (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN) |
63 | 63 | ||
64 | #define TX_BUFFS_AVAIL(tp) \ | 64 | #define TX_SLOTS_AVAIL(tp) \ |
65 | (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1) | 65 | (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx) |
66 | |||
67 | /* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */ | ||
68 | #define TX_FRAGS_READY_FOR(tp,nr_frags) \ | ||
69 | (TX_SLOTS_AVAIL(tp) >= (nr_frags + 1)) | ||
66 | 70 | ||
67 | /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). | 71 | /* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). |
68 | The RTL chips use a 64 element hash table based on the Ethernet CRC. */ | 72 | The RTL chips use a 64 element hash table based on the Ethernet CRC. */ |
@@ -5115,7 +5119,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
5115 | u32 opts[2]; | 5119 | u32 opts[2]; |
5116 | int frags; | 5120 | int frags; |
5117 | 5121 | ||
5118 | if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { | 5122 | if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) { |
5119 | netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); | 5123 | netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); |
5120 | goto err_stop_0; | 5124 | goto err_stop_0; |
5121 | } | 5125 | } |
@@ -5169,7 +5173,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
5169 | 5173 | ||
5170 | mmiowb(); | 5174 | mmiowb(); |
5171 | 5175 | ||
5172 | if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { | 5176 | if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) { |
5173 | /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must | 5177 | /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must |
5174 | * not miss a ring update when it notices a stopped queue. | 5178 | * not miss a ring update when it notices a stopped queue. |
5175 | */ | 5179 | */ |
@@ -5183,7 +5187,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb, | |||
5183 | * can't. | 5187 | * can't. |
5184 | */ | 5188 | */ |
5185 | smp_mb(); | 5189 | smp_mb(); |
5186 | if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) | 5190 | if (TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) |
5187 | netif_wake_queue(dev); | 5191 | netif_wake_queue(dev); |
5188 | } | 5192 | } |
5189 | 5193 | ||
@@ -5306,7 +5310,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp) | |||
5306 | */ | 5310 | */ |
5307 | smp_mb(); | 5311 | smp_mb(); |
5308 | if (netif_queue_stopped(dev) && | 5312 | if (netif_queue_stopped(dev) && |
5309 | (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { | 5313 | TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) { |
5310 | netif_wake_queue(dev); | 5314 | netif_wake_queue(dev); |
5311 | } | 5315 | } |
5312 | /* | 5316 | /* |
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c index 3cbfbffe3f00..4a0005342e65 100644 --- a/drivers/net/ethernet/sfc/efx.c +++ b/drivers/net/ethernet/sfc/efx.c | |||
@@ -1349,7 +1349,7 @@ static int efx_probe_interrupts(struct efx_nic *efx) | |||
1349 | } | 1349 | } |
1350 | 1350 | ||
1351 | /* RSS might be usable on VFs even if it is disabled on the PF */ | 1351 | /* RSS might be usable on VFs even if it is disabled on the PF */ |
1352 | efx->rss_spread = (efx->n_rx_channels > 1 ? | 1352 | efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ? |
1353 | efx->n_rx_channels : efx_vf_size(efx)); | 1353 | efx->n_rx_channels : efx_vf_size(efx)); |
1354 | 1354 | ||
1355 | return 0; | 1355 | return 0; |
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c index f975afdc315c..025367a94add 100644 --- a/drivers/net/macvlan.c +++ b/drivers/net/macvlan.c | |||
@@ -259,7 +259,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev) | |||
259 | 259 | ||
260 | xmit_world: | 260 | xmit_world: |
261 | skb->ip_summed = ip_summed; | 261 | skb->ip_summed = ip_summed; |
262 | skb_set_dev(skb, vlan->lowerdev); | 262 | skb->dev = vlan->lowerdev; |
263 | return dev_queue_xmit(skb); | 263 | return dev_queue_xmit(skb); |
264 | } | 264 | } |
265 | 265 | ||
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c index 0427c6561c84..cb8fd5069dbe 100644 --- a/drivers/net/macvtap.c +++ b/drivers/net/macvtap.c | |||
@@ -1,5 +1,6 @@ | |||
1 | #include <linux/etherdevice.h> | 1 | #include <linux/etherdevice.h> |
2 | #include <linux/if_macvlan.h> | 2 | #include <linux/if_macvlan.h> |
3 | #include <linux/if_vlan.h> | ||
3 | #include <linux/interrupt.h> | 4 | #include <linux/interrupt.h> |
4 | #include <linux/nsproxy.h> | 5 | #include <linux/nsproxy.h> |
5 | #include <linux/compat.h> | 6 | #include <linux/compat.h> |
@@ -759,6 +760,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, | |||
759 | struct macvlan_dev *vlan; | 760 | struct macvlan_dev *vlan; |
760 | int ret; | 761 | int ret; |
761 | int vnet_hdr_len = 0; | 762 | int vnet_hdr_len = 0; |
763 | int vlan_offset = 0; | ||
764 | int copied; | ||
762 | 765 | ||
763 | if (q->flags & IFF_VNET_HDR) { | 766 | if (q->flags & IFF_VNET_HDR) { |
764 | struct virtio_net_hdr vnet_hdr; | 767 | struct virtio_net_hdr vnet_hdr; |
@@ -773,18 +776,48 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q, | |||
773 | if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) | 776 | if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) |
774 | return -EFAULT; | 777 | return -EFAULT; |
775 | } | 778 | } |
779 | copied = vnet_hdr_len; | ||
780 | |||
781 | if (!vlan_tx_tag_present(skb)) | ||
782 | len = min_t(int, skb->len, len); | ||
783 | else { | ||
784 | int copy; | ||
785 | struct { | ||
786 | __be16 h_vlan_proto; | ||
787 | __be16 h_vlan_TCI; | ||
788 | } veth; | ||
789 | veth.h_vlan_proto = htons(ETH_P_8021Q); | ||
790 | veth.h_vlan_TCI = htons(vlan_tx_tag_get(skb)); | ||
791 | |||
792 | vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto); | ||
793 | len = min_t(int, skb->len + VLAN_HLEN, len); | ||
794 | |||
795 | copy = min_t(int, vlan_offset, len); | ||
796 | ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy); | ||
797 | len -= copy; | ||
798 | copied += copy; | ||
799 | if (ret || !len) | ||
800 | goto done; | ||
801 | |||
802 | copy = min_t(int, sizeof(veth), len); | ||
803 | ret = memcpy_toiovecend(iv, (void *)&veth, copied, copy); | ||
804 | len -= copy; | ||
805 | copied += copy; | ||
806 | if (ret || !len) | ||
807 | goto done; | ||
808 | } | ||
776 | 809 | ||
777 | len = min_t(int, skb->len, len); | 810 | ret = skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len); |
778 | 811 | copied += len; | |
779 | ret = skb_copy_datagram_const_iovec(skb, 0, iv, vnet_hdr_len, len); | ||
780 | 812 | ||
813 | done: | ||
781 | rcu_read_lock_bh(); | 814 | rcu_read_lock_bh(); |
782 | vlan = rcu_dereference_bh(q->vlan); | 815 | vlan = rcu_dereference_bh(q->vlan); |
783 | if (vlan) | 816 | if (vlan) |
784 | macvlan_count_rx(vlan, len, ret == 0, 0); | 817 | macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0); |
785 | rcu_read_unlock_bh(); | 818 | rcu_read_unlock_bh(); |
786 | 819 | ||
787 | return ret ? ret : (len + vnet_hdr_len); | 820 | return ret ? ret : copied; |
788 | } | 821 | } |
789 | 822 | ||
790 | static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb, | 823 | static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb, |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 90a30026a931..00880edba048 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
@@ -83,6 +83,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
83 | struct cdc_state *info = (void *) &dev->data; | 83 | struct cdc_state *info = (void *) &dev->data; |
84 | int status; | 84 | int status; |
85 | int rndis; | 85 | int rndis; |
86 | bool android_rndis_quirk = false; | ||
86 | struct usb_driver *driver = driver_of(intf); | 87 | struct usb_driver *driver = driver_of(intf); |
87 | struct usb_cdc_mdlm_desc *desc = NULL; | 88 | struct usb_cdc_mdlm_desc *desc = NULL; |
88 | struct usb_cdc_mdlm_detail_desc *detail = NULL; | 89 | struct usb_cdc_mdlm_detail_desc *detail = NULL; |
@@ -195,6 +196,11 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf) | |||
195 | info->control, | 196 | info->control, |
196 | info->u->bSlaveInterface0, | 197 | info->u->bSlaveInterface0, |
197 | info->data); | 198 | info->data); |
199 | /* fall back to hard-wiring for RNDIS */ | ||
200 | if (rndis) { | ||
201 | android_rndis_quirk = true; | ||
202 | goto next_desc; | ||
203 | } | ||
198 | goto bad_desc; | 204 | goto bad_desc; |
199 | } | 205 | } |
200 | if (info->control != intf) { | 206 | if (info->control != intf) { |
@@ -271,11 +277,15 @@ next_desc: | |||
271 | /* Microsoft ActiveSync based and some regular RNDIS devices lack the | 277 | /* Microsoft ActiveSync based and some regular RNDIS devices lack the |
272 | * CDC descriptors, so we'll hard-wire the interfaces and not check | 278 | * CDC descriptors, so we'll hard-wire the interfaces and not check |
273 | * for descriptors. | 279 | * for descriptors. |
280 | * | ||
281 | * Some Android RNDIS devices have a CDC Union descriptor pointing | ||
282 | * to non-existing interfaces. Ignore that and attempt the same | ||
283 | * hard-wired 0 and 1 interfaces. | ||
274 | */ | 284 | */ |
275 | if (rndis && !info->u) { | 285 | if (rndis && (!info->u || android_rndis_quirk)) { |
276 | info->control = usb_ifnum_to_if(dev->udev, 0); | 286 | info->control = usb_ifnum_to_if(dev->udev, 0); |
277 | info->data = usb_ifnum_to_if(dev->udev, 1); | 287 | info->data = usb_ifnum_to_if(dev->udev, 1); |
278 | if (!info->control || !info->data) { | 288 | if (!info->control || !info->data || info->control != intf) { |
279 | dev_dbg(&intf->dev, | 289 | dev_dbg(&intf->dev, |
280 | "rndis: master #0/%p slave #1/%p\n", | 290 | "rndis: master #0/%p slave #1/%p\n", |
281 | info->control, | 291 | info->control, |
diff --git a/drivers/net/wireless/ath/ath9k/ar9003_phy.c b/drivers/net/wireless/ath/ath9k/ar9003_phy.c index deb6cfb2959a..600aca9fe6b1 100644 --- a/drivers/net/wireless/ath/ath9k/ar9003_phy.c +++ b/drivers/net/wireless/ath/ath9k/ar9003_phy.c | |||
@@ -373,7 +373,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, | |||
373 | else | 373 | else |
374 | spur_subchannel_sd = 0; | 374 | spur_subchannel_sd = 0; |
375 | 375 | ||
376 | spur_freq_sd = (freq_offset << 9) / 11; | 376 | spur_freq_sd = ((freq_offset + 10) << 9) / 11; |
377 | 377 | ||
378 | } else { | 378 | } else { |
379 | if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, | 379 | if (REG_READ_FIELD(ah, AR_PHY_GEN_CTRL, |
@@ -382,7 +382,7 @@ static void ar9003_hw_spur_ofdm_work(struct ath_hw *ah, | |||
382 | else | 382 | else |
383 | spur_subchannel_sd = 1; | 383 | spur_subchannel_sd = 1; |
384 | 384 | ||
385 | spur_freq_sd = (freq_offset << 9) / 11; | 385 | spur_freq_sd = ((freq_offset - 10) << 9) / 11; |
386 | 386 | ||
387 | } | 387 | } |
388 | 388 | ||
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c index eb3829b03cd3..e2b34e1563f4 100644 --- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c +++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c | |||
@@ -2637,6 +2637,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data) | |||
2637 | /* after stopping the bus, exit thread */ | 2637 | /* after stopping the bus, exit thread */ |
2638 | brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); | 2638 | brcmf_sdbrcm_bus_stop(bus->sdiodev->dev); |
2639 | bus->dpc_tsk = NULL; | 2639 | bus->dpc_tsk = NULL; |
2640 | spin_lock_irqsave(&bus->dpc_tl_lock, flags); | ||
2640 | break; | 2641 | break; |
2641 | } | 2642 | } |
2642 | 2643 | ||
diff --git a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c index f4b84d1596e3..22474608a70b 100644 --- a/drivers/net/wireless/iwlwifi/iwl-agn-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-agn-rx.c | |||
@@ -773,8 +773,7 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
773 | struct sk_buff *skb; | 773 | struct sk_buff *skb; |
774 | __le16 fc = hdr->frame_control; | 774 | __le16 fc = hdr->frame_control; |
775 | struct iwl_rxon_context *ctx; | 775 | struct iwl_rxon_context *ctx; |
776 | struct page *p; | 776 | unsigned int hdrlen, fraglen; |
777 | int offset; | ||
778 | 777 | ||
779 | /* We only process data packets if the interface is open */ | 778 | /* We only process data packets if the interface is open */ |
780 | if (unlikely(!priv->is_open)) { | 779 | if (unlikely(!priv->is_open)) { |
@@ -788,16 +787,24 @@ static void iwlagn_pass_packet_to_mac80211(struct iwl_priv *priv, | |||
788 | iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats)) | 787 | iwlagn_set_decrypted_flag(priv, hdr, ampdu_status, stats)) |
789 | return; | 788 | return; |
790 | 789 | ||
791 | skb = dev_alloc_skb(128); | 790 | /* Dont use dev_alloc_skb(), we'll have enough headroom once |
791 | * ieee80211_hdr pulled. | ||
792 | */ | ||
793 | skb = alloc_skb(128, GFP_ATOMIC); | ||
792 | if (!skb) { | 794 | if (!skb) { |
793 | IWL_ERR(priv, "dev_alloc_skb failed\n"); | 795 | IWL_ERR(priv, "alloc_skb failed\n"); |
794 | return; | 796 | return; |
795 | } | 797 | } |
798 | hdrlen = min_t(unsigned int, len, skb_tailroom(skb)); | ||
799 | memcpy(skb_put(skb, hdrlen), hdr, hdrlen); | ||
800 | fraglen = len - hdrlen; | ||
796 | 801 | ||
797 | offset = (void *)hdr - rxb_addr(rxb); | 802 | if (fraglen) { |
798 | p = rxb_steal_page(rxb); | 803 | int offset = (void *)hdr + hdrlen - rxb_addr(rxb); |
799 | skb_add_rx_frag(skb, 0, p, offset, len, len); | ||
800 | 804 | ||
805 | skb_add_rx_frag(skb, 0, rxb_steal_page(rxb), offset, | ||
806 | fraglen, rxb->truesize); | ||
807 | } | ||
801 | iwl_update_stats(priv, false, fc, len); | 808 | iwl_update_stats(priv, false, fc, len); |
802 | 809 | ||
803 | /* | 810 | /* |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c index 8b1a7988e176..aa7aea168138 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c +++ b/drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c | |||
@@ -374,8 +374,9 @@ static void iwl_rx_handle_rxbuf(struct iwl_trans *trans, | |||
374 | if (WARN_ON(!rxb)) | 374 | if (WARN_ON(!rxb)) |
375 | return; | 375 | return; |
376 | 376 | ||
377 | rxcb.truesize = PAGE_SIZE << hw_params(trans).rx_page_order; | ||
377 | dma_unmap_page(trans->dev, rxb->page_dma, | 378 | dma_unmap_page(trans->dev, rxb->page_dma, |
378 | PAGE_SIZE << hw_params(trans).rx_page_order, | 379 | rxcb.truesize, |
379 | DMA_FROM_DEVICE); | 380 | DMA_FROM_DEVICE); |
380 | 381 | ||
381 | rxcb._page = rxb->page; | 382 | rxcb._page = rxb->page; |
diff --git a/drivers/net/wireless/iwlwifi/iwl-trans.h b/drivers/net/wireless/iwlwifi/iwl-trans.h index 0c81cbaa8088..fdf97886a5e4 100644 --- a/drivers/net/wireless/iwlwifi/iwl-trans.h +++ b/drivers/net/wireless/iwlwifi/iwl-trans.h | |||
@@ -260,6 +260,7 @@ static inline void iwl_free_resp(struct iwl_host_cmd *cmd) | |||
260 | 260 | ||
261 | struct iwl_rx_cmd_buffer { | 261 | struct iwl_rx_cmd_buffer { |
262 | struct page *_page; | 262 | struct page *_page; |
263 | unsigned int truesize; | ||
263 | }; | 264 | }; |
264 | 265 | ||
265 | static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r) | 266 | static inline void *rxb_addr(struct iwl_rx_cmd_buffer *r) |
diff --git a/drivers/parisc/sba_iommu.c b/drivers/parisc/sba_iommu.c index 8644d5372e7f..42cfcd9eb9aa 100644 --- a/drivers/parisc/sba_iommu.c +++ b/drivers/parisc/sba_iommu.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <asm/ropes.h> | 44 | #include <asm/ropes.h> |
45 | #include <asm/mckinley.h> /* for proc_mckinley_root */ | 45 | #include <asm/mckinley.h> /* for proc_mckinley_root */ |
46 | #include <asm/runway.h> /* for proc_runway_root */ | 46 | #include <asm/runway.h> /* for proc_runway_root */ |
47 | #include <asm/page.h> /* for PAGE0 */ | ||
47 | #include <asm/pdc.h> /* for PDC_MODEL_* */ | 48 | #include <asm/pdc.h> /* for PDC_MODEL_* */ |
48 | #include <asm/pdcpat.h> /* for is_pdc_pat() */ | 49 | #include <asm/pdcpat.h> /* for is_pdc_pat() */ |
49 | #include <asm/parisc-device.h> | 50 | #include <asm/parisc-device.h> |
diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c index e70dd382a009..046fb1bd8619 100644 --- a/drivers/regulator/core.c +++ b/drivers/regulator/core.c | |||
@@ -1431,7 +1431,10 @@ void devm_regulator_put(struct regulator *regulator) | |||
1431 | 1431 | ||
1432 | rc = devres_destroy(regulator->dev, devm_regulator_release, | 1432 | rc = devres_destroy(regulator->dev, devm_regulator_release, |
1433 | devm_regulator_match, regulator); | 1433 | devm_regulator_match, regulator); |
1434 | WARN_ON(rc); | 1434 | if (rc == 0) |
1435 | regulator_put(regulator); | ||
1436 | else | ||
1437 | WARN_ON(rc); | ||
1435 | } | 1438 | } |
1436 | EXPORT_SYMBOL_GPL(devm_regulator_put); | 1439 | EXPORT_SYMBOL_GPL(devm_regulator_put); |
1437 | 1440 | ||
diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c index 96579296f04d..17a58c56eebf 100644 --- a/drivers/regulator/max8997.c +++ b/drivers/regulator/max8997.c | |||
@@ -684,7 +684,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev, | |||
684 | } | 684 | } |
685 | 685 | ||
686 | new_val++; | 686 | new_val++; |
687 | } while (desc->min + desc->step + new_val <= desc->max); | 687 | } while (desc->min + desc->step * new_val <= desc->max); |
688 | 688 | ||
689 | new_idx = tmp_idx; | 689 | new_idx = tmp_idx; |
690 | new_val = tmp_val; | 690 | new_val = tmp_val; |
diff --git a/drivers/scsi/hosts.c b/drivers/scsi/hosts.c index 351dc0b86fab..a3a056a9db67 100644 --- a/drivers/scsi/hosts.c +++ b/drivers/scsi/hosts.c | |||
@@ -218,6 +218,9 @@ int scsi_add_host_with_dma(struct Scsi_Host *shost, struct device *dev, | |||
218 | 218 | ||
219 | if (!shost->shost_gendev.parent) | 219 | if (!shost->shost_gendev.parent) |
220 | shost->shost_gendev.parent = dev ? dev : &platform_bus; | 220 | shost->shost_gendev.parent = dev ? dev : &platform_bus; |
221 | if (!dma_dev) | ||
222 | dma_dev = shost->shost_gendev.parent; | ||
223 | |||
221 | shost->dma_dev = dma_dev; | 224 | shost->dma_dev = dma_dev; |
222 | 225 | ||
223 | error = device_add(&shost->shost_gendev); | 226 | error = device_add(&shost->shost_gendev); |
diff --git a/drivers/scsi/qla2xxx/qla_bsg.c b/drivers/scsi/qla2xxx/qla_bsg.c index f74cc0602f3b..bc3cc6d91117 100644 --- a/drivers/scsi/qla2xxx/qla_bsg.c +++ b/drivers/scsi/qla2xxx/qla_bsg.c | |||
@@ -1367,6 +1367,9 @@ qla2x00_read_optrom(struct fc_bsg_job *bsg_job) | |||
1367 | struct qla_hw_data *ha = vha->hw; | 1367 | struct qla_hw_data *ha = vha->hw; |
1368 | int rval = 0; | 1368 | int rval = 0; |
1369 | 1369 | ||
1370 | if (ha->flags.isp82xx_reset_hdlr_active) | ||
1371 | return -EBUSY; | ||
1372 | |||
1370 | rval = qla2x00_optrom_setup(bsg_job, vha, 0); | 1373 | rval = qla2x00_optrom_setup(bsg_job, vha, 0); |
1371 | if (rval) | 1374 | if (rval) |
1372 | return rval; | 1375 | return rval; |
diff --git a/drivers/scsi/qla2xxx/qla_dbg.c b/drivers/scsi/qla2xxx/qla_dbg.c index 897731b93df2..62324a1d5573 100644 --- a/drivers/scsi/qla2xxx/qla_dbg.c +++ b/drivers/scsi/qla2xxx/qla_dbg.c | |||
@@ -15,7 +15,7 @@ | |||
15 | * | Mailbox commands | 0x113e | 0x112c-0x112e | | 15 | * | Mailbox commands | 0x113e | 0x112c-0x112e | |
16 | * | | | 0x113a | | 16 | * | | | 0x113a | |
17 | * | Device Discovery | 0x2086 | 0x2020-0x2022 | | 17 | * | Device Discovery | 0x2086 | 0x2020-0x2022 | |
18 | * | Queue Command and IO tracing | 0x302f | 0x3006,0x3008 | | 18 | * | Queue Command and IO tracing | 0x3030 | 0x3006,0x3008 | |
19 | * | | | 0x302d-0x302e | | 19 | * | | | 0x302d-0x302e | |
20 | * | DPC Thread | 0x401c | | | 20 | * | DPC Thread | 0x401c | | |
21 | * | Async Events | 0x505d | 0x502b-0x502f | | 21 | * | Async Events | 0x505d | 0x502b-0x502f | |
diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c index f79844ce7122..ce42288049b5 100644 --- a/drivers/scsi/qla2xxx/qla_isr.c +++ b/drivers/scsi/qla2xxx/qla_isr.c | |||
@@ -1715,13 +1715,24 @@ qla2x00_status_entry(scsi_qla_host_t *vha, struct rsp_que *rsp, void *pkt) | |||
1715 | res = DID_ERROR << 16; | 1715 | res = DID_ERROR << 16; |
1716 | break; | 1716 | break; |
1717 | } | 1717 | } |
1718 | } else { | 1718 | } else if (lscsi_status != SAM_STAT_TASK_SET_FULL && |
1719 | lscsi_status != SAM_STAT_BUSY) { | ||
1720 | /* | ||
1721 | * scsi status of task set and busy are considered to be | ||
1722 | * task not completed. | ||
1723 | */ | ||
1724 | |||
1719 | ql_dbg(ql_dbg_io, fcport->vha, 0x301f, | 1725 | ql_dbg(ql_dbg_io, fcport->vha, 0x301f, |
1720 | "Dropped frame(s) detected (0x%x " | 1726 | "Dropped frame(s) detected (0x%x " |
1721 | "of 0x%x bytes).\n", resid, scsi_bufflen(cp)); | 1727 | "of 0x%x bytes).\n", resid, |
1728 | scsi_bufflen(cp)); | ||
1722 | 1729 | ||
1723 | res = DID_ERROR << 16 | lscsi_status; | 1730 | res = DID_ERROR << 16 | lscsi_status; |
1724 | goto check_scsi_status; | 1731 | goto check_scsi_status; |
1732 | } else { | ||
1733 | ql_dbg(ql_dbg_io, fcport->vha, 0x3030, | ||
1734 | "scsi_status: 0x%x, lscsi_status: 0x%x\n", | ||
1735 | scsi_status, lscsi_status); | ||
1725 | } | 1736 | } |
1726 | 1737 | ||
1727 | res = DID_OK << 16 | lscsi_status; | 1738 | res = DID_OK << 16 | lscsi_status; |
diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c index f0528539bbbc..de722a933438 100644 --- a/drivers/scsi/qla2xxx/qla_nx.c +++ b/drivers/scsi/qla2xxx/qla_nx.c | |||
@@ -3125,6 +3125,7 @@ qla82xx_need_reset_handler(scsi_qla_host_t *vha) | |||
3125 | ql_log(ql_log_info, vha, 0x00b7, | 3125 | ql_log(ql_log_info, vha, 0x00b7, |
3126 | "HW State: COLD/RE-INIT.\n"); | 3126 | "HW State: COLD/RE-INIT.\n"); |
3127 | qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA82XX_DEV_COLD); | 3127 | qla82xx_wr_32(ha, QLA82XX_CRB_DEV_STATE, QLA82XX_DEV_COLD); |
3128 | qla82xx_set_rst_ready(ha); | ||
3128 | if (ql2xmdenable) { | 3129 | if (ql2xmdenable) { |
3129 | if (qla82xx_md_collect(vha)) | 3130 | if (qla82xx_md_collect(vha)) |
3130 | ql_log(ql_log_warn, vha, 0xb02c, | 3131 | ql_log(ql_log_warn, vha, 0xb02c, |
diff --git a/drivers/scsi/qla2xxx/qla_os.c b/drivers/scsi/qla2xxx/qla_os.c index a2f999273a5f..7db803377c64 100644 --- a/drivers/scsi/qla2xxx/qla_os.c +++ b/drivers/scsi/qla2xxx/qla_os.c | |||
@@ -3577,9 +3577,25 @@ void qla2x00_relogin(struct scsi_qla_host *vha) | |||
3577 | continue; | 3577 | continue; |
3578 | /* Attempt a retry. */ | 3578 | /* Attempt a retry. */ |
3579 | status = 1; | 3579 | status = 1; |
3580 | } else | 3580 | } else { |
3581 | status = qla2x00_fabric_login(vha, | 3581 | status = qla2x00_fabric_login(vha, |
3582 | fcport, &next_loopid); | 3582 | fcport, &next_loopid); |
3583 | if (status == QLA_SUCCESS) { | ||
3584 | int status2; | ||
3585 | uint8_t opts; | ||
3586 | |||
3587 | opts = 0; | ||
3588 | if (fcport->flags & | ||
3589 | FCF_FCP2_DEVICE) | ||
3590 | opts |= BIT_1; | ||
3591 | status2 = | ||
3592 | qla2x00_get_port_database( | ||
3593 | vha, fcport, | ||
3594 | opts); | ||
3595 | if (status2 != QLA_SUCCESS) | ||
3596 | status = 1; | ||
3597 | } | ||
3598 | } | ||
3583 | } else | 3599 | } else |
3584 | status = qla2x00_local_device_login(vha, | 3600 | status = qla2x00_local_device_login(vha, |
3585 | fcport); | 3601 | fcport); |
diff --git a/drivers/scsi/qla2xxx/qla_sup.c b/drivers/scsi/qla2xxx/qla_sup.c index 3c13c0a6be63..a683e766d1ae 100644 --- a/drivers/scsi/qla2xxx/qla_sup.c +++ b/drivers/scsi/qla2xxx/qla_sup.c | |||
@@ -1017,6 +1017,9 @@ qla2xxx_flash_npiv_conf(scsi_qla_host_t *vha) | |||
1017 | !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha)) | 1017 | !IS_CNA_CAPABLE(ha) && !IS_QLA2031(ha)) |
1018 | return; | 1018 | return; |
1019 | 1019 | ||
1020 | if (ha->flags.isp82xx_reset_hdlr_active) | ||
1021 | return; | ||
1022 | |||
1020 | ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr, | 1023 | ha->isp_ops->read_optrom(vha, (uint8_t *)&hdr, |
1021 | ha->flt_region_npiv_conf << 2, sizeof(struct qla_npiv_header)); | 1024 | ha->flt_region_npiv_conf << 2, sizeof(struct qla_npiv_header)); |
1022 | if (hdr.version == __constant_cpu_to_le16(0xffff)) | 1025 | if (hdr.version == __constant_cpu_to_le16(0xffff)) |
diff --git a/drivers/scsi/qla2xxx/qla_version.h b/drivers/scsi/qla2xxx/qla_version.h index 29d780c38040..f5fdb16bec9b 100644 --- a/drivers/scsi/qla2xxx/qla_version.h +++ b/drivers/scsi/qla2xxx/qla_version.h | |||
@@ -7,9 +7,9 @@ | |||
7 | /* | 7 | /* |
8 | * Driver version | 8 | * Driver version |
9 | */ | 9 | */ |
10 | #define QLA2XXX_VERSION "8.03.07.13-k" | 10 | #define QLA2XXX_VERSION "8.04.00.03-k" |
11 | 11 | ||
12 | #define QLA_DRIVER_MAJOR_VER 8 | 12 | #define QLA_DRIVER_MAJOR_VER 8 |
13 | #define QLA_DRIVER_MINOR_VER 3 | 13 | #define QLA_DRIVER_MINOR_VER 4 |
14 | #define QLA_DRIVER_PATCH_VER 7 | 14 | #define QLA_DRIVER_PATCH_VER 0 |
15 | #define QLA_DRIVER_BETA_VER 3 | 15 | #define QLA_DRIVER_BETA_VER 3 |
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index efccd72c4a3e..1b3843117268 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c | |||
@@ -175,7 +175,8 @@ static void virtscsi_complete_free(void *buf) | |||
175 | 175 | ||
176 | if (cmd->comp) | 176 | if (cmd->comp) |
177 | complete_all(cmd->comp); | 177 | complete_all(cmd->comp); |
178 | mempool_free(cmd, virtscsi_cmd_pool); | 178 | else |
179 | mempool_free(cmd, virtscsi_cmd_pool); | ||
179 | } | 180 | } |
180 | 181 | ||
181 | static void virtscsi_ctrl_done(struct virtqueue *vq) | 182 | static void virtscsi_ctrl_done(struct virtqueue *vq) |
@@ -311,21 +312,22 @@ out: | |||
311 | static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd) | 312 | static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd) |
312 | { | 313 | { |
313 | DECLARE_COMPLETION_ONSTACK(comp); | 314 | DECLARE_COMPLETION_ONSTACK(comp); |
314 | int ret; | 315 | int ret = FAILED; |
315 | 316 | ||
316 | cmd->comp = ∁ | 317 | cmd->comp = ∁ |
317 | ret = virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd, | 318 | if (virtscsi_kick_cmd(vscsi, vscsi->ctrl_vq, cmd, |
318 | sizeof cmd->req.tmf, sizeof cmd->resp.tmf, | 319 | sizeof cmd->req.tmf, sizeof cmd->resp.tmf, |
319 | GFP_NOIO); | 320 | GFP_NOIO) < 0) |
320 | if (ret < 0) | 321 | goto out; |
321 | return FAILED; | ||
322 | 322 | ||
323 | wait_for_completion(&comp); | 323 | wait_for_completion(&comp); |
324 | if (cmd->resp.tmf.response != VIRTIO_SCSI_S_OK && | 324 | if (cmd->resp.tmf.response == VIRTIO_SCSI_S_OK || |
325 | cmd->resp.tmf.response != VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) | 325 | cmd->resp.tmf.response == VIRTIO_SCSI_S_FUNCTION_SUCCEEDED) |
326 | return FAILED; | 326 | ret = SUCCESS; |
327 | 327 | ||
328 | return SUCCESS; | 328 | out: |
329 | mempool_free(cmd, virtscsi_cmd_pool); | ||
330 | return ret; | ||
329 | } | 331 | } |
330 | 332 | ||
331 | static int virtscsi_device_reset(struct scsi_cmnd *sc) | 333 | static int virtscsi_device_reset(struct scsi_cmnd *sc) |
diff --git a/drivers/target/target_core_tpg.c b/drivers/target/target_core_tpg.c index 70c3ffb981e7..e320ec24aa1b 100644 --- a/drivers/target/target_core_tpg.c +++ b/drivers/target/target_core_tpg.c | |||
@@ -60,7 +60,6 @@ static void core_clear_initiator_node_from_tpg( | |||
60 | int i; | 60 | int i; |
61 | struct se_dev_entry *deve; | 61 | struct se_dev_entry *deve; |
62 | struct se_lun *lun; | 62 | struct se_lun *lun; |
63 | struct se_lun_acl *acl, *acl_tmp; | ||
64 | 63 | ||
65 | spin_lock_irq(&nacl->device_list_lock); | 64 | spin_lock_irq(&nacl->device_list_lock); |
66 | for (i = 0; i < TRANSPORT_MAX_LUNS_PER_TPG; i++) { | 65 | for (i = 0; i < TRANSPORT_MAX_LUNS_PER_TPG; i++) { |
@@ -81,28 +80,7 @@ static void core_clear_initiator_node_from_tpg( | |||
81 | core_update_device_list_for_node(lun, NULL, deve->mapped_lun, | 80 | core_update_device_list_for_node(lun, NULL, deve->mapped_lun, |
82 | TRANSPORT_LUNFLAGS_NO_ACCESS, nacl, tpg, 0); | 81 | TRANSPORT_LUNFLAGS_NO_ACCESS, nacl, tpg, 0); |
83 | 82 | ||
84 | spin_lock(&lun->lun_acl_lock); | ||
85 | list_for_each_entry_safe(acl, acl_tmp, | ||
86 | &lun->lun_acl_list, lacl_list) { | ||
87 | if (!strcmp(acl->initiatorname, nacl->initiatorname) && | ||
88 | (acl->mapped_lun == deve->mapped_lun)) | ||
89 | break; | ||
90 | } | ||
91 | |||
92 | if (!acl) { | ||
93 | pr_err("Unable to locate struct se_lun_acl for %s," | ||
94 | " mapped_lun: %u\n", nacl->initiatorname, | ||
95 | deve->mapped_lun); | ||
96 | spin_unlock(&lun->lun_acl_lock); | ||
97 | spin_lock_irq(&nacl->device_list_lock); | ||
98 | continue; | ||
99 | } | ||
100 | |||
101 | list_del(&acl->lacl_list); | ||
102 | spin_unlock(&lun->lun_acl_lock); | ||
103 | |||
104 | spin_lock_irq(&nacl->device_list_lock); | 83 | spin_lock_irq(&nacl->device_list_lock); |
105 | kfree(acl); | ||
106 | } | 84 | } |
107 | spin_unlock_irq(&nacl->device_list_lock); | 85 | spin_unlock_irq(&nacl->device_list_lock); |
108 | } | 86 | } |
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 1f21d2a1e528..5c170100de9c 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/if_arp.h> | 24 | #include <linux/if_arp.h> |
25 | #include <linux/if_tun.h> | 25 | #include <linux/if_tun.h> |
26 | #include <linux/if_macvlan.h> | 26 | #include <linux/if_macvlan.h> |
27 | #include <linux/if_vlan.h> | ||
27 | 28 | ||
28 | #include <net/sock.h> | 29 | #include <net/sock.h> |
29 | 30 | ||
@@ -283,8 +284,12 @@ static int peek_head_len(struct sock *sk) | |||
283 | 284 | ||
284 | spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); | 285 | spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); |
285 | head = skb_peek(&sk->sk_receive_queue); | 286 | head = skb_peek(&sk->sk_receive_queue); |
286 | if (likely(head)) | 287 | if (likely(head)) { |
287 | len = head->len; | 288 | len = head->len; |
289 | if (vlan_tx_tag_present(head)) | ||
290 | len += VLAN_HLEN; | ||
291 | } | ||
292 | |||
288 | spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); | 293 | spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); |
289 | return len; | 294 | return len; |
290 | } | 295 | } |
diff --git a/drivers/video/console/sticore.c b/drivers/video/console/sticore.c index 6468a297e341..39571f9e0162 100644 --- a/drivers/video/console/sticore.c +++ b/drivers/video/console/sticore.c | |||
@@ -22,7 +22,9 @@ | |||
22 | #include <linux/font.h> | 22 | #include <linux/font.h> |
23 | 23 | ||
24 | #include <asm/hardware.h> | 24 | #include <asm/hardware.h> |
25 | #include <asm/page.h> | ||
25 | #include <asm/parisc-device.h> | 26 | #include <asm/parisc-device.h> |
27 | #include <asm/pdc.h> | ||
26 | #include <asm/cacheflush.h> | 28 | #include <asm/cacheflush.h> |
27 | #include <asm/grfioctl.h> | 29 | #include <asm/grfioctl.h> |
28 | 30 | ||
diff --git a/drivers/video/uvesafb.c b/drivers/video/uvesafb.c index 26e83d7fdd6f..b0e2a4261afe 100644 --- a/drivers/video/uvesafb.c +++ b/drivers/video/uvesafb.c | |||
@@ -73,7 +73,7 @@ static void uvesafb_cn_callback(struct cn_msg *msg, struct netlink_skb_parms *ns | |||
73 | struct uvesafb_task *utask; | 73 | struct uvesafb_task *utask; |
74 | struct uvesafb_ktask *task; | 74 | struct uvesafb_ktask *task; |
75 | 75 | ||
76 | if (!cap_raised(current_cap(), CAP_SYS_ADMIN)) | 76 | if (!capable(CAP_SYS_ADMIN)) |
77 | return; | 77 | return; |
78 | 78 | ||
79 | if (msg->seq >= UVESAFB_TASKS_MAX) | 79 | if (msg->seq >= UVESAFB_TASKS_MAX) |
diff --git a/drivers/video/xen-fbfront.c b/drivers/video/xen-fbfront.c index cb4529c40d74..b7f5173ff9e9 100644 --- a/drivers/video/xen-fbfront.c +++ b/drivers/video/xen-fbfront.c | |||
@@ -365,7 +365,7 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
365 | struct fb_info *fb_info; | 365 | struct fb_info *fb_info; |
366 | int fb_size; | 366 | int fb_size; |
367 | int val; | 367 | int val; |
368 | int ret; | 368 | int ret = 0; |
369 | 369 | ||
370 | info = kzalloc(sizeof(*info), GFP_KERNEL); | 370 | info = kzalloc(sizeof(*info), GFP_KERNEL); |
371 | if (info == NULL) { | 371 | if (info == NULL) { |
@@ -458,26 +458,31 @@ static int __devinit xenfb_probe(struct xenbus_device *dev, | |||
458 | xenfb_init_shared_page(info, fb_info); | 458 | xenfb_init_shared_page(info, fb_info); |
459 | 459 | ||
460 | ret = xenfb_connect_backend(dev, info); | 460 | ret = xenfb_connect_backend(dev, info); |
461 | if (ret < 0) | 461 | if (ret < 0) { |
462 | goto error; | 462 | xenbus_dev_fatal(dev, ret, "xenfb_connect_backend"); |
463 | goto error_fb; | ||
464 | } | ||
463 | 465 | ||
464 | ret = register_framebuffer(fb_info); | 466 | ret = register_framebuffer(fb_info); |
465 | if (ret) { | 467 | if (ret) { |
466 | fb_deferred_io_cleanup(fb_info); | ||
467 | fb_dealloc_cmap(&fb_info->cmap); | ||
468 | framebuffer_release(fb_info); | ||
469 | xenbus_dev_fatal(dev, ret, "register_framebuffer"); | 468 | xenbus_dev_fatal(dev, ret, "register_framebuffer"); |
470 | goto error; | 469 | goto error_fb; |
471 | } | 470 | } |
472 | info->fb_info = fb_info; | 471 | info->fb_info = fb_info; |
473 | 472 | ||
474 | xenfb_make_preferred_console(); | 473 | xenfb_make_preferred_console(); |
475 | return 0; | 474 | return 0; |
476 | 475 | ||
477 | error_nomem: | 476 | error_fb: |
478 | ret = -ENOMEM; | 477 | fb_deferred_io_cleanup(fb_info); |
479 | xenbus_dev_fatal(dev, ret, "allocating device memory"); | 478 | fb_dealloc_cmap(&fb_info->cmap); |
480 | error: | 479 | framebuffer_release(fb_info); |
480 | error_nomem: | ||
481 | if (!ret) { | ||
482 | ret = -ENOMEM; | ||
483 | xenbus_dev_fatal(dev, ret, "allocating device memory"); | ||
484 | } | ||
485 | error: | ||
481 | xenfb_remove(dev); | 486 | xenfb_remove(dev); |
482 | return ret; | 487 | return ret; |
483 | } | 488 | } |
diff --git a/drivers/xen/Kconfig b/drivers/xen/Kconfig index 94243136f6bf..ea20c51d24c7 100644 --- a/drivers/xen/Kconfig +++ b/drivers/xen/Kconfig | |||
@@ -183,15 +183,17 @@ config XEN_ACPI_PROCESSOR | |||
183 | depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ | 183 | depends on XEN && X86 && ACPI_PROCESSOR && CPU_FREQ |
184 | default m | 184 | default m |
185 | help | 185 | help |
186 | This ACPI processor uploads Power Management information to the Xen hypervisor. | 186 | This ACPI processor uploads Power Management information to the Xen |
187 | 187 | hypervisor. | |
188 | To do that the driver parses the Power Management data and uploads said | 188 | |
189 | information to the Xen hypervisor. Then the Xen hypervisor can select the | 189 | To do that the driver parses the Power Management data and uploads |
190 | proper Cx and Pxx states. It also registers itslef as the SMM so that | 190 | said information to the Xen hypervisor. Then the Xen hypervisor can |
191 | other drivers (such as ACPI cpufreq scaling driver) will not load. | 191 | select the proper Cx and Pxx states. It also registers itslef as the |
192 | 192 | SMM so that other drivers (such as ACPI cpufreq scaling driver) will | |
193 | To compile this driver as a module, choose M here: the | 193 | not load. |
194 | module will be called xen_acpi_processor If you do not know what to choose, | 194 | |
195 | select M here. If the CPUFREQ drivers are built in, select Y here. | 195 | To compile this driver as a module, choose M here: the module will be |
196 | called xen_acpi_processor If you do not know what to choose, select | ||
197 | M here. If the CPUFREQ drivers are built in, select Y here. | ||
196 | 198 | ||
197 | endmenu | 199 | endmenu |