Skip to content

Commit

Permalink
libata: improve HPA error handling
Browse files Browse the repository at this point in the history
There's no point in retrying and eventually failing device detection
when the device rejects READ_NATIVE_MAX[_EXT].  Disable HPA unlocking
if READ_NATIVE_MAX[_EXT] is rejected as done when SET_MAX[_EXT] is
rejected.

This allows some old drives to work even if they aren't blacklisted.

Signed-off-by: Tejun Heo <htejun@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
  • Loading branch information
Tejun Heo authored and Jeff Garzik committed Mar 25, 2008
1 parent 1ffc151 commit dda7aba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/ata/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1416,12 +1416,12 @@ static int ata_hpa_resize(struct ata_device *dev)
/* read native max address */
rc = ata_read_native_max_address(dev, &native_sectors);
if (rc) {
/* If HPA isn't going to be unlocked, skip HPA
* resizing from the next try.
/* If device aborted the command or HPA isn't going to
* be unlocked, skip HPA resizing.
*/
if (!ata_ignore_hpa) {
if (rc == -EACCES || !ata_ignore_hpa) {
ata_dev_printk(dev, KERN_WARNING, "HPA support seems "
"broken, will skip HPA handling\n");
"broken, skipping HPA handling\n");
dev->horkage |= ATA_HORKAGE_BROKEN_HPA;

/* we can continue if device aborted the command */
Expand Down

0 comments on commit dda7aba

Please sign in to comment.