lkml.org 
[lkml]   [2002]   [Mar]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: Suspend support for IDE
Date
>> +	while (HWGROUP(drive)->handler)
>> + schedule();
>
>You need to yield. Remember the process might be hard real time and blocking
>your real work from occuring. while(foo) schedule() is always a bug
>
>> +static int idedisk_resume(struct device *dev, u32 level)
>> +{
>> + ide_drive_t *drive = dev->driver_data;
>> + if (!drive->blocked)
>> + panic("ide: Resume but not suspended?\n");
>> + drive->blocked = 0;
>> +}

I wouldn't do it this way in fact. The IDE disk is a device on the IDE
bus, so it's up to the IDE bus to get the PM requests, and pass them down
appropriately to the low level driver. The IDE common code has to make
sure any further request is properly blocked etc... Then, the controller
itself can eventually be suspended as well.

You can see code that blocks the IDE requests in ide-pmac sleep code,
it isn't perfect (I have a few known issues when waking up from sleep
with mounted CD/DVDs for example) but except from these it appear
to work well. It is currently specific to the pmac PM scheme, but I hope to
find time to port this over to the new macanism and make it more generic
in the future. That code is appropriate for what I need, you may, as Alan
states, need additional care to please your BIOS, like switching back to
PIO0, which means also updating your controller timings.

Ben.



-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:24    [W:0.997 / U:3.540 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site