Commit b5b8d2bf authored by Doug Ledford's avatar Doug Ledford

aic7xxx_old: fix check_region/request_region usage so that the module

	may be loaded/unloaded/reloaded
parent ad82a127
...@@ -9310,7 +9310,8 @@ aic7xxx_detect(Scsi_Host_Template *template) ...@@ -9310,7 +9310,8 @@ aic7xxx_detect(Scsi_Host_Template *template)
pci_write_config_dword(pdev, DEVCONFIG, devconfig); pci_write_config_dword(pdev, DEVCONFIG, devconfig);
#endif /* AIC7XXX_STRICT_PCI_SETUP */ #endif /* AIC7XXX_STRICT_PCI_SETUP */
if(temp_p->base && check_region(temp_p->base, MAXREG - MINREG)) if(temp_p->base && !request_region(temp_p->base, MAXREG - MINREG,
"aic7xxx"))
{ {
printk("aic7xxx: <%s> at PCI %d/%d/%d\n", printk("aic7xxx: <%s> at PCI %d/%d/%d\n",
board_names[aic_pdevs[i].board_name_index], board_names[aic_pdevs[i].board_name_index],
...@@ -9388,12 +9389,6 @@ aic7xxx_detect(Scsi_Host_Template *template) ...@@ -9388,12 +9389,6 @@ aic7xxx_detect(Scsi_Host_Template *template)
} }
#endif #endif
/*
* Lock out other contenders for our i/o space.
*/
if(temp_p->base)
request_region(temp_p->base, MAXREG - MINREG, "aic7xxx");
/* /*
* We HAVE to make sure the first pause_sequencer() and all other * We HAVE to make sure the first pause_sequencer() and all other
* subsequent I/O that isn't PCI config space I/O takes place * subsequent I/O that isn't PCI config space I/O takes place
...@@ -9742,7 +9737,7 @@ aic7xxx_detect(Scsi_Host_Template *template) ...@@ -9742,7 +9737,7 @@ aic7xxx_detect(Scsi_Host_Template *template)
{ {
base = SLOTBASE(slot) + MINREG; base = SLOTBASE(slot) + MINREG;
if (check_region(base, MAXREG - MINREG)) if (!request_region(base, MAXREG - MINREG, "aic7xxx"))
{ {
/* /*
* Some other driver has staked a * Some other driver has staked a
...@@ -9755,6 +9750,7 @@ aic7xxx_detect(Scsi_Host_Template *template) ...@@ -9755,6 +9750,7 @@ aic7xxx_detect(Scsi_Host_Template *template)
type = aic7xxx_probe(slot, base + AHC_HID0, &flags); type = aic7xxx_probe(slot, base + AHC_HID0, &flags);
if (type == -1) if (type == -1)
{ {
release_region(base, MAXREG - MINREG);
slot++; slot++;
continue; continue;
} }
...@@ -9762,13 +9758,10 @@ aic7xxx_detect(Scsi_Host_Template *template) ...@@ -9762,13 +9758,10 @@ aic7xxx_detect(Scsi_Host_Template *template)
if (temp_p == NULL) if (temp_p == NULL)
{ {
printk(KERN_WARNING "aic7xxx: Unable to allocate device space.\n"); printk(KERN_WARNING "aic7xxx: Unable to allocate device space.\n");
release_region(base, MAXREG - MINREG);
slot++; slot++;
continue; /* back to the beginning of the while loop */ continue; /* back to the beginning of the while loop */
} }
/*
* Lock out other contenders for our i/o space.
*/
request_region(base, MAXREG - MINREG, "aic7xxx");
/* /*
* Pause the card preserving the IRQ type. Allow the operator * Pause the card preserving the IRQ type. Allow the operator
...@@ -10972,6 +10965,10 @@ aic7xxx_reset(Scsi_Cmnd *cmd) ...@@ -10972,6 +10965,10 @@ aic7xxx_reset(Scsi_Cmnd *cmd)
* *
* Description: * Description:
* Return the disk geometry for the given SCSI device. * Return the disk geometry for the given SCSI device.
*
* Note:
* This function is broken for today's really large drives and needs
* fixed.
*-F*************************************************************************/ *-F*************************************************************************/
int int
aic7xxx_biosparam(struct scsi_device *sdev, struct block_device *bdev, aic7xxx_biosparam(struct scsi_device *sdev, struct block_device *bdev,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment