[Pkg-utopia-maintainers] Bug#456214: [PATCH] HAL polling, cd drives and wakeups

Doug Goldstein cardoe at gentoo.org
Thu Apr 3 14:38:42 UTC 2008


David Zeuthen wrote:
> On Wed, 2008-04-02 at 12:57 -0400, Doug Goldstein wrote:
>   
>> David Zeuthen wrote:
>>     
>>> On Wed, 2008-04-02 at 10:52 +0100, Sam Morris wrote:
>>>   
>>>       
>>>>> Attached is a patch to fix the problem with wakeups.  This patch does 
>>>>> CDROM_MEDIA_CHANGED first, and if it reports true, then checks to make 
>>>>> sure the drive is closed and then that the drive is not lying.  This 
>>>>> causes the number of wakeups from HAL to go to zero.  It also has the 
>>>>> side effect of issuing an extra ioctl(2) when the drive tray is open, 
>>>>> which is harmless since the drive tray should be closed most of the 
>>>>> time.
>>>>>       
>>>>>           
>>> So if I understand this correctly, what this patch does is to reduce the
>>> number of wakeups only when the drive door is open?
>>>
>>>      David
>>>
>>>   
>>>       
>> No. Other way around. It'll increase the number of wakeups when the 
>> drive door is opened and decrease them when it's closed. 
>>     
>
> Hmm. I'm confused how it can bring the wakeups to zero as is claimed
> upthread. Surely the kernel won't know if media is changed unless it
> asks the drive [1]. And the kernel won't do this by itself since it's a
> policy decision to do so. Or to put it in another way: To detect media
> changes the drive _will_ need to be polled from user space - SATA AN
> wasn't invented for nothing.
>   
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.

His patch would bring hal-addon-storage's wakeups down since it would 
offload more work on the kernel where the wakeups would occur.





More information about the Pkg-utopia-maintainers mailing list