<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/ata, branch v4.5</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=v4.5</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v4.5'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2016-02-29T21:17:57Z</updated>
<entry>
<title>ata: ahci: don't mark HotPlugCapable Ports as external/removable</title>
<updated>2016-02-29T21:17:57Z</updated>
<author>
<name>Manuel Lauss</name>
<email>manuel.lauss@gmail.com</email>
</author>
<published>2016-02-27T15:10:05Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=dc8b4afc4a04fac8ee55a19b59f2356a25e7e778'/>
<id>urn:sha1:dc8b4afc4a04fac8ee55a19b59f2356a25e7e778</id>
<content type='text'>
The HPCP bit is set by bioses for on-board sata ports either because
they think sata is hotplug capable in general or to allow Windows
to display a "device eject" icon on ports which are routed to an
external connector bracket.

However in Redhat Bugzilla #1310682, users report that with kernel 4.4,
where this bit test first appeared, a lot of partitions on sata drives
are now mounted automatically.

This patch should fix redhat and a lot of other distros which
unconditionally automount all devices which have the "removable"
bit set.

Signed-off-by: Manuel Lauss &lt;manuel.lauss@gmail.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Fixes: 8a3e33cf92c7 ("ata: ahci: find eSATA ports and flag them as removable" changes userspace behavior)
Link: http://lkml.kernel.org/g/56CF35FA.1070500@redhat.com
Cc: stable@vger.kernel.org #v4.4+
</content>
</entry>
<entry>
<title>ahci: Workaround for ThunderX Errata#22536</title>
<updated>2016-02-29T21:16:26Z</updated>
<author>
<name>Tirumalesh Chalamarla</name>
<email>tchalamarla@caviumnetworks.com</email>
</author>
<published>2016-02-16T20:08:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d243bed32f5042582896237f88fa1798aee55ff9'/>
<id>urn:sha1:d243bed32f5042582896237f88fa1798aee55ff9</id>
<content type='text'>
Due to Errata in ThunderX, HOST_IRQ_STAT should be
cleared before leaving the interrupt handler.
The patch attempts to satisfy the need.

Changes from V2:
	- removed newfile
	- code is now under CONFIG_ARM64

Changes from V1:
	- Rebased on top of libata/for-4.6
        - Moved ThunderX intr handler to new file

tj: Minor adjustments to comments.

