~ubuntu-branches/ubuntu/saucy/linux-ppc/saucy

« back to all changes in this revision

Viewing changes to drivers/char/virtio_console.c

  • Committer: Package Import Robot
  • Author(s): Ben Collins, Ubuntu: 3.8.0-17.27
  • Date: 2013-04-08 18:16:48 UTC
  • mfrom: (16.1.9 raring)
  • Revision ID: package-import@ubuntu.com-20130408181648-z7suubhgtq6k6zke
Tags: 3.8.0-8.14
[ Ubuntu: 3.8.0-17.27 ]

* SAUCE: (no-up) Bluetooth: Add support for 04ca:2007
  - LP: #1153448
* SAUCE: (no-up) Bluetooth: Add support for 105b:e065
  - LP: #1161261
* SAUCE: (no-up) tools/power turbostat: additional Haswell CPU-id
  - LP: #1083993
* Revert "SAUCE: (no-up) seccomp: forcing auditing of kill condition"
  Replaced by upstream patch.
* Release Tracking Bug
  - LP: #1165746
* rebase to v3.8.6
* Revert "brcmsmac: support 4313iPA"
  - LP: #1157190
* tools/power turbostat: support Haswell
  - LP: #1083993
* net: calxedaxgmac: fix rx ring handling when OOM
* cpufreq: check OF node /cpus presence before dereferencing it
* Input: cypress_ps2 - fix trackpadi found in Dell XPS12
  - LP: #1103594
* ARM: OMAP2+: Limit omap initcalls to omap only on multiplatform kernels
* ARM: OMAP2+: Use omap initcalls
* ARM: OMAP: Fix i2c cmdline initcall for multiplatform
* ARM: OMAP: Fix dmaengine init for multiplatform
* ARM: OMAP2+: Add multiplatform debug_ll support
* ARM: OMAP2+: Disable code that currently does not work with
  multiplaform
* ARM: OMAP2+: Enable ARCH_MULTIPLATFORM support
* ARM: OMAP2+: Add minimal support for booting vexpress
* ARM: OMAP2+: Remove now obsolete uncompress.h and debug-macro.S
* davinci: do not include mach/hardware.h
* clk: export __clk_get_name for re-use in imx-ipu-v3 and others
* [SCSI] storvsc: avoid usage of WRITE_SAME
  - LP: #1157952
* ACPICA: Fix possible memory leak in dispatcher error path.
* KVM: x86: fix for buffer overflow in handling of MSR_KVM_SYSTEM_TIME (CVE-2013-1796)
  - LP: #1158254
  - CVE-2013-1796
* SAUCE: (no-up) Bluetooth: Add a load_firmware callback to struct hci_dev
  - LP: #1065400
* SAUCE: (no-up) Bluetooth: Implement broadcom patchram firmware loader
  - LP: #1065400
* SAUCE: (no-up) Bluetooth: Add support for 13d3:3388 and 13d3:3389
  - LP: #1065400

Show diffs side-by-side

added added

removed removed

Lines of Context:
152
152
        spinlock_t ports_lock;
153
153
 
154
154
        /* To protect the vq operations for the control channel */
155
 
        spinlock_t cvq_lock;
 
155
        spinlock_t c_ivq_lock;
 
156
        spinlock_t c_ovq_lock;
156
157
 
157
158
        /* The current config space is stored here */
158
159
        struct virtio_console_config config;
575
576
        vq = portdev->c_ovq;
576
577
 
577
578
        sg_init_one(sg, &cpkt, sizeof(cpkt));
 
579
 
 
580
        spin_lock(&portdev->c_ovq_lock);
578
581
        if (virtqueue_add_buf(vq, sg, 1, 0, &cpkt, GFP_ATOMIC) == 0) {
579
582
                virtqueue_kick(vq);
580
583
                while (!virtqueue_get_buf(vq, &len))
581
584
                        cpu_relax();
582
585
        }
 
586
        spin_unlock(&portdev->c_ovq_lock);
583
587
        return 0;
584
588
}
585
589
 
1715
1719
        portdev = container_of(work, struct ports_device, control_work);
1716
1720
        vq = portdev->c_ivq;
1717
1721
 
1718
 
        spin_lock(&portdev->cvq_lock);
 
1722
        spin_lock(&portdev->c_ivq_lock);
1719
1723
        while ((buf = virtqueue_get_buf(vq, &len))) {
1720
 
                spin_unlock(&portdev->cvq_lock);
 
1724
                spin_unlock(&portdev->c_ivq_lock);
1721
1725
 
1722
1726
                buf->len = len;
1723
1727
                buf->offset = 0;
1724
1728
 
1725
1729
                handle_control_message(portdev, buf);
1726
1730
 
1727
 
                spin_lock(&portdev->cvq_lock);
 
1731
                spin_lock(&portdev->c_ivq_lock);
1728
1732
                if (add_inbuf(portdev->c_ivq, buf) < 0) {
1729
1733
                        dev_warn(&portdev->vdev->dev,
1730
1734
                                 "Error adding buffer to queue\n");
1731
1735
                        free_buf(buf, false);
1732
1736
                }
1733
1737
        }
1734
 
        spin_unlock(&portdev->cvq_lock);
 
1738
        spin_unlock(&portdev->c_ivq_lock);
1735
1739
}
1736
1740
 
1737
1741
static void out_intr(struct virtqueue *vq)
1996
2000
        if (multiport) {
1997
2001
                unsigned int nr_added_bufs;
1998
2002
 
1999
 
                spin_lock_init(&portdev->cvq_lock);
 
2003
                spin_lock_init(&portdev->c_ivq_lock);
 
2004
                spin_lock_init(&portdev->c_ovq_lock);
2000
2005
                INIT_WORK(&portdev->control_work, &control_work_handler);
2001
2006
 
2002
 
                nr_added_bufs = fill_queue(portdev->c_ivq, &portdev->cvq_lock);
 
2007
                nr_added_bufs = fill_queue(portdev->c_ivq,
 
2008
                                           &portdev->c_ivq_lock);
2003
2009
                if (!nr_added_bufs) {
2004
2010
                        dev_err(&vdev->dev,
2005
2011
                                "Error allocating buffers for control queue\n");
2150
2156
                return ret;
2151
2157
 
2152
2158
        if (use_multiport(portdev))
2153
 
                fill_queue(portdev->c_ivq, &portdev->cvq_lock);
 
2159
                fill_queue(portdev->c_ivq, &portdev->c_ivq_lock);
2154
2160
 
2155
2161
        list_for_each_entry(port, &portdev->ports, list) {
2156
2162
                port->in_vq = portdev->in_vqs[port->id];