<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/scsi, branch v3.14.3</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: arcmsr: upper 32 of dma address lost</title>
<updated>2014-05-06T14:59:29+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2014-02-11T16:06:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=60babe4b2093420c4a29162b1614671b65dc1949'/>
<id>60babe4b2093420c4a29162b1614671b65dc1949</id>
<content type='text'>
commit e2c70425f05219b142b3a8a9489a622c736db39d upstream.

The original code always set the upper 32 bits to zero because it was
doing a shift of the wrong variable.

Fixes: 1a4f550a09f8 ('[SCSI] arcmsr: 1.20.00.15: add SATA RAID plus other fixes')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit e2c70425f05219b142b3a8a9489a622c736db39d upstream.

The original code always set the upper 32 bits to zero because it was
doing a shift of the wrong variable.

Fixes: 1a4f550a09f8 ('[SCSI] arcmsr: 1.20.00.15: add SATA RAID plus other fixes')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>SCSI: qla2xxx: fix error handling of qla2x00_mem_alloc()</title>
<updated>2014-05-06T14:59:29+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2014-01-21T07:00:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b5c0bf598c7ce3f45fe670be00e873228746a727'/>
<id>b5c0bf598c7ce3f45fe670be00e873228746a727</id>
<content type='text'>
commit b2a72ec32d0f499aaadf41264232517a12326df0 upstream.

qla2x00_mem_alloc() returns 1 on success and -ENOMEM on failure.  On the
one hand the caller assumes non-zero is success but on the other hand
the caller also assumes that it returns an error code.

I've fixed it to return zero on success and a negative error code on
failure.  This matches the documentation as well.

[jejb: checkpatch fix]
Fixes: e315cd28b9ef ('[SCSI] qla2xxx: Code changes for qla data structure refactoring')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Saurav Kashyap &lt;saurav.kashyap@qlogic.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit b2a72ec32d0f499aaadf41264232517a12326df0 upstream.

qla2x00_mem_alloc() returns 1 on success and -ENOMEM on failure.  On the
one hand the caller assumes non-zero is success but on the other hand
the caller also assumes that it returns an error code.

I've fixed it to return zero on success and a negative error code on
failure.  This matches the documentation as well.

[jejb: checkpatch fix]
Fixes: e315cd28b9ef ('[SCSI] qla2xxx: Code changes for qla data structure refactoring')
Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Acked-by: Saurav Kashyap &lt;saurav.kashyap@qlogic.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>SCSI: sd: don't fail if the device doesn't recognize SYNCHRONIZE CACHE</title>
<updated>2014-04-27T00:19:04+00:00</updated>
<author>
<name>Alan Stern</name>
<email>stern@rowland.harvard.edu</email>
</author>
<published>2014-01-15T20:37:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0561b77b0f366aa168fa23aa07b606f5f49638c8'/>
<id>0561b77b0f366aa168fa23aa07b606f5f49638c8</id>
<content type='text'>
commit 7aae51347b21eb738dc1981df1365b57a6c5ee4e upstream.

Evidently some wacky USB-ATA bridges don't recognize the SYNCHRONIZE
CACHE command, as shown in this email thread:

	http://marc.info/?t=138978356200002&amp;r=1&amp;w=2

The fact that we can't tell them to drain their caches shouldn't
prevent the system from going into suspend.  Therefore sd_sync_cache()
shouldn't return an error if the device replies with an Invalid
Command ASC.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Sven Neumann &lt;s.neumann@raumfeld.com&gt;
Tested-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 7aae51347b21eb738dc1981df1365b57a6c5ee4e upstream.

Evidently some wacky USB-ATA bridges don't recognize the SYNCHRONIZE
CACHE command, as shown in this email thread:

	http://marc.info/?t=138978356200002&amp;r=1&amp;w=2

The fact that we can't tell them to drain their caches shouldn't
prevent the system from going into suspend.  Therefore sd_sync_cache()
shouldn't return an error if the device replies with an Invalid
Command ASC.

Signed-off-by: Alan Stern &lt;stern@rowland.harvard.edu&gt;
Reported-by: Sven Neumann &lt;s.neumann@raumfeld.com&gt;
Tested-by: Daniel Mack &lt;zonque@gmail.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</pre>
</div>
</content>
</entry>
<entry>
<title>Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net</title>
<updated>2014-03-25T00:07:24+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-03-25T00:07:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8a1094462c7ec47f9d3a31b0a281ce35cb138f50'/>
<id>8a1094462c7ec47f9d3a31b0a281ce35cb138f50</id>
<content type='text'>
Pull networking fixes from David Miller:

 1) OpenVswitch's lookup_datapath() returns error pointers, so don't
    check against NULL.  From Jiri Pirko.

 2) pfkey_compile_policy() code path tries to do a GFP_KERNEL allocation
    under RCU locks, fix by using GFP_ATOMIC when necessary.  From
    Nikolay Aleksandrov.

 3) phy_suspend() indirectly passes uninitialized data into the ethtool
    get wake-on-land implementations.  Fix from Sebastian Hesselbarth.

 4) CPSW driver unregisters CPTS twice, fix from Benedikt Spranger.

 5) If SKB allocation of reply packet fails, vxlan's arp_reduce() defers
    a NULL pointer.  Fix from David Stevens.

 6) IPV6 neigh handling in vxlan doesn't validate the destination
    address properly, and it builds a packet with the src and dst
    reversed.  Fix also from David Stevens.

 7) Fix spinlock recursion during subscription failures in TIPC stack,
    from Erik Hugne.

 8) Revert buggy conversion of davinci_emac to devm_request_irq, from
    Chrstian Riesch.

 9) Wrong flags passed into forwarding database netlink notifications,
    from Nicolas Dichtel.

10) The netpoll neighbour soliciation handler checks wrong ethertype,
    needs to be ETH_P_IPV6 rather than ETH_P_ARP.  Fix from Li RongQing.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (34 commits)
  tipc: fix spinlock recursion bug for failed subscriptions
  vxlan: fix nonfunctional neigh_reduce()
  net: davinci_emac: Fix rollback of emac_dev_open()
  net: davinci_emac: Replace devm_request_irq with request_irq
  netpoll: fix the skb check in pkt_is_ns
  net: micrel : ks8851-ml: add vdd-supply support
  ip6mr: fix mfc notification flags
  ipmr: fix mfc notification flags
  rtnetlink: fix fdb notification flags
  tcp: syncookies: do not use getnstimeofday()
  netlink: fix setsockopt in mmap examples in documentation
  openvswitch: Correctly report flow used times for first 5 minutes after boot.
  via-rhine: Disable device in error path
  ATHEROS-ATL1E: Convert iounmap to pci_iounmap
  vxlan: fix potential NULL dereference in arp_reduce()
  cnic: Update version to 2.5.20 and copyright year.
  cnic,bnx2i,bnx2fc: Fix inconsistent use of page size
  cnic: Use proper ulp_ops for per device operations.
  net: cdc_ncm: fix control message ordering
  ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull networking fixes from David Miller:

 1) OpenVswitch's lookup_datapath() returns error pointers, so don't
    check against NULL.  From Jiri Pirko.

 2) pfkey_compile_policy() code path tries to do a GFP_KERNEL allocation
    under RCU locks, fix by using GFP_ATOMIC when necessary.  From
    Nikolay Aleksandrov.

 3) phy_suspend() indirectly passes uninitialized data into the ethtool
    get wake-on-land implementations.  Fix from Sebastian Hesselbarth.

 4) CPSW driver unregisters CPTS twice, fix from Benedikt Spranger.

 5) If SKB allocation of reply packet fails, vxlan's arp_reduce() defers
    a NULL pointer.  Fix from David Stevens.

 6) IPV6 neigh handling in vxlan doesn't validate the destination
    address properly, and it builds a packet with the src and dst
    reversed.  Fix also from David Stevens.

 7) Fix spinlock recursion during subscription failures in TIPC stack,
    from Erik Hugne.

 8) Revert buggy conversion of davinci_emac to devm_request_irq, from
    Chrstian Riesch.

 9) Wrong flags passed into forwarding database netlink notifications,
    from Nicolas Dichtel.

10) The netpoll neighbour soliciation handler checks wrong ethertype,
    needs to be ETH_P_IPV6 rather than ETH_P_ARP.  Fix from Li RongQing.

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (34 commits)
  tipc: fix spinlock recursion bug for failed subscriptions
  vxlan: fix nonfunctional neigh_reduce()
  net: davinci_emac: Fix rollback of emac_dev_open()
  net: davinci_emac: Replace devm_request_irq with request_irq
  netpoll: fix the skb check in pkt_is_ns
  net: micrel : ks8851-ml: add vdd-supply support
  ip6mr: fix mfc notification flags
  ipmr: fix mfc notification flags
  rtnetlink: fix fdb notification flags
  tcp: syncookies: do not use getnstimeofday()
  netlink: fix setsockopt in mmap examples in documentation
  openvswitch: Correctly report flow used times for first 5 minutes after boot.
  via-rhine: Disable device in error path
  ATHEROS-ATL1E: Convert iounmap to pci_iounmap
  vxlan: fix potential NULL dereference in arp_reduce()
  cnic: Update version to 2.5.20 and copyright year.
  cnic,bnx2i,bnx2fc: Fix inconsistent use of page size
  cnic: Use proper ulp_ops for per device operations.
  net: cdc_ncm: fix control message ordering
  ipv6: ip6_append_data_mtu do not handle the mtu of the second fragment properly
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>cnic,bnx2i,bnx2fc: Fix inconsistent use of page size</title>
<updated>2014-03-18T20:02:16+00:00</updated>
<author>
<name>Michael Chan</name>
<email>mchan@broadcom.com</email>
</author>
<published>2014-03-18T03:19:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=be1fefc21433f6202fcd76bdc7916e557fe80b9a'/>
<id>be1fefc21433f6202fcd76bdc7916e557fe80b9a</id>
<content type='text'>
The bnx2/bnx2x rings are made up of linked pages.  However there is an
upper limit on the page size as some the page size settings are 16-bit
in the hardware/firmware interface.  In the current code, some parts
use BNX2_PAGE_SIZE which has a 16K upper limit and some parts use
PAGE_SIZE.  On archs with &gt;= 64K PAGE_SIZE, it generates some compile
warnings.  Define a new CNIC_PAGE_SZIE which has an upper limit of
16K and use it consistently in all relevant parts.

Signed-off-by: Michael Chan &lt;mchan@broadcom.com&gt;
Signed-off-by: Eddie Wai &lt;eddie.wai@broadcom.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The bnx2/bnx2x rings are made up of linked pages.  However there is an
upper limit on the page size as some the page size settings are 16-bit
in the hardware/firmware interface.  In the current code, some parts
use BNX2_PAGE_SIZE which has a 16K upper limit and some parts use
PAGE_SIZE.  On archs with &gt;= 64K PAGE_SIZE, it generates some compile
warnings.  Define a new CNIC_PAGE_SZIE which has an upper limit of
16K and use it consistently in all relevant parts.

Signed-off-by: Michael Chan &lt;mchan@broadcom.com&gt;
Signed-off-by: Eddie Wai &lt;eddie.wai@broadcom.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&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>2014-03-15T19:41:53+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2014-03-15T19:41:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3b4df68d0697129c172e66fd925cf32192044f9a'/>
<id>3b4df68d0697129c172e66fd925cf32192044f9a</id>
<content type='text'>
Pull SCSI fixes from James Bottomley:
 "This is a set of six fixes.  Two are instant crash/null deref types
  (storvsc and isci).  The two qla2xxx are initialisation problems that
  cause MSI-X failures and card misdetection, the isci erroneous macro
  is actually illegal C that's causing a miscompile with certain gcc
  versions and the be2iscsi bad if expression is a static checker fix"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] storvsc: NULL pointer dereference fix
  [SCSI] qla2xxx: Poll during initialization for ISP25xx and ISP83xx
  [SCSI] isci: correct erroneous for_each_isci_host macro
  [SCSI] isci: fix reset timeout handling
  [SCSI] be2iscsi: fix bad if expression
  [SCSI] qla2xxx: Fix multiqueue MSI-X registration.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull SCSI fixes from James Bottomley:
 "This is a set of six fixes.  Two are instant crash/null deref types
  (storvsc and isci).  The two qla2xxx are initialisation problems that
  cause MSI-X failures and card misdetection, the isci erroneous macro
  is actually illegal C that's causing a miscompile with certain gcc
  versions and the be2iscsi bad if expression is a static checker fix"

* tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
  [SCSI] storvsc: NULL pointer dereference fix
  [SCSI] qla2xxx: Poll during initialization for ISP25xx and ISP83xx
  [SCSI] isci: correct erroneous for_each_isci_host macro
  [SCSI] isci: fix reset timeout handling
  [SCSI] be2iscsi: fix bad if expression
  [SCSI] qla2xxx: Fix multiqueue MSI-X registration.
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] storvsc: NULL pointer dereference fix</title>
<updated>2014-03-12T09:16:54+00:00</updated>
<author>
<name>Ales Novak</name>
<email>alnovak@suse.cz</email>
</author>
<published>2014-02-27T10:03:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b12bb60d6c350b348a4e1460cd68f97ccae9822e'/>
<id>b12bb60d6c350b348a4e1460cd68f97ccae9822e</id>
<content type='text'>
If the initialization of storvsc fails, the storvsc_device_destroy()
causes NULL pointer dereference.

storvsc_bus_scan()
  scsi_scan_target()
    __scsi_scan_target()
      scsi_probe_and_add_lun(hostdata=NULL)
        scsi_alloc_sdev(hostdata=NULL)

	  sdev-&gt;hostdata = hostdata

	  now the host allocation fails

          __scsi_remove_device(sdev)

	  calls sdev-&gt;host-&gt;hostt-&gt;slave_destroy() ==
	  storvsc_device_destroy(sdev)
	    access of sdev-&gt;hostdata-&gt;request_mempool

Signed-off-by: Ales Novak &lt;alnovak@suse.cz&gt;
Signed-off-by: Thomas Abraham &lt;tabraham@suse.com&gt;
Reviewed-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Acked-by: K. Y. Srinivasan &lt;kys@microsoft.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 the initialization of storvsc fails, the storvsc_device_destroy()
causes NULL pointer dereference.

storvsc_bus_scan()
  scsi_scan_target()
    __scsi_scan_target()
      scsi_probe_and_add_lun(hostdata=NULL)
        scsi_alloc_sdev(hostdata=NULL)

	  sdev-&gt;hostdata = hostdata

	  now the host allocation fails

          __scsi_remove_device(sdev)

	  calls sdev-&gt;host-&gt;hostt-&gt;slave_destroy() ==
	  storvsc_device_destroy(sdev)
	    access of sdev-&gt;hostdata-&gt;request_mempool

Signed-off-by: Ales Novak &lt;alnovak@suse.cz&gt;
Signed-off-by: Thomas Abraham &lt;tabraham@suse.com&gt;
Reviewed-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
Acked-by: K. Y. Srinivasan &lt;kys@microsoft.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] qla2xxx: Poll during initialization for ISP25xx and ISP83xx</title>
<updated>2014-03-10T08:51:30+00:00</updated>
<author>
<name>Giridhar Malavali</name>
<email>giridhar.malavali@qlogic.com</email>
</author>
<published>2014-02-26T09:15:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b77ed25c9f8402e8b3e49e220edb4ef09ecfbb53'/>
<id>b77ed25c9f8402e8b3e49e220edb4ef09ecfbb53</id>
<content type='text'>
Cc: stable@vger.kernel.org
Signed-off-by: Giridhar Malavali &lt;giridhar.malavali@qlogic.com&gt;
Signed-off-by: Saurav Kashyap &lt;saurav.kashyap@qlogic.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>
Cc: stable@vger.kernel.org
Signed-off-by: Giridhar Malavali &lt;giridhar.malavali@qlogic.com&gt;
Signed-off-by: Saurav Kashyap &lt;saurav.kashyap@qlogic.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] isci: correct erroneous for_each_isci_host macro</title>
<updated>2014-03-10T08:49:39+00:00</updated>
<author>
<name>Lukasz Dorau</name>
<email>lukasz.dorau@intel.com</email>
</author>
<published>2014-02-06T20:23:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c59053a23d586675c25d789a7494adfdc02fba57'/>
<id>c59053a23d586675c25d789a7494adfdc02fba57</id>
<content type='text'>
In the first place, the loop 'for' in the macro 'for_each_isci_host'
(drivers/scsi/isci/host.h:314) is incorrect, because it accesses
the 3rd element of 2 element array. After the 2nd iteration it executes
the instruction:
        ihost = to_pci_info(pdev)-&gt;hosts[2]
(while the size of the 'hosts' array equals 2) and reads an
out of range element.

In the second place, this loop is incorrectly optimized by GCC v4.8
(see http://marc.info/?l=linux-kernel&amp;m=138998871911336&amp;w=2).
As a result, on platforms with two SCU controllers,
the loop is executed more times than it can be (for i=0,1 and 2).
It causes kernel panic during entering the S3 state
and the following oops after 'rmmod isci':

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [&lt;ffffffff8131360b&gt;] __list_add+0x1b/0xc0
Oops: 0000 [#1] SMP
RIP: 0010:[&lt;ffffffff8131360b&gt;]  [&lt;ffffffff8131360b&gt;] __list_add+0x1b/0xc0
Call Trace:
  [&lt;ffffffff81661b84&gt;] __mutex_lock_slowpath+0x114/0x1b0
  [&lt;ffffffff81661c3f&gt;] mutex_lock+0x1f/0x30
  [&lt;ffffffffa03e97cb&gt;] sas_disable_events+0x1b/0x50 [libsas]
  [&lt;ffffffffa03e9818&gt;] sas_unregister_ha+0x18/0x60 [libsas]
  [&lt;ffffffffa040316e&gt;] isci_unregister+0x1e/0x40 [isci]
  [&lt;ffffffffa0403efd&gt;] isci_pci_remove+0x5d/0x100 [isci]
  [&lt;ffffffff813391cb&gt;] pci_device_remove+0x3b/0xb0
  [&lt;ffffffff813fbf7f&gt;] __device_release_driver+0x7f/0xf0
  [&lt;ffffffff813fc8f8&gt;] driver_detach+0xa8/0xb0
  [&lt;ffffffff813fbb8b&gt;] bus_remove_driver+0x9b/0x120
  [&lt;ffffffff813fcf2c&gt;] driver_unregister+0x2c/0x50
  [&lt;ffffffff813381f3&gt;] pci_unregister_driver+0x23/0x80
  [&lt;ffffffffa04152f8&gt;] isci_exit+0x10/0x1e [isci]
  [&lt;ffffffff810d199b&gt;] SyS_delete_module+0x16b/0x2d0
  [&lt;ffffffff81012a21&gt;] ? do_notify_resume+0x61/0xa0
  [&lt;ffffffff8166ce29&gt;] system_call_fastpath+0x16/0x1b

The loop has been corrected.
This patch fixes kernel panic during entering the S3 state
and the above oops.

Signed-off-by: Lukasz Dorau &lt;lukasz.dorau@intel.com&gt;
Reviewed-by: Maciej Patelczyk &lt;maciej.patelczyk@intel.com&gt;
Tested-by: Lukasz Dorau &lt;lukasz.dorau@intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@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>
In the first place, the loop 'for' in the macro 'for_each_isci_host'
(drivers/scsi/isci/host.h:314) is incorrect, because it accesses
the 3rd element of 2 element array. After the 2nd iteration it executes
the instruction:
        ihost = to_pci_info(pdev)-&gt;hosts[2]
(while the size of the 'hosts' array equals 2) and reads an
out of range element.

In the second place, this loop is incorrectly optimized by GCC v4.8
(see http://marc.info/?l=linux-kernel&amp;m=138998871911336&amp;w=2).
As a result, on platforms with two SCU controllers,
the loop is executed more times than it can be (for i=0,1 and 2).
It causes kernel panic during entering the S3 state
and the following oops after 'rmmod isci':

BUG: unable to handle kernel NULL pointer dereference at (null)
IP: [&lt;ffffffff8131360b&gt;] __list_add+0x1b/0xc0
Oops: 0000 [#1] SMP
RIP: 0010:[&lt;ffffffff8131360b&gt;]  [&lt;ffffffff8131360b&gt;] __list_add+0x1b/0xc0
Call Trace:
  [&lt;ffffffff81661b84&gt;] __mutex_lock_slowpath+0x114/0x1b0
  [&lt;ffffffff81661c3f&gt;] mutex_lock+0x1f/0x30
  [&lt;ffffffffa03e97cb&gt;] sas_disable_events+0x1b/0x50 [libsas]
  [&lt;ffffffffa03e9818&gt;] sas_unregister_ha+0x18/0x60 [libsas]
  [&lt;ffffffffa040316e&gt;] isci_unregister+0x1e/0x40 [isci]
  [&lt;ffffffffa0403efd&gt;] isci_pci_remove+0x5d/0x100 [isci]
  [&lt;ffffffff813391cb&gt;] pci_device_remove+0x3b/0xb0
  [&lt;ffffffff813fbf7f&gt;] __device_release_driver+0x7f/0xf0
  [&lt;ffffffff813fc8f8&gt;] driver_detach+0xa8/0xb0
  [&lt;ffffffff813fbb8b&gt;] bus_remove_driver+0x9b/0x120
  [&lt;ffffffff813fcf2c&gt;] driver_unregister+0x2c/0x50
  [&lt;ffffffff813381f3&gt;] pci_unregister_driver+0x23/0x80
  [&lt;ffffffffa04152f8&gt;] isci_exit+0x10/0x1e [isci]
  [&lt;ffffffff810d199b&gt;] SyS_delete_module+0x16b/0x2d0
  [&lt;ffffffff81012a21&gt;] ? do_notify_resume+0x61/0xa0
  [&lt;ffffffff8166ce29&gt;] system_call_fastpath+0x16/0x1b

The loop has been corrected.
This patch fixes kernel panic during entering the S3 state
and the above oops.

Signed-off-by: Lukasz Dorau &lt;lukasz.dorau@intel.com&gt;
Reviewed-by: Maciej Patelczyk &lt;maciej.patelczyk@intel.com&gt;
Tested-by: Lukasz Dorau &lt;lukasz.dorau@intel.com&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[SCSI] isci: fix reset timeout handling</title>
<updated>2014-03-10T08:48:16+00:00</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2014-02-06T20:23:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ddfadd7736b677de2d4ca2cd5b4b655368c85a7a'/>
<id>ddfadd7736b677de2d4ca2cd5b4b655368c85a7a</id>
<content type='text'>
Remove an erroneous BUG_ON() in the case of a hard reset timeout.  The
reset timeout handler puts the port into the "awaiting link-up" state.
The timeout causes the device to be disconnected and we need to be in
the awaiting link-up state to re-connect the port.  The BUG_ON() made
the incorrect assumption that resets never timeout and we always
complete the reset in the "resetting" state.

Testing this patch also uncovered that libata continues to attempt to
reset the port long after the driver has torn down the context.  Once
the driver has committed to abandoning the link it must indicate to
libata that recovery ends by returning -ENODEV from
-&gt;lldd_I_T_nexus_reset().

Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Lukasz Dorau &lt;lukasz.dorau@intel.com&gt;
Reported-by: David Milburn &lt;dmilburn@redhat.com&gt;
Reported-by: Xun Ni &lt;xun.ni@intel.com&gt;
Tested-by: Xun Ni &lt;xun.ni@intel.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@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>
Remove an erroneous BUG_ON() in the case of a hard reset timeout.  The
reset timeout handler puts the port into the "awaiting link-up" state.
The timeout causes the device to be disconnected and we need to be in
the awaiting link-up state to re-connect the port.  The BUG_ON() made
the incorrect assumption that resets never timeout and we always
complete the reset in the "resetting" state.

Testing this patch also uncovered that libata continues to attempt to
reset the port long after the driver has torn down the context.  Once
the driver has committed to abandoning the link it must indicate to
libata that recovery ends by returning -ENODEV from
-&gt;lldd_I_T_nexus_reset().

Cc: &lt;stable@vger.kernel.org&gt;
Acked-by: Lukasz Dorau &lt;lukasz.dorau@intel.com&gt;
Reported-by: David Milburn &lt;dmilburn@redhat.com&gt;
Reported-by: Xun Ni &lt;xun.ni@intel.com&gt;
Tested-by: Xun Ni &lt;xun.ni@intel.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