Signed-off-by: Tirumalesh Chalamarla &lt;tchalamarla@caviumnetworks.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>Adding Intel Lewisburg device IDs for SATA</title>
<updated>2016-02-18T16:28:31Z</updated>
<author>
<name>Alexandra Yates</name>
<email>alexandra.yates@linux.intel.com</email>
</author>
<published>2016-02-18T03:36:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f5bdd66c705484b4bc77eb914be15c1b7881fae7'/>
<id>urn:sha1:f5bdd66c705484b4bc77eb914be15c1b7881fae7</id>
<content type='text'>
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;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>pata-rb532-cf: get rid of the irq_to_gpio() call</title>
<updated>2016-02-18T16:26:27Z</updated>
<author>
<name>Gabor Juhos</name>
<email>juhosg@openwrt.org</email>
</author>
<published>2016-02-17T11:58:20Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=018361767a21fb2d5ebd3ac182c04baf8a8b4e08'/>
<id>urn:sha1:018361767a21fb2d5ebd3ac182c04baf8a8b4e08</id>
<content type='text'>
The RB532 platform specific irq_to_gpio() implementation has been
removed with commit 832f5dacfa0b ("MIPS: Remove all the uses of
custom gpio.h"). Now the platform uses the generic stub which causes
the following error:

  pata-rb532-cf pata-rb532-cf: no GPIO found for irq149
  pata-rb532-cf: probe of pata-rb532-cf failed with error -2

Drop the irq_to_gpio() call and get the GPIO number from platform
data instead. After this change, the driver works again:

  scsi host0: pata-rb532-cf
  ata1: PATA max PIO4 irq 149
  ata1.00: CFA: CF 1GB, 20080820, max MWDMA4
  ata1.00: 1989792 sectors, multi 0: LBA
  ata1.00: configured for PIO4
  scsi 0:0:0:0: Direct-Access     ATA      CF 1GB           0820 PQ: 0\
  ANSI: 5
  sd 0:0:0:0: [sda] 1989792 512-byte logical blocks: (1.01 GB/971 MiB)
  sd 0:0:0:0: [sda] Write Protect is off
  sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't\
  support DPO or FUA
   sda: sda1 sda2
  sd 0:0:0:0: [sda] Attached SCSI disk

Fixes: 832f5dacfa0b ("MIPS: Remove all the uses of custom gpio.h")
Cc: Alban Bedel &lt;albeu@free.fr&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Arnd Bergmann &lt;arnd@arndb.de&gt;
Cc: &lt;stable@vger.kernel.org&gt; #v4.3+
Signed-off-by: Gabor Juhos &lt;juhosg@openwrt.org&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>libata: fix HDIO_GET_32BIT ioctl</title>
<updated>2016-02-11T15:07:18Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2016-02-11T13:16:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=287e6611ab1eac76c2c5ebf6e345e04c80ca9c61'/>
<id>urn:sha1:287e6611ab1eac76c2c5ebf6e345e04c80ca9c61</id>
<content type='text'>
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;
Cc: stable@vger.kernel.org
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>ahci_xgene: Implement the workaround to fix the missing of the edge interrupt for the HOST_IRQ_STAT.</title>
<updated>2016-02-11T14:54:15Z</updated>
<author>
<name>Suman Tripathi</name>
<email>stripathi@apm.com</email>
</author>
<published>2016-02-06T05:55:24Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=32aea2680de01f539d928112150279fdeeabca00'/>
<id>urn:sha1:32aea2680de01f539d928112150279fdeeabca00</id>
<content type='text'>
Due to H/W errata, the HOST_IRQ_STAT register misses the edge interrupt
when clearing the HOST_IRQ_STAT register and hardware reporting the
PORT_IRQ_STAT register happens to be at the same clock cycle.

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: Remove the AHCI_HFLAG_EDGE_IRQ support from libahci.</title>
<updated>2016-02-11T14:54:04Z</updated>
<author>
<name>Suman Tripathi</name>
<email>stripathi@apm.com</email>
</author>
<published>2016-02-06T05:55:23Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d867b95f965457b9e85fb061ef8e3fdc029116ed'/>
<id>urn:sha1:d867b95f965457b9e85fb061ef8e3fdc029116ed</id>
<content type='text'>
The flexibility to override the irq handles in the LLD's are already
present, so controllers implementing a edge trigger latch can
implement their own interrupt handler inside the driver.  This patch
removes the AHCI_HFLAG_EDGE_IRQ support from libahci and moves edge
irq handling to ahci_xgene.

tj: Minor update to description.

Signed-off-by: Suman Tripathi &lt;stripathi@apm.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kenrel.org&gt;
</content>
</entry>
<entry>
<title>libahci: Implement the capability to override the generic ahci interrupt handler.</title>
<updated>2016-02-11T14:53:51Z</updated>
<author>
<name>Suman Tripathi</name>
<email>stripathi@apm.com</email>
</author>
<published>2016-02-06T05:55:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f070d6715509dafc0af223577c896fe3d204ca88'/>
<id>urn:sha1:f070d6715509dafc0af223577c896fe3d204ca88</id>
<content type='text'>
This patch implements the capability to override the generic AHCI
interrupt handler so that specific ahci drivers can implement their
own custom interrupt handler routines.  It also exports
ahci_handle_port_intr so that custom irq_handler implementations can
use it.

tj: s/ahci_irq_handler/irq_handler/ and updated description.

Signed-off-by: Suman Tripathi &lt;stripathi@apm.com&gt;
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
<entry>
<title>ahci: Intel DNV device IDs SATA</title>
<updated>2016-02-10T16:35:55Z</updated>
<author>
<name>Alexandra Yates</name>
<email>alexandra.yates@linux.intel.com</email>
</author>
<published>2016-02-05T23:27:49Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=342decff2b846b46fa61eb5ee40986fab79a9a32'/>
<id>urn:sha1:342decff2b846b46fa61eb5ee40986fab79a9a32</id>
<content type='text'>
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;
Cc: stable@vger.kernel.org
</content>
</entry>
<entry>
<title>libata: fix sff host state machine locking while polling</title>
<updated>2016-02-01T16:33:21Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2016-02-01T16:33:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=8eee1d3ed5b6fc8e14389567c9a6f53f82bb7224'/>
<id>urn:sha1:8eee1d3ed5b6fc8e14389567c9a6f53f82bb7224</id>
<content type='text'>
The bulk of ATA host state machine is implemented by
ata_sff_hsm_move().  The function is called from either the interrupt
handler or, if polling, a work item.  Unlike from the interrupt path,
the polling path calls the function without holding the host lock and
ata_sff_hsm_move() selectively grabs the lock.

This is completely broken.  If an IRQ triggers while polling is in
progress, the two can easily race and end up accessing the hardware
and updating state machine state at the same time.  This can put the
state machine in an illegal state and lead to a crash like the
following.

  kernel BUG at drivers/ata/libata-sff.c:1302!
  invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN
  Modules linked in:
  CPU: 1 PID: 10679 Comm: syz-executor Not tainted 4.5.0-rc1+ #300
  Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
  task: ffff88002bd00000 ti: ffff88002e048000 task.ti: ffff88002e048000
  RIP: 0010:[&lt;ffffffff83a83409&gt;]  [&lt;ffffffff83a83409&gt;] ata_sff_hsm_move+0x619/0x1c60
  ...
  Call Trace:
   &lt;IRQ&gt;
   [&lt;ffffffff83a84c31&gt;] __ata_sff_port_intr+0x1e1/0x3a0 drivers/ata/libata-sff.c:1584
   [&lt;ffffffff83a85611&gt;] ata_bmdma_port_intr+0x71/0x400 drivers/ata/libata-sff.c:2877
   [&lt;     inline     &gt;] __ata_sff_interrupt drivers/ata/libata-sff.c:1629
   [&lt;ffffffff83a85bf3&gt;] ata_bmdma_interrupt+0x253/0x580 drivers/ata/libata-sff.c:2902
   [&lt;ffffffff81479f98&gt;] handle_irq_event_percpu+0x108/0x7e0 kernel/irq/handle.c:157
   [&lt;ffffffff8147a717&gt;] handle_irq_event+0xa7/0x140 kernel/irq/handle.c:205
   [&lt;ffffffff81484573&gt;] handle_edge_irq+0x1e3/0x8d0 kernel/irq/chip.c:623
   [&lt;     inline     &gt;] generic_handle_irq_desc include/linux/irqdesc.h:146
   [&lt;ffffffff811a92bc&gt;] handle_irq+0x10c/0x2a0 arch/x86/kernel/irq_64.c:78
   [&lt;ffffffff811a7e4d&gt;] do_IRQ+0x7d/0x1a0 arch/x86/kernel/irq.c:240
   [&lt;ffffffff86653d4c&gt;] common_interrupt+0x8c/0x8c arch/x86/entry/entry_64.S:520
   &lt;EOI&gt;
   [&lt;     inline     &gt;] rcu_lock_acquire include/linux/rcupdate.h:490
   [&lt;     inline     &gt;] rcu_read_lock include/linux/rcupdate.h:874
   [&lt;ffffffff8164b4a1&gt;] filemap_map_pages+0x131/0xba0 mm/filemap.c:2145
   [&lt;     inline     &gt;] do_fault_around mm/memory.c:2943
   [&lt;     inline     &gt;] do_read_fault mm/memory.c:2962
   [&lt;     inline     &gt;] do_fault mm/memory.c:3133
   [&lt;     inline     &gt;] handle_pte_fault mm/memory.c:3308
   [&lt;     inline     &gt;] __handle_mm_fault mm/memory.c:3418
   [&lt;ffffffff816efb16&gt;] handle_mm_fault+0x2516/0x49a0 mm/memory.c:3447
   [&lt;ffffffff8127dc16&gt;] __do_page_fault+0x376/0x960 arch/x86/mm/fault.c:1238
   [&lt;ffffffff8127e358&gt;] trace_do_page_fault+0xe8/0x420 arch/x86/mm/fault.c:1331
   [&lt;ffffffff8126f514&gt;] do_async_page_fault+0x14/0xd0 arch/x86/kernel/kvm.c:264
   [&lt;ffffffff86655578&gt;] async_page_fault+0x28/0x30 arch/x86/entry/entry_64.S:986

Fix it by ensuring that the polling path is holding the host lock
before entering ata_sff_hsm_move() so that all hardware accesses and
state updates are performed under the host lock.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reported-and-tested-by: Dmitry Vyukov &lt;dvyukov@google.com&gt;
Link: http://lkml.kernel.org/g/CACT4Y+b_JsOxJu2EZyEf+mOXORc_zid5V1-pLZSroJVxyWdSpw@mail.gmail.com
Cc: stable@vger.kernel.org
</content>
</entry>
</feed>
