<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/scsi, branch v3.11</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>[SCSI] pm80xx: fix Adaptec 71605H hang</title>
<updated>2013-08-26T09:33:58+00:00</updated>
<author>
<name>Hans Verkuil</name>
<email>hverkuil@xs4all.nl</email>
</author>
<published>2013-07-26T16:43:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9504a923924d663e1953f872f0a828e6454a6cfc'/>
<id>9504a923924d663e1953f872f0a828e6454a6cfc</id>
<content type='text'>
The IO command size is 128 bytes for these new controllers as opposed to 64
for the old 8001 controller.

The Adaptec out-of-tree driver did this correctly. After comparing the two
this turned out to be the crucial difference.

So don't hardcode the IO command size, instead use pm8001_ha-&gt;iomb_size as
that is the correct value for both old and new controllers.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Acked-by: Anand Kumar Santhanam &lt;AnandKumar.Santhanam@pmcs.com&gt;
Acked-by: Jack Wang &lt;xjtuwjp@gmail.com&gt;
Cc: stable@vger.kernel.org      # for v3.10 and up
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The IO command size is 128 bytes for these new controllers as opposed to 64
for the old 8001 controller.

The Adaptec out-of-tree driver did this correctly. After comparing the two
this turned out to be the crucial difference.

So don't hardcode the IO command size, instead use pm8001_ha-&gt;iomb_size as
that is the correct value for both old and new controllers.

Signed-off-by: Hans Verkuil &lt;hans.verkuil@cisco.com&gt;
Acked-by: Anand Kumar Santhanam &lt;AnandKumar.Santhanam@pmcs.com&gt;
Acked-by: Jack Wang &lt;xjtuwjp@gmail.com&gt;
Cc: stable@vger.kernel.org      # for v3.10 and up
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] lpfc: Don't force CONFIG_GENERIC_CSUM on</title>
<updated>2013-08-21T17:54:20+00:00</updated>
<author>
<name>Anton Blanchard</name>
<email>anton@samba.org</email>
</author>
<published>2013-08-08T07:47:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f5944daa0a72316077435c18a6571e73ed338332'/>
<id>f5944daa0a72316077435c18a6571e73ed338332</id>
<content type='text'>
We want ppc64 to be able to select between optimised assembly
checksum routines in big endian and the generic lib/checksum.c
routines in little endian.

The lpfc driver is forcing CONFIG_GENERIC_CSUM on which means
we are unable to make the decision to enable it in the arch
Kconfig. If the option exists it is always forced on.

This got introduced in 3.10 via commit 6a7252fdb0c3 ([SCSI] lpfc:
fix up Kconfig dependencies). I spoke to Randy about it and
the original issue was with CRC_T10DIF not being defined.

As such, remove the select of CONFIG_GENERIC_CSUM.

Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.10
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We want ppc64 to be able to select between optimised assembly
checksum routines in big endian and the generic lib/checksum.c
routines in little endian.

The lpfc driver is forcing CONFIG_GENERIC_CSUM on which means
we are unable to make the decision to enable it in the arch
Kconfig. If the option exists it is always forced on.

This got introduced in 3.10 via commit 6a7252fdb0c3 ([SCSI] lpfc:
fix up Kconfig dependencies). I spoke to Randy about it and
the original issue was with CRC_T10DIF not being defined.

As such, remove the select of CONFIG_GENERIC_CSUM.

Signed-off-by: Anton Blanchard &lt;anton@samba.org&gt;
Cc: &lt;stable@vger.kernel.org&gt; # 3.10
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi</title>
<updated>2013-08-11T23:32:26+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-08-11T23:32:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e5d081f4686f9c6be8ab3d34dfcdb0afdbbdeefd'/>
<id>e5d081f4686f9c6be8ab3d34dfcdb0afdbbdeefd</id>
<content type='text'>
Pull SCSI fixes from James Bottomley:
 "This is three bug fixes: An fnic warning caused by sleeping under a
  lock, a major regression with our updated WRITE SAME/UNMAP logic which
  caused tons of USB devices (and one RAID card) to cease to function
  and a megaraid_sas firmware initialisation problem which causes kdump
  failures"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] Don't attempt to send extended INQUIRY command if skip_vpd_pages is set
  [SCSI] fnic: BUG: sleeping function called from invalid context during probe
  [SCSI] megaraid_sas: megaraid_sas driver init fails in kdump kernel
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull SCSI fixes from James Bottomley:
 "This is three bug fixes: An fnic warning caused by sleeping under a
  lock, a major regression with our updated WRITE SAME/UNMAP logic which
  caused tons of USB devices (and one RAID card) to cease to function
  and a megaraid_sas firmware initialisation problem which causes kdump
  failures"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] Don't attempt to send extended INQUIRY command if skip_vpd_pages is set
  [SCSI] fnic: BUG: sleeping function called from invalid context during probe
  [SCSI] megaraid_sas: megaraid_sas driver init fails in kdump kernel
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux</title>
<updated>2013-08-08T16:32:20+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2013-08-08T16:32:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=bb014db07ce04851f0e19ef5c0f15ad0021ec38c'/>
<id>bb014db07ce04851f0e19ef5c0f15ad0021ec38c</id>
<content type='text'>
Pull virtio fixes from Rusty Russell:
 "More virtio console fixes than I'm happy with, but all real issues,
  and all CC:stable.."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  virtio-scsi: Fix virtqueue affinity setup
  virtio: console: return -ENODEV on all read operations after unplug
  virtio: console: fix raising SIGIO after port unplug
  virtio: console: clean up port data immediately at time of unplug
  virtio: console: fix race in port_fops_open() and port unplug
  virtio: console: fix race with port unplug and open/close
  virtio/console: Add pipe_lock/unlock for splice_write
  virtio/console: Quit from splice_write if pipe-&gt;nrbufs is 0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull virtio fixes from Rusty Russell:
 "More virtio console fixes than I'm happy with, but all real issues,
  and all CC:stable.."

* tag 'fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux:
  virtio-scsi: Fix virtqueue affinity setup
  virtio: console: return -ENODEV on all read operations after unplug
  virtio: console: fix raising SIGIO after port unplug
  virtio: console: clean up port data immediately at time of unplug
  virtio: console: fix race in port_fops_open() and port unplug
  virtio: console: fix race with port unplug and open/close
  virtio/console: Add pipe_lock/unlock for splice_write
  virtio/console: Quit from splice_write if pipe-&gt;nrbufs is 0
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] Don't attempt to send extended INQUIRY command if skip_vpd_pages is set</title>
<updated>2013-08-02T20:20:21+00:00</updated>
<author>
<name>Martin K. Petersen</name>
<email>martin.petersen@oracle.com</email>
</author>
<published>2013-07-31T02:58:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7562523e84ddc742fe1f9db8bd76b01acca89f6b'/>
<id>7562523e84ddc742fe1f9db8bd76b01acca89f6b</id>
<content type='text'>
If a device has the skip_vpd_pages flag set we should simply fail the
scsi_get_vpd_page() call.

Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Tested-by: Stuart Foster &lt;smf.linux@ntlworld.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If a device has the skip_vpd_pages flag set we should simply fail the
scsi_get_vpd_page() call.

Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Acked-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Tested-by: Stuart Foster &lt;smf.linux@ntlworld.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] fnic: BUG: sleeping function called from invalid context during probe</title>
<updated>2013-08-02T20:16:38+00:00</updated>
<author>
<name>Chris Leech</name>
<email>cleech@redhat.com</email>
</author>
<published>2013-07-23T20:04:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e09056b25c38357df5c01985a0b3af608bccbfc0'/>
<id>e09056b25c38357df5c01985a0b3af608bccbfc0</id>
<content type='text'>
I hit this during driver probe with the latest fnic updates (this trace
is from a backport into a distro kernel, but the issue is the same).

&gt; BUG: sleeping function called from invalid context at mm/slab.c:3113
&gt; in_atomic(): 0, irqs_disabled(): 1, pid: 610, name: work_for_cpu
&gt; INFO: lockdep is turned off.
&gt; irq event stamp: 0
&gt; hardirqs last  enabled at (0): [&lt;(null)&gt;] (null)
&gt; hardirqs last disabled at (0): [&lt;ffffffff81070aa5&gt;]
&gt; copy_process+0x5e5/0x1670
&gt; softirqs last  enabled at (0): [&lt;ffffffff81070aa5&gt;]
&gt; copy_process+0x5e5/0x1670
&gt; softirqs last disabled at (0): [&lt;(null)&gt;] (null)
&gt; Pid: 610, comm: work_for_cpu Not tainted
&gt; Call Trace:
&gt;  [&lt;ffffffff810b2d10&gt;] ? print_irqtrace_events+0xd0/0xe0
&gt;  [&lt;ffffffff8105c1a7&gt;] ? __might_sleep+0xf7/0x130
&gt;  [&lt;ffffffff81184efb&gt;] ? kmem_cache_alloc_trace+0x20b/0x2d0
&gt;  [&lt;ffffffff8109709e&gt;] ? __create_workqueue_key+0x3e/0x1d0
&gt;  [&lt;ffffffff8109709e&gt;] ? __create_workqueue_key+0x3e/0x1d0
&gt;  [&lt;ffffffffa00c101c&gt;] ? fnic_probe+0x977/0x11aa [fnic]
&gt;  [&lt;ffffffffa00c1048&gt;] ? fnic_probe+0x9a3/0x11aa [fnic]
&gt;  [&lt;ffffffff81096f00&gt;] ? do_work_for_cpu+0x0/0x30
&gt;  [&lt;ffffffff812c6da7&gt;] ? local_pci_probe+0x17/0x20
&gt;  [&lt;ffffffff81096f18&gt;] ? do_work_for_cpu+0x18/0x30
&gt;  [&lt;ffffffff8109cdc6&gt;] ? kthread+0x96/0xa0
&gt;  [&lt;ffffffff8100c1ca&gt;] ? child_rip+0xa/0x20
&gt;  [&lt;ffffffff81550f80&gt;] ? _spin_unlock_irq+0x30/0x40
&gt;  [&lt;ffffffff8100bb10&gt;] ? restore_args+0x0/0x30
&gt;  [&lt;ffffffff8109cd30&gt;] ? kthread+0x0/0xa0
&gt;  [&lt;ffffffff8100c1c0&gt;] ? child_rip+0x0/0x20

