]> git.baikalelectronics.ru Git - kernel.git/commit
libata: unlock HPA if device shrunk
authorTejun Heo <tj@kernel.org>
Mon, 5 Apr 2010 01:33:13 +0000 (10:33 +0900)
committerJeff Garzik <jgarzik@redhat.com>
Tue, 6 Apr 2010 14:55:33 +0000 (10:55 -0400)
commit9c39237e1bdd6c8ad89dd7dd2b003c456345ed3b
tree039ade5b49cb0bbd388babc369f28f541c76ec96
parent9c7e75f608fc693a438a6c4f095d3994ebae4d85
libata: unlock HPA if device shrunk

Some BIOSes don't configure HPA during boot but do so while resuming.
This causes harddrives to shrink during resume making libata detach
and reattach them.  This can be worked around by unlocking HPA if old
size equals native size.

Add ATA_DFLAG_UNLOCK_HPA so that HPA unlocking can be controlled
per-device and update ata_dev_revalidate() such that it sets
ATA_DFLAG_UNLOCK_HPA and fails with -EIO when the above condition is
detected.

This patch fixes the following bug.

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

Signed-off-by: Tejun Heo <tj@kernel.org>
Reported-by: Oleksandr Yermolenko <yaa.bta@gmail.com>
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
drivers/ata/libata-core.c
include/linux/libata.h