]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
Merge branch 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux...
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 16 May 2012 21:21:41 +0000 (14:21 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 16 May 2012 21:21:41 +0000 (14:21 -0700)
Pull two Tile arch fixes from Chris Metcalf:
 "These are both bug-fixes, one to avoid some issues in how we invoke
  the "pending userspace work" flags on return to userspace, and the
  other to provide the same signal handler arguments for tilegx32 that
  we do for tilegx64."

* 'stable' of git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  arch/tile: apply commit 74fca9da0 to the compat signal handling as well
  arch/tile: fix up some issues in calling do_work_pending()

49 files changed:
Documentation/feature-removal-schedule.txt
arch/mn10300/kernel/smp.c
arch/parisc/kernel/smp.c
drivers/media/dvb/dvb-core/dvb_frontend.c
drivers/media/rc/ene_ir.c
drivers/media/rc/fintek-cir.c
drivers/media/rc/ite-cir.c
drivers/media/rc/nuvoton-cir.c
drivers/media/rc/winbond-cir.c
drivers/media/video/gspca/sonixj.c
drivers/media/video/marvell-ccic/mmp-driver.c
drivers/media/video/s5p-fimc/fimc-capture.c
drivers/media/video/s5p-fimc/fimc-core.c
drivers/media/video/s5p-fimc/fimc-core.h
drivers/media/video/soc_camera.c
drivers/media/video/videobuf2-dma-contig.c
drivers/media/video/videobuf2-memops.c
drivers/mtd/mtdchar.c
drivers/mtd/nand/ams-delta.c
drivers/net/bonding/bond_alb.c
drivers/net/bonding/bonding.h
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h
drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c
drivers/net/usb/cdc_ether.c
drivers/net/usb/usbnet.c
drivers/net/wireless/rtlwifi/pci.c
drivers/net/wireless/rtlwifi/usb.c
drivers/ptp/ptp_pch.c
drivers/tty/vt/keyboard.c
fs/jffs2/gc.c
include/linux/netfilter/ipset/ip_set_ahash.h
include/linux/usb/usbnet.h
include/media/soc_camera.h
include/net/bluetooth/bluetooth.h
kernel/irq/chip.c
kernel/irq/irqdesc.c
net/bluetooth/af_bluetooth.c
net/bluetooth/hci_core.c
net/bluetooth/hci_event.c
net/bluetooth/l2cap_core.c
net/bluetooth/l2cap_sock.c
net/netfilter/ipset/ip_set_hash_ip.c
net/netfilter/ipset/ip_set_hash_ipport.c
net/netfilter/ipset/ip_set_hash_ipportip.c
net/netfilter/ipset/ip_set_hash_ipportnet.c
net/netfilter/ipset/ip_set_hash_net.c
net/netfilter/ipset/ip_set_hash_netiface.c
net/netfilter/ipset/ip_set_hash_netport.c
net/openvswitch/datapath.c

index 03ca210406edfcbe90fc58cd006ef0e7d313b42f..e4b57756b9f55a7786adab34da6bcb70ef31beaa 100644 (file)
@@ -539,3 +539,13 @@ When:      3.6
 Why:   setitimer is not returning -EFAULT if user pointer is NULL. This
        violates the spec.
 Who:   Sasikantha Babu <sasikanth.v19@gmail.com>
+
+----------------------------
+
+What:  V4L2_CID_HCENTER, V4L2_CID_VCENTER V4L2 controls
+When:  3.7
+Why:   The V4L2_CID_VCENTER, V4L2_CID_HCENTER controls have been deprecated
+       for about 4 years and they are not used by any mainline driver.
+       There are newer controls (V4L2_CID_PAN*, V4L2_CID_TILT*) that provide
+       similar functionality.
+Who:   Sylwester Nawrocki <sylvester.nawrocki@gmail.com>
index 910dddf65e44c4c732bdc36a17f8bd21703943ce..9cd69ad6aa02ee5529e4ff645efc2f910f61db0f 100644 (file)
@@ -24,6 +24,7 @@
 #include <linux/sched.h>
 #include <linux/profile.h>
 #include <linux/smp.h>
+#include <linux/cpu.h>
 #include <asm/tlbflush.h>
 #include <asm/bitops.h>
 #include <asm/processor.h>
@@ -38,7 +39,6 @@
 #include "internal.h"
 
 #ifdef CONFIG_HOTPLUG_CPU
-#include <linux/cpu.h>
 #include <asm/cacheflush.h>
 
 static unsigned long sleep_mode[NR_CPUS];
@@ -874,10 +874,13 @@ static void __init smp_online(void)
 
        cpu = smp_processor_id();
 
-       local_irq_enable();
+       notify_cpu_starting(cpu);
 
+       ipi_call_lock();
        set_cpu_online(cpu, true);
-       smp_wmb();
+       ipi_call_unlock();
+
+       local_irq_enable();
 }
 
 /**
index 0bb1d63907f88a4ac915c2398b9a154744d91265..4dc7b7942b4c99944a9d15c7559b22a34048018b 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/delay.h>
 #include <linux/bitops.h>
 #include <linux/ftrace.h>
+#include <linux/cpu.h>
 
 #include <linux/atomic.h>
 #include <asm/current.h>
@@ -295,8 +296,13 @@ smp_cpu_init(int cpunum)
 
                printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum);
                machine_halt();
-       }  
+       }
+
+       notify_cpu_starting(cpunum);
+
+       ipi_call_lock();
        set_cpu_online(cpunum, true);
+       ipi_call_unlock();
 
        /* Initialise the idle task for this CPU */
        atomic_inc(&init_mm.mm_count);
index 0f64d71826572d298d4cbf19050e8be254fce887..cb888d835a898375c0f759848b13fc1f85853ab0 100644 (file)
@@ -1921,6 +1921,10 @@ static int dtv_set_frontend(struct dvb_frontend *fe)
        } else {
                /* default values */
                switch (c->delivery_system) {
+               case SYS_DVBS:
+               case SYS_DVBS2:
+               case SYS_ISDBS:
+               case SYS_TURBO:
                case SYS_DVBC_ANNEX_A:
                case SYS_DVBC_ANNEX_C:
                        fepriv->min_delay = HZ / 20;
index 860c112e0fd23d8e0cd39f3b413428601692c8d2..bef5296173c904baffc14b8856627839de57f51d 100644 (file)
@@ -1018,22 +1018,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
 
        spin_lock_init(&dev->hw_lock);
 
-       /* claim the resources */
-       error = -EBUSY;
-       dev->hw_io = pnp_port_start(pnp_dev, 0);
-       if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) {
-               dev->hw_io = -1;
-               dev->irq = -1;
-               goto error;
-       }
-
-       dev->irq = pnp_irq(pnp_dev, 0);
-       if (request_irq(dev->irq, ene_isr,
-                       IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) {
-               dev->irq = -1;
-               goto error;
-       }
-
        pnp_set_drvdata(pnp_dev, dev);
        dev->pnp_dev = pnp_dev;
 
@@ -1086,6 +1070,22 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
        device_set_wakeup_capable(&pnp_dev->dev, true);
        device_set_wakeup_enable(&pnp_dev->dev, true);
 
+       /* claim the resources */
+       error = -EBUSY;
+       dev->hw_io = pnp_port_start(pnp_dev, 0);
+       if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) {
+               dev->hw_io = -1;
+               dev->irq = -1;
+               goto error;
+       }
+
+       dev->irq = pnp_irq(pnp_dev, 0);
+       if (request_irq(dev->irq, ene_isr,
+                       IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) {
+               dev->irq = -1;
+               goto error;
+       }
+
        error = rc_register_device(rdev);
        if (error < 0)
                goto error;
index 392d4be91f8f10b0acba9d5b669e5c885c06fbd4..4a3a238bcfbc0d3eabbfbf66eec0d49fd66ecaa3 100644 (file)
@@ -197,7 +197,7 @@ static int fintek_hw_detect(struct fintek_dev *fintek)
        /*
         * Newer reviews of this chipset uses port 8 instead of 5
         */
-       if ((chip != 0x0408) || (chip != 0x0804))
+       if ((chip != 0x0408) && (chip != 0x0804))
                fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2;
        else
                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
 
        spin_lock_init(&fintek->fintek_lock);
 
-       ret = -EBUSY;
-       /* now claim resources */
-       if (!request_region(fintek->cir_addr,
-                           fintek->cir_port_len, FINTEK_DRIVER_NAME))
-               goto failure;
-
-       if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
-                       FINTEK_DRIVER_NAME, (void *)fintek))
-               goto failure;
-
        pnp_set_drvdata(pdev, fintek);
        fintek->pdev = pdev;
 
@@ -558,6 +548,16 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
        /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */
        rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);
 
+       ret = -EBUSY;
+       /* now claim resources */
+       if (!request_region(fintek->cir_addr,
+                           fintek->cir_port_len, FINTEK_DRIVER_NAME))
+               goto failure;
+
+       if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
+                       FINTEK_DRIVER_NAME, (void *)fintek))
+               goto failure;
+
        ret = rc_register_device(rdev);
        if (ret)
                goto failure;
index 682009d76cdfe487ffe950c17235075808893795..0e49c99abf68501c4558953058ae8d9b9df2ffa7 100644 (file)
@@ -1515,16 +1515,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
        /* initialize raw event */
        init_ir_raw_event(&itdev->rawir);
 
-       ret = -EBUSY;
-       /* now claim resources */
-       if (!request_region(itdev->cir_addr,
-                               dev_desc->io_region_size, ITE_DRIVER_NAME))
-               goto failure;
-
-       if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
-                       ITE_DRIVER_NAME, (void *)itdev))
-               goto failure;
-
        /* set driver data into the pnp device */
        pnp_set_drvdata(pdev, itdev);
        itdev->pdev = pdev;
@@ -1600,6 +1590,16 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
        rdev->driver_name = ITE_DRIVER_NAME;
        rdev->map_name = RC_MAP_RC6_MCE;
 
+       ret = -EBUSY;
+       /* now claim resources */
+       if (!request_region(itdev->cir_addr,
+                               dev_desc->io_region_size, ITE_DRIVER_NAME))
+               goto failure;
+
+       if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
+                       ITE_DRIVER_NAME, (void *)itdev))
+               goto failure;
+
        ret = rc_register_device(rdev);
        if (ret)
                goto failure;
index 144f3f55d7656a51999b8a12f673fdf7bcc5ebcf..8b2c071ac0ab67d86cfb1ea8120435e5df23406f 100644 (file)
@@ -1021,24 +1021,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
        spin_lock_init(&nvt->nvt_lock);
        spin_lock_init(&nvt->tx.lock);
 
-       ret = -EBUSY;
-       /* now claim resources */
-       if (!request_region(nvt->cir_addr,
-                           CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
-               goto failure;
-
-       if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,
-                       NVT_DRIVER_NAME, (void *)nvt))
-               goto failure;
-
-       if (!request_region(nvt->cir_wake_addr,
-                           CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
-               goto failure;
-
-       if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,
-                       NVT_DRIVER_NAME, (void *)nvt))
-               goto failure;
-
        pnp_set_drvdata(pdev, nvt);
        nvt->pdev = pdev;
 
@@ -1085,6 +1067,24 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
        rdev->tx_resolution = XYZ;
 #endif
 
+       ret = -EBUSY;
+       /* now claim resources */
+       if (!request_region(nvt->cir_addr,
+                           CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
+               goto failure;
+
+       if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,
+                       NVT_DRIVER_NAME, (void *)nvt))
+               goto failure;
+
+       if (!request_region(nvt->cir_wake_addr,
+                           CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
+               goto failure;
+
+       if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,
+                       NVT_DRIVER_NAME, (void *)nvt))
+               goto failure;
+
        ret = rc_register_device(rdev);
        if (ret)
                goto failure;
index af526586fa263f63ccf6d2088f10a779724fb3a8..342c2c8c1ddfcff71f493f3f6f08a4f1969df440 100644 (file)
@@ -991,39 +991,10 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
                "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n",
                data->wbase, data->ebase, data->sbase, data->irq);
 
-       if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
-               dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
-                       data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1);
-               err = -EBUSY;
-               goto exit_free_data;
-       }
-
-       if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) {
-               dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
-                       data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1);
-               err = -EBUSY;
-               goto exit_release_wbase;
-       }
-
-       if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) {
-               dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
-                       data->sbase, data->sbase + SP_IOMEM_LEN - 1);
-               err = -EBUSY;
-               goto exit_release_ebase;
-       }
-
-       err = request_irq(data->irq, wbcir_irq_handler,
-                         IRQF_DISABLED, DRVNAME, device);
-       if (err) {
-               dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
-               err = -EBUSY;
-               goto exit_release_sbase;
-       }
-
        led_trigger_register_simple("cir-tx", &data->txtrigger);
        if (!data->txtrigger) {
                err = -ENOMEM;
-               goto exit_free_irq;
+               goto exit_free_data;
        }
 
        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)
        data->dev->priv = data;
        data->dev->dev.parent = &device->dev;
 
+       if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
+               dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
+                       data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1);
+               err = -EBUSY;
+               goto exit_free_rc;
+       }
+
+       if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) {
+               dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
+                       data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1);
+               err = -EBUSY;
+               goto exit_release_wbase;
+       }
+
+       if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) {
+               dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
+                       data->sbase, data->sbase + SP_IOMEM_LEN - 1);
+               err = -EBUSY;
+               goto exit_release_ebase;
+       }
+
+       err = request_irq(data->irq, wbcir_irq_handler,
+                         IRQF_DISABLED, DRVNAME, device);
+       if (err) {
+               dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
+               err = -EBUSY;
+               goto exit_release_sbase;
+       }
+
        err = rc_register_device(data->dev);
        if (err)
-               goto exit_free_rc;
+               goto exit_free_irq;
 
        device_init_wakeup(&device->dev, 1);
 
@@ -1072,14 +1072,6 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
 
        return 0;
 
-exit_free_rc:
-       rc_free_device(data->dev);
-exit_unregister_led:
-       led_classdev_unregister(&data->led);
-exit_unregister_rxtrigger:
-       led_trigger_unregister_simple(data->rxtrigger);
-exit_unregister_txtrigger:
-       led_trigger_unregister_simple(data->txtrigger);
 exit_free_irq:
        free_irq(data->irq, device);
 exit_release_sbase:
@@ -1088,6 +1080,14 @@ exit_release_ebase:
        release_region(data->ebase, EHFUNC_IOMEM_LEN);
 exit_release_wbase:
        release_region(data->wbase, WAKEUP_IOMEM_LEN);
+exit_free_rc:
+       rc_free_device(data->dev);
+exit_unregister_led:
+       led_classdev_unregister(&data->led);
+exit_unregister_rxtrigger:
+       led_trigger_unregister_simple(data->rxtrigger);
+exit_unregister_txtrigger:
+       led_trigger_unregister_simple(data->txtrigger);
 exit_free_data:
        kfree(data);
        pnp_set_drvdata(device, NULL);
index db8e5084df0660fff2e241d06f3073c5317646ab..863c755dd2b7a16866a3e5329b47a9507831bc9d 100644 (file)
@@ -2923,6 +2923,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
         * not the JPEG end of frame ('ff d9').
         */
 
+       /* count the packets and their size */
+       sd->npkt++;
+       sd->pktsz += len;
+
 /*fixme: assumption about the following code:
  *     - there can be only one marker in a packet
  */
@@ -2945,10 +2949,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev,
                data += i;
        }
 
-       /* count the packets and their size */
-       sd->npkt++;
-       sd->pktsz += len;
-
        /* search backwards if there is a marker in the packet */
        for (i = len - 1; --i >= 0; ) {
                if (data[i] != 0xff) {
index d23552323f456b0bffffeff508478921c29e9dab..c4c17fe76c0d5e0319c11947d9b7e062e3014b7d 100644 (file)
@@ -181,7 +181,6 @@ static int mmpcam_probe(struct platform_device *pdev)
        INIT_LIST_HEAD(&cam->devlist);
 
        mcam = &cam->mcam;
-       mcam->platform = MHP_Armada610;
        mcam->plat_power_up = mmpcam_power_up;
        mcam->plat_power_down = mmpcam_power_down;
        mcam->dev = &pdev->dev;
index b06efd2083287bc74b0f779fabdc159a41414437..7e9b2c612b03e9ccccb5a03883169f376876e272 100644 (file)
@@ -246,28 +246,37 @@ int fimc_capture_resume(struct fimc_dev *fimc)
 
 }
 
-static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane)
-{
-       if (!fr || plane >= fr->fmt->memplanes)
-               return 0;
-       return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8;
-}
-
-static int queue_setup(struct vb2_queue *vq,  const struct v4l2_format *pfmt,
+static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt,
                       unsigned int *num_buffers, unsigned int *num_planes,
                       unsigned int sizes[], void *allocators[])
 {
+       const struct v4l2_pix_format_mplane *pixm = NULL;
        struct fimc_ctx *ctx = vq->drv_priv;
-       struct fimc_fmt *fmt = ctx->d_frame.fmt;
+       struct fimc_frame *frame = &ctx->d_frame;
+       struct fimc_fmt *fmt = frame->fmt;
+       unsigned long wh;
        int i;
 
-       if (!fmt)
+       if (pfmt) {
+               pixm = &pfmt->fmt.pix_mp;
+               fmt = fimc_find_format(&pixm->pixelformat, NULL,
+                                      FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1);
+               wh = pixm->width * pixm->height;
+       } else {
+               wh = frame->f_width * frame->f_height;
+       }
+
+       if (fmt == NULL)
                return -EINVAL;
 
        *num_planes = fmt->memplanes;
 
        for (i = 0; i < fmt->memplanes; i++) {
-               sizes[i] = get_plane_size(&ctx->d_frame, i);
+               unsigned int size = (wh * fmt->depth[i]) / 8;
+               if (pixm)
+                       sizes[i] = max(size, pixm->plane_fmt[i].sizeimage);
+               else
+                       sizes[i] = size;
                allocators[i] = ctx->fimc_dev->alloc_ctx;
        }
 
@@ -1383,7 +1392,7 @@ static int fimc_subdev_set_crop(struct v4l2_subdev *sd,
        fimc_capture_try_crop(ctx, r, crop->pad);
 
        if (crop->which == V4L2_SUBDEV_FORMAT_TRY) {
-               mutex_lock(&fimc->lock);
+               mutex_unlock(&fimc->lock);
                *v4l2_subdev_get_try_crop(fh, crop->pad) = *r;
                return 0;
        }
index e184e650022a8a6b526b0eb0a254ebf9ed446bc0..e09ba7b0076ed5806f4ee17952f4bbacde53096a 100644 (file)
@@ -1048,14 +1048,14 @@ static int fimc_m2m_g_fmt_mplane(struct file *file, void *fh,
  * @mask: the color flags to match
  * @index: offset in the fimc_formats array, ignored if negative
  */
-struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code,
+struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code,
                                  unsigned int mask, int index)
 {
        struct fimc_fmt *fmt, *def_fmt = NULL;
        unsigned int i;
        int id = 0;
 
-       if (index >= ARRAY_SIZE(fimc_formats))
+       if (index >= (int)ARRAY_SIZE(fimc_formats))
                return NULL;
 
        for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) {
index a18291e648e295fcd328f3dfc3c29d4768e3bfb4..84fd83550bd7fcdbc5f76399c054bb7e2ca09837 100644 (file)
@@ -718,7 +718,7 @@ void fimc_alpha_ctrl_update(struct fimc_ctx *ctx);
 int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f);
 void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height,
                               struct v4l2_pix_format_mplane *pix);
-struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code,
+struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code,
                                  unsigned int mask, int index);
 
 int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh,
index eb25756a07af3fdbc26b9993f153716cea0edc85..aedb970d13f6a8c962f274484bb52e64f876fc0d 100644 (file)
@@ -530,7 +530,10 @@ static int soc_camera_open(struct file *file)
                if (icl->reset)
                        icl->reset(icd->pdev);
 
+               /* Don't mess with the host during probe */
+               mutex_lock(&ici->host_lock);
                ret = ici->ops->add(icd);
+               mutex_unlock(&ici->host_lock);
                if (ret < 0) {
                        dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret);
                        goto eiciadd;
@@ -956,7 +959,7 @@ static void scan_add_host(struct soc_camera_host *ici)
 {
        struct soc_camera_device *icd;
 
-       mutex_lock(&list_lock);
+       mutex_lock(&ici->host_lock);
 
        list_for_each_entry(icd, &devices, list) {
                if (icd->iface == ici->nr) {
@@ -967,7 +970,7 @@ static void scan_add_host(struct soc_camera_host *ici)
                }
        }
 
-       mutex_unlock(&list_lock);
+       mutex_unlock(&ici->host_lock);
 }
 
 #ifdef CONFIG_I2C_BOARDINFO
@@ -1313,6 +1316,7 @@ int soc_camera_host_register(struct soc_camera_host *ici)
        list_add_tail(&ici->list, &hosts);
        mutex_unlock(&list_lock);
 
+       mutex_init(&ici->host_lock);
        scan_add_host(ici);
 
        return 0;
index f17ad98fcc5fa61e09d87af99a57b6934443e656..4b7132660a938f52b105b6306b39d5d54a39777e 100644 (file)
@@ -15,6 +15,7 @@
 #include <linux/dma-mapping.h>
 
 #include <media/videobuf2-core.h>
+#include <media/videobuf2-dma-contig.h>
 #include <media/videobuf2-memops.h>
 
 struct vb2_dc_conf {
@@ -85,7 +86,7 @@ static void *vb2_dma_contig_vaddr(void *buf_priv)
 {
        struct vb2_dc_buf *buf = buf_priv;
        if (!buf)
-               return 0;
+               return NULL;
 
        return buf->vaddr;
 }
index c41cb60245d6c0b593f4614f3baeb2a7b88bc4f2..504cd4cbe29e44f40f822240eb21b03364136f65 100644 (file)
@@ -55,6 +55,7 @@ struct vm_area_struct *vb2_get_vma(struct vm_area_struct *vma)
 
        return vma_copy;
 }
+EXPORT_SYMBOL_GPL(vb2_get_vma);
 
 /**
  * vb2_put_userptr() - release a userspace virtual memory area
index 58fc65f5c8176d130bef3795ccb5163328489be6..f2f482bec5736b21a562da5e4fda11375e8cf457 100644 (file)
@@ -376,7 +376,7 @@ static int otp_select_filemode(struct mtd_file_info *mfi, int mode)
         * Make a fake call to mtd_read_fact_prot_reg() to check if OTP
         * operations are supported.
         */
-       if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP)
+       if (mtd_read_fact_prot_reg(mtd, -1, 0, &retlen, NULL) == -EOPNOTSUPP)
                return -EOPNOTSUPP;
 
        switch (mode) {
index 73416951f4c1f6bdd52b53c8f2ebe1967fae4d47..861ca8f7e47d2d62ff0b3929100117f0f7036543 100644 (file)
@@ -212,18 +212,17 @@ static int __devinit ams_delta_init(struct platform_device *pdev)
        /* Link the private data with the MTD structure */
        ams_delta_mtd->priv = this;
 
-       if (!request_mem_region(res->start, resource_size(res),
-                       dev_name(&pdev->dev))) {
-               dev_err(&pdev->dev, "request_mem_region failed\n");
-               err = -EBUSY;
-               goto out_free;
-       }
+       /*
+        * Don't try to request the memory region from here,
+        * it should have been already requested from the
+        * gpio-omap driver and requesting it again would fail.
+        */
 
        io_base = ioremap(res->start, resource_size(res));
        if (io_base == NULL) {
                dev_err(&pdev->dev, "ioremap failed\n");
                err = -EIO;
-               goto out_release_io;
+               goto out_free;
        }
 
        this->priv = io_base;
@@ -271,8 +270,6 @@ out_gpio:
        platform_set_drvdata(pdev, NULL);
        gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
        iounmap(io_base);
-out_release_io:
-       release_mem_region(res->start, resource_size(res));
 out_free:
        kfree(ams_delta_mtd);
  out:
@@ -285,7 +282,6 @@ out_free:
 static int __devexit ams_delta_cleanup(struct platform_device *pdev)
 {
        void __iomem *io_base = platform_get_drvdata(pdev);
-       struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 
        /* Release resources, unregister device */
        nand_release(ams_delta_mtd);
@@ -293,7 +289,6 @@ static int __devexit ams_delta_cleanup(struct platform_device *pdev)
        gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
        gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
        iounmap(io_base);
-       release_mem_region(res->start, resource_size(res));
 
        /* Free the MTD device structure */
        kfree(ams_delta_mtd);
index 9abfde4793166f8d323ad9a229d7a1ec09ab2fab..2e1f8066f1a8146b0f89cfb4a9e08e1f6b9a54bd 100644 (file)
@@ -342,26 +342,26 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp)
        _unlock_rx_hashtbl_bh(bond);
 }
 
-static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
+static int rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
                         struct slave *slave)
 {
        struct arp_pkt *arp;
 
        if (skb->protocol != cpu_to_be16(ETH_P_ARP))
-               return;
+               goto out;
 
        arp = (struct arp_pkt *) skb->data;
        if (!arp) {
                pr_debug("Packet has no ARP data\n");
-               return;
+               goto out;
        }
 
        if (!pskb_may_pull(skb, arp_hdr_len(bond->dev)))
-               return;
+               goto out;
 
        if (skb->len < sizeof(struct arp_pkt)) {
                pr_debug("Packet is too small to be an ARP\n");
-               return;
+               goto out;
        }
 
        if (arp->op_code == htons(ARPOP_REPLY)) {
@@ -369,6 +369,8 @@ static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond,
                rlb_update_entry_from_arp(bond, arp);
                pr_debug("Server received an ARP Reply from client\n");
        }
+out:
+       return RX_HANDLER_ANOTHER;
 }
 
 /* Caller must hold bond lock for read */
index 9f2bae6616d3f455ed097f927ba1ca9fd27be945..4581aa5ccabab0a36b5e1afcb2bfe5cc77e0d829 100644 (file)
@@ -218,7 +218,7 @@ struct bonding {
        struct   slave *primary_slave;
        bool     force_primary;
        s32      slave_cnt; /* never change this value outside the attach/detach wrappers */
-       void     (*recv_probe)(struct sk_buff *, struct bonding *,
+       int     (*recv_probe)(struct sk_buff *, struct bonding *,
                               struct slave *);
        rwlock_t lock;
        rwlock_t curr_slave_lock;
index dd14915f54bb8581516329c36b3fed3d0204cfae..ba781747d17421d7a0fff044b74c79303e6a8fa3 100644 (file)
@@ -584,7 +584,6 @@ struct pch_gbe_hw_stats {
 /**
  * struct pch_gbe_adapter - board specific private data structure
  * @stats_lock:        Spinlock structure for status
- * @tx_queue_lock:     Spinlock structure for transmit
  * @ethtool_lock:      Spinlock structure for ethtool
  * @irq_sem:           Semaphore for interrupt
  * @netdev:            Pointer of network device structure
@@ -609,7 +608,6 @@ struct pch_gbe_hw_stats {
 
 struct pch_gbe_adapter {
        spinlock_t stats_lock;
-       spinlock_t tx_queue_lock;
        spinlock_t ethtool_lock;
        atomic_t irq_sem;
        struct net_device *netdev;
index 8035e5ff6e060d4c208208857159c7e32c0484f0..1e38d502a06202d381b14d50964712896da4c67e 100644 (file)
@@ -640,14 +640,11 @@ static void pch_gbe_mac_set_pause_packet(struct pch_gbe_hw *hw)
  */
 static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter)
 {
-       int size;
-
-       size = (int)sizeof(struct pch_gbe_tx_ring);
-       adapter->tx_ring = kzalloc(size, GFP_KERNEL);
+       adapter->tx_ring = kzalloc(sizeof(*adapter->tx_ring), GFP_KERNEL);
        if (!adapter->tx_ring)
                return -ENOMEM;
-       size = (int)sizeof(struct pch_gbe_rx_ring);
-       adapter->rx_ring = kzalloc(size, GFP_KERNEL);
+
+       adapter->rx_ring = kzalloc(sizeof(*adapter->rx_ring), GFP_KERNEL);
        if (!adapter->rx_ring) {
                kfree(adapter->tx_ring);
                return -ENOMEM;
@@ -1162,7 +1159,6 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
        struct sk_buff *tmp_skb;
        unsigned int frame_ctrl;
        unsigned int ring_num;
-       unsigned long flags;
 
        /*-- Set frame control --*/
        frame_ctrl = 0;
@@ -1211,14 +1207,14 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter,
                        }
                }
        }
-       spin_lock_irqsave(&tx_ring->tx_lock, flags);
+
        ring_num = tx_ring->next_to_use;
        if (unlikely((ring_num + 1) == tx_ring->count))
                tx_ring->next_to_use = 0;
        else
                tx_ring->next_to_use = ring_num + 1;
 
-       spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
+
        buffer_info = &tx_ring->buffer_info[ring_num];
        tmp_skb = buffer_info->skb;
 
@@ -1518,7 +1514,7 @@ pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter,
                                                &rx_ring->rx_buff_pool_logic,
                                                GFP_KERNEL);
        if (!rx_ring->rx_buff_pool) {
-               pr_err("Unable to allocate memory for the receive poll buffer\n");
+               pr_err("Unable to allocate memory for the receive pool buffer\n");
                return -ENOMEM;
        }
        memset(rx_ring->rx_buff_pool, 0, size);
@@ -1637,15 +1633,17 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter,
        pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n",
                 cleaned_count);
        /* Recover from running out of Tx resources in xmit_frame */
+       spin_lock(&tx_ring->tx_lock);
        if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) {
                netif_wake_queue(adapter->netdev);
                adapter->stats.tx_restart_count++;
                pr_debug("Tx wake queue\n");
        }
-       spin_lock(&adapter->tx_queue_lock);
+
        tx_ring->next_to_clean = i;
-       spin_unlock(&adapter->tx_queue_lock);
+
        pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean);
+       spin_unlock(&tx_ring->tx_lock);
        return cleaned;
 }
 
@@ -2037,7 +2035,6 @@ static int pch_gbe_sw_init(struct pch_gbe_adapter *adapter)
                return -ENOMEM;
        }
        spin_lock_init(&adapter->hw.miim_lock);
-       spin_lock_init(&adapter->tx_queue_lock);
        spin_lock_init(&adapter->stats_lock);
        spin_lock_init(&adapter->ethtool_lock);
        atomic_set(&adapter->irq_sem, 0);
@@ -2142,10 +2139,10 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
                         tx_ring->next_to_use, tx_ring->next_to_clean);
                return NETDEV_TX_BUSY;
        }
-       spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
 
        /* CRC,ITAG no support */
        pch_gbe_tx_queue(adapter, tx_ring, skb);
+       spin_unlock_irqrestore(&tx_ring->tx_lock, flags);
        return NETDEV_TX_OK;
 }
 
index 00880edba04801bc9b686e17182bc09cc0531564..425e201f597c7f009d052859e65568d51b2c464f 100644 (file)
@@ -485,6 +485,7 @@ static const struct driver_info wwan_info = {
 /*-------------------------------------------------------------------------*/
 
 #define HUAWEI_VENDOR_ID       0x12D1
+#define NOVATEL_VENDOR_ID      0x1410
 
 static const struct usb_device_id      products [] = {
 /*
@@ -602,6 +603,21 @@ static const struct usb_device_id  products [] = {
  * because of bugs/quirks in a given product (like Zaurus, above).
  */
 {
+       /* Novatel USB551L */
+       /* This match must come *before* the generic CDC-ETHER match so that
+        * we get FLAG_WWAN set on the device, since it's descriptors are
+        * generic CDC-ETHER.
+        */
+       .match_flags    =   USB_DEVICE_ID_MATCH_VENDOR
+                | USB_DEVICE_ID_MATCH_PRODUCT
+                | USB_DEVICE_ID_MATCH_INT_INFO,
+       .idVendor               = NOVATEL_VENDOR_ID,
+       .idProduct              = 0xB001,
+       .bInterfaceClass        = USB_CLASS_COMM,
+       .bInterfaceSubClass     = USB_CDC_SUBCLASS_ETHERNET,
+       .bInterfaceProtocol     = USB_CDC_PROTO_NONE,
+       .driver_info = (unsigned long)&wwan_info,
+}, {
        USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
                        USB_CDC_PROTO_NONE),
        .driver_info = (unsigned long) &cdc_info,
index 2d927fb4adf4ea6805b2aeb02d06c8cb5108f496..b38db48b1ce09b380d8cdea0ea444be0d97573d0 100644 (file)
@@ -282,17 +282,32 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu)
 }
 EXPORT_SYMBOL_GPL(usbnet_change_mtu);
 
+/* The caller must hold list->lock */
+static void __usbnet_queue_skb(struct sk_buff_head *list,
+                       struct sk_buff *newsk, enum skb_state state)
+{
+       struct skb_data *entry = (struct skb_data *) newsk->cb;
+
+       __skb_queue_tail(list, newsk);
+       entry->state = state;
+}
+
 /*-------------------------------------------------------------------------*/
 
 /* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from
  * completion callbacks.  2.5 should have fixed those bugs...
  */
 
-static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_head *list)
+static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb,
+               struct sk_buff_head *list, enum skb_state state)
 {
        unsigned long           flags;
+       enum skb_state          old_state;
+       struct skb_data *entry = (struct skb_data *) skb->cb;
 
        spin_lock_irqsave(&list->lock, flags);
+       old_state = entry->state;
+       entry->state = state;
        __skb_unlink(skb, list);
        spin_unlock(&list->lock);
        spin_lock(&dev->done.lock);
@@ -300,6 +315,7 @@ static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_hea
        if (dev->done.qlen == 1)
                tasklet_schedule(&dev->bh);
        spin_unlock_irqrestore(&dev->done.lock, flags);
+       return old_state;
 }
 
 /* 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)
        entry = (struct skb_data *) skb->cb;
        entry->urb = urb;
        entry->dev = dev;
-       entry->state = rx_start;
        entry->length = 0;
 
        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)
                        tasklet_schedule (&dev->bh);
                        break;
                case 0:
-                       __skb_queue_tail (&dev->rxq, skb);
+                       __usbnet_queue_skb(&dev->rxq, skb, rx_start);
                }
        } else {
                netif_dbg(dev, ifdown, dev->net, "rx: stopped\n");
@@ -423,16 +438,17 @@ static void rx_complete (struct urb *urb)
        struct skb_data         *entry = (struct skb_data *) skb->cb;
        struct usbnet           *dev = entry->dev;
        int                     urb_status = urb->status;
+       enum skb_state          state;
 
        skb_put (skb, urb->actual_length);
-       entry->state = rx_done;
+       state = rx_done;
        entry->urb = NULL;
 
        switch (urb_status) {
        /* success */
        case 0:
                if (skb->len < dev->net->hard_header_len) {
-                       entry->state = rx_cleanup;
+                       state = rx_cleanup;
                        dev->net->stats.rx_errors++;
                        dev->net->stats.rx_length_errors++;
                        netif_dbg(dev, rx_err, dev->net,
@@ -471,7 +487,7 @@ static void rx_complete (struct urb *urb)
                                  "rx throttle %d\n", urb_status);
                }
 block:
