<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/scsi/hisi_sas, branch v4.9.57</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: hisi_sas: send three identify before phy up</title>
<updated>2016-09-14T16:54:18+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9c81e2cf7b9f4f0a806abb8d59736246b1b79708'/>
<id>9c81e2cf7b9f4f0a806abb8d59736246b1b79708</id>
<content type='text'>
When the v2 hw is attached with many disks through an expander, there
may be OOB reset resulting in a PHY going down after the speed is
negotiated (very low probability).

This issue is resolved by modifying the link control registers to send
three identify frames before the PHY is ready (according to 6.10.3.3.2
in SAS 3.0 spec) and close ready when the PHY is down.

Signed-off-by: NengLong Zhao &lt;zhaonenglong@hisilicon.com&gt;
Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the v2 hw is attached with many disks through an expander, there
may be OOB reset resulting in a PHY going down after the speed is
negotiated (very low probability).

This issue is resolved by modifying the link control registers to send
three identify frames before the PHY is ready (according to 6.10.3.3.2
in SAS 3.0 spec) and close ready when the PHY is down.

Signed-off-by: NengLong Zhao &lt;zhaonenglong@hisilicon.com&gt;
Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: hisi_sas: add missing SATA pending device type to v2 hw</title>
<updated>2016-09-14T16:54:18+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=56cc74b9999ff0059007626ef8fab031033a166b'/>
<id>56cc74b9999ff0059007626ef8fab031033a166b</id>
<content type='text'>
In setup_itct_v2_hw(), SATA device type SAS_SATA_PENDING is missing, so
add it.

Note: The HiSi SAS controller does not support SATA PM, so do not handle
SAS_SATA_PM_PORT or SAS_SATA_PM.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In setup_itct_v2_hw(), SATA device type SAS_SATA_PENDING is missing, so
add it.

Note: The HiSi SAS controller does not support SATA PM, so do not handle
SAS_SATA_PM_PORT or SAS_SATA_PM.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: hisi_sas: remove init_id_frame_v1_hw()</title>
<updated>2016-09-14T16:54:18+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8583d3b5b09f08a5b970489cc34a268f500a4a3d'/>
<id>8583d3b5b09f08a5b970489cc34a268f500a4a3d</id>
<content type='text'>
Function config_id_frame_v1_hw() is called twice for each PHY during
initialisation, which is unneeded.

So remove init_id_frame_v1_hw(), which only calls
config_id_frame_v1_hw().

We will keep the call to config_id_frame_v1_hw() in start_phy_v1_hw()
since it will be used for PHY reset functions.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Function config_id_frame_v1_hw() is called twice for each PHY during
initialisation, which is unneeded.

So remove init_id_frame_v1_hw(), which only calls
config_id_frame_v1_hw().

We will keep the call to config_id_frame_v1_hw() in start_phy_v1_hw()
since it will be used for PHY reset functions.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: hisi_sas: remove init_id_frame_v2_hw()</title>
<updated>2016-09-14T16:54:18+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=514f16e36b8cb7852fc388faeaccea125884a3cd'/>
<id>514f16e36b8cb7852fc388faeaccea125884a3cd</id>
<content type='text'>
Function config_id_frame_v2_hw() is called twice for each PHY during
initialisation, which is unneeded.

So remove init_id_frame_v2_hw(), which only calls
config_id_frame_v2_hw().

We will keep the call to config_id_frame_v2_hw() in start_phy_v2_hw()
since it will be used for PHY reset functions.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Function config_id_frame_v2_hw() is called twice for each PHY during
initialisation, which is unneeded.

So remove init_id_frame_v2_hw(), which only calls
config_id_frame_v2_hw().

We will keep the call to config_id_frame_v2_hw() in start_phy_v2_hw()
since it will be used for PHY reset functions.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: hisi_sas: fix HBA SAS addr endianness for v1 hw</title>
<updated>2016-09-14T16:54:18+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=44c4abe08f224817747795fb8d0677888166e4cd'/>
<id>44c4abe08f224817747795fb8d0677888166e4cd</id>
<content type='text'>
The endianness for the SAS address in the TX_ID_DWORD registers is set
incorrectly.  We see errors like this in the boot log for v2 hw (which
would have the same issue as v1 hw):

[    7.583284] sas: target proto 0x0 at 50000d1108e7923f:0x1f not handled

This is due to the host SAS addr not matching the PHY SAS addr in the
expander host-attached phy discovery responses.

