<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/drivers/scsi/libsas, branch v3.4.78</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.78</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.4.78'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2013-12-12T06:34:10Z</updated>
<entry>
<title>SCSI: libsas: fix usage of ata_tf_to_fis</title>
<updated>2013-12-12T06:34:10Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2013-10-23T01:35:19Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=41bb75da07743ef39d7c1be4d8d53f83270f6762'/>
<id>urn:sha1:41bb75da07743ef39d7c1be4d8d53f83270f6762</id>
<content type='text'>
commit ae5fbae0ccd982dfca0ce363036ed92f5b13f150 upstream.

Since commit 110dd8f19df5 "[SCSI] libsas: fix scr_read/write users and
update the libata documentation" we have been passing pmp=1 and is_cmd=0
to ata_tf_to_fis().  Praveen reports that eSATA attached drives do not
discover correctly.  His investigation found that the BIOS was passing
pmp=0 while Linux was passing pmp=1 and failing to discover the drives.
Update libsas to follow the libata example of pulling the pmp setting
from the ata_link and correct is_cmd to be 1 since all tf's submitted
through -&gt;qc_issue are commands.  Presumably libsas lldds do not care
about is_cmd as they have sideband mechanisms to perform link
management.

http://marc.info/?l=linux-scsi&amp;m=138179681726990

[jejb: checkpatch fix]
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Reported-by: Praveen Murali &lt;pmurali@logicube.com&gt;
Tested-by: Praveen Murali &lt;pmurali@logicube.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>SCSI: libsas: fix handling vacant phy in sas_set_ex_phy()</title>
<updated>2013-04-17T04:27:26Z</updated>
<author>
<name>Lukasz Dorau</name>
<email>lukasz.dorau@intel.com</email>
</author>
<published>2013-04-03T08:27:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b7dba0e4be51d0924af476456d2cb0f903e8aa77'/>
<id>urn:sha1:b7dba0e4be51d0924af476456d2cb0f903e8aa77</id>
<content type='text'>
commit d4a2618fa77b5e58ec15342972bd3505a1c3f551 upstream.

If a result of the SMP discover function is PHY VACANT,
the content of discover response structure (dr) is not valid.
It sometimes happens that dr-&gt;attached_sas_addr can contain
even SAS address of other phy. In such case an invalid phy
is created, what causes NULL pointer dereference during
destruction of expander's phys.

So if a result of SMP function is PHY VACANT, the content of discover
response structure (dr) must not be copied to phy structure.

This patch fixes the following bug:

BUG: unable to handle kernel NULL pointer dereference at 0000000000000030
IP: [&lt;ffffffff811c9002&gt;] sysfs_find_dirent+0x12/0x90
Call Trace:
  [&lt;ffffffff811c95f5&gt;] sysfs_get_dirent+0x35/0x80
  [&lt;ffffffff811cb55e&gt;] sysfs_unmerge_group+0x1e/0xb0
  [&lt;ffffffff813329f4&gt;] dpm_sysfs_remove+0x24/0x90
  [&lt;ffffffff8132b0f4&gt;] device_del+0x44/0x1d0
  [&lt;ffffffffa016fc59&gt;] sas_rphy_delete+0x9/0x20 [scsi_transport_sas]
  [&lt;ffffffffa01a16f6&gt;] sas_destruct_devices+0xe6/0x110 [libsas]
  [&lt;ffffffff8107ac7c&gt;] process_one_work+0x16c/0x350
  [&lt;ffffffff8107d84a&gt;] worker_thread+0x17a/0x410
  [&lt;ffffffff81081b76&gt;] kthread+0x96/0xa0
  [&lt;ffffffff81464944&gt;] kernel_thread_helper+0x4/0x10

Signed-off-by: Lukasz Dorau &lt;lukasz.dorau@intel.com&gt;
Signed-off-by: Pawel Baldysiak &lt;pawel.baldysiak@intel.com&gt;
Reviewed-by: Maciej Patelczyk &lt;maciej.patelczyk@intel.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>SCSI: libsas: fix sas_discover_devices return code handling</title>
<updated>2012-08-09T15:31:27Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2012-06-22T06:36:20Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=1c06102701a00d42f2c690d97cc2203d561ea6a4'/>
<id>urn:sha1:1c06102701a00d42f2c690d97cc2203d561ea6a4</id>
<content type='text'>
commit b17caa174a7e1fd2e17b26e210d4ee91c4c28b37 upstream.

commit 198439e4 [SCSI] libsas: do not set res = 0 in sas_ex_discover_dev()
commit 19252de6 [SCSI] libsas: fix wide port hotplug issues

The above commits seem to have confused the return value of
sas_ex_discover_dev which is non-zero on failure and
sas_ex_join_wide_port which just indicates short circuiting discovery on
already established ports.  The result is random discovery failures
depending on configuration.

Calls to sas_ex_join_wide_port are the source of the trouble as its
return value is errantly assigned to 'res'.  Convert it to bool and stop
returning its result up the stack.

Tested-by: Dan Melnic &lt;dan.melnic@amd.com&gt;
Reported-by: Dan Melnic &lt;dan.melnic@amd.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Reviewed-by: Jack Wang &lt;jack_wang@usish.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>SCSI: libsas: continue revalidation</title>
<updated>2012-08-09T15:31:27Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2012-06-22T06:36:15Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=de0449fd59c6c6a9a523c625a014c8d8cd73810f'/>
<id>urn:sha1:de0449fd59c6c6a9a523c625a014c8d8cd73810f</id>
<content type='text'>
commit 26f2f199ff150d8876b2641c41e60d1c92d2fb81 upstream.

Continue running revalidation until no more broadcast devices are
discovered.  Fixes cases where re-discovery completes too early in a
domain with multiple expanders with pending re-discovery events.
Servicing BCNs can get backed up behind error recovery.

Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>SCSI: libsas: fix taskfile corruption in sas_ata_qc_fill_rtf</title>
<updated>2012-07-16T16:04:37Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2012-06-22T17:52:34Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=76c6b958de9e72947ef08b1c9509f094c34abd8f'/>
<id>urn:sha1:76c6b958de9e72947ef08b1c9509f094c34abd8f</id>
<content type='text'>
commit 6ef1b512f4e6f936d89aa20be3d97a7ec7c290ac upstream.

fill_result_tf() grabs the taskfile flags from the originating qc which
sas_ata_qc_fill_rtf() promptly overwrites.  The presence of an
ata_taskfile in the sata_device makes it tempting to just copy the full
contents in sas_ata_qc_fill_rtf().  However, libata really only wants
the fis contents and expects the other portions of the taskfile to not
be touched by -&gt;qc_fill_rtf.  To that end store a fis buffer in the
sata_device and use ata_tf_from_fis() like every other -&gt;qc_fill_rtf()
implementation.

Reported-by: Praveen Murali &lt;pmurali@logicube.com&gt;
Tested-by: Praveen Murali &lt;pmurali@logicube.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>[SCSI] Revert "[SCSI] libsas: fix sas port naming"</title>
<updated>2012-04-23T11:15:53Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2012-04-20T06:48:12Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b4698d88585e23d815506f7f38c48192d944b2eb'/>
<id>urn:sha1:b4698d88585e23d815506f7f38c48192d944b2eb</id>
<content type='text'>
This reverts commit a692b0eec5efae382dfa800e8b4b083f172921a7.

Tom reports:

[    8.741033] ------------[ cut here ]------------
[    8.741038] WARNING: at fs/sysfs/dir.c:508 sysfs_add_one+0xc1/0xf0()
[    8.741040] Hardware name: To Be Filled By O.E.M.
[    8.741041] sysfs: cannot create duplicate filename

...and missing 2 out of 4 drives connected to mvsas.  Commit a692b0ee
made the assumption that all the phy ids an lldd registers to libsas are
unique.  However, in the "multi-chip" case mvsas does a rather annoying
duplication of phy ids in the array passed to libsas.  So, for example,
chip0 has phy0-3 at ha phy index 0-3 and chip1 has its phy0-3 at ha phy
index 4-7.  The more natural model would be to create a scsi_host (and
sas_ha) per chip (controller), but for now revert the naming fix which
unfortunately means dealing with unpredictable end-device names for a
bit longer.

Cc: Xiangliang Yu &lt;yuxiangl@marvell.com&gt;
Cc: Patrick Thomson &lt;patrick.s.thomson@intel.com&gt;
Reported-by: Tom Rini &lt;trini@ti.com&gt;
Tested-by: Tom Rini &lt;trini@ti.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>
</entry>
<entry>
<title>[SCSI] libsas: fix false positive 'device attached' conditions</title>
<updated>2012-04-23T11:14:09Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2012-03-20T17:50:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7d1d865181185bdf1316d236b1b4bd02c9020729'/>
<id>urn:sha1:7d1d865181185bdf1316d236b1b4bd02c9020729</id>
<content type='text'>
Normalize phy-&gt;attached_sas_addr to return a zero-address in the case
when device-type == NO_DEVICE or the linkrate is invalid to handle
expanders that put non-zero sas addresses in the discovery response:

 sas: ex 5001b4da000f903f phy02:U:0 attached: 0100000000000000 (no device)
 sas: ex 5001b4da000f903f phy01:U:0 attached: 0100000000000000 (no device)
 sas: ex 5001b4da000f903f phy03:U:0 attached: 0100000000000000 (no device)
 sas: ex 5001b4da000f903f phy00:U:0 attached: 0100000000000000 (no device)

Reported-by: Andrzej Jakowski &lt;andrzej.jakowski@intel.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Cc: stable@vger.kernel.org
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] libsas, libata: fix start of life for a sas ata_port</title>
<updated>2012-04-23T11:11:47Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2012-03-22T04:09:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=b2024459252a9d2d312ee562f86f332a1498f412'/>
<id>urn:sha1:b2024459252a9d2d312ee562f86f332a1498f412</id>
<content type='text'>
This changes the ordering of initialization and probing events from:
  1/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
  2/ allocate ata_port and schedule port probe in DISCE_PROBE
...to:
  1/ allocate ata_port in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
  2/ allocate rphy in PORTE_BYTES_DMAED, DISCE_REVALIDATE_DOMAIN
  3/ schedule port probe in DISCE_PROBE

This ordering prevents PHYE_SIGNAL_LOSS_EVENTS from sneaking in to
destrory ata devices before they have been fully initialized:

  BUG: unable to handle kernel paging request at 0000000000003b10
  IP: [&lt;ffffffffa0053d7e&gt;] sas_ata_end_eh+0x12/0x5e [libsas]
  ...
  [&lt;ffffffffa004d1af&gt;] sas_unregister_common_dev+0x78/0xc9 [libsas]
  [&lt;ffffffffa004d4d4&gt;] sas_unregister_dev+0x4f/0xad [libsas]
  [&lt;ffffffffa004d5b1&gt;] sas_unregister_domain_devices+0x7f/0xbf [libsas]
  [&lt;ffffffffa004c487&gt;] sas_deform_port+0x61/0x1b8 [libsas]
  [&lt;ffffffffa004bed0&gt;] sas_phye_loss_of_signal+0x29/0x2b [libsas]

...and kills the awkward "sata domain_device briefly existing in the
domain without an ata_port" state.

Reported-by: Michal Kosciowski &lt;michal.kosciowski@intel.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Acked-by: Jeff Garzik &lt;jgarzik@redhat.com&gt;
Signed-off-by: James Bottomley &lt;JBottomley@Parallels.com&gt;
</content>
</entry>
<entry>
<title>[SCSI] libsas: fix ata_eh clobbering ex_phys via smp_ata_check_ready</title>
<updated>2012-04-23T11:10:34Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2012-03-20T20:24:29Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0f3fce5cc77e1f35758ef0e46a989e76e5046a7b'/>
<id>urn:sha1:0f3fce5cc77e1f35758ef0e46a989e76e5046a7b</id>
<content type='text'>
The check_ready implementation in the expander-attached ata device case
polls on sas_ex_phy_discover().  The effect is that the ex_phy fields
(critically -&gt;attached_sas_addr) can change.  When ata_eh ends and
libsas comes along to revalidate the domain
sas_unregister_devs_sas_addr() can fail to lookup devices to remove, or
fail to re-add an ata device that ata_eh marked as disabled.  So change
the code to skip the sas_address and change count updates when ata_eh is
active.

