<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/ata, branch v3.16</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v3.16</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.16'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2014-07-23T14:30:34Z</updated>
<entry>
<title>libata: introduce ata_host-&gt;n_tags to avoid oops on SAS controllers</title>
<updated>2014-07-23T14:30:34Z</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.shady.money/linux/commit/?id=1a112d10f03e83fb3a2fdc4c9165865dec8a3ca6'/>
<id>urn:sha1:1a112d10f03e83fb3a2fdc4c9165865dec8a3ca6</id>
<content type='text'>
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;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>ahci: add support for the Promise FastTrak TX8660 SATA HBA (ahci mode)</title>
<updated>2014-07-18T22:00:50Z</updated>
<author>
<name>Romain Degez</name>
<email>romain.degez@gmail.com</email>
</author>
<published>2014-07-11T16:08:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b32bfc06aefab61acc872dec3222624e6cd867ed'/>
<id>urn:sha1:b32bfc06aefab61acc872dec3222624e6cd867ed</id>
<content type='text'>
Add support of the Promise FastTrak TX8660 SATA HBA in ahci mode by
registering the board in the ahci_pci_tbl[].

Note: this HBA also provide a hardware RAID mode when activated in
BIOS but specific drivers from the manufacturer are required in this
case.

Signed-off-by: Romain Degez &lt;romain.degez@gmail.com&gt;
Tested-by: Romain Degez &lt;romain.degez@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>drivers/ata/pata_ep93xx.c: use signed int type for result of platform_get_irq()</title>
<updated>2014-07-17T12:36:13Z</updated>
<author>
<name>Andrey Utkin</name>
<email>andrey.krieger.utkin@gmail.com</email>
</author>
<published>2014-07-17T12:13:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=a2a9e02b5b67a7a32a14ab6c4c331a1a0c23a1db'/>
<id>urn:sha1:a2a9e02b5b67a7a32a14ab6c4c331a1a0c23a1db</id>
<content type='text'>
[linux-3.16-rc5/drivers/ata/pata_ep93xx.c:929]: (style) Checking if unsigned
variable 'irq' is less than zero.