-               entry->state = rx_cleanup;
+               state = rx_cleanup;
                entry->urb = urb;
                urb = NULL;
                break;
@@ -482,17 +498,18 @@ block:
                // FALLTHROUGH
 
        default:
-               entry->state = rx_cleanup;
+               state = rx_cleanup;
                dev->net->stats.rx_errors++;
                netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status);
                break;
        }
 
-       defer_bh(dev, skb, &dev->rxq);
+       state = defer_bh(dev, skb, &dev->rxq, state);
 
        if (urb) {
                if (netif_running (dev->net) &&
-                   !test_bit (EVENT_RX_HALT, &dev->flags)) {
+                   !test_bit (EVENT_RX_HALT, &dev->flags) &&
+                   state != unlink_start) {
                        rx_submit (dev, urb, GFP_ATOMIC);
                        usb_mark_last_busy(dev->udev);
                        return;
@@ -579,16 +596,23 @@ EXPORT_SYMBOL_GPL(usbnet_purge_paused_rxq);
 static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q)
 {
        unsigned long           flags;
-       struct sk_buff          *skb, *skbnext;
+       struct sk_buff          *skb;
        int                     count = 0;
 
        spin_lock_irqsave (&q->lock, flags);
-       skb_queue_walk_safe(q, skb, skbnext) {
+       while (!skb_queue_empty(q)) {
                struct skb_data         *entry;
                struct urb              *urb;
                int                     retval;
 
-               entry = (struct skb_data *) skb->cb;
+               skb_queue_walk(q, skb) {
+                       entry = (struct skb_data *) skb->cb;
+                       if (entry->state != unlink_start)
+                               goto found;
+               }
+               break;
+found:
+               entry->state = unlink_start;
                urb = entry->urb;
 
                /*
@@ -1039,8 +1063,7 @@ static void tx_complete (struct urb *urb)
        }
 
        usb_autopm_put_interface_async(dev->intf);
-       entry->state = tx_done;
-       defer_bh(dev, skb, &dev->txq);
+       (void) defer_bh(dev, skb, &dev->txq, tx_done);
 }
 
 /*-------------------------------------------------------------------------*/
@@ -1096,7 +1119,6 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
        entry = (struct skb_data *) skb->cb;
        entry->urb = urb;
        entry->dev = dev;
-       entry->state = tx_start;
        entry->length = length;
 
        usb_fill_bulk_urb (urb, dev->udev, dev->out,
@@ -1155,7 +1177,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
                break;
        case 0:
                net->trans_start = jiffies;
-               __skb_queue_tail (&dev->txq, skb);
+               __usbnet_queue_skb(&dev->txq, skb, tx_start);
                if (dev->txq.qlen >= TX_QLEN (dev))
                        netif_stop_queue (net);
        }
index cc15fdb36060b3dd387124e6288ac288c901cc78..67f9430ee197743fa7d2f22a02f706c46cafdd98 100644 (file)
@@ -1851,14 +1851,6 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
        /*like read eeprom and so on */
        rtlpriv->cfg->ops->read_eeprom_info(hw);
 
-       if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
-               RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
-               err = -ENODEV;
-               goto fail3;
-       }
-
-       rtlpriv->cfg->ops->init_sw_leds(hw);
-
        /*aspm */
        rtl_pci_init_aspm(hw);
 
@@ -1877,6 +1869,14 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev,
                goto fail3;
        }
 
+       if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
+               RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
+               err = -ENODEV;
+               goto fail3;
+       }
+
+       rtlpriv->cfg->ops->init_sw_leds(hw);
+
        err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group);
        if (err) {
                RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG,
index d04dbda13f5a3bd699e6265490736da54adc2702..a6049d7d51b39dc0dbb02cccad5bf6c24003b419 100644 (file)
@@ -971,11 +971,6 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
        rtlpriv->cfg->ops->read_chip_version(hw);
        /*like read eeprom and so on */
        rtlpriv->cfg->ops->read_eeprom_info(hw);
-       if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
-               RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
-               goto error_out;
-       }
-       rtlpriv->cfg->ops->init_sw_leds(hw);
        err = _rtl_usb_init(hw);
        if (err)
                goto error_out;
@@ -987,6 +982,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf,
                         "Can't allocate sw for mac80211\n");
                goto error_out;
        }
+       if (rtlpriv->cfg->ops->init_sw_vars(hw)) {
+               RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n");
+               goto error_out;
+       }
+       rtlpriv->cfg->ops->init_sw_leds(hw);
 
        return 0;
 error_out:
index 375eb04c16ea4833d0858c0497b784ea475cbf37..6fff680204885a3653464bc5369495bef2a97fd7 100644 (file)
@@ -30,6 +30,7 @@
 #include <linux/module.h>
 #include <linux/pci.h>
 #include <linux/ptp_clock_kernel.h>
+#include <linux/slab.h>
 
 #define STATION_ADDR_LEN       20
 #define PCI_DEVICE_ID_PCH_1588 0x8819
index 29ca20dbd335da2235339b8f7970849f2d22895f..3b0c4e32ed7b61d367d530defb11c1f24f7bb938 100644 (file)
@@ -2044,7 +2044,7 @@ int vt_do_kdskled(int console, int cmd, unsigned long arg, int perm)
                kbd->default_ledflagstate = ((arg >> 4) & 7);
                set_leds();
                 spin_unlock_irqrestore(&kbd_event_lock, flags);
-               break;
+               return 0;
 
        /* the ioctls below only set the lights, not the functions */
        /* for those, see KDGKBLED and KDSKBLED above */
index ad271c70aa252feac98c4b6f25391ad27a66920b..5a2dec2b064c945aba23acac93dcee2820019d68 100644 (file)
@@ -234,8 +234,8 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
                        return 0;
 
                jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n");
-               spin_lock(&c->erase_completion_lock);
                mutex_lock(&c->alloc_sem);
+               spin_lock(&c->erase_completion_lock);
        }
 
        /* First, work out which block we're garbage-collecting */
index 05a5d72680bed904c23687a69e43a7759bc61848..230a290e1973c63f4411154e581692669e37ee08 100644 (file)
@@ -99,6 +99,22 @@ struct ip_set_hash {
 #endif
 };
 
