<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/libata.h, branch v3.14.33</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.14.33</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v3.14.33'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2014-07-31T19:52:54Z</updated>
<entry>
<title>libata: introduce ata_host-&gt;n_tags to avoid oops on SAS controllers</title>
<updated>2014-07-31T19:52:54Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-07-23T13:05:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=d073bb25909b610b3fd986fe87752120c4e6f04b'/>
<id>urn:sha1:d073bb25909b610b3fd986fe87752120c4e6f04b</id>
<content type='text'>
commit 1a112d10f03e83fb3a2fdc4c9165865dec8a3ca6 upstream.

1871ee134b73 ("libata: support the ata host which implements a queue
depth less than 32") directly used ata_port-&gt;scsi_host-&gt;can_queue from
ata_qc_new() to determine the number of tags supported by the host;
unfortunately, SAS controllers doing SATA don't initialize -&gt;scsi_host
leading to the following oops.

 BUG: unable to handle kernel NULL pointer dereference at 0000000000000058
 IP: [&lt;ffffffff814e0618&gt;] ata_qc_new_init+0x188/0x1b0
 PGD 0
 Oops: 0002 [#1] SMP
 Modules linked in: isci libsas scsi_transport_sas mgag200 drm_kms_helper ttm
 CPU: 1 PID: 518 Comm: udevd Not tainted 3.16.0-rc6+ #62
 Hardware name: Intel Corporation S2600CO/S2600CO, BIOS SE5C600.86B.02.02.0002.122320131210 12/23/2013
 task: ffff880c1a00b280 ti: ffff88061a000000 task.ti: ffff88061a000000
 RIP: 0010:[&lt;ffffffff814e0618&gt;]  [&lt;ffffffff814e0618&gt;] ata_qc_new_init+0x188/0x1b0
 RSP: 0018:ffff88061a003ae8  EFLAGS: 00010012
 RAX: 0000000000000001 RBX: ffff88000241ca80 RCX: 00000000000000fa
 RDX: 0000000000000020 RSI: 0000000000000020 RDI: ffff8806194aa298
 RBP: ffff88061a003ae8 R08: ffff8806194a8000 R09: 0000000000000000
 R10: 0000000000000000 R11: ffff88000241ca80 R12: ffff88061ad58200
 R13: ffff8806194aa298 R14: ffffffff814e67a0 R15: ffff8806194a8000
 FS:  00007f3ad7fe3840(0000) GS:ffff880627620000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: 0000000000000058 CR3: 000000061a118000 CR4: 00000000001407e0
 Stack:
  ffff88061a003b20 ffffffff814e96e1 ffff88000241ca80 ffff88061ad58200
  ffff8800b6bf6000 ffff880c1c988000 ffff880619903850 ffff88061a003b68
  ffffffffa0056ce1 ffff88061a003b48 0000000013d6e6f8 ffff88000241ca80
 Call Trace:
  [&lt;ffffffff814e96e1&gt;] ata_sas_queuecmd+0xa1/0x430
  [&lt;ffffffffa0056ce1&gt;] sas_queuecommand+0x191/0x220 [libsas]
  [&lt;ffffffff8149afee&gt;] scsi_dispatch_cmd+0x10e/0x300 [&lt;ffffffff814a3bc5&gt;] scsi_request_fn+0x2f5/0x550
  [&lt;ffffffff81317613&gt;] __blk_run_queue+0x33/0x40
  [&lt;ffffffff8131781a&gt;] queue_unplugged+0x2a/0x90
  [&lt;ffffffff8131ceb4&gt;] blk_flush_plug_list+0x1b4/0x210
  [&lt;ffffffff8131d274&gt;] blk_finish_plug+0x14/0x50
  [&lt;ffffffff8117eaa8&gt;] __do_page_cache_readahead+0x198/0x1f0
  [&lt;ffffffff8117ee21&gt;] force_page_cache_readahead+0x31/0x50
  [&lt;ffffffff8117ee7e&gt;] page_cache_sync_readahead+0x3e/0x50
  [&lt;ffffffff81172ac6&gt;] generic_file_read_iter+0x496/0x5a0
  [&lt;ffffffff81219897&gt;] blkdev_read_iter+0x37/0x40
  [&lt;ffffffff811e307e&gt;] new_sync_read+0x7e/0xb0
  [&lt;ffffffff811e3734&gt;] vfs_read+0x94/0x170
  [&lt;ffffffff811e43c6&gt;] SyS_read+0x46/0xb0
  [&lt;ffffffff811e33d1&gt;] ? SyS_lseek+0x91/0xb0
  [&lt;ffffffff8171ee29&gt;] system_call_fastpath+0x16/0x1b
 Code: 00 00 00 88 50 29 83 7f 08 01 19 d2 83 e2 f0 83 ea 50 88 50 34 c6 81 1d 02 00 00 40 c6 81 17 02 00 00 00 5d c3 66 0f 1f 44 00 00 &lt;89&gt; 14 25 58 00 00 00

Fix it by introducing ata_host-&gt;n_tags which is initialized to
ATA_MAX_QUEUE - 1 in ata_host_init() for SAS controllers and set to
scsi_host_template-&gt;can_queue in ata_host_register() for !SAS ones.
As SAS hosts are never registered, this will give them the same
ATA_MAX_QUEUE - 1 as before.  Note that we can't use
scsi_host-&gt;can_queue directly for SAS hosts anyway as they can go
higher than the libata maximum.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-by: Mike Qiu &lt;qiudayu@linux.vnet.ibm.com&gt;
Reported-by: Jesse Brandeburg &lt;jesse.brandeburg@gmail.com&gt;
Reported-by: Peter Hurley &lt;peter@hurleysoftware.com&gt;
Reported-by: Peter Zijlstra &lt;peterz@infradead.org&gt;
Tested-by: Alexey Kardashevskiy &lt;aik@ozlabs.ru&gt;
Fixes: 1871ee134b73 ("libata: support the ata host which implements a queue depth less than 32")
Cc: Kevin Hao &lt;haokexin@gmail.com&gt;
Cc: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>libata/ahci: accommodate tag ordered controllers</title>
<updated>2014-05-13T11:32:51Z</updated>
<author>
<name>Dan Williams</name>
<email>dan.j.williams@intel.com</email>
</author>
<published>2014-04-17T18:48:21Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=5c295064496bf06df2475f1046e47a5fedf7c3ea'/>
<id>urn:sha1:5c295064496bf06df2475f1046e47a5fedf7c3ea</id>
<content type='text'>
commit 8a4aeec8d2d6a3edeffbdfae451cdf05cbf0fefd upstream.

The AHCI spec allows implementations to issue commands in tag order
rather than FIFO order:

	5.3.2.12 P:SelectCmd
	HBA sets pSlotLoc = (pSlotLoc + 1) mod (CAP.NCS + 1)
	or HBA selects the command to issue that has had the
	PxCI bit set to '1' longer than any other command
	pending to be issued.

The result is that commands posted sequentially (time-wise) may play out
of sequence when issued by hardware.

This behavior has likely been hidden by drives that arrange for commands
to complete in issue order.  However, it appears recent drives (two from
different vendors that we have found so far) inflict out-of-order
completions as a matter of course.  So, we need to take care to maintain
ordered submission, otherwise we risk triggering a drive to fall out of
sequential-io automation and back to random-io processing, which incurs
large latency and degrades throughput.

This issue was found in simple benchmarks where QD=2 seq-write
performance was 30-50% *greater* than QD=32 seq-write performance.

Tagging for -stable and making the change globally since it has a low
risk-to-reward ratio.  Also, word is that recent versions of an unnamed
OS also does it this way now.  So, drives in the field are already
experienced with this tag ordering scheme.

Cc: Dave Jiang &lt;dave.jiang@intel.com&gt;
Cc: Ed Ciechanowski &lt;ed.ciechanowski@intel.com&gt;
Reviewed-by: Matthew Wilcox &lt;matthew.r.wilcox@intel.com&gt;
Signed-off-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;

</content>
</entry>
<entry>
<title>libata: disable LPM for some WD SATA-I devices</title>
<updated>2014-01-16T14:49:10Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2014-01-16T14:47:17Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ecd75ad514d73efc1bbcc5f10a13566c3ace5f53'/>
<id>urn:sha1:ecd75ad514d73efc1bbcc5f10a13566c3ace5f53</id>
<content type='text'>
For some reason, some early WD drives spin up and down drives
erratically when the link is put into slumber mode which can reduce
the life expectancy of the device significantly.  Unfortunately, we
don't have full list of devices and given the nature of the issue it'd
be better to err on the side of false positives than the other way
around.  Let's disable LPM on all WD devices which match one of the
known problematic model prefixes and are SATA-I.

As horkage list doesn't support matching SATA capabilities, this is
implemented as two horkages - WD_BROKEN_LPM and NOLPM.  The former is
set for the known prefixes and sets the latter if the matched device
is SATA-I.

Note that this isn't optimal as this disables all LPM operations and
partial link power state reportedly works fine on these; however, the
way LPM is implemented in libata makes it difficult to precisely map
libata LPM setting to specific link power state.  Well, these devices
are already fairly outdated.  Let's just disable whole LPM for now.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-and-tested-by: Nikos Barkas &lt;levelwol@gmail.com&gt;
Reported-and-tested-by: Ioannis Barkas &lt;risc4all@yahoo.com&gt;
References: https://bugzilla.kernel.org/show_bug.cgi?id=57211
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>libata: implement ATA_HORKAGE_NO_NCQ_TRIM and apply it to Micro M500 SSDs</title>
<updated>2013-12-17T12:03:14Z</updated>
<author>
<name>Marc Carino</name>
<email>marc.ceeeee@gmail.com</email>
</author>
<published>2013-12-17T02:15:53Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f78dea064c5f7de07de4912a6e5136dbc443d614'/>
<id>urn:sha1:f78dea064c5f7de07de4912a6e5136dbc443d614</id>
<content type='text'>
Certain drives cannot handle queued TRIM commands properly, even
though support is indicated in the IDENTIFY DEVICE buffer.  This patch
allows for disabling the commands for the affected drives and apply it
to the Micron/Crucial M500 SSDs which exhibit incorrect protocol
behavior when issued queued TRIM commands, which could lead to silent
data corruption.

tj: Merged two unnecessarily split patches and made minor edits
    including shortening horkage name.

Signed-off-by: Marc Carino &lt;marc.ceeeee@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Link: http://lkml.kernel.org/g/1387246554-7311-1-git-send-email-marc.ceeeee@gmail.com
Cc: stable@vger.kernel.org # 3.12+
</content>
</entry>
<entry>
<title>libata: Add support for queued DSM TRIM</title>
<updated>2013-08-25T13:39:12Z</updated>
<author>
<name>Marc Carino</name>
<email>marc.ceeeee@gmail.com</email>
</author>
<published>2013-08-25T06:22:51Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=87fb6c31b9ef9ccab9a822b01fc3911f026a29bb'/>
<id>urn:sha1:87fb6c31b9ef9ccab9a822b01fc3911f026a29bb</id>
<content type='text'>
Some new SSDs support the queued version of the DSM TRIM command.
Let the driver use the new command if supported.

Signed-off-by: Marc Carino &lt;marc.ceeeee@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>libata: Add support for SEND/RECEIVE FPDMA QUEUED</title>
<updated>2013-08-25T13:39:12Z</updated>
<author>
<name>Marc Carino</name>
<email>marc.ceeeee@gmail.com</email>
</author>
<published>2013-08-25T06:22:50Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ed36911c747c18525691c0aa0fbe6b918c8eac19'/>
<id>urn:sha1:ed36911c747c18525691c0aa0fbe6b918c8eac19</id>
<content type='text'>
Add support for the following ATA opcodes, which are present
in SATA 3.1 and T13 ATA ACS-3:

        SEND FPDMA QUEUED
        RECEIVE FPDMA QUEUED

Signed-off-by: Marc Carino &lt;marc.ceeeee@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>libata: Add H2D FIS "auxiliary" port flag</title>
<updated>2013-08-25T13:39:12Z</updated>
<author>
<name>Marc Carino</name>
<email>marc.ceeeee@gmail.com</email>
</author>
<published>2013-08-25T06:22:49Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=40fb59e75ad197a1c4ca2fbccef85432d8d103f8'/>
<id>urn:sha1:40fb59e75ad197a1c4ca2fbccef85432d8d103f8</id>
<content type='text'>
Add a new port flag, ATA_FLAG_FPDMA_AUX, used to indicate
support for transmission of the H2D FIS 'auxiliary' field.

Signed-off-by: Marc Carino &lt;marc.ceeeee@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>libata: Populate host-to-device FIS "auxiliary" field</title>
<updated>2013-08-25T13:39:11Z</updated>
<author>
<name>Marc Carino</name>
<email>marc.ceeeee@gmail.com</email>
</author>
<published>2013-08-25T06:22:48Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=8be5ad9acb7c11b9d717bcdbe3d6de0dab081a39'/>
<id>urn:sha1:8be5ad9acb7c11b9d717bcdbe3d6de0dab081a39</id>
<content type='text'>
SATA 3.1 added an "auxiliary" field to the host-to-device FIS.
Populate the host-to-device FIS with the new field via the
taskfile struct.

Signed-off-by: Marc Carino &lt;marc.ceeeee@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>ata: acpi: rework the ata acpi bind support</title>
<updated>2013-08-23T16:09:23Z</updated>
<author>
<name>Aaron Lu</name>
<email>aaron.lu@intel.com</email>
</author>
<published>2013-08-23T02:17:54Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f1bc1e4c44b1b78fe34431936c60759b5aad5e3f'/>
<id>urn:sha1:f1bc1e4c44b1b78fe34431936c60759b5aad5e3f</id>
<content type='text'>
Binding ACPI handle to SCSI device has several drawbacks, namely:
1 During ATA device initialization time, ACPI handle will be needed
  while SCSI devices are not created yet. So each time ACPI handle is
  needed, instead of retrieving the handle by ACPI_HANDLE macro,
  a namespace scan is performed to find the handle for the corresponding
  ATA device. This is inefficient, and also expose a restriction on
  calling path not holding any lock.
2 The binding to SCSI device tree makes code complex, while at the same
  time doesn't bring us any benefit. All ACPI handlings are still done
  in ATA module, not in SCSI.

Rework the ATA ACPI binding code to bind ACPI handle to ATA transport
devices(ATA port and ATA device). The binding needs to be done only once,
since the ATA transport devices do not go away with hotplug. And due to
this, the flush_work call in hotplug handler for ATA bay is no longer
needed.

Tested on an Intel test platform for binding and runtime power off for
ODD(ZPODD) and hard disk; on an ASUS S400C for binding and normal boot
and S3, where its SATA port node has _SDD and _GTF control methods when
configured as an AHCI controller and its PATA device node has _GTF
control method when configured as an IDE controller. SATA PMP binding
and ATA hotplug is not tested.

Signed-off-by: Aaron Lu &lt;aaron.lu@intel.com&gt;
Tested-by: Dirk Griesbach &lt;spamthis@freenet.de&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>libata: move 'struct ata_taskfile' and friends from ata.h to libata.h</title>
<updated>2013-07-16T11:46:56Z</updated>
<author>
<name>Sergei Shtylyov</name>
<email>sshtylyov@ru.mvista.com</email>
</author>
<published>2013-06-30T20:01:32Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dc34e7e1a701134c2639dc7af78dc91055616477'/>
<id>urn:sha1:dc34e7e1a701134c2639dc7af78dc91055616477</id>
<content type='text'>
Move 'struct ata_taskfile', ata_prot_flags() and their friends from
&lt;linux/ata.h&gt; to &lt;linux/libata.h&gt;. They were misplaced from the beginning,  as
&lt;linux/ata.h&gt; should cover ATA/ATAPI and related standards only -- to which the
aforementioned structure and function have only remote relation.

I would have moved 'enum ata_tf_protocols' closely related to 'struct
ata_taskfile' but it unfortunately gets used by 'drivers/ide/ide-ioctls.c'...

Signed-off-by: Sergei Shtylyov &lt;sshtylyov@ru.mvista.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
</feed>
