diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 23:28:47 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-11-14 23:28:47 -0500 |
commit | b746f9c7941f227ad582b4f0bc981f3adcbc46b2 (patch) | |
tree | fe3da3dedfe8d66f90cdcfa3d9ce847fdc411c20 /drivers/scsi | |
parent | ce6513f758b1852a2f24f76f07d0fae304d24ad3 (diff) | |
parent | 2bf4fd31394a3f875ea093ee8a209f30b378cbf3 (diff) |
Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux
Pull virtio updates from Rusty Russell:
"Nothing really exciting: some groundwork for changing virtio endian,
and some robustness fixes for broken virtio devices, plus minor
tweaks"
* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
virtio_scsi: verify if queue is broken after virtqueue_get_buf()
x86, asmlinkage, lguest: Pass in globals into assembler statement
virtio: mmio: fix signature checking for BE guests
virtio_ring: adapt to notify() returning bool
virtio_net: verify if queue is broken after virtqueue_get_buf()
virtio_console: verify if queue is broken after virtqueue_get_buf()
virtio_blk: verify if queue is broken after virtqueue_get_buf()
virtio_ring: add new function virtqueue_is_broken()
virtio_test: verify if virtqueue_kick() succeeded
virtio_net: verify if virtqueue_kick() succeeded
virtio_ring: let virtqueue_{kick()/notify()} return a bool
virtio_ring: change host notification API
virtio_config: remove virtio_config_val
virtio: use size-based config accessors.
virtio_config: introduce size-based accessors.
virtio_ring: plug kmemleak false positive.
virtio: pm: use CONFIG_PM_SLEEP instead of CONFIG_PM
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/virtio_scsi.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/scsi/virtio_scsi.c b/drivers/scsi/virtio_scsi.c index 74b88efde6ad..c3173dced870 100644 --- a/drivers/scsi/virtio_scsi.c +++ b/drivers/scsi/virtio_scsi.c | |||
@@ -224,6 +224,9 @@ static void virtscsi_vq_done(struct virtio_scsi *vscsi, | |||
224 | virtqueue_disable_cb(vq); | 224 | virtqueue_disable_cb(vq); |
225 | while ((buf = virtqueue_get_buf(vq, &len)) != NULL) | 225 | while ((buf = virtqueue_get_buf(vq, &len)) != NULL) |
226 | fn(vscsi, buf); | 226 | fn(vscsi, buf); |
227 | |||
228 | if (unlikely(virtqueue_is_broken(vq))) | ||
229 | break; | ||
227 | } while (!virtqueue_enable_cb(vq)); | 230 | } while (!virtqueue_enable_cb(vq)); |
228 | spin_unlock_irqrestore(&virtscsi_vq->vq_lock, flags); | 231 | spin_unlock_irqrestore(&virtscsi_vq->vq_lock, flags); |
229 | } | 232 | } |
@@ -710,19 +713,15 @@ static struct scsi_host_template virtscsi_host_template_multi = { | |||
710 | #define virtscsi_config_get(vdev, fld) \ | 713 | #define virtscsi_config_get(vdev, fld) \ |
711 | ({ \ | 714 | ({ \ |
712 | typeof(((struct virtio_scsi_config *)0)->fld) __val; \ | 715 | typeof(((struct virtio_scsi_config *)0)->fld) __val; \ |
713 | vdev->config->get(vdev, \ | 716 | virtio_cread(vdev, struct virtio_scsi_config, fld, &__val); \ |
714 | offsetof(struct virtio_scsi_config, fld), \ | ||
715 | &__val, sizeof(__val)); \ | ||
716 | __val; \ | 717 | __val; \ |
717 | }) | 718 | }) |
718 | 719 | ||
719 | #define virtscsi_config_set(vdev, fld, val) \ | 720 | #define virtscsi_config_set(vdev, fld, val) \ |
720 | (void)({ \ | 721 | do { \ |
721 | typeof(((struct virtio_scsi_config *)0)->fld) __val = (val); \ | 722 | typeof(((struct virtio_scsi_config *)0)->fld) __val = (val); \ |
722 | vdev->config->set(vdev, \ | 723 | virtio_cwrite(vdev, struct virtio_scsi_config, fld, &__val); \ |
723 | offsetof(struct virtio_scsi_config, fld), \ | 724 | } while(0) |
724 | &__val, sizeof(__val)); \ | ||
725 | }) | ||
726 | 725 | ||
727 | static void __virtscsi_set_affinity(struct virtio_scsi *vscsi, bool affinity) | 726 | static void __virtscsi_set_affinity(struct virtio_scsi *vscsi, bool affinity) |
728 | { | 727 | { |
@@ -954,7 +953,7 @@ static void virtscsi_remove(struct virtio_device *vdev) | |||
954 | scsi_host_put(shost); | 953 | scsi_host_put(shost); |
955 | } | 954 | } |
956 | 955 | ||
957 | #ifdef CONFIG_PM | 956 | #ifdef CONFIG_PM_SLEEP |
958 | static int virtscsi_freeze(struct virtio_device *vdev) | 957 | static int virtscsi_freeze(struct virtio_device *vdev) |
959 | { | 958 | { |
960 | virtscsi_remove_vqs(vdev); | 959 | virtscsi_remove_vqs(vdev); |
@@ -988,7 +987,7 @@ static struct virtio_driver virtio_scsi_driver = { | |||
988 | .id_table = id_table, | 987 | .id_table = id_table, |
989 | .probe = virtscsi_probe, | 988 | .probe = virtscsi_probe, |
990 | .scan = virtscsi_scan, | 989 | .scan = virtscsi_scan, |
991 | #ifdef CONFIG_PM | 990 | #ifdef CONFIG_PM_SLEEP |
992 | .freeze = virtscsi_freeze, | 991 | .freeze = virtscsi_freeze, |
993 | .restore = virtscsi_restore, | 992 | .restore = virtscsi_restore, |
994 | #endif | 993 | #endif |