* [TRIVIAL] [PATCH ] remove check_region from drivers_scsi_cpqfcTSinit.c
@ 2003-01-06 4:04 Rusty Trivial Russell
0 siblings, 0 replies; 2+ messages in thread
From: Rusty Trivial Russell @ 2003-01-06 4:04 UTC (permalink / raw)
To: linux-scsi, Chris Loveland
From: william stinson <wstinson@wanadoo.fr>
Hi Amy,
this proposed patch for drivers/scsi/cpqfcTSinit.c scsi driver for Linux removes two calls to check_region using request_region instead
I don't have this hardware so patch is not tested. This patch removes all references to check_region in this driver.
Patch also available at the following URL:
http://www.chez.com/wstinson/linux/kernel/patch-scsi-cpqfcTSinit
This is patch number 28 in a series of check_region patches I am doing as
part of the kernel janitors project. Removal of check_region is one of the
items on the kernel janitors TODO list (http://www.kerneljanitors.org/TODO)
- get rid of check_region, use just request_region checking its return (2.2
request_region returned void) and now the driver init sequence is not to be
serialized anymore, so races are possible (look at cardbus/pcihotplug code)
Best regards
William Stinson
--- trivial-2.5-bk/drivers/scsi/cpqfcTSinit.c.orig 2003-01-06 14:11:03.000000000 +1100
+++ trivial-2.5-bk/drivers/scsi/cpqfcTSinit.c 2003-01-06 14:11:03.000000000 +1100
@@ -384,7 +384,8 @@
// Since we have two 256-byte I/O port ranges (upper
// and lower), check them both
- if( check_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff) )
+ if( !request_region( cpqfcHBAdata->fcChip.Registers.IOBaseU,
+ 0xff, DEV_NAME ) )
{
printk(" cpqfcTS address in use: %x\n",
cpqfcHBAdata->fcChip.Registers.IOBaseU);
@@ -393,21 +394,21 @@
continue;
}
- if( check_region( cpqfcHBAdata->fcChip.Registers.IOBaseL, 0xff) )
+ if( !request_region( cpqfcHBAdata->fcChip.Registers.IOBaseL,
+ 0xff, DEV_NAME ) )
{
printk(" cpqfcTS address in use: %x\n",
cpqfcHBAdata->fcChip.Registers.IOBaseL);
+ release_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff );
free_irq( HostAdapter->irq, HostAdapter);
scsi_unregister( HostAdapter);
continue;
}
- // OK, we should be able to grab everything we need now.
- request_region( cpqfcHBAdata->fcChip.Registers.IOBaseL, 0xff, DEV_NAME);
- request_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff, DEV_NAME);
- DEBUG_PCI(printk(" Requesting 255 I/O addresses @ %x\n",
+ // OK, we have grabbed everything we need now.
+ DEBUG_PCI(printk(" Reserved 255 I/O addresses @ %x\n",
cpqfcHBAdata->fcChip.Registers.IOBaseL ));
- DEBUG_PCI(printk(" Requesting 255 I/O addresses @ %x\n",
+ DEBUG_PCI(printk(" Reserved 255 I/O addresses @ %x\n",
cpqfcHBAdata->fcChip.Registers.IOBaseU ));
--
Don't blame me: the Monkey is driving
File: william stinson <wstinson@wanadoo.fr>: [PATCH ] remove check_region from drivers_scsi_cpqfcTSinit.c
^ permalink raw reply [flat|nested] 2+ messages in thread
* [TRIVIAL] [PATCH ] remove check_region from drivers_scsi_cpqfcTSinit.c
@ 2003-01-14 2:46 Rusty Trivial Russell
0 siblings, 0 replies; 2+ messages in thread
From: Rusty Trivial Russell @ 2003-01-14 2:46 UTC (permalink / raw)
To: Linus Torvalds; +Cc: linux-scsi
From: william stinson <wstinson@wanadoo.fr>
Hi Amy,
this proposed patch for drivers/scsi/cpqfcTSinit.c scsi driver for Linux removes two calls to check_region using request_region instead
I don't have this hardware so patch is not tested. This patch removes all references to check_region in this driver.
Patch also available at the following URL:
http://www.chez.com/wstinson/linux/kernel/patch-scsi-cpqfcTSinit
This is patch number 28 in a series of check_region patches I am doing as
part of the kernel janitors project. Removal of check_region is one of the
items on the kernel janitors TODO list (http://www.kerneljanitors.org/TODO)
- get rid of check_region, use just request_region checking its return (2.2
request_region returned void) and now the driver init sequence is not to be
serialized anymore, so races are possible (look at cardbus/pcihotplug code)
Best regards
William Stinson
--- trivial-2.5.57/drivers/scsi/cpqfcTSinit.c.orig 2003-01-14 12:54:31.000000000 +1100
+++ trivial-2.5.57/drivers/scsi/cpqfcTSinit.c 2003-01-14 12:54:31.000000000 +1100
@@ -384,7 +384,8 @@
// Since we have two 256-byte I/O port ranges (upper
// and lower), check them both
- if( check_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff) )
+ if( !request_region( cpqfcHBAdata->fcChip.Registers.IOBaseU,
+ 0xff, DEV_NAME ) )
{
printk(" cpqfcTS address in use: %x\n",
cpqfcHBAdata->fcChip.Registers.IOBaseU);
@@ -393,21 +394,21 @@
continue;
}
- if( check_region( cpqfcHBAdata->fcChip.Registers.IOBaseL, 0xff) )
+ if( !request_region( cpqfcHBAdata->fcChip.Registers.IOBaseL,
+ 0xff, DEV_NAME ) )
{
printk(" cpqfcTS address in use: %x\n",
cpqfcHBAdata->fcChip.Registers.IOBaseL);
+ release_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff );
free_irq( HostAdapter->irq, HostAdapter);
scsi_unregister( HostAdapter);
continue;
}
- // OK, we should be able to grab everything we need now.
- request_region( cpqfcHBAdata->fcChip.Registers.IOBaseL, 0xff, DEV_NAME);
- request_region( cpqfcHBAdata->fcChip.Registers.IOBaseU, 0xff, DEV_NAME);
- DEBUG_PCI(printk(" Requesting 255 I/O addresses @ %x\n",
+ // OK, we have grabbed everything we need now.
+ DEBUG_PCI(printk(" Reserved 255 I/O addresses @ %x\n",
cpqfcHBAdata->fcChip.Registers.IOBaseL ));
- DEBUG_PCI(printk(" Requesting 255 I/O addresses @ %x\n",
+ DEBUG_PCI(printk(" Reserved 255 I/O addresses @ %x\n",
cpqfcHBAdata->fcChip.Registers.IOBaseU ));
--
Don't blame me: the Monkey is driving
File: william stinson <wstinson@wanadoo.fr>: [PATCH ] remove check_region from drivers_scsi_cpqfcTSinit.c
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2003-01-14 2:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-01-14 2:46 [TRIVIAL] [PATCH ] remove check_region from drivers_scsi_cpqfcTSinit.c Rusty Trivial Russell
-- strict thread matches above, loose matches on Subject: below --
2003-01-06 4:04 Rusty Trivial Russell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox