From: Roland S. <rsc...@hi...> - 2006-05-29 01:02:36
|
Benjamin Herrenschmidt wrote: >>> It should probably be infinite if no hw lock is being held. >>> Lock should be dropped in case of longer waits so that user is given a chance to stop the process. >> Well, the current behaviour (i.e. return EBUSY after 3 seconds) would >> make sense too, the user-space driver could simply redo the ioctl (it >> could also drop the lock before it retries). Which probably really is >> what was intended, just that it checks for EAGAIN instead of EBUSY >> (though the code does not drop and retake the lock) by mistake. > > Dropping the lock while the card is busy processing commands ? sounds > pretty dangerous to me.. Why? That's done already anyway, there is no sync or something like that when context switches happen. When you have the lock, it simply means you now can submit commands (and do other stuff requiring to have the lock), but while you do that the chip may still be processing commands submitted earlier from other contexts. That's at least my understanding of how that locking stuff works... Roland |