Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 57527
b: refs/heads/master
c: 0d2157f
h: refs/heads/master
i:
  57525: 7c3b013
  57523: e8f266d
  57519: 3056145
v: v3
  • Loading branch information
Lee Trager authored and Bartlomiej Zolnierkiewicz committed Jun 8, 2007
1 parent 95d3364 commit 0089895
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0380dad45e4f5a606025cc4df2a2cd26af08796b
refs/heads/master: 0d2157f78d17fcee17791f54959e67cc0af0da74
12 changes: 12 additions & 0 deletions trunk/drivers/ide/ide-disk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1037,6 +1037,17 @@ static void ide_disk_release(struct kref *kref)

static int ide_disk_probe(ide_drive_t *drive);

/*
* On HPA drives the capacity needs to be
* reinitilized on resume otherwise the disk
* can not be used and a hard reset is required
*/
static void ide_disk_resume(ide_drive_t *drive)
{
if (idedisk_supports_hpa(drive->id))
init_idedisk_capacity(drive);
}

static void ide_device_shutdown(ide_drive_t *drive)
{
#ifdef CONFIG_ALPHA
Expand Down Expand Up @@ -1071,6 +1082,7 @@ static ide_driver_t idedisk_driver = {
},
.probe = ide_disk_probe,
.remove = ide_disk_remove,
.resume = ide_disk_resume,
.shutdown = ide_device_shutdown,
.version = IDEDISK_VERSION,
.media = ide_disk,
Expand Down
9 changes: 8 additions & 1 deletion trunk/drivers/ide/ide.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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,
Expand Down
1 change: 1 addition & 0 deletions trunk/include/linux/ide.h
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ struct ide_driver_s {
struct device_driver gen_driver;
int (*probe)(ide_drive_t *);
void (*remove)(ide_drive_t *);
void (*resume)(ide_drive_t *);
void (*shutdown)(ide_drive_t *);
#ifdef CONFIG_IDE_PROC_FS
ide_proc_entry_t *proc;
Expand Down

0 comments on commit 0089895

Please sign in to comment.