To fix, we byte swap the SAS addr from BE to LE (which is the endianness
of the SAS controller).

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The endianness for the SAS address in the TX_ID_DWORD registers is set
incorrectly.  We see errors like this in the boot log for v2 hw (which
would have the same issue as v1 hw):

[    7.583284] sas: target proto 0x0 at 50000d1108e7923f:0x1f not handled

This is due to the host SAS addr not matching the PHY SAS addr in the
expander host-attached phy discovery responses.

To fix, we byte swap the SAS addr from BE to LE (which is the endianness
of the SAS controller).

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: hisi_sas: fix HBA SAS addr endianness for v2 hw</title>
<updated>2016-09-14T16:54:18+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d82debecf29b4d89e2d17a52dc32c745ba97c999'/>
<id>d82debecf29b4d89e2d17a52dc32c745ba97c999</id>
<content type='text'>
The endianness for the SAS address in the TX_ID_DWORD registers is set
incorrectly.  We see errors like this in the boot log:

[    7.583284] sas: target proto 0x0 at 50000d1108e7923f:0x1f not handled

This is due to the host SAS addr not matching the PHY SAS addr in the
expander host-attached phy discovery responses.

To fix, we byte swap the SAS addr from BE to LE (which is the endianness
of the SAS controller).

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The endianness for the SAS address in the TX_ID_DWORD registers is set
incorrectly.  We see errors like this in the boot log:

[    7.583284] sas: target proto 0x0 at 50000d1108e7923f:0x1f not handled

This is due to the host SAS addr not matching the PHY SAS addr in the
expander host-attached phy discovery responses.

To fix, we byte swap the SAS addr from BE to LE (which is the endianness
of the SAS controller).

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: hisi_sas: set dma mask before allocate DMA memory</title>
<updated>2016-09-14T16:54:18+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a6f2c7fff90a6fe7a31e764a21b65a809fafa765'/>
<id>a6f2c7fff90a6fe7a31e764a21b65a809fafa765</id>
<content type='text'>
The device DMA mask was being set after the bulk of the DMA allocations
in the driver init, so potentially DMA allocates fail.  To resolve,
relocate before allocating the DMA memory when initialising the driver.

Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The device DMA mask was being set after the bulk of the DMA allocations
in the driver init, so potentially DMA allocates fail.  To resolve,
relocate before allocating the DMA memory when initialising the driver.

Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: hisi_sas: fix a potential warning for sata disk ejection</title>
<updated>2016-09-14T16:54:17+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=09fe9ecb18a7add9b05928151998692d96338e41'/>
<id>09fe9ecb18a7add9b05928151998692d96338e41</id>
<content type='text'>
If hisi_sas_task_prep() fails for a SATA device due to PHY down, we
return a failure to libata and also call task_done(), which will cause
ata_qc_complete() to be called twice: - first call from
hisi_sas_task_prep(), which will clear flag ATA_QCFLAG_ACTIVE -
ata_qc_complete() called from libata The warning call trace is as
follows:

[  117.070206] [&lt;ffff0000084f59b0&gt;] __ata_qc_complete+0xf4/0x11c
[  117.070208] [&lt;ffff0000084f5b58&gt;] ata_qc_complete+0x180/0x200
[  117.070210] [&lt;ffff0000084f5dd0&gt;] ata_qc_issue+0x110/0x354
[  117.070212] [&lt;ffff0000084f6254&gt;] ata_exec_internal_sg+0x240/0x4d0
[  117.070214] [&lt;ffff0000084f6544&gt;] ata_exec_internal+0x60/0xa0
[  117.070217] [&lt;ffff000008501580&gt;] ata_read_log_page+0x188/0x1b4
[  117.070218] [&lt;ffff0000085017dc&gt;] ata_eh_analyze_ncq_error+0xa8/0x274
[  117.070220] [&lt;ffff000008501a3c&gt;] ata_eh_link_autopsy+0x94/0x8c8
[  117.070222] [&lt;ffff0000085022a4&gt;] ata_eh_autopsy+0x34/0xe8
[  117.070223] [&lt;ffff00000850540c&gt;] ata_do_eh+0x28/0xc0
[  117.070225] [&lt;ffff0000085054e0&gt;] ata_std_error_handler+0x3c/0x84
[  117.070227] [&lt;ffff000008505140&gt;] ata_scsi_port_error_handler+0x480/0x674
[  117.070230] [&lt;ffff0000084e3020&gt;] async_sas_ata_eh+0x44/0x78
[  117.070231] [&lt;ffff0000080d6b8c&gt;] async_run_entry_fn+0x40/0x104
[  117.070234] [&lt;ffff0000080ce518&gt;] process_one_work+0x128/0x2f0
[  117.070235] [&lt;ffff0000080ce738&gt;] worker_thread+0x58/0x434
[  117.070237] [&lt;ffff0000080d416c&gt;] kthread+0xd4/0xe8
[  117.070240] [&lt;ffff000008084e10&gt;] ret_from_fork+0x10/0x40

