<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-stable.git/drivers/ata, branch v3.2.99</title>
<subtitle>Linux kernel stable tree</subtitle>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/'/>
<entry>
<title>cs5536: add support for IDE controller variant</title>
<updated>2017-11-26T13:51:03+00:00</updated>
<author>
<name>Andrey Korolyov</name>
<email>andrey@xdel.ru</email>
</author>
<published>2017-08-10T10:21:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=27c98187446ad56a2911e5c83baf4ebf68492b91'/>
<id>27c98187446ad56a2911e5c83baf4ebf68492b91</id>
<content type='text'>
commit 591b6bb605785c12a21e8b07a08a277065b655a5 upstream.

Several legacy devices such as Geode-based Cisco ASA appliances
and DB800 development board do possess CS5536 IDE controller
with different PCI id than existing one. Using pata_generic is
not always feasible as at least DB800 requires MSR quirk from
pata_cs5536 to be used with vendor firmware.

Signed-off-by: Andrey Korolyov &lt;andrey@xdel.ru&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 591b6bb605785c12a21e8b07a08a277065b655a5 upstream.

Several legacy devices such as Geode-based Cisco ASA appliances
and DB800 development board do possess CS5536 IDE controller
with different PCI id than existing one. Using pata_generic is
not always feasible as at least DB800 requires MSR quirk from
pata_cs5536 to be used with vendor firmware.

Signed-off-by: Andrey Korolyov &lt;andrey@xdel.ru&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libata: array underflow in ata_find_dev()</title>
<updated>2017-11-11T13:34:24+00:00</updated>
<author>
<name>Dan Carpenter</name>
<email>dan.carpenter@oracle.com</email>
</author>
<published>2017-07-19T10:06:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=2679d58535a3b67664655760611920c32fe5279f'/>
<id>2679d58535a3b67664655760611920c32fe5279f</id>
<content type='text'>
commit 59a5e266c3f5c1567508888dd61a45b86daed0fa upstream.

My static checker complains that "devno" can be negative, meaning that
we read before the start of the loop.  I've looked at the code, and I
think the warning is right.  This come from /proc so it's root only or
it would be quite a quite a serious bug.  The call tree looks like this:

proc_scsi_write() &lt;- gets id and channel from simple_strtoul()
-&gt; scsi_add_single_device() &lt;- calls shost-&gt;transportt-&gt;user_scan()
   -&gt; ata_scsi_user_scan()
      -&gt; ata_find_dev()

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 59a5e266c3f5c1567508888dd61a45b86daed0fa upstream.

My static checker complains that "devno" can be negative, meaning that
we read before the start of the loop.  I've looked at the code, and I
think the warning is right.  This come from /proc so it's root only or
it would be quite a quite a serious bug.  The call tree looks like this:

proc_scsi_write() &lt;- gets id and channel from simple_strtoul()
-&gt; scsi_add_single_device() &lt;- calls shost-&gt;transportt-&gt;user_scan()
   -&gt; ata_scsi_user_scan()
      -&gt; ata_find_dev()

Signed-off-by: Dan Carpenter &lt;dan.carpenter@oracle.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ahci: Acer SA5-271 SSD Not Detected Fix</title>
<updated>2017-09-15T17:30:41+00:00</updated>
<author>
<name>Sui Chen</name>
<email>suichen6@gmail.com</email>
</author>
<published>2017-05-09T12:47:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=5503a42c94dfc823dd005818444deb8d5efd9a98'/>
<id>5503a42c94dfc823dd005818444deb8d5efd9a98</id>
<content type='text'>
commit 8bfd174312629866efa535193d9e563768ff4307 upstream.

(Correction in this resend: fixed function name acer_sa5_271_workaround; fixed
 the always-true condition in the function; fixed description.)

On the Acer Switch Alpha 12 (model number: SA5-271), the internal SSD may not
get detected because the port_map and CAP.nr_ports combination causes the driver
to skip the port that is actually connected to the SSD. More specifically,
either all SATA ports are identified as DUMMY, or all ports get ``link down''
and never get up again.

This problem occurs occasionally. When this problem occurs, CAP may hold a
value of 0xC734FF00 or 0xC734FF01 and port_map may hold a value of 0x00 or 0x01.
When this problem does not occur, CAP holds a value of 0xC734FF02 and port_map
may hold a value of 0x07. Overriding the CAP value to 0xC734FF02 and port_map to
0x7 significantly reduces the occurrence of this problem.

Link: https://bugzilla.kernel.org/attachment.cgi?id=253091
Signed-off-by: Sui Chen &lt;suichen6@gmail.com&gt;
Tested-by: Damian Ivanov &lt;damianatorrpm@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 8bfd174312629866efa535193d9e563768ff4307 upstream.

(Correction in this resend: fixed function name acer_sa5_271_workaround; fixed
 the always-true condition in the function; fixed description.)

On the Acer Switch Alpha 12 (model number: SA5-271), the internal SSD may not
get detected because the port_map and CAP.nr_ports combination causes the driver
to skip the port that is actually connected to the SSD. More specifically,
either all SATA ports are identified as DUMMY, or all ports get ``link down''
and never get up again.

This problem occurs occasionally. When this problem occurs, CAP may hold a
value of 0xC734FF00 or 0xC734FF01 and port_map may hold a value of 0x00 or 0x01.
When this problem does not occur, CAP holds a value of 0xC734FF02 and port_map
may hold a value of 0x07. Overriding the CAP value to 0xC734FF02 and port_map to
0x7 significantly reduces the occurrence of this problem.

Link: https://bugzilla.kernel.org/attachment.cgi?id=253091
Signed-off-by: Sui Chen &lt;suichen6@gmail.com&gt;
Tested-by: Damian Ivanov &lt;damianatorrpm@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libata: reject passthrough WRITE SAME requests</title>
<updated>2017-08-26T01:14:03+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2017-04-25T11:39:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=4d34a500e77add127cdee5b4778079596a9ebabe'/>
<id>4d34a500e77add127cdee5b4778079596a9ebabe</id>
<content type='text'>
commit c6ade20f5e50e188d20b711a618b20dd1d50457e upstream.

