<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/virtio/virtio.c, branch v3.10.78</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux</title>
<updated>2012-12-20T16:37:05+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2012-12-20T16:37:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b7dfde956daee23f4439d0c8562a5e38b43e79d9'/>
<id>b7dfde956daee23f4439d0c8562a5e38b43e79d9</id>
<content type='text'>
Pull virtio update from Rusty Russell:
 "Some nice cleanups, and even a patch my wife did as a "live" demo for
  Latinoware 2012.

  There's a slightly non-trivial merge in virtio-net, as we cleaned up
  the virtio add_buf interface while DaveM accepted the mq virtio-net
  patches."

* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (27 commits)
  virtio_console: Add support for remoteproc serial
  virtio_console: Merge struct buffer_token into struct port_buffer
  virtio: add drv_to_virtio to make code clearly
  virtio: use dev_to_virtio wrapper in virtio
  virtio-mmio: Fix irq parsing in command line parameter
  virtio_console: Free buffers from out-queue upon close
  virtio: Convert dev_printk(KERN_&lt;LEVEL&gt; to dev_&lt;level&gt;(
  virtio_console: Use kmalloc instead of kzalloc
  virtio_console: Free buffer if splice fails
  virtio: tools: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: scsi: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: rpmsg: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: net: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: console: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: make virtqueue_add_buf() returning 0 on success, not capacity.
  virtio: console: don't rely on virtqueue_add_buf() returning capacity.
  virtio_net: don't rely on virtqueue_add_buf() returning capacity.
  virtio-net: remove unused skb_vnet_hdr-&gt;num_sg field
  virtio-net: correct capacity math on ring full
  virtio: move queue_index and num_free fields into core struct virtqueue.
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull virtio update from Rusty Russell:
 "Some nice cleanups, and even a patch my wife did as a "live" demo for
  Latinoware 2012.

  There's a slightly non-trivial merge in virtio-net, as we cleaned up
  the virtio add_buf interface while DaveM accepted the mq virtio-net
  patches."

* tag 'virtio-next-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux: (27 commits)
  virtio_console: Add support for remoteproc serial
  virtio_console: Merge struct buffer_token into struct port_buffer
  virtio: add drv_to_virtio to make code clearly
  virtio: use dev_to_virtio wrapper in virtio
  virtio-mmio: Fix irq parsing in command line parameter
  virtio_console: Free buffers from out-queue upon close
  virtio: Convert dev_printk(KERN_&lt;LEVEL&gt; to dev_&lt;level&gt;(
  virtio_console: Use kmalloc instead of kzalloc
  virtio_console: Free buffer if splice fails
  virtio: tools: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: scsi: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: rpmsg: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: net: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: console: make it clear that virtqueue_add_buf() no longer returns &gt; 0
  virtio: make virtqueue_add_buf() returning 0 on success, not capacity.
  virtio: console: don't rely on virtqueue_add_buf() returning capacity.
  virtio_net: don't rely on virtqueue_add_buf() returning capacity.
  virtio-net: remove unused skb_vnet_hdr-&gt;num_sg field
  virtio-net: correct capacity math on ring full
  virtio: move queue_index and num_free fields into core struct virtqueue.
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: add drv_to_virtio to make code clearly</title>
<updated>2012-12-18T04:50:43+00:00</updated>
<author>
<name>Wanlong Gao</name>
<email>gaowanlong@cn.fujitsu.com</email>
</author>
<published>2012-12-10T08:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9a2bdcc85d28506d4e5d4a9618fb133a3f40945d'/>
<id>9a2bdcc85d28506d4e5d4a9618fb133a3f40945d</id>
<content type='text'>
Add drv_to_virtio wrapper to get virtio_driver from device_driver.

Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Signed-off-by: Wanlong Gao &lt;gaowanlong@cn.fujitsu.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add drv_to_virtio wrapper to get virtio_driver from device_driver.

Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Signed-off-by: Wanlong Gao &lt;gaowanlong@cn.fujitsu.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: use dev_to_virtio wrapper in virtio</title>
<updated>2012-12-18T04:50:42+00:00</updated>
<author>
<name>Wanlong Gao</name>
<email>gaowanlong@cn.fujitsu.com</email>
</author>
<published>2012-12-11T00:34:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9bffdca8c64a72ac54c47a552734ab457bc720d4'/>
<id>9bffdca8c64a72ac54c47a552734ab457bc720d4</id>
<content type='text'>
Use dev_to_virtio wrapper in virtio to make code clearly.

Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Signed-off-by: Wanlong Gao &lt;gaowanlong@cn.fujitsu.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use dev_to_virtio wrapper in virtio to make code clearly.

Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: "Michael S. Tsirkin" &lt;mst@redhat.com&gt;
Signed-off-by: Wanlong Gao &lt;gaowanlong@cn.fujitsu.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: Don't access index after unregister.</title>
<updated>2012-11-09T04:24:24+00:00</updated>
<author>
<name>Cornelia Huck</name>
<email>cornelia.huck@de.ibm.com</email>
</author>
<published>2012-11-09T04:24:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=237242bddc99041e15a4ca51b8439657cadaff17'/>
<id>237242bddc99041e15a4ca51b8439657cadaff17</id>
<content type='text'>
Virtio wants to release used indices after the corresponding
virtio device has been unregistered. However, virtio does not
hold an extra reference, giving up its last reference with
device_unregister(), making accessing dev-&gt;index afterwards
invalid.

I actually saw problems when testing my (not-yet-merged)
virtio-ccw code:

- device_add virtio-net,id=xxx
-&gt; creates device virtio&lt;n&gt; with n&gt;0

- device_del xxx
-&gt; deletes virtio&lt;n&gt;, but calls ida_simple_remove with an
   index of 0

- device_add virtio-net,id=xxx
-&gt; tries to add virtio0, which is still in use...

So let's save the index we want to release before calling
device_unregister().

Signed-off-by: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Acked-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Cc: stable@kernel.org
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Virtio wants to release used indices after the corresponding
virtio device has been unregistered. However, virtio does not
hold an extra reference, giving up its last reference with
device_unregister(), making accessing dev-&gt;index afterwards
invalid.

I actually saw problems when testing my (not-yet-merged)
virtio-ccw code:

- device_add virtio-net,id=xxx
-&gt; creates device virtio&lt;n&gt; with n&gt;0

- device_del xxx
-&gt; deletes virtio&lt;n&gt;, but calls ida_simple_remove with an
   index of 0

- device_add virtio-net,id=xxx
-&gt; tries to add virtio0, which is still in use...

So let's save the index we want to release before calling
device_unregister().

Signed-off-by: Cornelia Huck &lt;cornelia.huck@de.ibm.com&gt;
Acked-by: Sjur Brændeland &lt;sjur.brandeland@stericsson.com&gt;
Cc: stable@kernel.org
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: don't crash when device is buggy</title>
<updated>2012-09-28T05:35:16+00:00</updated>
<author>
<name>Michael S. Tsirkin</name>
<email>mst@redhat.com</email>
</author>
<published>2012-09-28T05:35:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5543a6ac31eb4bfd8d938db6b234ce833d14e04e'/>
<id>5543a6ac31eb4bfd8d938db6b234ce833d14e04e</id>
<content type='text'>
Because of a sanity check in virtio_dev_remove, a buggy device can crash
kernel.  And in case of rproc it's userspace so it's not a good idea.
We are unloading a driver so how bad can it be?
Be less aggressive in handling this error: if it's a driver bug,
warning once should be enough.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Because of a sanity check in virtio_dev_remove, a buggy device can crash
kernel.  And in case of rproc it's userspace so it's not a good idea.
We are unloading a driver so how bad can it be?
Be less aggressive in handling this error: if it's a driver bug,
warning once should be enough.

Signed-off-by: Michael S. Tsirkin &lt;mst@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] virtio-scsi: Add vdrv-&gt;scan for post VIRTIO_CONFIG_S_DRIVER_OK LUN scanning</title>
<updated>2012-07-20T07:59:03+00:00</updated>
<author>
<name>Nicholas Bellinger</name>
<email>nab@linux-iscsi.org</email>
</author>
<published>2012-07-11T21:22:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=59057fbc37178f10a196ab7ec170b80273f75a47'/>
<id>59057fbc37178f10a196ab7ec170b80273f75a47</id>
<content type='text'>
This patch changes virtio-scsi to use a new virtio_driver-&gt;scan() callback
so that scsi_scan_host() can be properly invoked once virtio_dev_probe() has
set add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK) to signal active virtio-ring
operation, instead of from within virtscsi_probe().

This fixes a bug where SCSI LUN scanning for both virtio-scsi-raw and
virtio-scsi/tcm_vhost setups was happening before VIRTIO_CONFIG_S_DRIVER_OK
had been set, causing VIRTIO_SCSI_S_BAD_TARGET to occur.  This fixes a bug
with virtio-scsi/tcm_vhost where LUN scan was not detecting LUNs.

Tested with virtio-scsi-raw + virtio-scsi/tcm_vhost w/ IBLOCK on 3.5-rc2 code.

Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Acked-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch changes virtio-scsi to use a new virtio_driver-&gt;scan() callback
so that scsi_scan_host() can be properly invoked once virtio_dev_probe() has
set add_status(dev, VIRTIO_CONFIG_S_DRIVER_OK) to signal active virtio-ring
operation, instead of from within virtscsi_probe().

This fixes a bug where SCSI LUN scanning for both virtio-scsi-raw and
virtio-scsi/tcm_vhost setups was happening before VIRTIO_CONFIG_S_DRIVER_OK
had been set, causing VIRTIO_SCSI_S_BAD_TARGET to occur.  This fixes a bug
with virtio-scsi/tcm_vhost where LUN scan was not detecting LUNs.

Tested with virtio-scsi-raw + virtio-scsi/tcm_vhost w/ IBLOCK on 3.5-rc2 code.

Signed-off-by: Nicholas Bellinger &lt;nab@linux-iscsi.org&gt;
Acked-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: Use ida to allocate virtio index</title>
<updated>2012-05-22T02:46:12+00:00</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2012-05-03T02:20:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=90e03207f468e84258270ad07095ef50f925c17d'/>
<id>90e03207f468e84258270ad07095ef50f925c17d</id>
<content type='text'>
Current index allocation in virtio is based on a monotonically
increasing variable "index". This means we'll run out of numbers
after a while. E.g. someone crazy doing this in host side.

while(1) {
	hot-plug a virtio device
	hot-unplug the virito devcie
}

Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Current index allocation in virtio is based on a monotonically
increasing variable "index". This means we'll run out of numbers
after a while. E.g. someone crazy doing this in host side.

while(1) {
	hot-plug a virtio device
	hot-unplug the virito devcie
}

Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: Add module.h to drivers/virtio users.</title>
<updated>2011-10-31T23:32:14+00:00</updated>
<author>
<name>Paul Gortmaker</name>
<email>paul.gortmaker@windriver.com</email>
</author>
<published>2011-07-03T20:20:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b5a2c4f1996d1d258ac10897e0bbb57c6904a735'/>
<id>b5a2c4f1996d1d258ac10897e0bbb57c6904a735</id>
<content type='text'>
Up to now, the module.h header was as hard to keep out as
sunlight.  But we are cleaning that up.  Fix the virtio users
who simply expect module.h to be there in every C file.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Up to now, the module.h header was as hard to keep out as
sunlight.  But we are cleaning that up.  Fix the virtio users
who simply expect module.h to be there in every C file.

Signed-off-by: Paul Gortmaker &lt;paul.gortmaker@windriver.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: fix format of sysfs driver/vendor files</title>
<updated>2010-11-24T04:51:12+00:00</updated>
<author>
<name>Stephen Hemminger</name>
<email>shemminger@vyatta.com</email>
</author>
<published>2010-11-10T06:20:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=be6528b2e58d92ef2ffed6f130e2d42bb85dbf29'/>
<id>be6528b2e58d92ef2ffed6f130e2d42bb85dbf29</id>
<content type='text'>
The sysfs files for virtio produce the wrong format and are missing
the required newline. The output for virtio bus vendor/device should
have the same format as the corresponding entries for PCI devices.

Although this technically changes the ABI for sysfs, these files were
broken to start with!

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The sysfs files for virtio produce the wrong format and are missing
the required newline. The output for virtio bus vendor/device should
have the same format as the corresponding entries for PCI devices.

Although this technically changes the ABI for sysfs, these files were
broken to start with!

Signed-off-by: Stephen Hemminger &lt;shemminger@vyatta.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio: enhance id_matching for virtio drivers</title>
<updated>2009-06-12T12:46:40+00:00</updated>
<author>
<name>Christian Borntraeger</name>
<email>borntraeger@de.ibm.com</email>
</author>
<published>2009-05-26T13:46:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e3353853730eb99c56b7b0aed1667d51c0e3699a'/>
<id>e3353853730eb99c56b7b0aed1667d51c0e3699a</id>
<content type='text'>
This patch allows a virtio driver to use VIRTIO_DEV_ANY_ID for the
device id. This will be used by a test module that can be bound to
any virtio device.

Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch allows a virtio driver to use VIRTIO_DEV_ANY_ID for the
device id. This will be used by a test module that can be bound to
any virtio device.

Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
</pre>
</div>
</content>
</entry>
</feed>