Source code is

    irq = platform_get_irq(pdev, 0);
    if (irq &lt; 0) {

but

    unsigned int irq;

$ fgrep platform_get_irq `find . -name \*.h -print`
./include/linux/platform_device.h:extern int platform_get_irq(struct
platform_device *, unsigned int);

Now using "int" type instead of "unsigned int" for "irq" variable.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=80401
Reported-by: David Binderman &lt;dcb314@hotmail.com&gt;
Signed-off-by: Andrey Utkin &lt;andrey.krieger.utkin@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>libata: EH should handle AMNF error condition as a media error</title>
<updated>2014-07-15T15:13:57Z</updated>
<author>
<name>Alexey Asemov</name>
<email>alex@alex-at.ru</email>
</author>
<published>2014-07-15T06:28:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=eec7e1c16d2b65e38137686dd9b7e102c2150905'/>
<id>urn:sha1:eec7e1c16d2b65e38137686dd9b7e102c2150905</id>
<content type='text'>
libata-eh.c should handle AMNF error condition (error byte bit 0,
usually code 0x01) in libata-eh.c along with UNC as a media error so
SCSI stack can handle it properly (translation code 0x01 is already
present in libata-scsi.c) but was never passed down due to lack of
handling in EH.

While using linux-based machine (AMD 6550M-based notebook, PCI IDs for the
controller are 1022:7801 subsys 1025:059d) and ddrescue to salvage data
from failing hard drive (WD7500BPVT 2.5" 750G SATA2), I've found that pure
AMNF 0x01 error code generates generic "device error" that is retried
several times by SCSI stack instead of "media error" that is passed up to
software.

So we may assume deprecated AMNF error code is surely not dead yet, and
it's better for it to be handled properly. As we may see it is used by
modern enough devices, and used properly: drive returned AMNF only when IDs
for track cannot be read completely due to dying head or positioning,
otherwise it returned UNC(orrectables).

Not handling it causes wrong generic error code ("device error") reporting
down the stack, can damage failing drives further because of excessive
retries, and slows salvaging down a lot. Also, there is handling code in
libata-scsi.c for 0x01 AMNF error already.

https://bugzilla.kernel.org/show_bug.cgi?id=80031

tj: Shortened $SUBJ and moved its content to the first paragraph.

Signed-off-by: Alexey Asemov &lt;alex@alex-at.ru&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>libata: support the ata host which implements a queue depth less than 32</title>
<updated>2014-07-14T16:38:20Z</updated>
<author>
<name>Kevin Hao</name>
<email>haokexin@gmail.com</email>
</author>
<published>2014-07-12T04:08:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=1871ee134b73fb4cadab75752a7152ed2813c751'/>
<id>urn:sha1:1871ee134b73fb4cadab75752a7152ed2813c751</id>
<content type='text'>
The sata on fsl mpc8315e is broken after the commit 8a4aeec8d2d6
("libata/ahci: accommodate tag ordered controllers"). The reason is
that the ata controller on this SoC only implement a queue depth of
16. When issuing the commands in tag order, all the commands in tag
16 ~ 31 are mapped to tag 0 unconditionally and then causes the sata
malfunction. It makes no senses to use a 32 queue in software while
the hardware has less queue depth. So consider the queue depth
implemented by the hardware when requesting a command tag.

Fixes: 8a4aeec8d2d6 ("libata/ahci: accommodate tag ordered controllers")
Cc: stable@vger.kernel.org
Signed-off-by: Kevin Hao &lt;haokexin@gmail.com&gt;
Acked-by: Dan Williams &lt;dan.j.williams@intel.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>ahci_xgene: fix the dma state machine lockup for the IDENTIFY DEVICE PIO mode command.</title>
<updated>2014-07-08T15:46:05Z</updated>
<author>
<name>Suman Tripathi</name>
<email>stripathi@apm.com</email>
</author>
<published>2014-07-07T17:03:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2a0bdff6b958d1b2523d2754b6cd5e0ea4053016'/>
<id>urn:sha1:2a0bdff6b958d1b2523d2754b6cd5e0ea4053016</id>
<content type='text'>
This patch fixes the dma state machine lockup due to the processing
of IDENTIFY DEVICE PIO mode command. The X-Gene AHCI controller
has an errata in which it cannot clear the BSY bit after the PIO setup
FIS. The dma state machine enters CMFatalErrorUpdate state and locks
up. This patch also removes the dma restart workaround from the read_id
function as the read_id function is only called by libata layer for
ATA_INTERNAL commands. But for some cases eg: PORT MULTIPLIER
and udev, the framework will enumerate using SCSI commands and it will
not call read_id function.

Signed-off-by: Loc Ho &lt;lho@apm.com&gt;
Signed-off-by: Suman Tripathi &lt;stripathi@apm.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>libahci: export ahci_qc_issue() and ahci_start_fix_rx()</title>
<updated>2014-07-08T15:46:05Z</updated>
<author>
<name>Suman Tripathi</name>
<email>stripathi@apm.com</email>
</author>
<published>2014-07-07T17:03:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=39e0ee9964b1245b79ec89f6b89d8ec4ef672524'/>
<id>urn:sha1:39e0ee9964b1245b79ec89f6b89d8ec4ef672524</id>
<content type='text'>
The subsequent patch will make use of them.

Signed-off-by: Loc Ho &lt;lho@apm.com&gt;
Signed-off-by: Suman Tripathi &lt;stripathi@apm.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>ata: ahci_imx: warn when disabling ahci link</title>
<updated>2014-06-24T21:58:14Z</updated>
<author>
<name>Russell King</name>
<email>rmk+kernel@arm.linux.org.uk</email>
</author>
<published>2014-06-23T11:59:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f118ae5901172dacc4f272acf5eccfba06e8d221'/>
<id>urn:sha1:f118ae5901172dacc4f272acf5eccfba06e8d221</id>
<content type='text'>
When the AHCI link is disabled, it can't be re-enabled except by
resetting the entire SoC.  Rather than doing this silently print
some kernel messages to inform the user, along with how to avoid
this.

tj: Put a long printf format string on a single line.

Signed-off-by: Russell King &lt;rmk+kernel@arm.linux.org.uk&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>ahci: disable ncq feature for hisilicon sata</title>
<updated>2014-06-24T20:54:23Z</updated>
<author>
<name>Kefeng Wang</name>
<email>kefeng.wang@linaro.org</email>
</author>
<published>2014-06-24T20:54:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=72cbaa3d2f563d7b48c9f8aef47ec9aa3a31adf2'/>
<id>urn:sha1:72cbaa3d2f563d7b48c9f8aef47ec9aa3a31adf2</id>
<content type='text'>
NCQ feature is unsupported on hisilicon sata controller, so disable
it.  This version of IP is used by hip04 and hix5hd2 soc.

tj: "|=" was replaced with "=" for no reason.  Restored "|=".

Signed-off-by: Kefeng Wang &lt;kefeng.wang@linaro.org&gt;
Sigend-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>ahci: imx: manage only sata_ref_clk in imx_sata_enable[disable]</title>
<updated>2014-06-19T14:14:58Z</updated>
<author>
<name>Shawn Guo</name>
<email>shawn.guo@freescale.com</email>
</author>
<published>2014-05-28T15:05:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e6dd42a917e62d916c6e513dbf87a4dec8cf3a1c'/>
<id>urn:sha1:e6dd42a917e62d916c6e513dbf87a4dec8cf3a1c</id>
<content type='text'>
Doing suspend/resume on imx6q and imx53 boards with no SATA disk
attached will trigger the following warning.

------------[ cut here ]------------
WARNING: CPU: 0 PID: 661 at drivers/ata/libahci.c:224 ahci_enable_ahci+0x74/0x8)
Modules linked in:
CPU: 0 PID: 661 Comm: sh Tainted: G        W     3.15.0-rc5-next-20140521-000027
Backtrace:
[&lt;80011c90&gt;] (dump_backtrace) from [&lt;80011e2c&gt;] (show_stack+0x18/0x1c)
 r6:803a22f4 r5:00000000 r4:00000000 r3:00000000
[&lt;80011e14&gt;] (show_stack) from [&lt;80661e60&gt;] (dump_stack+0x88/0xa4)
[&lt;80661dd8&gt;] (dump_stack) from [&lt;80028fdc&gt;] (warn_slowpath_common+0x70/0x94)
 r5:00000009 r4:00000000
[&lt;80028f6c&gt;] (warn_slowpath_common) from [&lt;80029024&gt;] (warn_slowpath_null+0x24/)
 r8:808f68c4 r7:00000000 r6:00000000 r5:00000000 r4:e0810004
[&lt;80029000&gt;] (warn_slowpath_null) from [&lt;803a22f4&gt;] (ahci_enable_ahci+0x74/0x80)
[&lt;803a2280&gt;] (ahci_enable_ahci) from [&lt;803a2324&gt;] (ahci_reset_controller+0x24/0)
 r8:ddcd9410 r7:80351178 r6:ddcd9444 r5:dde8b850 r4:e0810000 r3:ddf35e90
[&lt;803a2300&gt;] (ahci_reset_controller) from [&lt;803a2c68&gt;] (ahci_platform_resume_ho)
 r7:80351178 r6:ddcd9444 r5:dde8b850 r4:ddcd9410
[&lt;803a2c30&gt;] (ahci_platform_resume_host) from [&lt;803a38f0&gt;] (imx_ahci_resume+0x2)
 r5:00000000 r4:ddcd9410
[&lt;803a38c4&gt;] (imx_ahci_resume) from [&lt;803511ac&gt;] (platform_pm_resume+0x34/0x54)
....

The reason is that the SATA controller has no working clock at this
point, and thus ahci_enable_ahci() fails to enable the controller.  In
case that there is no SATA disk attached, the imx_sata_disable() gets
called in ahci_imx_error_handler(), and both sata_clk and sata_ref_clk
will be disabled there.  Because all the imx_sata_enable() calls
afterward will return immediately due to imxpriv-&gt;no_device check, the
SATA controller working clock sata_clk will never get any chance to be
enabled again.

This is a regression caused by commit 90870d79d4f2 (ahci-imx: Port to
library-ised ahci_platform).  Before the commit, only sata_ref_clk is
managed by the driver in enable/disable function.  But after the commit,
all the clocks are enabled/disabled in a row by ahci platform helpers
ahci_platform_enable[disable]_clks.  Since ahb_clk is a bus clock which
does not have gate at all, and i.MX low-power hardware module already
manages sata_clk across suspend/resume cycle, the only clock that needs
to be managed by software is sata_ref_clk.

So instead of using ahci_platform_enable[disable]_clks to manage all
the clocks in a row from imx_sata_enable[disable], we should manage
only sata_ref_clk in there.

Reported-by: Fabio Estevam &lt;fabio.estevam@freescale.com&gt;
Fixes: 90870d79d4f2 (ahci-imx: Port to library-ised ahci_platform)
Signed-off-by: Shawn Guo &lt;shawn.guo@freescale.com&gt;
Acked-by: Hans de Goede &lt;hdegoede@redhat.com&gt;
</content>
</entry>
</feed>