The WRITE SAME to TRIM translation rewrites the DATA OUT buffer.  While
the SCSI code accomodates for this by passing a read-writable buffer
userspace applications don't cater for this behavior.  In fact it can
be used to rewrite e.g. a readonly file through mmap and should be
considered as a security fix.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
[bwh: Backported to 3.2:
 - Open-code blk_rq_is_passthrough()
 - We don't distinguish which field is invaid so goto invalid_fld
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit c6ade20f5e50e188d20b711a618b20dd1d50457e upstream.

The WRITE SAME to TRIM translation rewrites the DATA OUT buffer.  While
the SCSI code accomodates for this by passing a read-writable buffer
userspace applications don't cater for this behavior.  In fact it can
be used to rewrite e.g. a readonly file through mmap and should be
considered as a security fix.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
[bwh: Backported to 3.2:
 - Open-code blk_rq_is_passthrough()
 - We don't distinguish which field is invaid so goto invalid_fld
 - Adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ata: sata_mv:- Handle return value of devm_ioremap.</title>
<updated>2017-03-16T02:18:39+00:00</updated>
<author>
<name>Arvind Yadav</name>
<email>arvind.yadav.cs@gmail.com</email>
</author>
<published>2016-12-12T17:43:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=e0e1e04e0e409078deb3d5be064a1934f0c58ea0'/>
<id>e0e1e04e0e409078deb3d5be064a1934f0c58ea0</id>
<content type='text'>
commit 064c3db9c564cc5be514ac21fb4aa26cc33db746 upstream.

Here, If devm_ioremap will fail. It will return NULL.
Then hpriv-&gt;base = NULL - 0x20000; Kernel can run into
a NULL-pointer dereference. This error check will avoid
NULL pointer dereference.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 064c3db9c564cc5be514ac21fb4aa26cc33db746 upstream.

Here, If devm_ioremap will fail. It will return NULL.
Then hpriv-&gt;base = NULL - 0x20000; Kernel can run into
a NULL-pointer dereference. This error check will avoid
NULL pointer dereference.

Signed-off-by: Arvind Yadav &lt;arvind.yadav.cs@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ata: sata_dwc_460ex: remove incorrect locking</title>
<updated>2016-08-22T21:37:10+00:00</updated>
<author>
<name>Mans Rullgard</name>
<email>mans@mansr.com</email>
</author>
<published>2016-04-26T09:03:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=b75812386e3d15dfa1bf6a754d29d99069f9e108'/>
<id>b75812386e3d15dfa1bf6a754d29d99069f9e108</id>
<content type='text'>
commit 55e610cdd28c0ad3dce0652030c0296d549673f3 upstream.

This lock is already taken in ata_scsi_queuecmd() a few levels up the
call stack so attempting to take it here is an error.  Moreover, it is
pointless in the first place since it only protects a single, atomic
assignment.

Enabling lock debugging gives the following output:

=============================================
[ INFO: possible recursive locking detected ]
4.4.0-rc5+ #189 Not tainted
---------------------------------------------
kworker/u2:3/37 is trying to acquire lock:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock){-.-...}, at: [&lt;90283294&gt;] sata_dwc_exec_command_by_tag.constprop.14+0x44/0x8c

but task is already holding lock:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock){-.-...}, at: [&lt;902761ac&gt;] ata_scsi_queuecmd+0x2c/0x330

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;host-&gt;lock)-&gt;rlock);
  lock(&amp;(&amp;host-&gt;lock)-&gt;rlock);

 *** DEADLOCK ***
 May be due to missing lock nesting notation

4 locks held by kworker/u2:3/37:
 #0:  ("events_unbound"){.+.+.+}, at: [&lt;9003a0a4&gt;] process_one_work+0x12c/0x430
 #1:  ((&amp;entry-&gt;work)){+.+.+.}, at: [&lt;9003a0a4&gt;] process_one_work+0x12c/0x430
 #2:  (&amp;bdev-&gt;bd_mutex){+.+.+.}, at: [&lt;9011fd54&gt;] __blkdev_get+0x50/0x380
 #3:  (&amp;(&amp;host-&gt;lock)-&gt;rlock){-.-...}, at: [&lt;902761ac&gt;] ata_scsi_queuecmd+0x2c/0x330

stack backtrace:
CPU: 0 PID: 37 Comm: kworker/u2:3 Not tainted 4.4.0-rc5+ #189
Workqueue: events_unbound async_run_entry_fn
Stack : 90b38e30 00000021 00000003 9b2a6040 00000000 9005f3f0 904fc8dc 00000025
        906b96e4 00000000 90528648 9b3336c4 904fc8dc 9009bf18 00000002 00000004
        00000000 00000000 9b3336c4 9b3336e4 904fc8dc 9003d074 00000000 90500000
        9005e738 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        6e657665 755f7374 756f626e 0000646e 00000000 00000000 9b00ca00 9b025000
          ...
