[PATCH] HAL polling, cd drives and wakeups

brian m. carlson sandals at crustytoothpaste.ath.cx
Fri Apr 4 07:57:02 PDT 2008


On Thu, Apr 03, 2008 at 07:49:09PM -0400, David Zeuthen wrote:
>On Thu, 2008-04-03 at 10:38 -0400, Doug Goldstein wrote:
>> Now I could be wrong (I'm not too well versed in hardware specs and 
>> driver bits). I was under the impression that MMC-2 ATAPI provides for a 
>> Media Status Notification. Which is a polled condition. However, the 
>> device should emit an Unit Attention Condition when a disc *may* have 
>> been removed. Which basically means, the device should emit a notice 
>> when the drive door opens and closes to tell you that the media may have 
>> changed.
>> 
>> As the bug report explains now, HAL is checking for the drive door to be 
>> closed. Instead of relying on the Unit Attention Condition notice.
>
>Except that approximately 0% of the drives out there support that
>command properly. See 'man hal-disable-polling' for the longer story.

I don't know why it causes fewer wakeups, but it does.  It may or may 
not have anything to do with MMC-2 ATAPI.  HAL shows ten wakeups per 
second without the patch, and doesn't appear in powertop with the patch.  

It doesn't really matter to me why it happens, but since I'm now 
curious: the cdrom driver talks to the specific driver (in the example 
I'm using, ide-cd) and does a media_changed request, which calls 
ide_cdrom_check_media_change_real.  That does a cdrom_check_status, 
which issues a TEST_UNIT_READY command.

Issuing a drive status command calls ide_cdrom_drive_status, which also 
eventually issues a cdrom_check_status, but it also calls 
cdrom_get_media_event, which does a GET_EVENT_STATUS_NOTIFICATION.  This 
appears to be the expensive part.  ide_cdrom_drive_status also checks 
the MMC-2 ATAPI method with UNIT_ATTENTION, and doesn't bother doing the 
more expensive check if that happens.

-- 
brian m. carlson / brian with sandals: Houston, Texas, US
+1 713 440 7475 | http://crustytoothpaste.ath.cx/~bmc | My opinion only
troff on top of XML: http://crustytoothpaste.ath.cx/~bmc/code/thwack
OpenPGP: RSA v4 4096b 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 827 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/hal/attachments/20080404/5695e44b/attachment.pgp 


More information about the hal mailing list