From: Manuel T. <man...@so...> - 2001-10-27 20:42:58
|
El S=E1b 27 Oct 2001 21:40, Leif Delgass escribi=F3: > On Sat, 27 Oct 2001, Manuel Teira wrote: > > El S=E1b 27 Oct 2001 19:49, Leif Delgass escribi=F3: > > > Well, I just got my box to hang hard (like with the vt switching) = when > > > running tuxracer and switching modes with Ctrl-Alt-+ (I have 3 mod= es > > > defined in my config and the hang happened when looping back to th= e > > > original mode, i.e. the third switch), so I think the > > > answer is yes, it needs locking. I really should use a journallin= g > > > filesystem, all this fsck-ing is getting a bit tedious. ;) > > > > OK. I have added the DRILock/Unlock to the AtiModeSet function in th= e > > atimode.c file. I've added another condition (also to the locks in t= he > > aticonsole.c file for vt changing) in this way: > > It looks like ATIEnter/LeaveVT calls ATIEnter/LeaveGraphics, which in = turn > calls ATIModeSet. Won't this lead to trying to obtain a lock when the > lock is already secured? It might be better to put the lock in > aticonsole.c in the ATIModeSwitch function. You are right, I was deadlocking the server. Anyway, the idea is that ATIModeSet has to Lock and Unlock, but ATIEnterVT(LeaveVT) has only to Unlock(Lock) the DRM. We could Lock/Unlock in ATISwitchMode, but I thi= nk that we are locking more that needed, because the ATIModeCalculate that = is also called from ATISwitchMode doesn't need to be locked. I think that the better way to do this is: ATIEnterVT: Unlock at the end of the Function (to avoid interlocks) ATILeaveVT: Lock at the end of the Function (to avoid interlocks) ATIModeSet: Lock at the beginning and Unlock at the end. What do you thing about this? > OK. I'm attaching a small patch that defines and uses a convenience m= acro > used by the other drm drivers (LOCK_TEST_WITH_RETURN). We can use thi= s > when we add more ioctls. The patch also includes the FIFO size define= s, > but you can just say no to that and delete the .rej file. All right. I've commited the changes to the CVS branch yet, but I have t= o fix the deadlock you've found, so, I'll also send the changes you've sent me= . > > On a totally unrelated note, do you know how to get etags to index K&R > style functions like the ones in aticonsole.c? No. Sorry. |