Commit ba08cd44 authored by Aristeu Sergio Rozanski Filho's avatar Aristeu Sergio Rozanski Filho Committed by James Bottomley

[PATCH] qlogicfas: kill horrible irq probing

	this patch kills irq probe and also I/O because isn't useful to
	probe I/O if we can't probe irq later.
parent 07789a18
...@@ -475,7 +475,6 @@ int qlogicfas_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *)) ...@@ -475,7 +475,6 @@ int qlogicfas_queuecommand(Scsi_Cmnd * cmd, void (*done) (Scsi_Cmnd *))
struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase, struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase,
int qlirq) int qlirq)
{ {
int i, j; /* these are only used by IRQ detect */
int qltyp; /* type of chip */ int qltyp; /* type of chip */
int qinitid; int qinitid;
struct Scsi_Host *hreg; /* registered host structure */ struct Scsi_Host *hreg; /* registered host structure */
...@@ -490,20 +489,26 @@ struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase, ...@@ -490,20 +489,26 @@ struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase,
* the second card, but I haven't tested this. * the second card, but I haven't tested this.
*/ */
if (!qbase) { if (!qbase || qlirq == -1)
for (qbase = 0x230; qbase < 0x430; qbase += 0x100) { goto err;
if (!request_region(qbase, 0x10, qlogicfas_name))
continue; if (!request_region(qbase, 0x10, qlogicfas_name)) {
REG1; printk(KERN_INFO "%s: address %#x is busy\n", qlogicfas_name,
if (((inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7) qbase);
&& ((inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7)) goto err;
break; }
release_region(qbase, 0x10);
} REG1;
if (qbase == 0x430) if (((inb(qbase + 0xe) ^ inb(qbase + 0xe)) != 7)
return NULL; || ((inb(qbase + 0xe) ^ inb(qbase + 0xe)) != 7)) {
} else printk(KERN_WARNING "%s: probe failed for %#x\n",
printk(KERN_INFO "Ql: Using preset base address of %03x\n", qbase); qlogicfas_name,
qbase);
goto err_release_mem;
}
printk(KERN_INFO "%s: Using preset base address of %03x,"
" IRQ %d\n", qlogicfas_name, qbase, qlirq);
qltyp = inb(qbase + 0xe) & 0xf8; qltyp = inb(qbase + 0xe) & 0xf8;
qinitid = host->this_id; qinitid = host->this_id;
...@@ -524,32 +529,6 @@ struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase, ...@@ -524,32 +529,6 @@ struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase,
REG0; REG0;
#endif #endif
/*
* IRQ probe - toggle pin and check request pending
*/
if (qlirq == -1) {
i = 0xffff;
j = 3;
outb(0x90, qbase + 3); /* illegal command - cause interrupt */
REG1;
outb(10, 0x20); /* access pending interrupt map */
outb(10, 0xa0);
while (j--) {
outb(0xb0 | QL_INT_ACTIVE_HIGH, qbase + 0xd); /* int pin off */
i &= ~(inb(0x20) | (inb(0xa0) << 8)); /* find IRQ off */
outb(0xb4 | QL_INT_ACTIVE_HIGH, qbase + 0xd); /* int pin on */
i &= inb(0x20) | (inb(0xa0) << 8); /* find IRQ on */
}
REG0;
while (inb(qbase + 5)); /* purge int */
j = -1;
while (i) /* find on bit */
i >>= 1, j++; /* should check for exactly 1 on */
qlirq = j;
} else
printk(KERN_INFO "Ql: Using preset IRQ %d\n", qlirq);
hreg = scsi_host_alloc(host, sizeof(struct qlogicfas_priv)); hreg = scsi_host_alloc(host, sizeof(struct qlogicfas_priv));
if (!hreg) if (!hreg)
goto err_release_mem; goto err_release_mem;
...@@ -587,6 +566,7 @@ struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase, ...@@ -587,6 +566,7 @@ struct Scsi_Host *__qlogicfas_detect(Scsi_Host_Template *host, int qbase,
err_release_mem: err_release_mem:
release_region(qbase, 0x10); release_region(qbase, 0x10);
err:
return NULL; return NULL;
} }
...@@ -603,10 +583,9 @@ int __devinit qlogicfas_detect(Scsi_Host_Template *sht) ...@@ -603,10 +583,9 @@ int __devinit qlogicfas_detect(Scsi_Host_Template *sht)
{ {
struct Scsi_Host *shost; struct Scsi_Host *shost;
qlogicfas_priv_t priv; qlogicfas_priv_t priv;
int i, int num;
num = 0;
for (i = 0; i < MAX_QLOGICFAS; i++) { for (num = 0; num < MAX_QLOGICFAS; num++) {
shost = __qlogicfas_detect(sht, iobase[num], irq[num]); shost = __qlogicfas_detect(sht, iobase[num], irq[num]);
if (shost == NULL) { if (shost == NULL) {
/* no more devices */ /* no more devices */
...@@ -615,7 +594,6 @@ int __devinit qlogicfas_detect(Scsi_Host_Template *sht) ...@@ -615,7 +594,6 @@ int __devinit qlogicfas_detect(Scsi_Host_Template *sht)
priv = (qlogicfas_priv_t)&(shost->hostdata[0]); priv = (qlogicfas_priv_t)&(shost->hostdata[0]);
priv->next = cards; priv->next = cards;
cards = priv; cards = priv;
num++;
} }
return num; return num;
...@@ -747,6 +725,9 @@ static __init int qlogicfas_init(void) ...@@ -747,6 +725,9 @@ static __init int qlogicfas_init(void)
{ {
if (!qlogicfas_detect(&qlogicfas_driver_template)) { if (!qlogicfas_detect(&qlogicfas_driver_template)) {
/* no cards found */ /* no cards found */
printk(KERN_INFO "%s: no cards were found, please specify "
"I/O address and IRQ using iobase= and irq= "
"options", qlogicfas_name);
return -ENODEV; return -ENODEV;
} }
......
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