You are not logged in.

#1 2007-04-16 13:16:04

lloeki
Member
From: France
Registered: 2007-02-20
Posts: 456
Website

SATA hd/PATA dvd with libata, unresponsive&al. [solved by workaround]

it happened to me recently that sometimes (on my asus W7J laptop, but that's not much relevant, see later), copying files from my dvd drive is painfully slow, and makes the system unresponsive. top would then show big cpu usage (in both User and IO wait).

dmesg show things like:

ata2: port is slow to respond, please be patient (Status 0xd0)
ata2: soft resetting port
ata2.00: configured for PIO2
ata2: EH complete
ata2.00: limiting speed to PIO1

all the way from top-notch UDMA down to PIO0

obviously that's the cause for slow transfer. and obviously, once it reaches PIO modes, that's the cause of unresponsiveness (because, well, PIO is really a legacy of the past that should have been killed long ago, esp. in laptops where you obviously won't hardwire an old PIO-only device to the motherboard[/sarcasm]).

I then googled for that, crawled the forums, and came to the following conclusion:
this is caused by a seemingly non-standard (buggy?) but fairly common attitude of some optical drives when answering questions, in conjuction with libata not handling it correctly. the given workaround is to use legacy ide (in my case use piix instead of ata_piix).
well, in my case I can't because my hd is sata, so I need libata (and because, hey, legacy ide is just that, legacy, so somewhere, a little voice pushes me to use libata)

then, I noticed some details:
- this occurs gradually (as it switches down modes), and during some time (it does not happen all modes at once)
- this does not occur when some media is in the drive

why so? well, because when I put a cd in the drive, it's mounted. so why for heaven's sake is there no error message when a cd is in the drive? I couldn't find an answer up until I turned it the other way around: why is there an error when no cd is in the drive? duh, because no cd is in the drive. and it seems that's the specific non-standard stuff not (yet, patches float around) handled by libata. but why the answer 'no cd' from the drive when there's no question? because there's a question, and hal asks the question.

specifically, hal polls (with hal-addon-storage) drives with the key 'storage.media_check_enabled' set to true. previously (on another laptop) I'd disable it because polling would kill my battery.

how to disable that? back in the day I did it the hard way by editing hal policies files. but hal now has this functionality bundled:

hal-disable-polling /dev/sr0

this adds some file to /etc/hal/fdi/information/ to just do that (see man for interesting details). isn't it neat?

and now, hal stops polling my drive when there's no media in, and *poof* no more messages in dmesg, no more mode step down from the drive.

well, this is only a workaround, as the flip side is that since there's no more polling, there's no more automounting on media insertion (but hey, I hate automounting anyway).

happy happy, hope it helps someone.

Last edited by lloeki (2007-04-16 13:17:17)


To know recursion, you must first know recursion.

Offline

Board footer

Powered by FluxBB