The issue is resolved by simply returning a failure status code to the
upper layer.

Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
If hisi_sas_task_prep() fails for a SATA device due to PHY down, we
return a failure to libata and also call task_done(), which will cause
ata_qc_complete() to be called twice: - first call from
hisi_sas_task_prep(), which will clear flag ATA_QCFLAG_ACTIVE -
ata_qc_complete() called from libata The warning call trace is as
follows:

[  117.070206] [&lt;ffff0000084f59b0&gt;] __ata_qc_complete+0xf4/0x11c
[  117.070208] [&lt;ffff0000084f5b58&gt;] ata_qc_complete+0x180/0x200
[  117.070210] [&lt;ffff0000084f5dd0&gt;] ata_qc_issue+0x110/0x354
[  117.070212] [&lt;ffff0000084f6254&gt;] ata_exec_internal_sg+0x240/0x4d0
[  117.070214] [&lt;ffff0000084f6544&gt;] ata_exec_internal+0x60/0xa0
[  117.070217] [&lt;ffff000008501580&gt;] ata_read_log_page+0x188/0x1b4
[  117.070218] [&lt;ffff0000085017dc&gt;] ata_eh_analyze_ncq_error+0xa8/0x274
[  117.070220] [&lt;ffff000008501a3c&gt;] ata_eh_link_autopsy+0x94/0x8c8
[  117.070222] [&lt;ffff0000085022a4&gt;] ata_eh_autopsy+0x34/0xe8
[  117.070223] [&lt;ffff00000850540c&gt;] ata_do_eh+0x28/0xc0
[  117.070225] [&lt;ffff0000085054e0&gt;] ata_std_error_handler+0x3c/0x84
[  117.070227] [&lt;ffff000008505140&gt;] ata_scsi_port_error_handler+0x480/0x674
[  117.070230] [&lt;ffff0000084e3020&gt;] async_sas_ata_eh+0x44/0x78
[  117.070231] [&lt;ffff0000080d6b8c&gt;] async_run_entry_fn+0x40/0x104
[  117.070234] [&lt;ffff0000080ce518&gt;] process_one_work+0x128/0x2f0
[  117.070235] [&lt;ffff0000080ce738&gt;] worker_thread+0x58/0x434
[  117.070237] [&lt;ffff0000080d416c&gt;] kthread+0xd4/0xe8
[  117.070240] [&lt;ffff000008084e10&gt;] ret_from_fork+0x10/0x40

The issue is resolved by simply returning a failure status code to the
upper layer.

Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: hisi_sas: fix phy8 linkrate calculation in phy_up_v2_hw()</title>
<updated>2016-09-14T16:54:17+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=85bd6cf3be44602a85714ca61442c3b0666dbb62'/>
<id>85bd6cf3be44602a85714ca61442c3b0666dbb62</id>
<content type='text'>
In function phy_up_v2_hw(), we needlessly recalculate the phy linkrate
for all phys, and the calculation is incorrect for phy8, so remove this
code.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In function phy_up_v2_hw(), we needlessly recalculate the phy linkrate
for all phys, and the calculation is incorrect for phy8, so remove this
code.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Signed-off-by: Xiang Chen &lt;chenxiang66@hisilicon.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>scsi: hisi_sas: disable dlvry queues once at reset for v2 hw</title>
<updated>2016-09-14T16:54:17+00:00</updated>
<author>
<name>John Garry</name>
<email>john.garry@huawei.com</email>
</author>
<published>2016-09-06T15:36:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d0df8f9ad549b8dda643a518fc1907abdaf33976'/>
<id>d0df8f9ad549b8dda643a518fc1907abdaf33976</id>
<content type='text'>
The Delivery queue enable register should only be written to once at
reset for v2 hw.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The Delivery queue enable register should only be written to once at
reset for v2 hw.

Signed-off-by: John Garry &lt;john.garry@huawei.com&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</pre>
</div>
</content>
</entry>
</feed>