Call Trace:
[&lt;90009d6c&gt;] show_stack+0x88/0xa4
[&lt;90057744&gt;] __lock_acquire+0x1ce8/0x2154
[&lt;900583e4&gt;] lock_acquire+0x64/0x8c
[&lt;9045ff10&gt;] _raw_spin_lock_irqsave+0x54/0x78
[&lt;90283294&gt;] sata_dwc_exec_command_by_tag.constprop.14+0x44/0x8c
[&lt;90283484&gt;] sata_dwc_qc_issue+0x1a8/0x24c
[&lt;9026b39c&gt;] ata_qc_issue+0x1f0/0x410
[&lt;90273c6c&gt;] ata_scsi_translate+0xb4/0x200
[&lt;90276234&gt;] ata_scsi_queuecmd+0xb4/0x330
[&lt;9025800c&gt;] scsi_dispatch_cmd+0xd0/0x128
[&lt;90259934&gt;] scsi_request_fn+0x58c/0x638
[&lt;901a3e50&gt;] __blk_run_queue+0x40/0x5c
[&lt;901a83d4&gt;] blk_queue_bio+0x27c/0x28c
[&lt;901a5914&gt;] generic_make_request+0xf0/0x188
[&lt;901a5a54&gt;] submit_bio+0xa8/0x194
[&lt;9011adcc&gt;] submit_bh_wbc.isra.23+0x15c/0x17c
[&lt;9011c908&gt;] block_read_full_page+0x3e4/0x428
[&lt;9009e2e0&gt;] do_read_cache_page+0xac/0x210
[&lt;9009fd90&gt;] read_cache_page+0x18/0x24
[&lt;901bbd18&gt;] read_dev_sector+0x38/0xb0
[&lt;901bd174&gt;] msdos_partition+0xb4/0x5c0
[&lt;901bcb8c&gt;] check_partition+0x140/0x274
[&lt;901bba60&gt;] rescan_partitions+0xa0/0x2b0
[&lt;9011ff68&gt;] __blkdev_get+0x264/0x380
[&lt;901201ac&gt;] blkdev_get+0x128/0x36c
[&lt;901b9378&gt;] add_disk+0x3c0/0x4bc
[&lt;90268268&gt;] sd_probe_async+0x100/0x224
[&lt;90043a44&gt;] async_run_entry_fn+0x50/0x124
[&lt;9003a11c&gt;] process_one_work+0x1a4/0x430
[&lt;9003a4f4&gt;] worker_thread+0x14c/0x4fc
[&lt;900408f4&gt;] kthread+0xd0/0xe8
[&lt;90004338&gt;] ret_from_kernel_thread+0x14/0x1c

Fixes: 62936009f35a ("[libata] Add 460EX on-chip SATA driver, sata_dwc_460ex")
Tested-by: Christian Lamparter &lt;chunkeey@googlemail.com&gt;
Signed-off-by: Mans Rullgard &lt;mans@mansr.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 55e610cdd28c0ad3dce0652030c0296d549673f3 upstream.

This lock is already taken in ata_scsi_queuecmd() a few levels up the
call stack so attempting to take it here is an error.  Moreover, it is
pointless in the first place since it only protects a single, atomic
assignment.

Enabling lock debugging gives the following output:

=============================================
[ INFO: possible recursive locking detected ]
4.4.0-rc5+ #189 Not tainted
---------------------------------------------
kworker/u2:3/37 is trying to acquire lock:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock){-.-...}, at: [&lt;90283294&gt;] sata_dwc_exec_command_by_tag.constprop.14+0x44/0x8c

but task is already holding lock:
 (&amp;(&amp;host-&gt;lock)-&gt;rlock){-.-...}, at: [&lt;902761ac&gt;] ata_scsi_queuecmd+0x2c/0x330

other info that might help us debug this:
 Possible unsafe locking scenario:

       CPU0
       ----
  lock(&amp;(&amp;host-&gt;lock)-&gt;rlock);
  lock(&amp;(&amp;host-&gt;lock)-&gt;rlock);

 *** DEADLOCK ***
 May be due to missing lock nesting notation

4 locks held by kworker/u2:3/37:
 #0:  ("events_unbound"){.+.+.+}, at: [&lt;9003a0a4&gt;] process_one_work+0x12c/0x430
 #1:  ((&amp;entry-&gt;work)){+.+.+.}, at: [&lt;9003a0a4&gt;] process_one_work+0x12c/0x430
 #2:  (&amp;bdev-&gt;bd_mutex){+.+.+.}, at: [&lt;9011fd54&gt;] __blkdev_get+0x50/0x380
 #3:  (&amp;(&amp;host-&gt;lock)-&gt;rlock){-.-...}, at: [&lt;902761ac&gt;] ata_scsi_queuecmd+0x2c/0x330