+static size_t
+htable_size(u8 hbits)
+{
+       size_t hsize;
+
+       /* We must fit both into u32 in jhash and size_t */
+       if (hbits > 31)
+               return 0;
+       hsize = jhash_size(hbits);
+       if ((((size_t)-1) - sizeof(struct htable))/sizeof(struct hbucket)
+           < hsize)
+               return 0;
+
+       return hsize * sizeof(struct hbucket) + sizeof(struct htable);
+}
+
 /* Compute htable_bits from the user input parameter hashsize */
 static u8
 htable_bits(u32 hashsize)
index 605b0aa8d852f63d4d0c7a3cf18add1f518e2acd..76f439647c4bdbe8a81c8518be0f5194ed43af8f 100644 (file)
@@ -191,7 +191,8 @@ extern void usbnet_cdc_status(struct usbnet *, struct urb *);
 enum skb_state {
        illegal = 0,
        tx_start, tx_done,
-       rx_start, rx_done, rx_cleanup
+       rx_start, rx_done, rx_cleanup,
+       unlink_start
 };
 
 struct skb_data {      /* skb->cb is one of these */
index b5c2b6cb0d81078f23fb3a6c1c779e90e31b88ce..cad374bdcf4be14d9e1866748108149acb4115f8 100644 (file)
@@ -59,7 +59,8 @@ struct soc_camera_device {
 struct soc_camera_host {
        struct v4l2_device v4l2_dev;
        struct list_head list;
-       unsigned char nr;                               /* Host number */
+       struct mutex host_lock;         /* Protect during probing */
+       unsigned char nr;               /* Host number */
        void *priv;
        const char *drv_name;
        struct soc_camera_host_ops *ops;
index 262ebd1747d4d2d0121f20a5114741d48c8a48fe..a65910bda3811551ba0ae089abb47f428dee3e94 100644 (file)
@@ -191,6 +191,7 @@ struct bt_sock {
        struct list_head accept_q;
        struct sock *parent;
        u32 defer_setup;
+       bool suspended;
 };
 
 struct bt_sock_list {
index 6080f6bc8c33f452782c1d259bb14fb778b345c5..3914c1e03cfffb2bf5a3ed016ffcb7bf051c92d4 100644 (file)
@@ -518,6 +518,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc)
 out_unlock:
        raw_spin_unlock(&desc->lock);
 }
+EXPORT_SYMBOL(handle_edge_irq);
 
 #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER
 /**
index d86e254b95eb06123a57da2349b320871faa4f8a..192a302d6cfd34d23d61294fed068fbc60adc858 100644 (file)
@@ -112,6 +112,7 @@ struct irq_desc *irq_to_desc(unsigned int irq)
 {
        return radix_tree_lookup(&irq_desc_tree, irq);
 }
+EXPORT_SYMBOL(irq_to_desc);
 
 static void delete_irq_desc(unsigned int irq)
 {
index 72eb187a5f605f9835d71c2de9f980e1e52d6a4e..6fb68a9743af7ebef18adc506f55d1f048bc9181 100644 (file)
@@ -450,7 +450,7 @@ unsigned int bt_sock_poll(struct file *file, struct socket *sock, poll_table *wa
                        sk->sk_state == BT_CONFIG)
                return mask;
 
-       if (sock_writeable(sk))
+       if (!bt_sk(sk)->suspended && sock_writeable(sk))
                mask |= POLLOUT | POLLWRNORM | POLLWRBAND;
        else
                set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags);
index edfd61addceca4b269891734646fedbe6fbe8606..d6dc44cd15b0729a90bc8963ae90182353ed7e10 100644 (file)
@@ -2784,6 +2784,14 @@ static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb)
        if (conn) {
                hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF);
 
+               hci_dev_lock(hdev);
+               if (test_bit(HCI_MGMT, &hdev->dev_flags) &&
+                   !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags))
+                       mgmt_device_connected(hdev, &conn->dst, conn->type,
+                                             conn->dst_type, 0, NULL, 0,
+                                             conn->dev_class);
+               hci_dev_unlock(hdev);
+
                /* Send to upper protocol */
                l2cap_recv_acldata(conn, skb, flags);
                return;
index 6c065254afc03dcfbd11bad037791561b7f99f45..1266f78fa8e3283a6d854d1b808312b8916c981f 100644 (file)
@@ -2039,6 +2039,12 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
 
                clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags);
 
+               if (ev->status && conn->state == BT_CONNECTED) {
+                       hci_acl_disconn(conn, 0x13);
+                       hci_conn_put(conn);
+                       goto unlock;
+               }
+
                if (conn->state == BT_CONFIG) {
                        if (!ev->status)
                                conn->state = BT_CONNECTED;
@@ -2049,6 +2055,7 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff *
                        hci_encrypt_cfm(conn, ev->status, ev->encrypt);
        }
 
+unlock:
        hci_dev_unlock(hdev);
 }
 
@@ -2102,7 +2109,7 @@ static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff
                goto unlock;
        }
 