The problem is in this hunk of "FIP VLAN Discovery Feature Support"
(d3c995f1dcf938f1084388d92b8fb97bec366566)

create_singlethreaded_workqueue cannot be called with irqs disabled

@@ -620,7 +634,29 @@ static int __devinit fnic_probe(struct pci_dev
*pdev,
        vnic_dev_packet_filter(fnic-&gt;vdev, 1, 1, 0, 0, 0);
        vnic_dev_add_addr(fnic-&gt;vdev, FIP_ALL_ENODE_MACS);
        vnic_dev_add_addr(fnic-&gt;vdev, fnic-&gt;ctlr.ctl_src_addr);
+       fnic-&gt;set_vlan = fnic_set_vlan;
        fcoe_ctlr_init(&amp;fnic-&gt;ctlr, FIP_MODE_AUTO);
+       setup_timer(&amp;fnic-&gt;fip_timer, fnic_fip_notify_timer,
+                           (unsigned long)fnic);
+       spin_lock_init(&amp;fnic-&gt;vlans_lock);
+       INIT_WORK(&amp;fnic-&gt;fip_frame_work, fnic_handle_fip_frame);
+       INIT_WORK(&amp;fnic-&gt;event_work, fnic_handle_event);
+       skb_queue_head_init(&amp;fnic-&gt;fip_frame_queue);
+       spin_lock_irqsave(&amp;fnic_list_lock, flags);
+       if (!fnic_fip_queue) {
+           fnic_fip_queue =
+               create_singlethread_workqueue("fnic_fip_q");
+           if (!fnic_fip_queue) {
+               spin_unlock_irqrestore(&amp;fnic_list_lock, flags);
+               printk(KERN_ERR PFX "fnic FIP work queue "
+                        "create failed\n");
+               err = -ENOMEM;
+               goto err_out_free_max_pool;
+           }
+       }
+       spin_unlock_irqrestore(&amp;fnic_list_lock, flags);
+       INIT_LIST_HEAD(&amp;fnic-&gt;evlist);
+       INIT_LIST_HEAD(&amp;fnic-&gt;vlans);
    } else {
        shost_printk(KERN_INFO, fnic-&gt;lport-&gt;host,
                 "firmware uses non-FIP mode\n");

The attempts to make fnic_fip_queue a single instance for the driver
while it's being created in probe look awkward anyway, why is this not
created in fnic_init_module like the event workqueue?

Signed-off-by: Chris Leech &lt;cleech@redhat.com&gt;
Tested-by: Anantha Tungarakodi &lt;atungara@cisco.com&gt;
Acked-by: Hiral Patel &lt;hiralpat@cisco.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>
I hit this during driver probe with the latest fnic updates (this trace
is from a backport into a distro kernel, but the issue is the same).

&gt; BUG: sleeping function called from invalid context at mm/slab.c:3113
&gt; in_atomic(): 0, irqs_disabled(): 1, pid: 610, name: work_for_cpu
&gt; INFO: lockdep is turned off.
&gt; irq event stamp: 0
&gt; hardirqs last  enabled at (0): [&lt;(null)&gt;] (null)
&gt; hardirqs last disabled at (0): [&lt;ffffffff81070aa5&gt;]
&gt; copy_process+0x5e5/0x1670
&gt; softirqs last  enabled at (0): [&lt;ffffffff81070aa5&gt;]
&gt; copy_process+0x5e5/0x1670
&gt; softirqs last disabled at (0): [&lt;(null)&gt;] (null)
&gt; Pid: 610, comm: work_for_cpu Not tainted
&gt; Call Trace:
&gt;  [&lt;ffffffff810b2d10&gt;] ? print_irqtrace_events+0xd0/0xe0
&gt;  [&lt;ffffffff8105c1a7&gt;] ? __might_sleep+0xf7/0x130
&gt;  [&lt;ffffffff81184efb&gt;] ? kmem_cache_alloc_trace+0x20b/0x2d0
&gt;  [&lt;ffffffff8109709e&gt;] ? __create_workqueue_key+0x3e/0x1d0
&gt;  [&lt;ffffffff8109709e&gt;] ? __create_workqueue_key+0x3e/0x1d0
&gt;  [&lt;ffffffffa00c101c&gt;] ? fnic_probe+0x977/0x11aa [fnic]
&gt;  [&lt;ffffffffa00c1048&gt;] ? fnic_probe+0x9a3/0x11aa [fnic]
&gt;  [&lt;ffffffff81096f00&gt;] ? do_work_for_cpu+0x0/0x30
&gt;  [&lt;ffffffff812c6da7&gt;] ? local_pci_probe+0x17/0x20
&gt;  [&lt;ffffffff81096f18&gt;] ? do_work_for_cpu+0x18/0x30
&gt;  [&lt;ffffffff8109cdc6&gt;] ? kthread+0x96/0xa0
&gt;  [&lt;ffffffff8100c1ca&gt;] ? child_rip+0xa/0x20
&gt;  [&lt;ffffffff81550f80&gt;] ? _spin_unlock_irq+0x30/0x40
&gt;  [&lt;ffffffff8100bb10&gt;] ? restore_args+0x0/0x30
&gt;  [&lt;ffffffff8109cd30&gt;] ? kthread+0x0/0xa0
&gt;  [&lt;ffffffff8100c1c0&gt;] ? child_rip+0x0/0x20

The problem is in this hunk of "FIP VLAN Discovery Feature Support"
(d3c995f1dcf938f1084388d92b8fb97bec366566)

create_singlethreaded_workqueue cannot be called with irqs disabled

@@ -620,7 +634,29 @@ static int __devinit fnic_probe(struct pci_dev
*pdev,
        vnic_dev_packet_filter(fnic-&gt;vdev, 1, 1, 0, 0, 0);
        vnic_dev_add_addr(fnic-&gt;vdev, FIP_ALL_ENODE_MACS);
        vnic_dev_add_addr(fnic-&gt;vdev, fnic-&gt;ctlr.ctl_src_addr);
+       fnic-&gt;set_vlan = fnic_set_vlan;
        fcoe_ctlr_init(&amp;fnic-&gt;ctlr, FIP_MODE_AUTO);
+       setup_timer(&amp;fnic-&gt;fip_timer, fnic_fip_notify_timer,
+                           (unsigned long)fnic);
+       spin_lock_init(&amp;fnic-&gt;vlans_lock);
+       INIT_WORK(&amp;fnic-&gt;fip_frame_work, fnic_handle_fip_frame);
+       INIT_WORK(&amp;fnic-&gt;event_work, fnic_handle_event);
+       skb_queue_head_init(&amp;fnic-&gt;fip_frame_queue);
+       spin_lock_irqsave(&amp;fnic_list_lock, flags);
+       if (!fnic_fip_queue) {
+           fnic_fip_queue =
+               create_singlethread_workqueue("fnic_fip_q");
+           if (!fnic_fip_queue) {
+               spin_unlock_irqrestore(&amp;fnic_list_lock, flags);
+               printk(KERN_ERR PFX "fnic FIP work queue "
+                        "create failed\n");
+               err = -ENOMEM;
+               goto err_out_free_max_pool;
+           }
+       }
+       spin_unlock_irqrestore(&amp;fnic_list_lock, flags);
+       INIT_LIST_HEAD(&amp;fnic-&gt;evlist);
+       INIT_LIST_HEAD(&amp;fnic-&gt;vlans);
    } else {
        shost_printk(KERN_INFO, fnic-&gt;lport-&gt;host,
                 "firmware uses non-FIP mode\n");

The attempts to make fnic_fip_queue a single instance for the driver
while it's being created in probe look awkward anyway, why is this not
created in fnic_init_module like the event workqueue?

Signed-off-by: Chris Leech &lt;cleech@redhat.com&gt;
Tested-by: Anantha Tungarakodi &lt;atungara@cisco.com&gt;
Acked-by: Hiral Patel &lt;hiralpat@cisco.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] megaraid_sas: megaraid_sas driver init fails in kdump kernel</title>
<updated>2013-08-02T20:01:29+00:00</updated>
<author>
<name>Sumit.Saxena@lsi.com</name>
<email>Sumit.Saxena@lsi.com</email>
</author>
<published>2013-07-15T20:56:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6431f5d7c6025f8b007af06ea090de308f7e6881'/>
<id>6431f5d7c6025f8b007af06ea090de308f7e6881</id>
<content type='text'>
Problem: When Hardware IOMMU is on, megaraid_sas driver initialization fails
in kdump kernel with LSI MegaRAID controller(device id-0x73).

Actually this issue needs fix in firmware, but for firmware running in field,
this driver fix is proposed to resolve the issue.  At firmware initialization
time, if firmware does not come to ready state, driver will reset the adapter
and retry for firmware transition to ready state unconditionally(not only
executed for kdump kernel).

Signed-off-by: Sumit Saxena &lt;sumit.saxena@lsi.com&gt;
Signed-off-by: Kashyap Desai &lt;kashyap.desai@lsi.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Problem: When Hardware IOMMU is on, megaraid_sas driver initialization fails
in kdump kernel with LSI MegaRAID controller(device id-0x73).

Actually this issue needs fix in firmware, but for firmware running in field,
this driver fix is proposed to resolve the issue.  At firmware initialization
time, if firmware does not come to ready state, driver will reset the adapter
and retry for firmware transition to ready state unconditionally(not only
executed for kdump kernel).

Signed-off-by: Sumit Saxena &lt;sumit.saxena@lsi.com&gt;
Signed-off-by: Kashyap Desai &lt;kashyap.desai@lsi.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>virtio-scsi: Fix virtqueue affinity setup</title>
<updated>2013-08-01T02:07:19+00:00</updated>
<author>
<name>Asias He</name>
<email>asias@redhat.com</email>
</author>
<published>2013-08-01T01:37:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=aa52aeea2725839bdd3dcce394486e9a043065e0'/>
<id>aa52aeea2725839bdd3dcce394486e9a043065e0</id>
<content type='text'>
vscsi-&gt;num_queues counts the number of request virtqueue which does not
include the control and event virtqueue. It is wrong to subtract
VIRTIO_SCSI_VQ_BASE from vscsi-&gt;num_queues.

This patch fixes the following panic.

(qemu) device_del scsi0

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
 IP: [&lt;ffffffff8179b29f&gt;] __virtscsi_set_affinity+0x6f/0x120
 PGD 0
 Oops: 0000 [#1] SMP
 Modules linked in:
 CPU: 0 PID: 659 Comm: kworker/0:1 Not tainted 3.11.0-rc2+ #1172
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
 Workqueue: kacpi_hotplug _handle_hotplug_event_func
 task: ffff88007bee1cc0 ti: ffff88007bfe4000 task.ti: ffff88007bfe4000
 RIP: 0010:[&lt;ffffffff8179b29f&gt;]  [&lt;ffffffff8179b29f&gt;] __virtscsi_set_affinity+0x6f/0x120
 RSP: 0018:ffff88007bfe5a38  EFLAGS: 00010202
 RAX: 0000000000000010 RBX: ffff880077fd0d28 RCX: 0000000000000050
 RDX: 0000000000000000 RSI: 0000000000000246 RDI: 0000000000000000
 RBP: ffff88007bfe5a58 R08: ffff880077f6ff00 R09: 0000000000000001
 R10: ffffffff8143e673 R11: 0000000000000001 R12: 0000000000000001
 R13: ffff880077fd0800 R14: 0000000000000000 R15: ffff88007bf489b0
 FS:  0000000000000000(0000) GS:ffff88007ea00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000020 CR3: 0000000079f8b000 CR4: 00000000000006f0
 Stack:
  ffff880077fd0d28 0000000000000000 ffff880077fd0800 0000000000000008
  ffff88007bfe5a78 ffffffff8179b37d ffff88007bccc800 ffff88007bccc800
  ffff88007bfe5a98 ffffffff8179b3b6 ffff88007bccc800 ffff880077fd0d28
 Call Trace:
  [&lt;ffffffff8179b37d&gt;] virtscsi_set_affinity+0x2d/0x40
  [&lt;ffffffff8179b3b6&gt;] virtscsi_remove_vqs+0x26/0x50
  [&lt;ffffffff8179c7d2&gt;] virtscsi_remove+0x82/0xa0
  [&lt;ffffffff814cb6b2&gt;] virtio_dev_remove+0x22/0x70
  [&lt;ffffffff8167ca49&gt;] __device_release_driver+0x69/0xd0
  [&lt;ffffffff8167cb9d&gt;] device_release_driver+0x2d/0x40
  [&lt;ffffffff8167bb96&gt;] bus_remove_device+0x116/0x150
  [&lt;ffffffff81679936&gt;] device_del+0x126/0x1e0
  [&lt;ffffffff81679a06&gt;] device_unregister+0x16/0x30
  [&lt;ffffffff814cb889&gt;] unregister_virtio_device+0x19/0x30
  [&lt;ffffffff814cdad6&gt;] virtio_pci_remove+0x36/0x80
  [&lt;ffffffff81464ae7&gt;] pci_device_remove+0x37/0x70
  [&lt;ffffffff8167ca49&gt;] __device_release_driver+0x69/0xd0
  [&lt;ffffffff8167cb9d&gt;] device_release_driver+0x2d/0x40
  [&lt;ffffffff8167bb96&gt;] bus_remove_device+0x116/0x150
  [&lt;ffffffff81679936&gt;] device_del+0x126/0x1e0
  [&lt;ffffffff8145edfc&gt;] pci_stop_bus_device+0x9c/0xb0
  [&lt;ffffffff8145f036&gt;] pci_stop_and_remove_bus_device+0x16/0x30
  [&lt;ffffffff81474a9e&gt;] acpiphp_disable_slot+0x8e/0x150
  [&lt;ffffffff81474f6a&gt;] hotplug_event_func+0xba/0x1a0
  [&lt;ffffffff814906c8&gt;] ? acpi_os_release_object+0xe/0x12
  [&lt;ffffffff81475911&gt;] _handle_hotplug_event_func+0x31/0x70
  [&lt;ffffffff810b5333&gt;] process_one_work+0x183/0x500
  [&lt;ffffffff810b66e2&gt;] worker_thread+0x122/0x400
  [&lt;ffffffff810b65c0&gt;] ? manage_workers+0x2d0/0x2d0
  [&lt;ffffffff810bc5de&gt;] kthread+0xce/0xe0
  [&lt;ffffffff810bc510&gt;] ? kthread_freezable_should_stop+0x70/0x70
  [&lt;ffffffff81ca045c&gt;] ret_from_fork+0x7c/0xb0
  [&lt;ffffffff810bc510&gt;] ? kthread_freezable_should_stop+0x70/0x70
 Code: 01 00 00 00 74 59 45 31 e4 83 bb c8 01 00 00 02 74 46 66 2e 0f 1f 84 00 00 00 00 00 49 63 c4 48 c1 e0 04 48 8b bc 0
3 10 02 00 00 &lt;48&gt; 8b 47 20 48 8b 80 d0 01 00 00 48 8b 40 50 48 85 c0 74 07 be
 RIP  [&lt;ffffffff8179b29f&gt;] __virtscsi_set_affinity+0x6f/0x120
  RSP &lt;ffff88007bfe5a38&gt;
 CR2: 0000000000000020
 ---[ end trace 99679331a3775f48 ]---

CC: stable@vger.kernel.org
Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Reviewed-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>
vscsi-&gt;num_queues counts the number of request virtqueue which does not
include the control and event virtqueue. It is wrong to subtract
VIRTIO_SCSI_VQ_BASE from vscsi-&gt;num_queues.

This patch fixes the following panic.

(qemu) device_del scsi0

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000020
 IP: [&lt;ffffffff8179b29f&gt;] __virtscsi_set_affinity+0x6f/0x120
 PGD 0
 Oops: 0000 [#1] SMP
 Modules linked in:
 CPU: 0 PID: 659 Comm: kworker/0:1 Not tainted 3.11.0-rc2+ #1172
 Hardware name: Bochs Bochs, BIOS Bochs 01/01/2011
 Workqueue: kacpi_hotplug _handle_hotplug_event_func
 task: ffff88007bee1cc0 ti: ffff88007bfe4000 task.ti: ffff88007bfe4000
 RIP: 0010:[&lt;ffffffff8179b29f&gt;]  [&lt;ffffffff8179b29f&gt;] __virtscsi_set_affinity+0x6f/0x120
 RSP: 0018:ffff88007bfe5a38  EFLAGS: 00010202
 RAX: 0000000000000010 RBX: ffff880077fd0d28 RCX: 0000000000000050
 RDX: 0000000000000000 RSI: 0000000000000246 RDI: 0000000000000000
 RBP: ffff88007bfe5a58 R08: ffff880077f6ff00 R09: 0000000000000001
 R10: ffffffff8143e673 R11: 0000000000000001 R12: 0000000000000001
 R13: ffff880077fd0800 R14: 0000000000000000 R15: ffff88007bf489b0
 FS:  0000000000000000(0000) GS:ffff88007ea00000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
 CR2: 0000000000000020 CR3: 0000000079f8b000 CR4: 00000000000006f0
 Stack:
  ffff880077fd0d28 0000000000000000 ffff880077fd0800 0000000000000008
  ffff88007bfe5a78 ffffffff8179b37d ffff88007bccc800 ffff88007bccc800
  ffff88007bfe5a98 ffffffff8179b3b6 ffff88007bccc800 ffff880077fd0d28
 Call Trace:
  [&lt;ffffffff8179b37d&gt;] virtscsi_set_affinity+0x2d/0x40
  [&lt;ffffffff8179b3b6&gt;] virtscsi_remove_vqs+0x26/0x50
  [&lt;ffffffff8179c7d2&gt;] virtscsi_remove+0x82/0xa0
  [&lt;ffffffff814cb6b2&gt;] virtio_dev_remove+0x22/0x70
  [&lt;ffffffff8167ca49&gt;] __device_release_driver+0x69/0xd0
  [&lt;ffffffff8167cb9d&gt;] device_release_driver+0x2d/0x40
  [&lt;ffffffff8167bb96&gt;] bus_remove_device+0x116/0x150
  [&lt;ffffffff81679936&gt;] device_del+0x126/0x1e0
  [&lt;ffffffff81679a06&gt;] device_unregister+0x16/0x30
  [&lt;ffffffff814cb889&gt;] unregister_virtio_device+0x19/0x30
  [&lt;ffffffff814cdad6&gt;] virtio_pci_remove+0x36/0x80
  [&lt;ffffffff81464ae7&gt;] pci_device_remove+0x37/0x70
  [&lt;ffffffff8167ca49&gt;] __device_release_driver+0x69/0xd0
  [&lt;ffffffff8167cb9d&gt;] device_release_driver+0x2d/0x40
  [&lt;ffffffff8167bb96&gt;] bus_remove_device+0x116/0x150
  [&lt;ffffffff81679936&gt;] device_del+0x126/0x1e0
  [&lt;ffffffff8145edfc&gt;] pci_stop_bus_device+0x9c/0xb0
  [&lt;ffffffff8145f036&gt;] pci_stop_and_remove_bus_device+0x16/0x30
  [&lt;ffffffff81474a9e&gt;] acpiphp_disable_slot+0x8e/0x150
  [&lt;ffffffff81474f6a&gt;] hotplug_event_func+0xba/0x1a0
  [&lt;ffffffff814906c8&gt;] ? acpi_os_release_object+0xe/0x12
  [&lt;ffffffff81475911&gt;] _handle_hotplug_event_func+0x31/0x70
  [&lt;ffffffff810b5333&gt;] process_one_work+0x183/0x500
  [&lt;ffffffff810b66e2&gt;] worker_thread+0x122/0x400
  [&lt;ffffffff810b65c0&gt;] ? manage_workers+0x2d0/0x2d0
  [&lt;ffffffff810bc5de&gt;] kthread+0xce/0xe0
  [&lt;ffffffff810bc510&gt;] ? kthread_freezable_should_stop+0x70/0x70
  [&lt;ffffffff81ca045c&gt;] ret_from_fork+0x7c/0xb0
  [&lt;ffffffff810bc510&gt;] ? kthread_freezable_should_stop+0x70/0x70
 Code: 01 00 00 00 74 59 45 31 e4 83 bb c8 01 00 00 02 74 46 66 2e 0f 1f 84 00 00 00 00 00 49 63 c4 48 c1 e0 04 48 8b bc 0
3 10 02 00 00 &lt;48&gt; 8b 47 20 48 8b 80 d0 01 00 00 48 8b 40 50 48 85 c0 74 07 be
 RIP  [&lt;ffffffff8179b29f&gt;] __virtscsi_set_affinity+0x6f/0x120
  RSP &lt;ffff88007bfe5a38&gt;
 CR2: 0000000000000020
 ---[ end trace 99679331a3775f48 ]---

CC: stable@vger.kernel.org
Signed-off-by: Asias He &lt;asias@redhat.com&gt;
Reviewed-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>[SCSI] isci: fix breakage caused by &gt;16byte CDB patch</title>
<updated>2013-07-24T21:18:12+00:00</updated>
<author>
<name>James Bottomley</name>
<email>JBottomley@Parallels.com</email>
</author>
<published>2013-07-24T19:43:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e1be09808e030d57bb743618eb41e2bc31dd464c'/>
<id>e1be09808e030d57bb743618eb41e2bc31dd464c</id>
<content type='text'>
Oops, apparently no-one I cc'd at intel actually bothered to check this
patch for the isci driver:

commit e73823f7a2c921dcf068d34ea03bd682498d9e42
Author: James Bottomley &lt;JBottomley@Parallels.com&gt;
Date:   Tue May 7 15:38:18 2013 -0700

    [SCSI] libsas: implement &gt; 16 byte CDB support

sci_swab32_cpy needs multiples of four, so for commands that aren't that, it's
rounding the wrong way.  fix by doing (len+3)/4 instead of len/4.

Reported-by: Tony Luck &lt;tony.luck@intel.com&gt;
Tested-by: Tony Luck &lt;tony.luck@intel.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>
Oops, apparently no-one I cc'd at intel actually bothered to check this
patch for the isci driver:

commit e73823f7a2c921dcf068d34ea03bd682498d9e42
Author: James Bottomley &lt;JBottomley@Parallels.com&gt;
Date:   Tue May 7 15:38:18 2013 -0700

    [SCSI] libsas: implement &gt; 16 byte CDB support

sci_swab32_cpy needs multiples of four, so for commands that aren't that, it's
rounding the wrong way.  fix by doing (len+3)/4 instead of len/4.

Reported-by: Tony Luck &lt;tony.luck@intel.com&gt;
Tested-by: Tony Luck &lt;tony.luck@intel.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] mvsas: Fix kernel panic on tile due to unaligned data access</title>
<updated>2013-07-23T22:23:08+00:00</updated>
<author>
<name>James Bottomley</name>
<email>JBottomley@Parallels.com</email>
</author>
<published>2013-06-09T16:23:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=53a983c4f8b4246f5ff00567411be55967b0350a'/>
<id>53a983c4f8b4246f5ff00567411be55967b0350a</id>
<content type='text'>
slot-&gt;response is a 64 bit quantity (and accessed as such), but its alignment
is only 32 bits.  This doesn't cause a problem on x86, but apparently causes a
kernel panic on Tile:

Stack dump complete Kernel panic - not syncing:
 Kernel unalign fault running the idle task!
 Starting stack dump of tid 0, pid 0 (swapper) on cpu 1 at cycle 341586172541
   frame 0: 0xfffffff700140ee0 dump_stack+0x0/0x20 (sp 0xfffffe43ffedf420)
   frame 1: 0xfffffff700283270 panic+0x150/0x3a0 (sp 0xfffffe43ffedf420)
   frame 2: 0xfffffff70012bff8 jit_bundle_gen+0xfd8/0x27e0 (sp 0xfffffe43ffedf4c8)
   frame 3: 0xfffffff7003b5b68 do_unaligned+0xc0/0x5a0 (sp 0xfffffe43ffedf710)
   frame 4: 0xfffffff70044ca78 handle_interrupt+0x270/0x278 (sp 0xfffffe43ffedf840)
   &lt;interrupt 17 while in kernel mode&gt;
   frame 5: 0xfffffff7002ac370 mvs_slot_complete+0x5f0/0x12a0 (sp 0xfffffe43ffedfa90)
   frame 6: 0xfffffff7002abec0 mvs_slot_complete+0x140/0x12a0 (sp 0xfffffe43ffedfa90)
   frame 7: 0xfffffff7005cc840 mvs_int_rx+0x140/0x2a0 (sp 0xfffffe43ffedfb00)
   frame 8: 0xfffffff7005bbaf0 mvs_94xx_isr+0xd8/0x2b8 (sp 0xfffffe43ffedfb68)
   frame 9: 0xfffffff700658ba0 mvs_tasklet+0x128/0x1f8 (sp 0xfffffe43ffedfba8)
   frame 10: 0xfffffff7003e8230 tasklet_action+0x178/0x2c8 (sp 0xfffffe43ffedfbe0)
   frame 11: 0xfffffff700103850 __do_softirq+0x210/0x398 (sp 0xfffffe43ffedfc40)
   frame 12: 0xfffffff700180308 do_softirq+0xc8/0x140 (sp 0xfffffe43ffedfcd8)
   frame 13: 0xfffffff7000bd7f0 irq_exit+0xb0/0x158 (sp 0xfffffe43ffedfcf0)
   frame 14: 0xfffffff70013fa58 tile_dev_intr+0x1d8/0x2f0 (sp 0xfffffe43ffedfd00)
   frame 15: 0xfffffff70044ca78 handle_interrupt+0x270/0x278 (sp 0xfffffe43ffedfd40)
   &lt;interrupt 30 while in kernel mode&gt;
   frame 16: 0xfffffff700143e68 _cpu_idle_nap+0x0/0x18 (sp 0xfffffe43ffedffb0)
   frame 17: 0xfffffff700482480 cpu_idle+0x310/0x428 (sp 0xfffffe43ffedffb0)

Since the check is just for non-zero, split it to be two 32 bit accesses
(preserving speed in the fast path) and do a get_unaligned() in the slow path.

This is a modification of a wholly get_unaligned patch submitted by Paul Guo

Reported-by: Paul Guo &lt;ggang@tilera.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>
slot-&gt;response is a 64 bit quantity (and accessed as such), but its alignment
is only 32 bits.  This doesn't cause a problem on x86, but apparently causes a
kernel panic on Tile:

Stack dump complete Kernel panic - not syncing:
 Kernel unalign fault running the idle task!
 Starting stack dump of tid 0, pid 0 (swapper) on cpu 1 at cycle 341586172541
   frame 0: 0xfffffff700140ee0 dump_stack+0x0/0x20 (sp 0xfffffe43ffedf420)
   frame 1: 0xfffffff700283270 panic+0x150/0x3a0 (sp 0xfffffe43ffedf420)
   frame 2: 0xfffffff70012bff8 jit_bundle_gen+0xfd8/0x27e0 (sp 0xfffffe43ffedf4c8)
   frame 3: 0xfffffff7003b5b68 do_unaligned+0xc0/0x5a0 (sp 0xfffffe43ffedf710)
   frame 4: 0xfffffff70044ca78 handle_interrupt+0x270/0x278 (sp 0xfffffe43ffedf840)
   &lt;interrupt 17 while in kernel mode&gt;
   frame 5: 0xfffffff7002ac370 mvs_slot_complete+0x5f0/0x12a0 (sp 0xfffffe43ffedfa90)
   frame 6: 0xfffffff7002abec0 mvs_slot_complete+0x140/0x12a0 (sp 0xfffffe43ffedfa90)
   frame 7: 0xfffffff7005cc840 mvs_int_rx+0x140/0x2a0 (sp 0xfffffe43ffedfb00)
   frame 8: 0xfffffff7005bbaf0 mvs_94xx_isr+0xd8/0x2b8 (sp 0xfffffe43ffedfb68)
   frame 9: 0xfffffff700658ba0 mvs_tasklet+0x128/0x1f8 (sp 0xfffffe43ffedfba8)
   frame 10: 0xfffffff7003e8230 tasklet_action+0x178/0x2c8 (sp 0xfffffe43ffedfbe0)
   frame 11: 0xfffffff700103850 __do_softirq+0x210/0x398 (sp 0xfffffe43ffedfc40)
   frame 12: 0xfffffff700180308 do_softirq+0xc8/0x140 (sp 0xfffffe43ffedfcd8)
   frame 13: 0xfffffff7000bd7f0 irq_exit+0xb0/0x158 (sp 0xfffffe43ffedfcf0)
   frame 14: 0xfffffff70013fa58 tile_dev_intr+0x1d8/0x2f0 (sp 0xfffffe43ffedfd00)
   frame 15: 0xfffffff70044ca78 handle_interrupt+0x270/0x278 (sp 0xfffffe43ffedfd40)
   &lt;interrupt 30 while in kernel mode&gt;
   frame 16: 0xfffffff700143e68 _cpu_idle_nap+0x0/0x18 (sp 0xfffffe43ffedffb0)
   frame 17: 0xfffffff700482480 cpu_idle+0x310/0x428 (sp 0xfffffe43ffedffb0)

Since the check is just for non-zero, split it to be two 32 bit accesses
(preserving speed in the fast path) and do a get_unaligned() in the slow path.

This is a modification of a wholly get_unaligned patch submitted by Paul Guo

Reported-by: Paul Guo &lt;ggang@tilera.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
