ATA Locking

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
giszo

ATA Locking

Post by giszo »

Hi!

I have the following question with ATA driver:
Before i want to read from an ATA device i have to select the device, right? Is it possible to lock only that drive what i want to read or should i lock the full channel not to possible to read from the other drive on the same channel?
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:ATA Locking

Post by Pype.Clicker »

hmm .. sorry, but i got confused here ... what do you mean by "locking" an ATA disk ? okay for locking/unlocking ATAPI cdroms, but ATA disks ??? or did i miss something ::)
giszo

Re:ATA Locking

Post by giszo »

I mean for example a mutex. When i want to read/write an ATA device i lock it with a mutex, so only one thread can access it :)
But is it good if i lock only that device what i use or should i lock the full channel? ... I thought about it a little and i have some ideas. So... If i got an IDE irq from a channel what has 2 devices i don't know which device sent it... but if i lock the full channel when i access a device i'll know which device did it :)
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:ATA Locking

Post by Pype.Clicker »

personnally, i'd lock the controller, and not only the drive. Since some registers of the controller are shared by both drive (e.g. the sector register, etc) and since the IRQ is controller-specific and not drive-specific, allowing interleaving of a request for master and slave controller could lead to situation i prefer not thinking of ...
giszo

Re:ATA Locking

Post by giszo »

Okey.. Thanx... I also thought that ;)
Post Reply