-       if (!ev->status) {
+       if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
                struct hci_cp_remote_name_req cp;
                memset(&cp, 0, sizeof(cp));
                bacpy(&cp.bdaddr, &conn->dst);
@@ -2871,7 +2878,7 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b
        if (conn->state != BT_CONFIG)
                goto unlock;
 
-       if (!ev->status) {
+       if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) {
                struct hci_cp_remote_name_req cp;
                memset(&cp, 0, sizeof(cp));
                bacpy(&cp.bdaddr, &conn->dst);
index 94552b33d528447eea4b604b996c7d90ba0ab036..6f9c25b633a604ce35824a8b466186df6ddb25c3 100644 (file)
@@ -4589,6 +4589,11 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt)
 
                if (!status && (chan->state == BT_CONNECTED ||
                                                chan->state == BT_CONFIG)) {
+                       struct sock *sk = chan->sk;
+
+                       bt_sk(sk)->suspended = false;
+                       sk->sk_state_change(sk);
+
                        l2cap_check_encryption(chan, encrypt);
                        l2cap_chan_unlock(chan);
                        continue;
index 29122ed28ea96965433fb6086756244d9eabd508..04e7c172d49c9e0ce421b7f378f693e28bda888f 100644 (file)
@@ -592,10 +592,14 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch
                        sk->sk_state = BT_CONFIG;
                        chan->state = BT_CONFIG;
 
-               /* or for ACL link, under defer_setup time */
-               } else if (sk->sk_state == BT_CONNECT2 &&
-                                       bt_sk(sk)->defer_setup) {
-                       err = l2cap_chan_check_security(chan);
+               /* or for ACL link */
+               } else if ((sk->sk_state == BT_CONNECT2 &&
+                          bt_sk(sk)->defer_setup) ||
+                          sk->sk_state == BT_CONNECTED) {
+                       if (!l2cap_chan_check_security(chan))
+                               bt_sk(sk)->suspended = true;
+                       else
+                               sk->sk_state_change(sk);
                } else {
                        err = -EINVAL;
                }
index 5139dea6019e44ba24ee01d9c4f65beb3eddfe61..828ce46cb34b9ad6eb90a8363461e6f1e24c9344 100644 (file)
@@ -364,6 +364,7 @@ hash_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
 {
        u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
        u8 netmask, hbits;
+       size_t hsize;
        struct ip_set_hash *h;
 
        if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
@@ -405,9 +406,12 @@ hash_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        h->timeout = IPSET_NO_TIMEOUT;
 
        hbits = htable_bits(hashsize);
-       h->table = ip_set_alloc(
-                       sizeof(struct htable)
-                       + jhash_size(hbits) * sizeof(struct hbucket));
+       hsize = htable_size(hbits);
+       if (hsize == 0) {
+               kfree(h);
+               return -ENOMEM;
+       }
+       h->table = ip_set_alloc(hsize);
        if (!h->table) {
                kfree(h);
                return -ENOMEM;
index 9c27e249c1713bb14d9d03c730bd2a5a125c6177..e8dbb498af8f465fe38866b4ae0cf9038c1bfbaa 100644 (file)
@@ -449,6 +449,7 @@ hash_ipport_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        struct ip_set_hash *h;
        u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
        u8 hbits;
+       size_t hsize;
 
        if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
                return -IPSET_ERR_INVALID_FAMILY;
@@ -476,9 +477,12 @@ hash_ipport_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        h->timeout = IPSET_NO_TIMEOUT;
 
        hbits = htable_bits(hashsize);
-       h->table = ip_set_alloc(
-                       sizeof(struct htable)
-                       + jhash_size(hbits) * sizeof(struct hbucket));
+       hsize = htable_size(hbits);
+       if (hsize == 0) {
+               kfree(h);
+               return -ENOMEM;
+       }
+       h->table = ip_set_alloc(hsize);
        if (!h->table) {
                kfree(h);
                return -ENOMEM;
index 9134057c07284cf41b1e2d119415e8c043a0fc9a..52f79d8ef741cfb432ae2a66cb7913b82e7c94a4 100644 (file)
@@ -467,6 +467,7 @@ hash_ipportip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        struct ip_set_hash *h;
        u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
        u8 hbits;
+       size_t hsize;
 
        if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
                return -IPSET_ERR_INVALID_FAMILY;
@@ -494,9 +495,12 @@ hash_ipportip_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        h->timeout = IPSET_NO_TIMEOUT;
 
        hbits = htable_bits(hashsize);
-       h->table = ip_set_alloc(
-                       sizeof(struct htable)
-                       + jhash_size(hbits) * sizeof(struct hbucket));
+       hsize = htable_size(hbits);
+       if (hsize == 0) {
+               kfree(h);
+               return -ENOMEM;
+       }
+       h->table = ip_set_alloc(hsize);
        if (!h->table) {
                kfree(h);
                return -ENOMEM;
index 5d05e69698626570ca8247732d4bb8f8af632674..97583f5af7457e75763fc9aed7f85a38d6cb7306 100644 (file)
@@ -616,6 +616,7 @@ hash_ipportnet_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        struct ip_set_hash *h;
        u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
        u8 hbits;
+       size_t hsize;
 
        if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
                return -IPSET_ERR_INVALID_FAMILY;
@@ -645,9 +646,12 @@ hash_ipportnet_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        h->timeout = IPSET_NO_TIMEOUT;
 
        hbits = htable_bits(hashsize);
-       h->table = ip_set_alloc(
-                       sizeof(struct htable)
-                       + jhash_size(hbits) * sizeof(struct hbucket));
+       hsize = htable_size(hbits);
+       if (hsize == 0) {
+               kfree(h);
+               return -ENOMEM;
+       }
+       h->table = ip_set_alloc(hsize);
        if (!h->table) {
                kfree(h);
                return -ENOMEM;
index 7c3d945517cfa55c62faeccb24d6bce29c958faa..1721cdecc9f9eee4d91c75314a5e325327972322 100644 (file)
@@ -460,6 +460,7 @@ hash_net_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
        struct ip_set_hash *h;
        u8 hbits;
+       size_t hsize;
 
        if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
                return -IPSET_ERR_INVALID_FAMILY;
@@ -489,9 +490,12 @@ hash_net_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        h->timeout = IPSET_NO_TIMEOUT;
 
        hbits = htable_bits(hashsize);
-       h->table = ip_set_alloc(
-                       sizeof(struct htable)
-                       + jhash_size(hbits) * sizeof(struct hbucket));
+       hsize = htable_size(hbits);
+       if (hsize == 0) {
+               kfree(h);
+               return -ENOMEM;
+       }
+       h->table = ip_set_alloc(hsize);
        if (!h->table) {
                kfree(h);
                return -ENOMEM;
index f24037ff432201015e81731f61133d45079128d6..33bafc97ca6d0e800426e85bb8b558b9516f2d30 100644 (file)
@@ -722,6 +722,7 @@ hash_netiface_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        struct ip_set_hash *h;
        u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
        u8 hbits;
+       size_t hsize;
 
        if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
                return -IPSET_ERR_INVALID_FAMILY;
@@ -752,9 +753,12 @@ hash_netiface_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        h->ahash_max = AHASH_MAX_SIZE;
 
        hbits = htable_bits(hashsize);
-       h->table = ip_set_alloc(
-                       sizeof(struct htable)
-                       + jhash_size(hbits) * sizeof(struct hbucket));
+       hsize = htable_size(hbits);
+       if (hsize == 0) {
+               kfree(h);
+               return -ENOMEM;
+       }
+       h->table = ip_set_alloc(hsize);
        if (!h->table) {
                kfree(h);
                return -ENOMEM;
index ce2e77100b64ecb521db1cf45c0babd4902a374f..3a5e198641d6a9d9bb3c1ce6a36c0f6fac800fcf 100644 (file)
@@ -572,6 +572,7 @@ hash_netport_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        struct ip_set_hash *h;
        u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM;
        u8 hbits;
+       size_t hsize;
 
        if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6))
                return -IPSET_ERR_INVALID_FAMILY;
@@ -601,9 +602,12 @@ hash_netport_create(struct ip_set *set, struct nlattr *tb[], u32 flags)
        h->timeout = IPSET_NO_TIMEOUT;
 
        hbits = htable_bits(hashsize);
-       h->table = ip_set_alloc(
-                       sizeof(struct htable)
-                       + jhash_size(hbits) * sizeof(struct hbucket));
+       hsize = htable_size(hbits);
+       if (hsize == 0) {
+               kfree(h);
+               return -ENOMEM;
+       }
+       h->table = ip_set_alloc(hsize);
        if (!h->table) {
                kfree(h);
                return -ENOMEM;
index 777716bc80f7c2ad183a7309c037f4cc9c84fffa..e66341ec455c3d7c588680bd829e044b7d7752ce 100644 (file)
@@ -321,7 +321,7 @@ static int queue_userspace_packet(int dp_ifindex, struct sk_buff *skb,
                        return -ENOMEM;
 
                nskb = __vlan_put_tag(nskb, vlan_tx_tag_get(nskb));
-               if (!skb)
+               if (!nskb)
                        return -ENOMEM;
 
                nskb->vlan_tci = 0;