stack backtrace:
CPU: 0 PID: 37 Comm: kworker/u2:3 Not tainted 4.4.0-rc5+ #189
Workqueue: events_unbound async_run_entry_fn
Stack : 90b38e30 00000021 00000003 9b2a6040 00000000 9005f3f0 904fc8dc 00000025
        906b96e4 00000000 90528648 9b3336c4 904fc8dc 9009bf18 00000002 00000004
        00000000 00000000 9b3336c4 9b3336e4 904fc8dc 9003d074 00000000 90500000
        9005e738 00000000 00000000 00000000 00000000 00000000 00000000 00000000
        6e657665 755f7374 756f626e 0000646e 00000000 00000000 9b00ca00 9b025000
          ...
Call Trace:
[&lt;90009d6c&gt;] show_stack+0x88/0xa4
[&lt;90057744&gt;] __lock_acquire+0x1ce8/0x2154
[&lt;900583e4&gt;] lock_acquire+0x64/0x8c
[&lt;9045ff10&gt;] _raw_spin_lock_irqsave+0x54/0x78
[&lt;90283294&gt;] sata_dwc_exec_command_by_tag.constprop.14+0x44/0x8c
[&lt;90283484&gt;] sata_dwc_qc_issue+0x1a8/0x24c
[&lt;9026b39c&gt;] ata_qc_issue+0x1f0/0x410
[&lt;90273c6c&gt;] ata_scsi_translate+0xb4/0x200
[&lt;90276234&gt;] ata_scsi_queuecmd+0xb4/0x330
[&lt;9025800c&gt;] scsi_dispatch_cmd+0xd0/0x128
[&lt;90259934&gt;] scsi_request_fn+0x58c/0x638
[&lt;901a3e50&gt;] __blk_run_queue+0x40/0x5c
[&lt;901a83d4&gt;] blk_queue_bio+0x27c/0x28c
[&lt;901a5914&gt;] generic_make_request+0xf0/0x188
[&lt;901a5a54&gt;] submit_bio+0xa8/0x194
[&lt;9011adcc&gt;] submit_bh_wbc.isra.23+0x15c/0x17c
[&lt;9011c908&gt;] block_read_full_page+0x3e4/0x428
[&lt;9009e2e0&gt;] do_read_cache_page+0xac/0x210
[&lt;9009fd90&gt;] read_cache_page+0x18/0x24
[&lt;901bbd18&gt;] read_dev_sector+0x38/0xb0
[&lt;901bd174&gt;] msdos_partition+0xb4/0x5c0
[&lt;901bcb8c&gt;] check_partition+0x140/0x274
[&lt;901bba60&gt;] rescan_partitions+0xa0/0x2b0
[&lt;9011ff68&gt;] __blkdev_get+0x264/0x380
[&lt;901201ac&gt;] blkdev_get+0x128/0x36c
[&lt;901b9378&gt;] add_disk+0x3c0/0x4bc
[&lt;90268268&gt;] sd_probe_async+0x100/0x224
[&lt;90043a44&gt;] async_run_entry_fn+0x50/0x124
[&lt;9003a11c&gt;] process_one_work+0x1a4/0x430
[&lt;9003a4f4&gt;] worker_thread+0x14c/0x4fc
[&lt;900408f4&gt;] kthread+0xd0/0xe8
[&lt;90004338&gt;] ret_from_kernel_thread+0x14/0x1c

