Re: [PATCH] raceless request_region() fix (was Re: Linux 2.6.0-test4)

From: insecure
Date: Tue Aug 26 2003 - 00:22:04 EST


[de-cc'ing Linus]

On Tuesday 26 August 2003 00:59, Jeff Garzik wrote:
> Is it a race if noone cares? :)
>
> The code does
>
> if (!request_region(...))
> fail
> touch hardware
> release_region
> if (!request_region(...))
> fail
>
> If the HIGHLY UNLIKELY event of another ISA driver claiming this region
> occurs, the system continues working just fine.

Yes, this particular driver is fine. My patch just eliminate back-to-back
release_region(...)
if (!request_region(...)) fail;
pair.

I just have a feeling that if I am going to replace check_region with
request_region, I can close race window altogether.

BTW, it all started when I tried to get rid of check_region in de4x5.c.
That's a bit worse. For example:
barrier();
request_region(iobase, (lp->bus == PCI ? DE4X5_PCI_TOTAL_SIZE :
DE4X5_EISA_TOTAL_SIZE),
lp->adapter_name);
lp->rxRingSize = NUM_RX_DESC;
--
vda
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/