aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2012-05-16 22:17:37 -0400
committerDavid S. Miller <davem@davemloft.net>2012-05-16 22:17:37 -0400
commit028940342a906db8da014a7603a0deddc2c323dd (patch)
tree688dbc38a3e218f2493d311b1d70a67668837347 /drivers
parentbe3eed2e96340d3c7a4d1ea1d63e7bd6095d1e34 (diff)
parent0e93b4b304ae052ba1bc73f6d34a68556fe93429 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'drivers')
-rw-r--r--drivers/acpi/power.c2
-rw-r--r--drivers/acpi/scan.c17
-rw-r--r--drivers/base/regmap/regmap.c4
-rw-r--r--drivers/block/drbd/drbd_nl.c2
-rw-r--r--drivers/gpio/gpio-omap.c9
-rw-r--r--drivers/gpio/gpio-pch.c57
-rw-r--r--drivers/gpio/gpio-samsung.c18
-rw-r--r--drivers/gpu/drm/i915/i915_debugfs.c3
-rw-r--r--drivers/gpu/drm/i915/i915_dma.c15
-rw-r--r--drivers/gpu/drm/i915/intel_display.c9
-rw-r--r--drivers/gpu/drm/i915/intel_hdmi.c2
-rw-r--r--drivers/gpu/drm/i915/intel_lvds.c4
-rw-r--r--drivers/gpu/drm/i915/intel_ringbuffer.c9
-rw-r--r--drivers/gpu/drm/i915/intel_sdvo.c6
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_i2c.c199
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_i2c.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c4
-rw-r--r--drivers/leds/leds-netxbig.c4
-rw-r--r--drivers/leds/leds-ns2.c2
-rw-r--r--drivers/md/bitmap.c3
-rw-r--r--drivers/md/bitmap.h3
-rw-r--r--drivers/md/dm-log-userspace-transfer.c2
-rw-r--r--drivers/md/dm-mpath.c4
-rw-r--r--drivers/md/dm-thin.c16
-rw-r--r--drivers/media/dvb/dvb-core/dvb_frontend.c4
-rw-r--r--drivers/media/rc/ene_ir.c32
-rw-r--r--drivers/media/rc/fintek-cir.c22
-rw-r--r--drivers/media/rc/ite-cir.c20
-rw-r--r--drivers/media/rc/nuvoton-cir.c36
-rw-r--r--drivers/media/rc/winbond-cir.c78
-rw-r--r--drivers/media/video/gspca/sonixj.c8
-rw-r--r--drivers/media/video/marvell-ccic/mmp-driver.c1
-rw-r--r--drivers/media/video/s5p-fimc/fimc-capture.c33
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.c4
-rw-r--r--drivers/media/video/s5p-fimc/fimc-core.h2
-rw-r--r--drivers/media/video/soc_camera.c8
-rw-r--r--drivers/media/video/videobuf2-dma-contig.c3
-rw-r--r--drivers/media/video/videobuf2-memops.c1
-rw-r--r--drivers/mtd/mtdchar.c2
-rw-r--r--drivers/mtd/nand/ams-delta.c17
-rw-r--r--drivers/net/bonding/bond_3ad.c18
-rw-r--r--drivers/net/bonding/bond_3ad.h2
-rw-r--r--drivers/net/bonding/bond_alb.c12
-rw-r--r--drivers/net/bonding/bond_main.c16
-rw-r--r--drivers/net/bonding/bonding.h2
-rw-r--r--drivers/net/ethernet/ibm/ehea/ehea_main.c2
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c20
-rw-r--r--drivers/net/ethernet/micrel/ks8851.c7
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h2
-rw-r--r--drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c25
-rw-r--r--drivers/net/ethernet/realtek/r8169.c16
-rw-r--r--drivers/net/ethernet/sfc/efx.c2
-rw-r--r--drivers/net/macvlan.c2
-rw-r--r--drivers/net/macvtap.c43
-rw-r--r--drivers/net/usb/cdc_ether.c16
-rw-r--r--drivers/net/usb/usbnet.c54
-rw-r--r--drivers/net/wireless/rtlwifi/pci.c16
-rw-r--r--drivers/net/wireless/rtlwifi/usb.c10
-rw-r--r--drivers/parisc/sba_iommu.c1
-rw-r--r--drivers/pci/pci-acpi.c4
-rw-r--r--drivers/platform/x86/intel_mid_powerbtn.c2
-rw-r--r--drivers/ptp/ptp_pch.c1
-rw-r--r--drivers/regulator/core.c5
-rw-r--r--drivers/regulator/max8997.c2
-rw-r--r--drivers/remoteproc/remoteproc_core.c2
-rw-r--r--drivers/rtc/rtc-mpc5121.c3
-rw-r--r--drivers/scsi/hosts.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_bsg.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_dbg.c2
-rw-r--r--drivers/scsi/qla2xxx/qla_isr.c15
-rw-r--r--drivers/scsi/qla2xxx/qla_nx.c1
-rw-r--r--drivers/scsi/qla2xxx/qla_os.c18
-rw-r--r--drivers/scsi/qla2xxx/qla_sup.c3
-rw-r--r--drivers/scsi/qla2xxx/qla_version.h6
-rw-r--r--drivers/scsi/virtio_scsi.c24
-rw-r--r--drivers/target/target_core_tpg.c22
-rw-r--r--drivers/tty/vt/keyboard.c2
-rw-r--r--drivers/vhost/net.c7
-rw-r--r--drivers/video/console/sticore.c2
-rw-r--r--drivers/video/uvesafb.c2
-rw-r--r--drivers/video/xen-fbfront.c27
-rw-r--r--drivers/xen/Kconfig22
82 files changed, 552 insertions, 558 deletions
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c
index 7049a7d27c4f..330bb4d75852 100644
--- a/drivers/acpi/power.c
+++ b/drivers/acpi/power.c
@@ -631,7 +631,7 @@ int acpi_power_get_inferred_state(struct acpi_device *device, int *state)
631 * We know a device's inferred power state when all the resources 631 * We know a device's inferred power state when all the resources
632 * required for a given D-state are 'on'. 632 * required for a given D-state are 'on'.
633 */ 633 */
634 for (i = ACPI_STATE_D0; i < ACPI_STATE_D3; i++) { 634 for (i = ACPI_STATE_D0; i < ACPI_STATE_D3_HOT; i++) {
635 list = &device->power.states[i].resources; 635 list = &device->power.states[i].resources;
636 if (list->count < 1) 636 if (list->count < 1)
637 continue; 637 continue;
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
index 767e2dcb9616..7417267e88fa 100644
--- a/drivers/acpi/scan.c
+++ b/drivers/acpi/scan.c
@@ -869,7 +869,7 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
869 /* 869 /*
870 * Enumerate supported power management states 870 * Enumerate supported power management states
871 */ 871 */
872 for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3; i++) { 872 for (i = ACPI_STATE_D0; i <= ACPI_STATE_D3_HOT; i++) {
873 struct acpi_device_power_state *ps = &device->power.states[i]; 873 struct acpi_device_power_state *ps = &device->power.states[i];
874 char object_name[5] = { '_', 'P', 'R', '0' + i, '\0' }; 874 char object_name[5] = { '_', 'P', 'R', '0' + i, '\0' };
875 875
@@ -884,21 +884,18 @@ static int acpi_bus_get_power_flags(struct acpi_device *device)
884 acpi_bus_add_power_resource(ps->resources.handles[j]); 884 acpi_bus_add_power_resource(ps->resources.handles[j]);
885 } 885 }
886 886
887 /* The exist of _PR3 indicates D3Cold support */
888 if (i == ACPI_STATE_D3) {
889 status = acpi_get_handle(device->handle, object_name, &handle);
890 if (ACPI_SUCCESS(status))
891 device->power.states[ACPI_STATE_D3_COLD].flags.valid = 1;
892 }
893
894 /* Evaluate "_PSx" to see if we can do explicit sets */ 887 /* Evaluate "_PSx" to see if we can do explicit sets */
895 object_name[2] = 'S'; 888 object_name[2] = 'S';
896 status = acpi_get_handle(device->handle, object_name, &handle); 889 status = acpi_get_handle(device->handle, object_name, &handle);
897 if (ACPI_SUCCESS(status)) 890 if (ACPI_SUCCESS(status))
898 ps->flags.explicit_set = 1; 891 ps->flags.explicit_set = 1;
899 892
900 /* State is valid if we have some power control */ 893 /*
901 if (ps->resources.count || ps->flags.explicit_set) 894 * State is valid if there are means to put the device into it.
895 * D3hot is only valid if _PR3 present.
896 */
897 if (ps->resources.count ||
898 (ps->flags.explicit_set && i < ACPI_STATE_D3_HOT))
902 ps->flags.valid = 1; 899 ps->flags.valid = 1;
903 900
904 ps->power = -1; /* Unknown - driver assigned */ 901 ps->power = -1; /* Unknown - driver assigned */
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
982static __devinit void 979static __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
231static int pch_irq_type(struct irq_data *d, unsigned int type) 231static 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 */ 283unlock:
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);
294end:
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
304static 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
316static irqreturn_t pch_gpio_handler(int irq, void *dev_id) 312static 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);
423end: 422end:
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)
455static struct samsung_gpio_cfg exynos_gpio_cfg = { 456static 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)
463static struct samsung_gpio_cfg s5p64x0_gpio_cfg_rbank = { 465static 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
2126static struct samsung_gpio_chip exynos4_gpios_1[] = {
2127#ifdef CONFIG_ARCH_EXYNOS4 2128#ifdef CONFIG_ARCH_EXYNOS4
2129static 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
2228static struct samsung_gpio_chip exynos4_gpios_2[] = {
2229#ifdef CONFIG_ARCH_EXYNOS4 2230#ifdef CONFIG_ARCH_EXYNOS4
2231static 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
2373static struct samsung_gpio_chip exynos4_gpios_3[] = {
2374#ifdef CONFIG_ARCH_EXYNOS4 2375#ifdef CONFIG_ARCH_EXYNOS4
2376static 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
2386static struct samsung_gpio_chip exynos5_gpios_1[] = { 2388static 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)
2974err_ioremap4: 2979err_ioremap4:
2975 iounmap(gpio_base3); 2980 iounmap(gpio_base3);
2976err_ioremap3: 2981err_ioremap3:
@@ -2979,6 +2984,7 @@ err_ioremap2:
2979 iounmap(gpio_base1); 2984 iounmap(gpio_base1);
2980err_ioremap1: 2985err_ioremap1:
2981 return -ENOMEM; 2986 return -ENOMEM;
2987#endif
2982} 2988}
2983core_initcall(samsung_gpiolib_init); 2989core_initcall(samsung_gpiolib_init);
2984 2990
diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c
index b505b70dba05..e6162a1681f0 100644
--- a/drivers/gpu/drm/i915/i915_debugfs.c
+++ b/drivers/gpu/drm/i915/i915_debugfs.c
@@ -1224,6 +1224,9 @@ static int i915_emon_status(struct seq_file *m, void *unused)
1224 unsigned long temp, chipset, gfx; 1224 unsigned long temp, chipset, gfx;
1225 int ret; 1225 int ret;
1226 1226
1227 if (!IS_GEN5(dev))
1228 return -ENODEV;
1229
1227 ret = mutex_lock_interruptible(&dev->struct_mutex); 1230 ret = mutex_lock_interruptible(&dev->struct_mutex);
1228 if (ret) 1231 if (ret)
1229 return ret; 1232 return ret;
diff --git a/drivers/gpu/drm/i915/i915_dma.c b/drivers/gpu/drm/i915/i915_dma.c
index 785f67f963ef..ba60f3c8f911 100644
--- a/drivers/gpu/drm/i915/i915_dma.c
+++ b/drivers/gpu/drm/i915/i915_dma.c
@@ -1701,6 +1701,9 @@ void i915_update_gfx_val(struct drm_i915_private *dev_priv)
1701 unsigned long diffms; 1701 unsigned long diffms;
1702 u32 count; 1702 u32 count;
1703 1703
1704 if (dev_priv->info->gen != 5)
1705 return;
1706
1704 getrawmonotonic(&now); 1707 getrawmonotonic(&now);
1705 diff1 = timespec_sub(now, dev_priv->last_time2); 1708 diff1 = timespec_sub(now, dev_priv->last_time2);
1706 1709
@@ -2121,12 +2124,14 @@ int i915_driver_load(struct drm_device *dev, unsigned long flags)
2121 setup_timer(&dev_priv->hangcheck_timer, i915_hangcheck_elapsed, 2124 setup_timer(&dev_priv->hangcheck_timer, i915_hangcheck_elapsed,
2122 (unsigned long) dev); 2125 (unsigned long) dev);
2123 2126
2124 spin_lock(&mchdev_lock); 2127 if (IS_GEN5(dev)) {
2125 i915_mch_dev = dev_priv; 2128 spin_lock(&mchdev_lock);
2126 dev_priv->mchdev_lock = &mchdev_lock; 2129 i915_mch_dev = dev_priv;
2127 spin_unlock(&mchdev_lock); 2130 dev_priv->mchdev_lock = &mchdev_lock;
2131 spin_unlock(&mchdev_lock);
2128 2132
2129 ips_ping_for_i915_load(); 2133 ips_ping_for_i915_load();
2134 }
2130 2135
2131 return 0; 2136 return 0;
2132 2137
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 5908cd563400..1b1cf3b3ff51 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -7072,9 +7072,6 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
7072 struct drm_device *dev = crtc->dev; 7072 struct drm_device *dev = crtc->dev;
7073 drm_i915_private_t *dev_priv = dev->dev_private; 7073 drm_i915_private_t *dev_priv = dev->dev_private;
7074 struct intel_crtc *intel_crtc = to_intel_crtc(crtc); 7074 struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
7075 int pipe = intel_crtc->pipe;
7076 int dpll_reg = DPLL(pipe);
7077 int dpll = I915_READ(dpll_reg);
7078 7075
7079 if (HAS_PCH_SPLIT(dev)) 7076 if (HAS_PCH_SPLIT(dev))
7080 return; 7077 return;
@@ -7087,10 +7084,15 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
7087 * the manual case. 7084 * the manual case.
7088 */ 7085 */
7089 if (!HAS_PIPE_CXSR(dev) && intel_crtc->lowfreq_avail) { 7086 if (!HAS_PIPE_CXSR(dev) && intel_crtc->lowfreq_avail) {
7087 int pipe = intel_crtc->pipe;
7088 int dpll_reg = DPLL(pipe);
7089 u32 dpll;
7090
7090 DRM_DEBUG_DRIVER("downclocking LVDS\n"); 7091 DRM_DEBUG_DRIVER("downclocking LVDS\n");
7091 7092
7092 assert_panel_unlocked(dev_priv, pipe); 7093 assert_panel_unlocked(dev_priv, pipe);
7093 7094
7095 dpll = I915_READ(dpll_reg);
7094 dpll |= DISPLAY_RATE_SELECT_FPA1; 7096 dpll |= DISPLAY_RATE_SELECT_FPA1;
7095 I915_WRITE(dpll_reg, dpll); 7097 I915_WRITE(dpll_reg, dpll);
7096 intel_wait_for_vblank(dev, pipe); 7098 intel_wait_for_vblank(dev, pipe);
@@ -7098,7 +7100,6 @@ static void intel_decrease_pllclock(struct drm_crtc *crtc)
7098 if (!(dpll & DISPLAY_RATE_SELECT_FPA1)) 7100 if (!(dpll & DISPLAY_RATE_SELECT_FPA1))
7099 DRM_DEBUG_DRIVER("failed to downclock LVDS!\n"); 7101 DRM_DEBUG_DRIVER("failed to downclock LVDS!\n");
7100 } 7102 }
7101
7102} 7103}
7103 7104
7104/** 7105/**
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index cae3e5f17a49..2d7f47b56b6a 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -136,7 +136,7 @@ static void i9xx_write_infoframe(struct drm_encoder *encoder,
136 136
137 val &= ~VIDEO_DIP_SELECT_MASK; 137 val &= ~VIDEO_DIP_SELECT_MASK;
138 138
139 I915_WRITE(VIDEO_DIP_CTL, val | port | flags); 139 I915_WRITE(VIDEO_DIP_CTL, VIDEO_DIP_ENABLE | val | port | flags);
140 140
141 for (i = 0; i < len; i += 4) { 141 for (i = 0; i < len; i += 4) {
142 I915_WRITE(VIDEO_DIP_DATA, *data); 142 I915_WRITE(VIDEO_DIP_DATA, *data);
diff --git a/drivers/gpu/drm/i915/intel_lvds.c b/drivers/gpu/drm/i915/intel_lvds.c
index 30e2c82101de..9c71183629c2 100644
--- a/drivers/gpu/drm/i915/intel_lvds.c
+++ b/drivers/gpu/drm/i915/intel_lvds.c
@@ -750,7 +750,7 @@ static const struct dmi_system_id intel_no_lvds[] = {
750 .ident = "Hewlett-Packard t5745", 750 .ident = "Hewlett-Packard t5745",
751 .matches = { 751 .matches = {
752 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), 752 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
753 DMI_MATCH(DMI_BOARD_NAME, "hp t5745"), 753 DMI_MATCH(DMI_PRODUCT_NAME, "hp t5745"),
754 }, 754 },
755 }, 755 },
756 { 756 {
@@ -758,7 +758,7 @@ static const struct dmi_system_id intel_no_lvds[] = {
758 .ident = "Hewlett-Packard st5747", 758 .ident = "Hewlett-Packard st5747",
759 .matches = { 759 .matches = {
760 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"), 760 DMI_MATCH(DMI_BOARD_VENDOR, "Hewlett-Packard"),
761 DMI_MATCH(DMI_BOARD_NAME, "hp st5747"), 761 DMI_MATCH(DMI_PRODUCT_NAME, "hp st5747"),
762 }, 762 },
763 }, 763 },
764 { 764 {
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
1221static int intel_sdvo_supports_hotplug(struct intel_sdvo *intel_sdvo) 1221static 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
36static void 32static void
37i2c_drive_scl(void *data, int state) 33i2c_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
116static void
117i2c_delay(struct nouveau_i2c_chan *port, u32 nsec)
118{
119 udelay((nsec + 500) / 1000);
120}
121
122static bool
123i2c_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
135static int
136i2c_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
156static void
157i2c_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
169static int
170i2c_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
184static int
185i2c_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
203static int
204i2c_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
219static int
220i2c_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
235static int
236i2c_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
244static int
245i2c_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
274static u32
275i2c_bit_func(struct i2c_adapter *adap)
276{
277 return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
278}
279
280const struct i2c_algorithm nouveau_i2c_bit_algo = {
281 .master_xfer = i2c_bit_xfer,
282 .functionality = i2c_bit_func
283};
284
285static const uint32_t nv50_i2c_port[] = { 112static 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 @@
34struct nouveau_i2c_chan { 34struct 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/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index ea7df16e2f84..5992502a3448 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -241,8 +241,8 @@ int radeon_wb_init(struct radeon_device *rdev)
241 rdev->wb.use_event = true; 241 rdev->wb.use_event = true;
242 } 242 }
243 } 243 }
244 /* always use writeback/events on NI */ 244 /* always use writeback/events on NI, APUs */
245 if (ASIC_IS_DCE5(rdev)) { 245 if (rdev->family >= CHIP_PALM) {
246 rdev->wb.enabled = true; 246 rdev->wb.enabled = true;
247 rdev->wb.use_event = true; 247 rdev->wb.use_event = true;
248 } 248 }
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
115static void __devexit gpio_ext_free(struct netxbig_gpio_ext *gpio_ext) 115static 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
295static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store); 295static DEVICE_ATTR(sata, 0644, netxbig_led_sata_show, netxbig_led_sata_store);
296 296
297static void __devexit delete_netxbig_led(struct netxbig_led_data *led_dat) 297static 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
258static void __devexit delete_ns2_led(struct ns2_led_data *led_dat) 258static 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/bitmap.c b/drivers/md/bitmap.c
index 97e73e555d11..17e2b472e16d 100644
--- a/drivers/md/bitmap.c
+++ b/drivers/md/bitmap.c
@@ -1727,8 +1727,7 @@ int bitmap_create(struct mddev *mddev)
1727 bitmap->chunkshift = (ffz(~mddev->bitmap_info.chunksize) 1727 bitmap->chunkshift = (ffz(~mddev->bitmap_info.chunksize)
1728 - BITMAP_BLOCK_SHIFT); 1728 - BITMAP_BLOCK_SHIFT);
1729 1729
1730 /* now that chunksize and chunkshift are set, we can use these macros */ 1730 chunks = (blocks + (1 << bitmap->chunkshift) - 1) >>
1731 chunks = (blocks + bitmap->chunkshift - 1) >>
1732 bitmap->chunkshift; 1731 bitmap->chunkshift;
1733 pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO; 1732 pages = (chunks + PAGE_COUNTER_RATIO - 1) / PAGE_COUNTER_RATIO;
1734 1733
diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h
index 55ca5aec84e4..b44b0aba2d47 100644
--- a/drivers/md/bitmap.h
+++ b/drivers/md/bitmap.h
@@ -101,9 +101,6 @@ typedef __u16 bitmap_counter_t;
101 101
102#define BITMAP_BLOCK_SHIFT 9 102#define BITMAP_BLOCK_SHIFT 9
103 103
104/* how many blocks per chunk? (this is variable) */
105#define CHUNK_BLOCK_RATIO(bitmap) ((bitmap)->mddev->bitmap_info.chunksize >> BITMAP_BLOCK_SHIFT)
106
107#endif 104#endif
108 105
109/* 106/*
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 */
304static void __cell_release_singleton(struct cell *cell, struct bio *bio) 306static 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
311static void cell_release_singleton(struct cell *cell, struct bio *bio) 314static void cell_release_singleton(struct cell *cell, struct bio *bio)
@@ -1177,6 +1180,7 @@ static void no_space(struct cell *cell)
1177static void process_discard(struct thin_c *tc, struct bio *bio) 1180static 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)
2759module_init(dm_thin_init); 2767module_init(dm_thin_init);
2760module_exit(dm_thin_exit); 2768module_exit(dm_thin_exit);
2761 2769
2762MODULE_DESCRIPTION(DM_NAME "device-mapper thin provisioning target"); 2770MODULE_DESCRIPTION(DM_NAME " thin provisioning target");
2763MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>"); 2771MODULE_AUTHOR("Joe Thornber <dm-devel@redhat.com>");
2764MODULE_LICENSE("GPL"); 2772MODULE_LICENSE("GPL");
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c
index 0f64d7182657..cb888d835a89 100644
--- a/drivers/media/dvb/dvb-core/dvb_frontend.c
+++ b/drivers/media/dvb/dvb-core/dvb_frontend.c
@@ -1921,6 +1921,10 @@ static int dtv_set_frontend(struct dvb_frontend *fe)
1921 } else { 1921 } else {
1922 /* default values */ 1922 /* default values */
1923 switch (c->delivery_system) { 1923 switch (c->delivery_system) {
1924 case SYS_DVBS:
1925 case SYS_DVBS2:
1926 case SYS_ISDBS:
1927 case SYS_TURBO:
1924 case SYS_DVBC_ANNEX_A: 1928 case SYS_DVBC_ANNEX_A:
1925 case SYS_DVBC_ANNEX_C: 1929 case SYS_DVBC_ANNEX_C:
1926 fepriv->min_delay = HZ / 20; 1930 fepriv->min_delay = HZ / 20;
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
index 860c112e0fd2..bef5296173c9 100644
--- a/drivers/media/rc/ene_ir.c
+++ b/drivers/media/rc/ene_ir.c
@@ -1018,22 +1018,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
1018 1018
1019 spin_lock_init(&dev->hw_lock); 1019 spin_lock_init(&dev->hw_lock);
1020 1020
1021 /* claim the resources */
1022 error = -EBUSY;
1023 dev->hw_io = pnp_port_start(pnp_dev, 0);
1024 if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) {
1025 dev->hw_io = -1;
1026 dev->irq = -1;
1027 goto error;
1028 }
1029
1030 dev->irq = pnp_irq(pnp_dev, 0);
1031 if (request_irq(dev->irq, ene_isr,
1032 IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) {
1033 dev->irq = -1;
1034 goto error;
1035 }
1036
1037 pnp_set_drvdata(pnp_dev, dev); 1021 pnp_set_drvdata(pnp_dev, dev);
1038 dev->pnp_dev = pnp_dev; 1022 dev->pnp_dev = pnp_dev;
1039 1023
@@ -1086,6 +1070,22 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
1086 device_set_wakeup_capable(&pnp_dev->dev, true); 1070 device_set_wakeup_capable(&pnp_dev->dev, true);
1087 device_set_wakeup_enable(&pnp_dev->dev, true); 1071 device_set_wakeup_enable(&pnp_dev->dev, true);
1088 1072
1073 /* claim the resources */
1074 error = -EBUSY;
1075 dev->hw_io = pnp_port_start(pnp_dev, 0);
1076 if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) {
1077 dev->hw_io = -1;
1078 dev->irq = -1;
1079 goto error;
1080 }
1081
1082 dev->irq = pnp_irq(pnp_dev, 0);
1083 if (request_irq(dev->irq, ene_isr,
1084 IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) {
1085 dev->irq = -1;
1086 goto error;
1087 }
1088
1089 error = rc_register_device(rdev); 1089 error = rc_register_device(rdev);
1090 if (error < 0) 1090 if (error < 0)
1091 goto error; 1091 goto error;
diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c
index 392d4be91f8f..4a3a238bcfbc 100644
--- a/drivers/media/rc/fintek-cir.c
+++ b/drivers/media/rc/fintek-cir.c
@@ -197,7 +197,7 @@ static int fintek_hw_detect(struct fintek_dev *fintek)
197 /* 197 /*
198 * Newer reviews of this chipset uses port 8 instead of 5 198 * Newer reviews of this chipset uses port 8 instead of 5
199 */ 199 */
200 if ((chip != 0x0408) || (chip != 0x0804)) 200 if ((chip != 0x0408) && (chip != 0x0804))
201 fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2; 201 fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2;
202 else 202 else
203 fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1; 203 fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1;
@@ -514,16 +514,6 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
514 514
515 spin_lock_init(&fintek->fintek_lock); 515 spin_lock_init(&fintek->fintek_lock);
516 516
517 ret = -EBUSY;
518 /* now claim resources */
519 if (!request_region(fintek->cir_addr,
520 fintek->cir_port_len, FINTEK_DRIVER_NAME))
521 goto failure;
522
523 if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
524 FINTEK_DRIVER_NAME, (void *)fintek))
525 goto failure;
526
527 pnp_set_drvdata(pdev, fintek); 517 pnp_set_drvdata(pdev, fintek);
528 fintek->pdev = pdev; 518 fintek->pdev = pdev;
529 519
@@ -558,6 +548,16 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
558 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ 548 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */
559 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); 549 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);
560 550
551 ret = -EBUSY;
552 /* now claim resources */
553 if (!request_region(fintek->cir_addr,
554 fintek->cir_port_len, FINTEK_DRIVER_NAME))
555 goto failure;
556
557 if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
558 FINTEK_DRIVER_NAME, (void *)fintek))
559 goto failure;
560
561 ret = rc_register_device(rdev); 561 ret = rc_register_device(rdev);
562 if (ret) 562 if (ret)
563 goto failure; 563 goto failure;
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
index 682009d76cdf..0e49c99abf68 100644
--- a/drivers/media/rc/ite-cir.c
+++ b/drivers/media/rc/ite-cir.c
@@ -1515,16 +1515,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
1515 /* initialize raw event */ 1515 /* initialize raw event */
1516 init_ir_raw_event(&itdev->rawir); 1516 init_ir_raw_event(&itdev->rawir);
1517 1517
1518 ret = -EBUSY;
1519 /* now claim resources */
1520 if (!request_region(itdev->cir_addr,
1521 dev_desc->io_region_size, ITE_DRIVER_NAME))
1522 goto failure;
1523
1524 if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
1525 ITE_DRIVER_NAME, (void *)itdev))
1526 goto failure;
1527
1528 /* set driver data into the pnp device */ 1518 /* set driver data into the pnp device */
1529 pnp_set_drvdata(pdev, itdev); 1519 pnp_set_drvdata(pdev, itdev);
1530 itdev->pdev = pdev; 1520 itdev->pdev = pdev;
@@ -1600,6 +1590,16 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
1600 rdev->driver_name = ITE_DRIVER_NAME; 1590 rdev->driver_name = ITE_DRIVER_NAME;
1601 rdev->map_name = RC_MAP_RC6_MCE; 1591 rdev->map_name = RC_MAP_RC6_MCE;
1602 1592
1593 ret = -EBUSY;
1594 /* now claim resources */
1595 if (!request_region(itdev->cir_addr,
1596 dev_desc->io_region_size, ITE_DRIVER_NAME))
1597 goto failure;
1598
1599 if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
1600 ITE_DRIVER_NAME, (void *)itdev))
1601 goto failure;
1602
1603 ret = rc_register_device(rdev); 1603 ret = rc_register_device(rdev);
1604 if (ret) 1604 if (ret)
1605 goto failure; 1605 goto failure;
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
index 144f3f55d765..8b2c071ac0ab 100644
--- a/drivers/media/rc/nuvoton-cir.c
+++ b/drivers/media/rc/nuvoton-cir.c
@@ -1021,24 +1021,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
1021 spin_lock_init(&nvt->nvt_lock); 1021 spin_lock_init(&nvt->nvt_lock);
1022 spin_lock_init(&nvt->tx.lock); 1022 spin_lock_init(&nvt->tx.lock);
1023 1023
1024 ret = -EBUSY;
1025 /* now claim resources */
1026 if (!request_region(nvt->cir_addr,
1027 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1028 goto failure;
1029
1030 if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,
1031 NVT_DRIVER_NAME, (void *)nvt))
1032 goto failure;
1033
1034 if (!request_region(nvt->cir_wake_addr,
1035 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1036 goto failure;
1037
1038 if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,
1039 NVT_DRIVER_NAME, (void *)nvt))
1040 goto failure;
1041
1042 pnp_set_drvdata(pdev, nvt); 1024 pnp_set_drvdata(pdev, nvt);
1043 nvt->pdev = pdev; 1025 nvt->pdev = pdev;
1044 1026
@@ -1085,6 +1067,24 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
1085 rdev->tx_resolution = XYZ; 1067 rdev->tx_resolution = XYZ;
1086#endif 1068#endif
1087 1069
1070 ret = -EBUSY;
1071 /* now claim resources */
1072 if (!request_region(nvt->cir_addr,
1073 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1074 goto failure;
1075
1076 if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,
1077 NVT_DRIVER_NAME, (void *)nvt))
1078 goto failure;
1079
1080 if (!request_region(nvt->cir_wake_addr,
1081 CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
1082 goto failure;
1083
1084 if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,
1085 NVT_DRIVER_NAME, (void *)nvt))
1086 goto failure;
1087
1088 ret = rc_register_device(rdev); 1088 ret = rc_register_device(rdev);
1089 if (ret) 1089 if (ret)
1090 goto failure; 1090 goto failure;
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
index af526586fa26..342c2c8c1ddf 100644
--- a/drivers/media/rc/winbond-cir.c
+++ b/drivers/media/rc/winbond-cir.c
@@ -991,39 +991,10 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
991 "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n", 991 "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n",
992 data->wbase, data->ebase, data->sbase, data->irq); 992 data->wbase, data->ebase, data->sbase, data->irq);
993 993
994 if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
995 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
996 data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1);
997 err = -EBUSY;
998 goto exit_free_data;
999 }
1000
1001 if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) {
1002 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1003 data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1);
1004 err = -EBUSY;
1005 goto exit_release_wbase;
1006 }
1007
1008 if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) {
1009 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1010 data->sbase, data->sbase + SP_IOMEM_LEN - 1);
1011 err = -EBUSY;
1012 goto exit_release_ebase;
1013 }
1014
1015 err = request_irq(data->irq, wbcir_irq_handler,
1016 IRQF_DISABLED, DRVNAME, device);
1017 if (err) {
1018 dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
1019 err = -EBUSY;
1020 goto exit_release_sbase;
1021 }
1022
1023 led_trigger_register_simple("cir-tx", &data->txtrigger); 994 led_trigger_register_simple("cir-tx", &data->txtrigger);
1024 if (!data->txtrigger) { 995 if (!data->txtrigger) {
1025 err = -ENOMEM; 996 err = -ENOMEM;
1026 goto exit_free_irq; 997 goto exit_free_data;
1027 } 998 }
1028 999
1029 led_trigger_register_simple("cir-rx", &data->rxtrigger); 1000 led_trigger_register_simple("cir-rx", &data->rxtrigger);
@@ -1062,9 +1033,38 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
1062 data->dev->priv = data; 1033 data->dev->priv = data;
1063 data->dev->dev.parent = &device->dev; 1034 data->dev->dev.parent = &device->dev;
1064 1035
1036 if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
1037 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1038 data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1);
1039 err = -EBUSY;
1040 goto exit_free_rc;
1041 }
1042
1043 if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) {
1044 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1045 data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1);
1046 err = -EBUSY;
1047 goto exit_release_wbase;
1048 }
1049
1050 if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) {
1051 dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
1052 data->sbase, data->sbase + SP_IOMEM_LEN - 1);
1053 err = -EBUSY;
1054 goto exit_release_ebase;
1055 }
1056
1057 err = request_irq(data->irq, wbcir_irq_handler,
1058 IRQF_DISABLED, DRVNAME, device);
1059 if (err) {
1060 dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
1061 err = -EBUSY;
1062 goto exit_release_sbase;
1063 }
1064
1065 err = rc_register_device(data->dev); 1065 err = rc_register_device(data->dev);
1066 if (err) 1066 if (err)
1067 goto exit_free_rc; 1067 goto exit_free_irq;
1068 1068
1069 device_init_wakeup(&device->dev, 1); 1069 device_init_wakeup(&device->dev, 1);
1070 1070
@@ -1072,14 +1072,6 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
1072 1072
1073 return 0; 1073 return 0;
1074 1074
1075exit_free_rc:
1076 rc_free_device(data->dev);
1077exit_unregister_led:
1078 led_classdev_unregister(&data->led);
1079exit_unregister_rxtrigger:
1080 led_trigger_unregister_simple(data->rxtrigger);
1081exit_unregister_txtrigger:
1082 led_trigger_unregister_simple(data->txtrigger);
1083exit_free_irq: 1075exit_free_irq:
1084 free_irq(data->irq, device); 1076 free_irq(data->irq, device);
1085exit_release_sbase: 1077exit_release_sbase:
@@ -1088,6 +1080,14 @@ exit_release_ebase:
1088 release_region(data->ebase, EHFUNC_IOMEM_LEN); 1080 release_region(data->ebase, EHFUNC_IOMEM_LEN);
1089exit_release_wbase: 1081exit_release_wbase:
1090 release_region(data->wbase, WAKEUP_IOMEM_LEN); 1082 release_region(data->wbase, WAKEUP_IOMEM_LEN);
1083exit_free_rc:
1084 rc_free_device(data->dev);
1085exit_unregister_led:
1086 led_classdev_unregister(&data->led);
1087exit_unregister_rxtrigger:
1088 led_trigger_unregister_simple(data->rxtrigger);
1089exit_unregister_txtrigger:
1090 led_trigger_unregister_simple(data->txtrigger);
1091exit_free_data: 1091exit_free_data:
1092 kfree(data); 1092 kfree(data);
1093 pnp_set_drvdata(device, NULL); 1093 pnp_set_drvdata(device, NULL);
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c
index db8e5084df06..863c755dd2b7 100644
--- a/drivers/media/video/gspca/sonixj.c
+++ b/drivers/media/video/gspca/sonixj.c
@@ -2923,6 +2923,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2923 * not the JPEG end of frame ('ff d9'). 2923 * not the JPEG end of frame ('ff d9').
2924 */ 2924 */
2925 2925
2926 /* count the packets and their size */
2927 sd->npkt++;
2928 sd->pktsz += len;
2929
2926/*fixme: assumption about the following code: 2930/*fixme: assumption about the following code:
2927 * - there can be only one marker in a packet 2931 * - there can be only one marker in a packet
2928 */ 2932 */
@@ -2945,10 +2949,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
2945 data += i; 2949 data += i;
2946 } 2950 }
2947 2951
2948 /* count the packets and their size */
2949 sd->npkt++;
2950 sd->pktsz += len;
2951
2952 /* search backwards if there is a marker in the packet */ 2952 /* search backwards if there is a marker in the packet */
2953 for (i = len - 1; --i >= 0; ) { 2953 for (i = len - 1; --i >= 0; ) {
2954 if (data[i] != 0xff) { 2954 if (data[i] != 0xff) {
diff --git a/drivers/media/video/marvell-ccic/mmp-driver.c b/drivers/media/video/marvell-ccic/mmp-driver.c
index d23552323f45..c4c17fe76c0d 100644
--- a/drivers/media/video/marvell-ccic/mmp-driver.c
+++ b/drivers/media/video/marvell-ccic/mmp-driver.c
@@ -181,7 +181,6 @@ static int mmpcam_probe(struct platform_device *pdev)
181 INIT_LIST_HEAD(&cam->devlist); 181 INIT_LIST_HEAD(&cam->devlist);
182 182
183 mcam = &cam->mcam; 183 mcam = &cam->mcam;
184 mcam->platform = MHP_Armada610;
185 mcam->plat_power_up = mmpcam_power_up; 184 mcam->plat_power_up = mmpcam_power_up;
186 mcam->plat_power_down = mmpcam_power_down; 185 mcam->plat_power_down = mmpcam_power_down;
187 mcam->dev = &pdev->dev; 186 mcam->dev = &pdev->dev;
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c
index b06efd208328..7e9b2c612b03 100644
--- a/drivers/media/video/s5p-fimc/fimc-capture.c
+++ b/drivers/media/video/s5p-fimc/fimc-capture.c
@@ -246,28 +246,37 @@ int fimc_capture_resume(struct fimc_dev *fimc)
246 246
247} 247}
248 248
249static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane) 249static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
250{
251 if (!fr || plane >= fr->fmt->memplanes)
252 return 0;
253 return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8;
254}
255
256static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
257 unsigned int *num_buffers, unsigned int *num_planes, 250 unsigned int *num_buffers, unsigned int *num_planes,
258 unsigned int sizes[], void *allocators[]) 251 unsigned int sizes[], void *allocators[])
259{ 252{
253 const struct v4l2_pix_format_mplane *pixm = NULL;
260 struct fimc_ctx *ctx = vq->drv_priv; 254 struct fimc_ctx *ctx = vq->drv_priv;
261 struct fimc_fmt *fmt = ctx->d_frame.fmt; 255 struct fimc_frame *frame = &ctx->d_frame;
256 struct fimc_fmt *fmt = frame->fmt;
257 unsigned long wh;
262 int i; 258 int i;
263 259
264 if (!fmt) 260 if (pfmt) {
261 pixm = &pfmt->fmt.pix_mp;
262 fmt = fimc_find_format(&pixm->pixelformat, NULL,
263 FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1);
264 wh = pixm->width * pixm->height;
265 } else {
266 wh = frame->f_width * frame->f_height;
267 }
268
269 if (fmt == NULL)
265 return -EINVAL; 270 return -EINVAL;
266 271
267 *num_planes = fmt->memplanes; 272 *num_planes = fmt->memplanes;
268 273
269 for (i = 0; i < fmt->memplanes; i++) { 274 for (i = 0; i < fmt->memplanes; i++) {
270 sizes[i] = get_plane_size(&ctx->d_frame, i); 275 unsigned int size = (wh * fmt->depth[i]) / 8;
276 if (pixm)
277 sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
278 else
279 sizes[i] = size;
271 allocators[i] = ctx->fimc_dev->alloc_ctx; 280 allocators[i] = ctx->fimc_dev->alloc_ctx;
272 } 281 }
273 282
@@ -1383,7 +1392,7 @@ static int fimc_subdev_set_crop(struct v4l2_subdev *sd,
1383 fimc_capture_try_crop(ctx, r, crop->pad); 1392 fimc_capture_try_crop(ctx, r, crop->pad);
1384 1393
1385 if (crop->which == V4L2_SUBDEV_FORMAT_TRY) { 1394 if (crop->which == V4L2_SUBDEV_FORMAT_TRY) {
1386 mutex_lock(&fimc->lock); 1395 mutex_unlock(&fimc->lock);
1387 *v4l2_subdev_get_try_crop(fh, crop->pad) = *r; 1396 *v4l2_subdev_get_try_crop(fh, crop->pad) = *r;
1388 return 0; 1397 return 0;
1389 } 1398 }
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c
index e184e650022a..e09ba7b0076e 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.c
+++ b/drivers/media/video/s5p-fimc/fimc-core.c
@@ -1048,14 +1048,14 @@ static int fimc_m2m_g_fmt_mplane(struct file *file, void *fh,
1048 * @mask: the color flags to match 1048 * @mask: the color flags to match
1049 * @index: offset in the fimc_formats array, ignored if negative 1049 * @index: offset in the fimc_formats array, ignored if negative
1050 */ 1050 */
1051struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, 1051struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code,
1052 unsigned int mask, int index) 1052 unsigned int mask, int index)
1053{ 1053{
1054 struct fimc_fmt *fmt, *def_fmt = NULL; 1054 struct fimc_fmt *fmt, *def_fmt = NULL;
1055 unsigned int i; 1055 unsigned int i;
1056 int id = 0; 1056 int id = 0;
1057 1057
1058 if (index >= ARRAY_SIZE(fimc_formats)) 1058 if (index >= (int)ARRAY_SIZE(fimc_formats))
1059 return NULL; 1059 return NULL;
1060 1060
1061 for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) { 1061 for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) {
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h
index a18291e648e2..84fd83550bd7 100644
--- a/drivers/media/video/s5p-fimc/fimc-core.h
+++ b/drivers/media/video/s5p-fimc/fimc-core.h
@@ -718,7 +718,7 @@ void fimc_alpha_ctrl_update(struct fimc_ctx *ctx);
718int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f); 718int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f);
719void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, 719void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height,
720 struct v4l2_pix_format_mplane *pix); 720 struct v4l2_pix_format_mplane *pix);
721struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, 721struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code,
722 unsigned int mask, int index); 722 unsigned int mask, int index);
723 723
724int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh, 724int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh,
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c
index eb25756a07af..aedb970d13f6 100644
--- a/drivers/media/video/soc_camera.c
+++ b/drivers/media/video/soc_camera.c
@@ -530,7 +530,10 @@ static int soc_camera_open(struct file *file)
530 if (icl->reset) 530 if (icl->reset)
531 icl->reset(icd->pdev); 531 icl->reset(icd->pdev);
532 532
533 /* Don't mess with the host during probe */
534 mutex_lock(&ici->host_lock);
533 ret = ici->ops->add(icd); 535 ret = ici->ops->add(icd);
536 mutex_unlock(&ici->host_lock);
534 if (ret < 0) { 537 if (ret < 0) {
535 dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret); 538 dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret);
536 goto eiciadd; 539 goto eiciadd;
@@ -956,7 +959,7 @@ static void scan_add_host(struct soc_camera_host *ici)
956{ 959{
957 struct soc_camera_device *icd; 960 struct soc_camera_device *icd;
958 961
959 mutex_lock(&list_lock); 962 mutex_lock(&ici->host_lock);
960 963
961 list_for_each_entry(icd, &devices, list) { 964 list_for_each_entry(icd, &devices, list) {
962 if (icd->iface == ici->nr) { 965 if (icd->iface == ici->nr) {
@@ -967,7 +970,7 @@ static void scan_add_host(struct soc_camera_host *ici)
967 } 970 }
968 } 971 }
969 972
970 mutex_unlock(&list_lock); 973 mutex_unlock(&ici->host_lock);
971} 974}
972 975
973#ifdef CONFIG_I2C_BOARDINFO 976#ifdef CONFIG_I2C_BOARDINFO
@@ -1313,6 +1316,7 @@ int soc_camera_host_register(struct soc_camera_host *ici)
1313 list_add_tail(&ici->list, &hosts); 1316 list_add_tail(&ici->list, &hosts);
1314 mutex_unlock(&list_lock); 1317 mutex_unlock(&list_lock);
1315 1318
1319 mutex_init(&ici->host_lock);
1316 scan_add_host(ici); 1320 scan_add_host(ici);
1317 1321
1318 return 0; 1322 return 0;
diff --git a/drivers/media/video/videobuf2-dma-contig.c b/drivers/media/video/videobuf2-dma-contig.c
index f17ad98fcc5f..4b7132660a93 100644
--- a/drivers/media/video/videobuf2-dma-contig.c
+++ b/drivers/media/video/videobuf2-dma-contig.c
@@ -15,6 +15,7 @@
15#include <linux/dma-mapping.h> 15#include <linux/dma-mapping.h>
16 16
17#include <media/videobuf2-core.h> 17#include <media/videobuf2-core.h>
18#include <media/videobuf2-dma-contig.h>
18#include <media/videobuf2-memops.h> 19#include <media/videobuf2-memops.h>
19 20
20struct vb2_dc_conf { 21struct vb2_dc_conf {
@@ -85,7 +86,7 @@ static void *vb2_dma_contig_vaddr(void *buf_priv)
85{ 86{
86 struct vb2_dc_buf *buf = buf_priv; 87 struct vb2_dc_buf *buf = buf_priv;
87 if (!buf) 88 if (!buf)
88 return 0; 89 return NULL;
89 90
90 return buf->vaddr; 91 return buf->vaddr;
91} 92}
diff --git a/drivers/media/video/videobuf2-memops.c b/drivers/media/video/videobuf2-memops.c
index c41cb60245d6..504cd4cbe29e 100644
--- a/drivers/media/video/videobuf2-memops.c
+++ b/drivers/media/video/videobuf2-memops.c
@@ -55,6 +55,7 @@ struct vm_area_struct *vb2_get_vma(struct vm_area_struct *vma)
55 55
56 return vma_copy; 56 return vma_copy;
57} 57}
58EXPORT_SYMBOL_GPL(vb2_get_vma);
58 59
59/** 60/**
60 * vb2_put_userptr() - release a userspace virtual memory area 61 * vb2_put_userptr() - release a userspace virtual memory area
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c
index 58fc65f5c817..f2f482bec573 100644
--- a/drivers/mtd/mtdchar.c
+++ b/drivers/mtd/mtdchar.c
@@ -376,7 +376,7 @@ static int otp_select_filemode(struct mtd_file_info *mfi, int mode)
376 * Make a fake call to mtd_read_fact_prot_reg() to check if OTP 376 * Make a fake call to mtd_read_fact_prot_reg() to check if OTP
377 * operations are supported. 377 * operations are supported.
378 */ 378 */
379 if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP) 379 if (mtd_read_fact_prot_reg(mtd, -1, 0, &retlen, NULL) == -EOPNOTSUPP)
380 return -EOPNOTSUPP; 380 return -EOPNOTSUPP;
381 381
382 switch (mode) { 382 switch (mode) {
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c
index 73416951f4c1..861ca8f7e47d 100644
--- a/drivers/mtd/nand/ams-delta.c
+++ b/drivers/mtd/nand/ams-delta.c
@@ -212,18 +212,17 @@ static int __devinit ams_delta_init(struct platform_device *pdev)
212 /* Link the private data with the MTD structure */ 212 /* Link the private data with the MTD structure */
213 ams_delta_mtd->priv = this; 213 ams_delta_mtd->priv = this;
214 214
215 if (!request_mem_region(res->start, resource_size(res), 215 /*
216 dev_name(&pdev->dev))) { 216 * Don't try to request the memory region from here,
217 dev_err(&pdev->dev, "request_mem_region failed\n"); 217 * it should have been already requested from the
218 err = -EBUSY; 218 * gpio-omap driver and requesting it again would fail.
219 goto out_free; 219 */
220 }
221 220
222 io_base = ioremap(res->start, resource_size(res)); 221 io_base = ioremap(res->start, resource_size(res));
223 if (io_base == NULL) { 222 if (io_base == NULL) {
224 dev_err(&pdev->dev, "ioremap failed\n"); 223 dev_err(&pdev->dev, "ioremap failed\n");
225 err = -EIO; 224 err = -EIO;
226 goto out_release_io; 225 goto out_free;
227 } 226 }
228 227
229 this->priv = io_base; 228 this->priv = io_base;
@@ -271,8 +270,6 @@ out_gpio:
271 platform_set_drvdata(pdev, NULL); 270 platform_set_drvdata(pdev, NULL);
272 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); 271 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
273 iounmap(io_base); 272 iounmap(io_base);
274out_release_io:
275 release_mem_region(res->start, resource_size(res));
276out_free: 273out_free:
277 kfree(ams_delta_mtd); 274 kfree(ams_delta_mtd);
278 out: 275 out:
@@ -285,7 +282,6 @@ out_free:
285static int __devexit ams_delta_cleanup(struct platform_device *pdev) 282static int __devexit ams_delta_cleanup(struct platform_device *pdev)
286{ 283{
287 void __iomem *io_base = platform_get_drvdata(pdev); 284 void __iomem *io_base = platform_get_drvdata(pdev);
288 struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
289 285
290 /* Release resources, unregister device */ 286 /* Release resources, unregister device */
291 nand_release(ams_delta_mtd); 287 nand_release(ams_delta_mtd);
@@ -293,7 +289,6 @@ static int __devexit ams_delta_cleanup(struct platform_device *pdev)
293 gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); 289 gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
294 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); 290 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
295 iounmap(io_base); 291 iounmap(io_base);
296 release_mem_region(res->start, resource_size(res));
297 292
298 /* Free the MTD device structure */ 293 /* Free the MTD device structure */
299 kfree(ams_delta_mtd); 294 kfree(ams_delta_mtd);
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 */
2176static void bond_3ad_rx_indication(struct lacpdu *lacpdu, struct slave *slave, u16 length) 2176static 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
2459void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 2463int 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);
274void bond_3ad_handle_link_change(struct slave *slave, char link); 274void bond_3ad_handle_link_change(struct slave *slave, char link);
275int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info); 275int bond_3ad_get_active_agg_info(struct bonding *bond, struct ad_info *ad_info);
276int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev); 276int bond_3ad_xmit_xor(struct sk_buff *skb, struct net_device *dev);
277void bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond, 277int bond_3ad_lacpdu_recv(struct sk_buff *skb, struct bonding *bond,
278 struct slave *slave); 278 struct slave *slave);
279int bond_3ad_set_carrier(struct bonding *bond); 279int bond_3ad_set_carrier(struct bonding *bond);
280void bond_3ad_update_lacp_rate(struct bonding *bond); 280void bond_3ad_update_lacp_rate(struct bonding *bond);
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c
index b4f1b4ac92c6..0f59c1564e53 100644
--- a/drivers/net/bonding/bond_alb.c
+++ b/drivers/net/bonding/bond_alb.c
@@ -342,26 +342,26 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
342 _unlock_rx_hashtbl_bh(bond); 342 _unlock_rx_hashtbl_bh(bond);
343} 343}
344 344
345static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, 345static int rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
346 struct slave *slave) 346 struct slave *slave)
347{ 347{
348 struct arp_pkt *arp; 348 struct arp_pkt *arp;
349 349
350 if (skb->protocol != cpu_to_be16(ETH_P_ARP)) 350 if (skb->protocol != cpu_to_be16(ETH_P_ARP))
351 return; 351 goto out;
352 352
353 arp = (struct arp_pkt *) skb->data; 353 arp = (struct arp_pkt *) skb->data;
354 if (!arp) { 354 if (!arp) {
355 pr_debug("Packet has no ARP data\n"); 355 pr_debug("Packet has no ARP data\n");
356 return; 356 goto out;
357 } 357 }
358 358
359 if (!pskb_may_pull(skb, arp_hdr_len(bond->dev))) 359 if (!pskb_may_pull(skb, arp_hdr_len(bond->dev)))
360 return; 360 goto out;
361 361
362 if (skb->len < sizeof(struct arp_pkt)) { 362 if (skb->len < sizeof(struct arp_pkt)) {
363 pr_debug("Packet is too small to be an ARP\n"); 363 pr_debug("Packet is too small to be an ARP\n");
364 return; 364 goto out;
365 } 365 }
366 366
367 if (arp->op_code == htons(ARPOP_REPLY)) { 367 if (arp->op_code == htons(ARPOP_REPLY)) {
@@ -369,6 +369,8 @@ static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
369 rlb_update_entry_from_arp(bond, arp); 369 rlb_update_entry_from_arp(bond, arp);
370 pr_debug("Server received an ARP Reply from client\n"); 370 pr_debug("Server received an ARP Reply from client\n");
371 } 371 }
372out:
373 return RX_HANDLER_ANOTHER;
372} 374}
373 375
374/* Caller must hold bond lock for read */ 376/* Caller must hold bond lock for read */
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index bbb004354bbd..2ee8cf9e8a3b 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> */
@@ -2732,7 +2737,7 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32
2732 } 2737 }
2733} 2738}
2734 2739
2735static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond, 2740static int bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2736 struct slave *slave) 2741 struct slave *slave)
2737{ 2742{
2738 struct arphdr *arp; 2743 struct arphdr *arp;
@@ -2740,7 +2745,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2740 __be32 sip, tip; 2745 __be32 sip, tip;
2741 2746
2742 if (skb->protocol != __cpu_to_be16(ETH_P_ARP)) 2747 if (skb->protocol != __cpu_to_be16(ETH_P_ARP))
2743 return; 2748 return RX_HANDLER_ANOTHER;
2744 2749
2745 read_lock(&bond->lock); 2750 read_lock(&bond->lock);
2746 2751
@@ -2785,6 +2790,7 @@ static void bond_arp_rcv(struct sk_buff *skb, struct bonding *bond,
2785 2790
2786out_unlock: 2791out_unlock:
2787 read_unlock(&bond->lock); 2792 read_unlock(&bond->lock);
2793 return RX_HANDLER_ANOTHER;
2788} 2794}
2789 2795
2790/* 2796/*
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 9f2bae6616d3..4581aa5ccaba 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -218,7 +218,7 @@ struct bonding {
218 struct slave *primary_slave; 218 struct slave *primary_slave;
219 bool force_primary; 219 bool force_primary;
220 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ 220 s32 slave_cnt; /* never change this value outside the attach/detach wrappers */
221 void (*recv_probe)(struct sk_buff *, struct bonding *, 221 int (*recv_probe)(struct sk_buff *, struct bonding *,
222 struct slave *); 222 struct slave *);
223 rwlock_t lock; 223 rwlock_t lock;
224 rwlock_t curr_slave_lock; 224 rwlock_t curr_slave_lock;
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/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index ba21f9c72a21..9bbf1a275947 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -1103,9 +1103,12 @@ msi_only:
1103 adapter->flags |= IGB_FLAG_HAS_MSI; 1103 adapter->flags |= IGB_FLAG_HAS_MSI;
1104out: 1104out:
1105 /* Notify the stack of the (possibly) reduced queue counts. */ 1105 /* Notify the stack of the (possibly) reduced queue counts. */
1106 rtnl_lock();
1106 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues); 1107 netif_set_real_num_tx_queues(adapter->netdev, adapter->num_tx_queues);
1107 return netif_set_real_num_rx_queues(adapter->netdev, 1108 err = netif_set_real_num_rx_queues(adapter->netdev,
1108 adapter->num_rx_queues); 1109 adapter->num_rx_queues);
1110 rtnl_unlock();
1111 return err;
1109} 1112}
1110 1113
1111/** 1114/**
@@ -6706,18 +6709,7 @@ static int igb_resume(struct device *dev)
6706 pci_enable_wake(pdev, PCI_D3hot, 0); 6709 pci_enable_wake(pdev, PCI_D3hot, 0);
6707 pci_enable_wake(pdev, PCI_D3cold, 0); 6710 pci_enable_wake(pdev, PCI_D3cold, 0);
6708 6711
6709 if (!rtnl_is_locked()) { 6712 if (igb_init_interrupt_scheme(adapter)) {
6710 /*
6711 * shut up ASSERT_RTNL() warning in
6712 * netif_set_real_num_tx/rx_queues.
6713 */
6714 rtnl_lock();
6715 err = igb_init_interrupt_scheme(adapter);
6716 rtnl_unlock();
6717 } else {
6718 err = igb_init_interrupt_scheme(adapter);
6719 }
6720 if (err) {
6721 dev_err(&pdev->dev, "Unable to allocate memory for queues\n"); 6713 dev_err(&pdev->dev, "Unable to allocate memory for queues\n");
6722 return -ENOMEM; 6714 return -ENOMEM;
6723 } 6715 }
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/oki-semi/pch_gbe/pch_gbe.h b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
index 9f3dbc4feadc..b07311eaa693 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
@@ -584,7 +584,6 @@ struct pch_gbe_hw_stats {
584/** 584/**
585 * struct pch_gbe_adapter - board specific private data structure 585 * struct pch_gbe_adapter - board specific private data structure
586 * @stats_lock: Spinlock structure for status 586 * @stats_lock: Spinlock structure for status
587 * @tx_queue_lock: Spinlock structure for transmit
588 * @ethtool_lock: Spinlock structure for ethtool 587 * @ethtool_lock: Spinlock structure for ethtool
589 * @irq_sem: Semaphore for interrupt 588 * @irq_sem: Semaphore for interrupt
590 * @netdev: Pointer of network device structure 589 * @netdev: Pointer of network device structure
@@ -609,7 +608,6 @@ struct pch_gbe_hw_stats {
609 608
610struct pch_gbe_adapter { 609struct pch_gbe_adapter {
611 spinlock_t stats_lock; 610 spinlock_t stats_lock;
612 spinlock_t tx_queue_lock;
613 spinlock_t ethtool_lock; 611 spinlock_t ethtool_lock;
614 atomic_t irq_sem; 612 atomic_t irq_sem;
615 struct net_device *netdev; 613 struct net_device *netdev;
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
index 9dc7e5023671..3787c64ee71c 100644
--- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
+++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
@@ -645,14 +645,11 @@ static void pch_gbe_mac_set_pause_packet(struct pch_gbe_hw *hw)
645 */ 645 */
646static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter) 646static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter)
647{ 647{
648 int size; 648 adapter->tx_ring = kzalloc(sizeof(*adapter->tx_ring), GFP_KERNEL);
649
650 size = (int)sizeof(struct pch_gbe_tx_ring);
651 adapter->tx_ring = kzalloc(size, GFP_KERNEL);
652 if (!adapter->tx_ring) 649 if (!adapter->tx_ring)
653 return -ENOMEM; 650 return -ENOMEM;
654 size = (int)sizeof(struct pch_gbe_rx_ring); 651
655 adapter->rx_ring = kzalloc(size, GFP_KERNEL); 652 adapter->rx_ring = kzalloc(sizeof(*adapter->rx_ring), GFP_KERNEL);
656 if (!adapter->rx_ring) { 653 if (!adapter->rx_ring) {
657 kfree(adapter->tx_ring); 654 kfree(adapter->tx_ring);
658 return -ENOMEM; 655 return -ENOMEM;
@@ -1169,7 +1166,6 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
1169 struct sk_buff *tmp_skb; 1166 struct sk_buff *tmp_skb;
1170 unsigned int frame_ctrl; 1167 unsigned int frame_ctrl;
1171 unsigned int ring_num; 1168 unsigned int ring_num;
1172 unsigned long flags;
1173 1169
1174 /*-- Set frame control --*/ 1170 /*-- Set frame control --*/
1175 frame_ctrl = 0; 1171 frame_ctrl = 0;
@@ -1216,14 +1212,14 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
1216 } 1212 }
1217 } 1213 }
1218 } 1214 }
1219 spin_lock_irqsave(&tx_ring->tx_lock, flags); 1215
1220 ring_num = tx_ring->next_to_use; 1216 ring_num = tx_ring->next_to_use;
1221 if (unlikely((ring_num + 1) == tx_ring->count)) 1217 if (unlikely((ring_num + 1) == tx_ring->count))
1222 tx_ring->next_to_use = 0; 1218 tx_ring->next_to_use = 0;
1223 else 1219 else
1224 tx_ring->next_to_use = ring_num + 1; 1220 tx_ring->next_to_use = ring_num + 1;
1225 1221
1226 spin_unlock_irqrestore(&tx_ring->tx_lock, flags); 1222
1227 buffer_info = &tx_ring->buffer_info[ring_num]; 1223 buffer_info = &tx_ring->buffer_info[ring_num];
1228 tmp_skb = buffer_info->skb; 1224 tmp_skb = buffer_info->skb;
1229 1225
@@ -1525,7 +1521,7 @@ pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter,
1525 &rx_ring->rx_buff_pool_logic, 1521 &rx_ring->rx_buff_pool_logic,
1526 GFP_KERNEL); 1522 GFP_KERNEL);
1527 if (!rx_ring->rx_buff_pool) { 1523 if (!rx_ring->rx_buff_pool) {
1528 pr_err("Unable to allocate memory for the receive poll buffer\n"); 1524 pr_err("Unable to allocate memory for the receive pool buffer\n");
1529 return -ENOMEM; 1525 return -ENOMEM;
1530 } 1526 }
1531 memset(rx_ring->rx_buff_pool, 0, size); 1527 memset(rx_ring->rx_buff_pool, 0, size);
@@ -1644,15 +1640,17 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
1644 pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n", 1640 pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n",
1645 cleaned_count); 1641 cleaned_count);
1646 /* Recover from running out of Tx resources in xmit_frame */ 1642 /* Recover from running out of Tx resources in xmit_frame */
1643 spin_lock(&tx_ring->tx_lock);
1647 if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) { 1644 if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) {
1648 netif_wake_queue(adapter->netdev); 1645 netif_wake_queue(adapter->netdev);
1649 adapter->stats.tx_restart_count++; 1646 adapter->stats.tx_restart_count++;
1650 pr_debug("Tx wake queue\n"); 1647 pr_debug("Tx wake queue\n");
1651 } 1648 }
1652 spin_lock(&adapter->tx_queue_lock); 1649
1653 tx_ring->next_to_clean = i; 1650 tx_ring->next_to_clean = i;
1654 spin_unlock(&adapter->tx_queue_lock); 1651
1655 pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean); 1652 pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean);
1653 spin_unlock(&tx_ring->tx_lock);
1656 return cleaned; 1654 return cleaned;
1657} 1655}
1658 1656
@@ -2043,7 +2041,6 @@ static int pch_gbe_sw_init(struct pch_gbe_adapter *adapter)
2043 return -ENOMEM; 2041 return -ENOMEM;
2044 } 2042 }
2045 spin_lock_init(&adapter->hw.miim_lock); 2043 spin_lock_init(&adapter->hw.miim_lock);
2046 spin_lock_init(&adapter->tx_queue_lock);
2047 spin_lock_init(&adapter->stats_lock); 2044 spin_lock_init(&adapter->stats_lock);
2048 spin_lock_init(&adapter->ethtool_lock); 2045 spin_lock_init(&adapter->ethtool_lock);
2049 atomic_set(&adapter->irq_sem, 0); 2046 atomic_set(&adapter->irq_sem, 0);
@@ -2148,10 +2145,10 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
2148 tx_ring->next_to_use, tx_ring->next_to_clean); 2145 tx_ring->next_to_use, tx_ring->next_to_clean);
2149 return NETDEV_TX_BUSY; 2146 return NETDEV_TX_BUSY;
2150 } 2147 }
2151 spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
2152 2148
2153 /* CRC,ITAG no support */ 2149 /* CRC,ITAG no support */
2154 pch_gbe_tx_queue(adapter, tx_ring, skb); 2150 pch_gbe_tx_queue(adapter, tx_ring, skb);
2151 spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
2155 return NETDEV_TX_OK; 2152 return NETDEV_TX_OK;
2156} 2153}
2157 2154
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 00628d84342f..4f74b9762c29 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -63,8 +63,12 @@
63#define R8169_MSG_DEFAULT \ 63#define R8169_MSG_DEFAULT \
64 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN) 64 (NETIF_MSG_DRV | NETIF_MSG_PROBE | NETIF_MSG_IFUP | NETIF_MSG_IFDOWN)
65 65
66#define TX_BUFFS_AVAIL(tp) \ 66#define TX_SLOTS_AVAIL(tp) \
67 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx - 1) 67 (tp->dirty_tx + NUM_TX_DESC - tp->cur_tx)
68
69/* A skbuff with nr_frags needs nr_frags+1 entries in the tx queue */
70#define TX_FRAGS_READY_FOR(tp,nr_frags) \
71 (TX_SLOTS_AVAIL(tp) >= (nr_frags + 1))
68 72
69/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast). 73/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
70 The RTL chips use a 64 element hash table based on the Ethernet CRC. */ 74 The RTL chips use a 64 element hash table based on the Ethernet CRC. */
@@ -5494,7 +5498,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5494 u32 opts[2]; 5498 u32 opts[2];
5495 int frags; 5499 int frags;
5496 5500
5497 if (unlikely(TX_BUFFS_AVAIL(tp) < skb_shinfo(skb)->nr_frags)) { 5501 if (unlikely(!TX_FRAGS_READY_FOR(tp, skb_shinfo(skb)->nr_frags))) {
5498 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n"); 5502 netif_err(tp, drv, dev, "BUG! Tx Ring full when queue awake!\n");
5499 goto err_stop_0; 5503 goto err_stop_0;
5500 } 5504 }
@@ -5548,7 +5552,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5548 5552
5549 mmiowb(); 5553 mmiowb();
5550 5554
5551 if (TX_BUFFS_AVAIL(tp) < MAX_SKB_FRAGS) { 5555 if (!TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {
5552 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must 5556 /* Avoid wrongly optimistic queue wake-up: rtl_tx thread must
5553 * not miss a ring update when it notices a stopped queue. 5557 * not miss a ring update when it notices a stopped queue.
5554 */ 5558 */
@@ -5562,7 +5566,7 @@ static netdev_tx_t rtl8169_start_xmit(struct sk_buff *skb,
5562 * can't. 5566 * can't.
5563 */ 5567 */
5564 smp_mb(); 5568 smp_mb();
5565 if (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS) 5569 if (TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS))
5566 netif_wake_queue(dev); 5570 netif_wake_queue(dev);
5567 } 5571 }
5568 5572
@@ -5685,7 +5689,7 @@ static void rtl_tx(struct net_device *dev, struct rtl8169_private *tp)
5685 */ 5689 */
5686 smp_mb(); 5690 smp_mb();
5687 if (netif_queue_stopped(dev) && 5691 if (netif_queue_stopped(dev) &&
5688 (TX_BUFFS_AVAIL(tp) >= MAX_SKB_FRAGS)) { 5692 TX_FRAGS_READY_FOR(tp, MAX_SKB_FRAGS)) {
5689 netif_wake_queue(dev); 5693 netif_wake_queue(dev);
5690 } 5694 }
5691 /* 5695 /*
diff --git a/drivers/net/ethernet/sfc/efx.c b/drivers/net/ethernet/sfc/efx.c
index 8253d2155fe3..b95f2e1b33f0 100644
--- a/drivers/net/ethernet/sfc/efx.c
+++ b/drivers/net/ethernet/sfc/efx.c
@@ -1354,7 +1354,7 @@ static int efx_probe_interrupts(struct efx_nic *efx)
1354 } 1354 }
1355 1355
1356 /* RSS might be usable on VFs even if it is disabled on the PF */ 1356 /* RSS might be usable on VFs even if it is disabled on the PF */
1357 efx->rss_spread = (efx->n_rx_channels > 1 ? 1357 efx->rss_spread = ((efx->n_rx_channels > 1 || !efx_sriov_wanted(efx)) ?
1358 efx->n_rx_channels : efx_vf_size(efx)); 1358 efx->n_rx_channels : efx_vf_size(efx));
1359 1359
1360 return 0; 1360 return 0;
diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
index ebacec1944ed..66a9bfe7b1c8 100644
--- a/drivers/net/macvlan.c
+++ b/drivers/net/macvlan.c
@@ -258,7 +258,7 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
258 258
259xmit_world: 259xmit_world:
260 skb->ip_summed = ip_summed; 260 skb->ip_summed = ip_summed;
261 skb_set_dev(skb, vlan->lowerdev); 261 skb->dev = vlan->lowerdev;
262 return dev_queue_xmit(skb); 262 return dev_queue_xmit(skb);
263} 263}
264 264
diff --git a/drivers/net/macvtap.c b/drivers/net/macvtap.c
index 163559c16988..2ee56de7b0ca 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>
@@ -782,6 +783,8 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
782 struct macvlan_dev *vlan; 783 struct macvlan_dev *vlan;
783 int ret; 784 int ret;
784 int vnet_hdr_len = 0; 785 int vnet_hdr_len = 0;
786 int vlan_offset = 0;
787 int copied;
785 788
786 if (q->flags & IFF_VNET_HDR) { 789 if (q->flags & IFF_VNET_HDR) {
787 struct virtio_net_hdr vnet_hdr; 790 struct virtio_net_hdr vnet_hdr;
@@ -796,18 +799,48 @@ static ssize_t macvtap_put_user(struct macvtap_queue *q,
796 if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr))) 799 if (memcpy_toiovecend(iv, (void *)&vnet_hdr, 0, sizeof(vnet_hdr)))
797 return -EFAULT; 800 return -EFAULT;
798 } 801 }
802 copied = vnet_hdr_len;
803
804 if (!vlan_tx_tag_present(skb))
805 len = min_t(int, skb->len, len);
806 else {
807 int copy;
808 struct {
809 __be16 h_vlan_proto;
810 __be16 h_vlan_TCI;
811 } veth;
812 veth.h_vlan_proto = htons(ETH_P_8021Q);
813 veth.h_vlan_TCI = htons(vlan_tx_tag_get(skb));
814
815 vlan_offset = offsetof(struct vlan_ethhdr, h_vlan_proto);
816 len = min_t(int, skb->len + VLAN_HLEN, len);
817
818 copy = min_t(int, vlan_offset, len);
819 ret = skb_copy_datagram_const_iovec(skb, 0, iv, copied, copy);
820 len -= copy;
821 copied += copy;
822 if (ret || !len)
823 goto done;
824
825 copy = min_t(int, sizeof(veth), len);
826 ret = memcpy_toiovecend(iv, (void *)&veth, copied, copy);
827 len -= copy;
828 copied += copy;
829 if (ret || !len)
830 goto done;
831 }
799 832
800 len = min_t(int, skb->len, len); 833 ret = skb_copy_datagram_const_iovec(skb, vlan_offset, iv, copied, len);
801 834 copied += len;
802 ret = skb_copy_datagram_const_iovec(skb, 0, iv, vnet_hdr_len, len);
803 835
836done:
804 rcu_read_lock_bh(); 837 rcu_read_lock_bh();
805 vlan = rcu_dereference_bh(q->vlan); 838 vlan = rcu_dereference_bh(q->vlan);
806 if (vlan) 839 if (vlan)
807 macvlan_count_rx(vlan, len, ret == 0, 0); 840 macvlan_count_rx(vlan, copied - vnet_hdr_len, ret == 0, 0);
808 rcu_read_unlock_bh(); 841 rcu_read_unlock_bh();
809 842
810 return ret ? ret : (len + vnet_hdr_len); 843 return ret ? ret : copied;
811} 844}
812 845
813static ssize_t macvtap_do_read(struct macvtap_queue *q, struct kiocb *iocb, 846static 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 00880edba048..425e201f597c 100644
--- a/drivers/net/usb/cdc_ether.c
+++ b/drivers/net/usb/cdc_ether.c
@@ -485,6 +485,7 @@ static const struct driver_info wwan_info = {
485/*-------------------------------------------------------------------------*/ 485/*-------------------------------------------------------------------------*/
486 486
487#define HUAWEI_VENDOR_ID 0x12D1 487#define HUAWEI_VENDOR_ID 0x12D1
488#define NOVATEL_VENDOR_ID 0x1410
488 489
489static const struct usb_device_id products [] = { 490static const struct usb_device_id products [] = {
490/* 491/*
@@ -602,6 +603,21 @@ static const struct usb_device_id products [] = {
602 * because of bugs/quirks in a given product (like Zaurus, above). 603 * because of bugs/quirks in a given product (like Zaurus, above).
603 */ 604 */
604{ 605{
606 /* Novatel USB551L */
607 /* This match must come *before* the generic CDC-ETHER match so that
608 * we get FLAG_WWAN set on the device, since it's descriptors are
609 * generic CDC-ETHER.
610 */
611 .match_flags = USB_DEVICE_ID_MATCH_VENDOR
612 | USB_DEVICE_ID_MATCH_PRODUCT
613 | USB_DEVICE_ID_MATCH_INT_INFO,
614 .idVendor = NOVATEL_VENDOR_ID,
615 .idProduct = 0xB001,
616 .bInterfaceClass = USB_CLASS_COMM,
617 .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
618 .bInterfaceProtocol = USB_CDC_PROTO_NONE,
619 .driver_info = (unsigned long)&wwan_info,
620}, {
605 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET, 621 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
606 USB_CDC_PROTO_NONE), 622 USB_CDC_PROTO_NONE),
607 .driver_info = (unsigned long) &cdc_info, 623 .driver_info = (unsigned long) &cdc_info,
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
index 80b837c88f0d..9f58330f1312 100644
--- a/drivers/net/usb/usbnet.c
+++ b/drivers/net/usb/usbnet.c
@@ -282,17 +282,32 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu)
282} 282}
283EXPORT_SYMBOL_GPL(usbnet_change_mtu); 283EXPORT_SYMBOL_GPL(usbnet_change_mtu);
284 284
285/* The caller must hold list->lock */
286static void __usbnet_queue_skb(struct sk_buff_head *list,
287 struct sk_buff *newsk, enum skb_state state)
288{
289 struct skb_data *entry = (struct skb_data *) newsk->cb;
290
291 __skb_queue_tail(list, newsk);
292 entry->state = state;
293}
294
285/*-------------------------------------------------------------------------*/ 295/*-------------------------------------------------------------------------*/
286 296
287/* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from 297/* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from
288 * completion callbacks. 2.5 should have fixed those bugs... 298 * completion callbacks. 2.5 should have fixed those bugs...
289 */ 299 */
290 300
291static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_head *list) 301static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb,
302 struct sk_buff_head *list, enum skb_state state)
292{ 303{
293 unsigned long flags; 304 unsigned long flags;
305 enum skb_state old_state;
306 struct skb_data *entry = (struct skb_data *) skb->cb;
294 307
295 spin_lock_irqsave(&list->lock, flags); 308 spin_lock_irqsave(&list->lock, flags);
309 old_state = entry->state;
310 entry->state = state;
296 __skb_unlink(skb, list); 311 __skb_unlink(skb, list);
297 spin_unlock(&list->lock); 312 spin_unlock(&list->lock);
298 spin_lock(&dev->done.lock); 313 spin_lock(&dev->done.lock);
@@ -300,6 +315,7 @@ static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_hea
300 if (dev->done.qlen == 1) 315 if (dev->done.qlen == 1)
301 tasklet_schedule(&dev->bh); 316 tasklet_schedule(&dev->bh);
302 spin_unlock_irqrestore(&dev->done.lock, flags); 317 spin_unlock_irqrestore(&dev->done.lock, flags);
318 return old_state;
303} 319}
304 320
305/* some work can't be done in tasklets, so we use keventd 321/* some work can't be done in tasklets, so we use keventd
@@ -340,7 +356,6 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
340 entry = (struct skb_data *) skb->cb; 356 entry = (struct skb_data *) skb->cb;
341 entry->urb = urb; 357 entry->urb = urb;
342 entry->dev = dev; 358 entry->dev = dev;
343 entry->state = rx_start;
344 entry->length = 0; 359 entry->length = 0;
345 360
346 usb_fill_bulk_urb (urb, dev->udev, dev->in, 361 usb_fill_bulk_urb (urb, dev->udev, dev->in,
@@ -372,7 +387,7 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
372 tasklet_schedule (&dev->bh); 387 tasklet_schedule (&dev->bh);
373 break; 388 break;
374 case 0: 389 case 0:
375 __skb_queue_tail (&dev->rxq, skb); 390 __usbnet_queue_skb(&dev->rxq, skb, rx_start);
376 } 391 }
377 } else { 392 } else {
378 netif_dbg(dev, ifdown, dev->net, "rx: stopped\n"); 393 netif_dbg(dev, ifdown, dev->net, "rx: stopped\n");
@@ -423,16 +438,17 @@ static void rx_complete (struct urb *urb)
423 struct skb_data *entry = (struct skb_data *) skb->cb; 438 struct skb_data *entry = (struct skb_data *) skb->cb;
424 struct usbnet *dev = entry->dev; 439 struct usbnet *dev = entry->dev;
425 int urb_status = urb->status; 440 int urb_status = urb->status;
441 enum skb_state state;
426 442
427 skb_put (skb, urb->actual_length); 443 skb_put (skb, urb->actual_length);
428 entry->state = rx_done; 444 state = rx_done;
429 entry->urb = NULL; 445 entry->urb = NULL;
430 446
431 switch (urb_status) { 447 switch (urb_status) {
432 /* success */ 448 /* success */
433 case 0: 449 case 0:
434 if (skb->len < dev->net->hard_header_len) { 450 if (skb->len < dev->net->hard_header_len) {
435 entry->state = rx_cleanup; 451 state = rx_cleanup;
436 dev->net->stats.rx_errors++; 452 dev->net->stats.rx_errors++;
437 dev->net->stats.rx_length_errors++; 453 dev->net->stats.rx_length_errors++;
438 netif_dbg(dev, rx_err, dev->net, 454 netif_dbg(dev, rx_err, dev->net,
@@ -471,7 +487,7 @@ static void rx_complete (struct urb *urb)
471 "rx throttle %d\n", urb_status); 487 "rx throttle %d\n", urb_status);
472 } 488 }
473block: 489block:
474 entry->state = rx_cleanup; 490 state = rx_cleanup;
475 entry->urb = urb; 491 entry->urb = urb;
476 urb = NULL; 492 urb = NULL;
477 break; 493 break;
@@ -482,17 +498,18 @@ block:
482 // FALLTHROUGH 498 // FALLTHROUGH
483 499
484 default: 500 default:
485 entry->state = rx_cleanup; 501 state = rx_cleanup;
486 dev->net->stats.rx_errors++; 502 dev->net->stats.rx_errors++;
487 netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status); 503 netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status);
488 break; 504 break;
489 } 505 }
490 506
491 defer_bh(dev, skb, &dev->rxq); 507 state = defer_bh(dev, skb, &dev->rxq, state);
492 508
493 if (urb) { 509 if (urb) {
494 if (netif_running (dev->net) && 510 if (netif_running (dev->net) &&
495 !test_bit (EVENT_RX_HALT, &dev->flags)) { 511 !test_bit (EVENT_RX_HALT, &dev->flags) &&
512 state != unlink_start) {
496 rx_submit (dev, urb, GFP_ATOMIC); 513 rx_submit (dev, urb, GFP_ATOMIC);
497 usb_mark_last_busy(dev->udev); 514 usb_mark_last_busy(dev->udev);
498 return; 515 return;
@@ -579,16 +596,23 @@ EXPORT_SYMBOL_GPL(usbnet_purge_paused_rxq);
579static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) 596static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q)
580{ 597{
581 unsigned long flags; 598 unsigned long flags;
582 struct sk_buff *skb, *skbnext; 599 struct sk_buff *skb;
583 int count = 0; 600 int count = 0;
584 601
585 spin_lock_irqsave (&q->lock, flags); 602 spin_lock_irqsave (&q->lock, flags);
586 skb_queue_walk_safe(q, skb, skbnext) { 603 while (!skb_queue_empty(q)) {
587 struct skb_data *entry; 604 struct skb_data *entry;
588 struct urb *urb; 605 struct urb *urb;
589 int retval; 606 int retval;
590 607
591 entry = (struct skb_data *) skb->cb; 608 skb_queue_walk(q, skb) {
609 entry = (struct skb_data *) skb->cb;
610 if (entry->state != unlink_start)
611 goto found;
612 }
613 break;
614found:
615 entry->state = unlink_start;
592 urb = entry->urb; 616 urb = entry->urb;
593 617
594 /* 618 /*
@@ -1040,8 +1064,7 @@ static void tx_complete (struct urb *urb)
1040 } 1064 }
1041 1065
1042 usb_autopm_put_interface_async(dev->intf); 1066 usb_autopm_put_interface_async(dev->intf);
1043 entry->state = tx_done; 1067 (void) defer_bh(dev, skb, &dev->txq, tx_done);
1044 defer_bh(dev, skb, &dev->txq);
1045} 1068}
1046 1069
1047/*-------------------------------------------------------------------------*/ 1070/*-------------------------------------------------------------------------*/
@@ -1097,7 +1120,6 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1097 entry = (struct skb_data *) skb->cb; 1120 entry = (struct skb_data *) skb->cb;
1098 entry->urb = urb; 1121 entry->urb = urb;
1099 entry->dev = dev; 1122 entry->dev = dev;
1100 entry->state = tx_start;
1101 entry->length = length; 1123 entry->length = length;
1102 1124
1103 usb_fill_bulk_urb (urb, dev->udev, dev->out, 1125 usb_fill_bulk_urb (urb, dev->udev, dev->out,
@@ -1156,7 +1178,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1156 break; 1178 break;
1157 case 0: 1179 case 0:
1158 net->trans_start = jiffies; 1180 net->trans_start = jiffies;
1159 __skb_queue_tail (&dev->txq, skb); 1181 __usbnet_queue_skb(&dev->txq, skb, tx_start);
1160 if (dev->txq.qlen >= TX_QLEN (dev)) 1182 if (dev->txq.qlen >= TX_QLEN (dev))
1161 netif_stop_queue (net); 1183 netif_stop_queue (net);
1162 } 1184 }
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c
index f7868c0d79ed..2062ea1d7c80 100644
--- a/drivers/net/wireless/rtlwifi/pci.c
+++ b/drivers/net/wireless/rtlwifi/pci.c
@@ -1853,14 +1853,6 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1853 /*like read eeprom and so on */ 1853 /*like read eeprom and so on */
1854 rtlpriv->cfg->ops->read_eeprom_info(hw); 1854 rtlpriv->cfg->ops->read_eeprom_info(hw);
1855 1855
1856 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
1857 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
1858 err = -ENODEV;
1859 goto fail3;
1860 }
1861
1862 rtlpriv->cfg->ops->init_sw_leds(hw);
1863
1864 /*aspm */ 1856 /*aspm */
1865 rtl_pci_init_aspm(hw); 1857 rtl_pci_init_aspm(hw);
1866 1858
@@ -1879,6 +1871,14 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
1879 goto fail3; 1871 goto fail3;
1880 } 1872 }
1881 1873
1874 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
1875 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
1876 err = -ENODEV;
1877 goto fail3;
1878 }
1879
1880 rtlpriv->cfg->ops->init_sw_leds(hw);
1881
1882 err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); 1882 err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group);
1883 if (err) { 1883 if (err) {
1884 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, 1884 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c
index d04dbda13f5a..a6049d7d51b3 100644
--- a/drivers/net/wireless/rtlwifi/usb.c
+++ b/drivers/net/wireless/rtlwifi/usb.c
@@ -971,11 +971,6 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
971 rtlpriv->cfg->ops->read_chip_version(hw); 971 rtlpriv->cfg->ops->read_chip_version(hw);
972 /*like read eeprom and so on */ 972 /*like read eeprom and so on */
973 rtlpriv->cfg->ops->read_eeprom_info(hw); 973 rtlpriv->cfg->ops->read_eeprom_info(hw);
974 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
975 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
976 goto error_out;
977 }
978 rtlpriv->cfg->ops->init_sw_leds(hw);
979 err = _rtl_usb_init(hw); 974 err = _rtl_usb_init(hw);
980 if (err) 975 if (err)
981 goto error_out; 976 goto error_out;
@@ -987,6 +982,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
987 "Can't allocate sw for mac80211\n"); 982 "Can't allocate sw for mac80211\n");
988 goto error_out; 983 goto error_out;
989 } 984 }
985 if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
986 RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
987 goto error_out;
988 }
989 rtlpriv->cfg->ops->init_sw_leds(hw);
990 990
991 return 0; 991 return 0;
992error_out: 992error_out:
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/pci/pci-acpi.c b/drivers/pci/pci-acpi.c
index 0f150f271c2a..1929c0c63b75 100644
--- a/drivers/pci/pci-acpi.c
+++ b/drivers/pci/pci-acpi.c
@@ -200,7 +200,7 @@ static pci_power_t acpi_pci_choose_state(struct pci_dev *pdev)
200 return PCI_D1; 200 return PCI_D1;
201 case ACPI_STATE_D2: 201 case ACPI_STATE_D2:
202 return PCI_D2; 202 return PCI_D2;
203 case ACPI_STATE_D3: 203 case ACPI_STATE_D3_HOT:
204 return PCI_D3hot; 204 return PCI_D3hot;
205 case ACPI_STATE_D3_COLD: 205 case ACPI_STATE_D3_COLD:
206 return PCI_D3cold; 206 return PCI_D3cold;
@@ -223,7 +223,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
223 [PCI_D0] = ACPI_STATE_D0, 223 [PCI_D0] = ACPI_STATE_D0,
224 [PCI_D1] = ACPI_STATE_D1, 224 [PCI_D1] = ACPI_STATE_D1,
225 [PCI_D2] = ACPI_STATE_D2, 225 [PCI_D2] = ACPI_STATE_D2,
226 [PCI_D3hot] = ACPI_STATE_D3, 226 [PCI_D3hot] = ACPI_STATE_D3_HOT,
227 [PCI_D3cold] = ACPI_STATE_D3 227 [PCI_D3cold] = ACPI_STATE_D3
228 }; 228 };
229 int error = -EINVAL; 229 int error = -EINVAL;
diff --git a/drivers/platform/x86/intel_mid_powerbtn.c b/drivers/platform/x86/intel_mid_powerbtn.c
index 0a3594c7e912..bcbad8452a6f 100644
--- a/drivers/platform/x86/intel_mid_powerbtn.c
+++ b/drivers/platform/x86/intel_mid_powerbtn.c
@@ -78,7 +78,7 @@ static int __devinit mfld_pb_probe(struct platform_device *pdev)
78 78
79 input_set_capability(input, EV_KEY, KEY_POWER); 79 input_set_capability(input, EV_KEY, KEY_POWER);
80 80
81 error = request_threaded_irq(irq, NULL, mfld_pb_isr, 0, 81 error = request_threaded_irq(irq, NULL, mfld_pb_isr, IRQF_NO_SUSPEND,
82 DRIVER_NAME, input); 82 DRIVER_NAME, input);
83 if (error) { 83 if (error) {
84 dev_err(&pdev->dev, "Unable to request irq %d for mfld power" 84 dev_err(&pdev->dev, "Unable to request irq %d for mfld power"
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c
index 08c331130d88..3a9c17eced10 100644
--- a/drivers/ptp/ptp_pch.c
+++ b/drivers/ptp/ptp_pch.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/pci.h> 31#include <linux/pci.h>
32#include <linux/ptp_clock_kernel.h> 32#include <linux/ptp_clock_kernel.h>
33#include <linux/slab.h>
33 34
34#define STATION_ADDR_LEN 20 35#define STATION_ADDR_LEN 20
35#define PCI_DEVICE_ID_PCH_1588 0x8819 36#define PCI_DEVICE_ID_PCH_1588 0x8819
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}
1436EXPORT_SYMBOL_GPL(devm_regulator_put); 1439EXPORT_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/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index ee15c68fb519..e756a0df3664 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -354,7 +354,7 @@ static void __rproc_free_vrings(struct rproc_vdev *rvdev, int i)
354{ 354{
355 struct rproc *rproc = rvdev->rproc; 355 struct rproc *rproc = rvdev->rproc;
356 356
357 for (i--; i > 0; i--) { 357 for (i--; i >= 0; i--) {
358 struct rproc_vring *rvring = &rvdev->vring[i]; 358 struct rproc_vring *rvring = &rvdev->vring[i];
359 int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); 359 int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align));
360 360
diff --git a/drivers/rtc/rtc-mpc5121.c b/drivers/rtc/rtc-mpc5121.c
index 42f5f829b3ee..029e421baaed 100644
--- a/drivers/rtc/rtc-mpc5121.c
+++ b/drivers/rtc/rtc-mpc5121.c
@@ -360,12 +360,11 @@ static int __devinit mpc5121_rtc_probe(struct platform_device *op)
360 &mpc5200_rtc_ops, THIS_MODULE); 360 &mpc5200_rtc_ops, THIS_MODULE);
361 } 361 }
362 362
363 rtc->rtc->uie_unsupported = 1;
364
365 if (IS_ERR(rtc->rtc)) { 363 if (IS_ERR(rtc->rtc)) {
366 err = PTR_ERR(rtc->rtc); 364 err = PTR_ERR(rtc->rtc);
367 goto out_free_irq; 365 goto out_free_irq;
368 } 366 }
367 rtc->rtc->uie_unsupported = 1;
369 368
370 return 0; 369 return 0;
371 370
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
181static void virtscsi_ctrl_done(struct virtqueue *vq) 182static void virtscsi_ctrl_done(struct virtqueue *vq)
@@ -311,21 +312,22 @@ out:
311static int virtscsi_tmf(struct virtio_scsi *vscsi, struct virtio_scsi_cmd *cmd) 312static 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 = &comp; 317 cmd->comp = &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; 328out:
329 mempool_free(cmd, virtscsi_cmd_pool);
330 return ret;
329} 331}
330 332
331static int virtscsi_device_reset(struct scsi_cmnd *sc) 333static 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/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c
index 29ca20dbd335..3b0c4e32ed7b 100644
--- a/drivers/tty/vt/keyboard.c
+++ b/drivers/tty/vt/keyboard.c
@@ -2044,7 +2044,7 @@ int vt_do_kdskled(int console, int cmd, unsigned long arg, int perm)
2044 kbd->default_ledflagstate = ((arg >> 4) & 7); 2044 kbd->default_ledflagstate = ((arg >> 4) & 7);
2045 set_leds(); 2045 set_leds();
2046 spin_unlock_irqrestore(&kbd_event_lock, flags); 2046 spin_unlock_irqrestore(&kbd_event_lock, flags);
2047 break; 2047 return 0;
2048 2048
2049 /* the ioctls below only set the lights, not the functions */ 2049 /* the ioctls below only set the lights, not the functions */
2050 /* for those, see KDGKBLED and KDSKBLED above */ 2050 /* for those, see KDGKBLED and KDSKBLED above */
diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c
index 853db7a08a26..f82a7394756e 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
@@ -286,8 +287,12 @@ static int peek_head_len(struct sock *sk)
286 287
287 spin_lock_irqsave(&sk->sk_receive_queue.lock, flags); 288 spin_lock_irqsave(&sk->sk_receive_queue.lock, flags);
288 head = skb_peek(&sk->sk_receive_queue); 289 head = skb_peek(&sk->sk_receive_queue);
289 if (likely(head)) 290 if (likely(head)) {
290 len = head->len; 291 len = head->len;
292 if (vlan_tx_tag_present(head))
293 len += VLAN_HLEN;
294 }
295
291 spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags); 296 spin_unlock_irqrestore(&sk->sk_receive_queue.lock, flags);
292 return len; 297 return len;
293} 298}
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: 476error_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);
480error_nomem:
481 if (!ret) {
482 ret = -ENOMEM;
483 xenbus_dev_fatal(dev, ret, "allocating device memory");
484 }
485error:
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
197endmenu 199endmenu