Fixes: 62936009f35a ("[libata] Add 460EX on-chip SATA driver, sata_dwc_460ex")
Tested-by: Christian Lamparter &lt;chunkeey@googlemail.com&gt;
Signed-off-by: Mans Rullgard &lt;mans@mansr.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libahci: save port map for forced port map</title>
<updated>2016-06-15T20:28:11+00:00</updated>
<author>
<name>Srinivas Kandagatla</name>
<email>srinivas.kandagatla@linaro.org</email>
</author>
<published>2016-04-01T07:52:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=72692570f912eafefd514dff9a70d85215e7d62d'/>
<id>72692570f912eafefd514dff9a70d85215e7d62d</id>
<content type='text'>
commit 2fd0f46cb1b82587c7ae4a616d69057fb9bd0af7 upstream.

In usecases where force_port_map is used saved_port_map is never set,
resulting in not programming the PORTS_IMPL register as part of initial
config. This patch fixes this by setting it to port_map even in case
where force_port_map is used, making it more inline with other parts of
the code.

Fixes: 566d1827df2e ("libata: disable forced PORTS_IMPL for &gt;= AHCI 1.3")
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 2fd0f46cb1b82587c7ae4a616d69057fb9bd0af7 upstream.

In usecases where force_port_map is used saved_port_map is never set,
resulting in not programming the PORTS_IMPL register as part of initial
config. This patch fixes this by setting it to port_map even in case
where force_port_map is used, making it more inline with other parts of
the code.

Fixes: 566d1827df2e ("libata: disable forced PORTS_IMPL for &gt;= AHCI 1.3")
Signed-off-by: Srinivas Kandagatla &lt;srinivas.kandagatla@linaro.org&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Andy Gross &lt;andy.gross@linaro.org&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
[bwh: Backported to 3.2: adjust context]
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Adding Intel Lewisburg device IDs for SATA</title>
<updated>2016-04-01T00:54:34+00:00</updated>
<author>
<name>Alexandra Yates</name>
<email>alexandra.yates@linux.intel.com</email>
</author>
<published>2016-02-18T03:36:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=8f8c03856431eb65088f600e58b73e1fa6715ffd'/>
<id>8f8c03856431eb65088f600e58b73e1fa6715ffd</id>
<content type='text'>
commit f5bdd66c705484b4bc77eb914be15c1b7881fae7 upstream.

This patch complements the list of device IDs previously
added for lewisburg sata.

Signed-off-by: Alexandra Yates &lt;alexandra.yates@linux.intel.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit f5bdd66c705484b4bc77eb914be15c1b7881fae7 upstream.

This patch complements the list of device IDs previously
added for lewisburg sata.

Signed-off-by: Alexandra Yates &lt;alexandra.yates@linux.intel.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>libata: fix HDIO_GET_32BIT ioctl</title>
<updated>2016-04-01T00:54:32+00:00</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-02-11T13:16:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=846b4032720fd8815984aaafc6cbb46f86063306'/>
<id>846b4032720fd8815984aaafc6cbb46f86063306</id>
<content type='text'>
commit 287e6611ab1eac76c2c5ebf6e345e04c80ca9c61 upstream.

As reported by Soohoon Lee, the HDIO_GET_32BIT ioctl does not
work correctly in compat mode with libata.

I have investigated the issue further and found multiple problems
that all appeared with the same commit that originally introduced
HDIO_GET_32BIT handling in libata back in linux-2.6.8 and presumably
also linux-2.4, as the code uses "copy_to_user(arg, &amp;val, 1)" to copy
a 'long' variable containing either 0 or 1 to user space.

The problems with this are:

* On big-endian machines, this will always write a zero because it
  stores the wrong byte into user space.

* In compat mode, the upper three bytes of the variable are updated
  by the compat_hdio_ioctl() function, but they now contain
  uninitialized stack data.

* The hdparm tool calling this ioctl uses a 'static long' variable
  to store the result. This means at least the upper bytes are
  initialized to zero, but calling another ioctl like HDIO_GET_MULTCOUNT
  would fill them with data that remains stale when the low byte
  is overwritten. Fortunately libata doesn't implement any of the
  affected ioctl commands, so this would only happen when we query
  both an IDE and an ATA device in the same command such as
  "hdparm -N -c /dev/hda /dev/sda"

