Jens Axboe wrote: > On Thu, Apr 03 2003, rain.wang wrote: > > Hi Alan, > > I found just changing ide_do_reset() to wait till completion can > > handle the handler race. can this be enough? > > This is buggy for a number of reasons. Firstly, how do you make sure > that someone else doesn't race with your hwif_data manipulation? This > looks very suspect. By far the worst problem is that you are assuming > that ide_do_reset() can sleep, when in fact it cannot (just follow the > various paths into ide_do_request()). You even grab the ide_lock _and_ > disable interrupts yourself prior calling wait_for_completion(), this is > incredibly broken. > > -- > Jens Axboe Hi, Thank you, I'm too young. I should have put this in RFC. please help me to replace using 'hwif-data', I mainly mean to let drive reset wait for its clean up complete. regards rain.w