Re: Quick aic7xxx bug hunt...

From: Jeff Garzik (
Date: Mon Sep 23 2002 - 18:22:18 EST

Justin T. Gibbs wrote:
>>>For all of these delays, I'd be more than happy to make them all into
>>>sleeps if I can tell, from inside ahc_delay() if I'm in a context where
>>>it is safe to sleep. On the other platforms that this core code runs on
>>>I'm usually not in a context where it is safe to sleep, so I don't want
>>>to switch to using a different driver primitive.
>>For Linux it's unconditionally safe, and other platforms is sounds like
>>it's unconditionally not. So, s/ahc_delay/ahc_sleep/ for the places I
>>pointed out, and just make ahc_delay==ahc_sleep on non-Linux platforms
>>(or any similarly-functioning solution)
> So you can sleep while in an interrupt context? I didn't know that
> 2.5 had switched to using interrupt threads or some similar construct.

Of course not :)

        aic7770_config -> can sleep
        ahc_pci_config -> can sleep
        ahc_shutdown -> can't sleep, whoops
        ahc_resume -> dead code
        aic7770_config -> can sleep
        ahc_pci_config -> can sleep
        check_extport -> can sleep
        ahc_proc_write_seeprom -> can sleep

so, ahc_init and ahc_acquire_seeprom can s/ahc_delay/ahc_sleep/ safely.

Oh, and I found another bug: never use check_region, it's inherently
racy. Use request_region and check its return value.

Note I agree with a comment in the code, that wrapping SHT->detect() in
io_request_lock is silly... the comment describing the rationale in
drivers/scsi/scsi.c is not really accurate...


To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

This archive was generated by hypermail 2b29 : Mon Sep 23 2002 - 22:00:41 EST