Cc: Jack Wang &lt;jack_wang@usish.com&gt;
Tested-by: Maciej Patelczyk &lt;maciej.patelczyk@intel.com&gt;
Tested-by: Bartek Nowakowski &lt;bartek.nowakowski@intel.com&gt;
Tested-by: Jacek Danecki &lt;jacek.danecki@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>
</entry>
<entry>
<title>[SCSI] libsas: unify domain_device sas_rphy lifetimes</title>
<updated>2012-04-23T11:08:56Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2012-03-20T17:53:24Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=9487669fc225092cf315e1291ece28e23e6754f3'/>
<id>urn:sha1:9487669fc225092cf315e1291ece28e23e6754f3</id>
<content type='text'>
Since the domain_device can out live the scsi_target we need the rphy to
follow suit otherwise we run into issues like:

  BUG: unable to handle kernel NULL pointer dereference at 0000000000000050
  IP: [&lt;ffffffffa011561b&gt;] sas_ata_printk+0x43/0x6f [libsas]
  PGD 0
  Oops: 0000 [#1] SMP
  CPU 1
  Modules linked in: ses enclosure isci libsas scsi_transport_sas fuse sunrpc cpufreq_ondemand acpi_cpufreq freq_table mperf microcode pcspkr igb joydev iTCO_wdt ioatdma iTCO_vendor_support i2c_i801 i2c_core dca wmi hed ipv6 pata_acpi ata_generic [last unloaded: scsi_wait_scan]

  Pid: 129, comm: kworker/u:3 Not tainted 3.3.0-rc5-isci+ #1 Intel Corporation SandyBridge Platform/To be filled by O.E.M.
  RIP: 0010:[&lt;ffffffffa011561b&gt;] [&lt;ffffffffa011561b&gt;] sas_ata_printk+0x43/0x6f [libsas]
  RSP: 0018:ffff88042232dd70 EFLAGS: 00010282
  RAX: 0000000000000000 RBX: ffff8804283165b8 RCX: ffff88042232dda0
  RDX: ffff88042232dd78 RSI: ffff8804283165b8 RDI: ffffffffa01188d7
  RBP: ffff88042232ddd0 R08: ffff880388454000 R09: ffff8803edfde1f8
  R10: ffff8803edfde1f8 R11: ffff8803edfde1f8 R12: ffff880428316750
  R13: ffff880388454000 R14: ffff8803f88b31d0 R15: ffff8803f8b21d50
  FS: 0000000000000000(0000) GS:ffff88042ee20000(0000) knlGS:0000000000000000
  CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
  CR2: 0000000000000050 CR3: 0000000001a05000 CR4: 00000000000406e0
  DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
  DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
  Process kworker/u:3 (pid: 129, threadinfo ffff88042232c000, task ffff88042230c920)
  Stack:
  0000000000000000 ffff880400000018 ffff88042232dde0 ffff88042232dda0
  ffffffffa01188c4 ffff88042ee93af0 ffff88042232ddb0 ffffffff8100e047
  ffff88042232de10 ffff880420e5a2c8 ffff8803f8b21d50 ffff8803edfde1f8
  Call Trace:
  [&lt;ffffffff8100e047&gt;] ? load_TLS+0xb/0xf
  [&lt;ffffffffa01156ad&gt;] async_sas_ata_eh+0x66/0x95 [libsas]
  [&lt;ffffffff810655e1&gt;] async_run_entry_fn+0x9e/0x131

Reported-by: Tom Jackson &lt;thomas.p.jackson@intel.com&gt;
Tested-by: Tom Jackson &lt;thomas.p.jackson@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>
</entry>
</feed>
