From 0d2157f78d17fcee17791f54959e67cc0af0da74 Mon Sep 17 00:00:00 2001 From: Lee Trager Date: Fri, 8 Jun 2007 15:14:30 +0200 Subject: ide: HPA detect from resume Currently when system which have HPA require HPA to be detected and disabled upon resume from RAM or disk. The current IDE drivers do not do this nor does libata (obviously it since it doesn't support HPA yet). I have implemented this into the current IDE drivers and it has been tested by many others since 7/15/2006 in bug number 6840: http://bugzilla.kernel.org/show_bug.cgi?id=6840 and it has been confirmed to work fine with no problems. bart: added drv != NULL check to generic_ide_suspend() From: Lee Trager Signed-off-by: Bartlomiej Zolnierkiewicz --- drivers/ide/ide.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'drivers/ide/ide.c') diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c index 6002713a20a1..0af0d1614f75 100644 --- a/drivers/ide/ide.c +++ b/drivers/ide/ide.c @@ -1010,9 +1010,11 @@ static int generic_ide_resume(struct device *dev) { ide_drive_t *drive = dev->driver_data; ide_hwif_t *hwif = HWIF(drive); + ide_driver_t *drv = to_ide_driver(dev->driver); struct request rq; struct request_pm_state rqpm; ide_task_t args; + int err; /* Call ACPI _STM only once */ if (!(drive->dn % 2)) @@ -1029,7 +1031,12 @@ static int generic_ide_resume(struct device *dev) rqpm.pm_step = ide_pm_state_start_resume; rqpm.pm_state = PM_EVENT_ON; - return ide_do_drive_cmd(drive, &rq, ide_head_wait); + err = ide_do_drive_cmd(drive, &rq, ide_head_wait); + + if (err == 0 && drv && drv->resume) + drv->resume(drive); + + return err; } int generic_ide_ioctl(ide_drive_t *drive, struct file *file, struct block_device *bdev, -- cgit v1.2.3