]> git.baikalelectronics.ru Git - kernel.git/commit
libata: fix PMP initialization
authorTejun Heo <tj@kernel.org>
Thu, 15 Oct 2009 14:37:32 +0000 (23:37 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Fri, 16 Oct 2009 10:21:54 +0000 (06:21 -0400)
commit773a7a54853ac183610a5b2f7689a2968c42ff17
treeab355d2b7392a8db4807bb7b31eb61190afa01e0
parent536311d0e98035371e9e0228b42fe5d86e3b8887
libata: fix PMP initialization

Commit b81f19d55e2592d17d55176e0ae3eab766cea1b3 fixed error handling
during attach by not committing detected device class to dev->class
while attaching a new device.  However, this change missed the PMP
class check in the configuration loop causing a new PMP device to go
through ata_dev_configure() as if it were an ATA or ATAPI device.

As PMP device doesn't have a regular IDENTIFY data, this makes
ata_dev_configure() tries to configure a PMP device using an invalid
data.  For the most part, it wasn't too harmful and went unnoticed but
this ends up clearing dev->flags which may have ATA_DFLAG_AN set by
sata_pmp_attach().  This means that SATA_PMP_FEAT_NOTIFY ends up being
disabled on PMPs and on PMPs which honor the flag breaks hotplug
support.

This problem was discovered and reported by Ethan Hsiao.

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Ethan Hsiao <ethanhsiao@jmicron.com>
Cc: stable@kernel.org
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-eh.c