* The libata code for unknown reasons started using ATA_IOC_GET_IO32
  and ATA_IOC_SET_IO32 as aliases for HDIO_GET_32BIT and HDIO_SET_32BIT,
  while the ioctl commands that were added later use the normal
  HDIO_* names. This is harmless but rather confusing.

This addresses all four issues by changing the code to use put_user()
on an 'unsigned long' variable in HDIO_GET_32BIT, like the IDE subsystem
does, and by clarifying the names of the ioctl commands.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reported-by: Soohoon Lee &lt;Soohoon.Lee@f5.com&gt;
Tested-by: Soohoon Lee &lt;Soohoon.Lee@f5.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 287e6611ab1eac76c2c5ebf6e345e04c80ca9c61 upstream.

As reported by Soohoon Lee, the HDIO_GET_32BIT ioctl does not
work correctly in compat mode with libata.

I have investigated the issue further and found multiple problems
that all appeared with the same commit that originally introduced
HDIO_GET_32BIT handling in libata back in linux-2.6.8 and presumably
also linux-2.4, as the code uses "copy_to_user(arg, &amp;val, 1)" to copy
a 'long' variable containing either 0 or 1 to user space.

The problems with this are:

* On big-endian machines, this will always write a zero because it
  stores the wrong byte into user space.

* In compat mode, the upper three bytes of the variable are updated
  by the compat_hdio_ioctl() function, but they now contain
  uninitialized stack data.

* The hdparm tool calling this ioctl uses a 'static long' variable
  to store the result. This means at least the upper bytes are
  initialized to zero, but calling another ioctl like HDIO_GET_MULTCOUNT
  would fill them with data that remains stale when the low byte
  is overwritten. Fortunately libata doesn't implement any of the
  affected ioctl commands, so this would only happen when we query
  both an IDE and an ATA device in the same command such as
  "hdparm -N -c /dev/hda /dev/sda"

* The libata code for unknown reasons started using ATA_IOC_GET_IO32
  and ATA_IOC_SET_IO32 as aliases for HDIO_GET_32BIT and HDIO_SET_32BIT,
  while the ioctl commands that were added later use the normal
  HDIO_* names. This is harmless but rather confusing.

This addresses all four issues by changing the code to use put_user()
on an 'unsigned long' variable in HDIO_GET_32BIT, like the IDE subsystem
does, and by clarifying the names of the ioctl commands.

Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Reported-by: Soohoon Lee &lt;Soohoon.Lee@f5.com&gt;
Tested-by: Soohoon Lee &lt;Soohoon.Lee@f5.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>ahci: Intel DNV device IDs SATA</title>
<updated>2016-02-27T14:28:48+00:00</updated>
<author>
<name>Alexandra Yates</name>
<email>alexandra.yates@linux.intel.com</email>
</author>
<published>2016-02-05T23:27:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.tavy.me/linux-stable.git/commit/?id=fe9f7e71ffbd6fbdd78ae88fb7c07c49ff662a19'/>
<id>fe9f7e71ffbd6fbdd78ae88fb7c07c49ff662a19</id>
<content type='text'>
commit 342decff2b846b46fa61eb5ee40986fab79a9a32 upstream.

Adding Intel codename DNV platform device IDs for SATA.

Signed-off-by: Alexandra Yates &lt;alexandra.yates@linux.intel.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
commit 342decff2b846b46fa61eb5ee40986fab79a9a32 upstream.

Adding Intel codename DNV platform device IDs for SATA.

Signed-off-by: Alexandra Yates &lt;alexandra.yates@linux.intel.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Ben Hutchings &lt;ben@decadent.org.uk&gt;
</pre>
</div>
</content>
</entry>
</feed>
