Skip to contentSkip to conversation

Can't compile Symbios 53c416 SCSI support

DISCUSSION Paulo Andre' 2 participants 5 messages Jan 27, 2002 – Jan 28, 2002

lore
Share & tools
lore
#0 lore raw

Hi!

I've been trying to compile the Symbios 53c416 SCSI host adapter but it chokes when trying to compile sym53c416.c. AFAIK, this happens with 2.5.1 and later kernels and did _not_ happen with any 2.4 kernel. I reproduced this on both 2.5.1, 2.5.2 and 2.5.2-dj3. Here's the output:

gcc -D__KERNEL__ -I/usr/local/src/devel/linux/include -Wall -Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer -fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2 -march=i586 -c -o sym53c416.o sym53c416.c
sym53c416.c: In function `sym53c416_intr_handle':
sym53c416.c:362: `io_request_lock' undeclared (first use in this function) sym53c416.c:362: (Each undeclared identifier is reported only once sym53c416.c:362: for each function it appears in.)
make[3]: *** [sym53c416.o] Error 1
make[3]: Leaving directory `/usr/local/src/devel/linux/drivers/scsi' make[2]: *** [first_rule] Error 2
make[2]: Leaving directory `/usr/local/src/devel/linux/drivers/scsi' make[1]: *** [_subdir_scsi] Error 2
make[1]: Leaving directory `/usr/local/src/devel/linux/drivers'
make: *** [_dir_drivers] Error 2

If it is of any help, the .config used goes attached.

I'm a newbie though I see <linux/blk.h> is included. Still it says io_request_lock is undeclared... should be trivial but goes beyond my knowledge :)

Thanks in advance

// Paulo Andre'

/~\ The ASCII
\ / Ribbon Campaign
X Against HTML
/ \ Email!

#1 lore raw
Quoted 9 lines · On Sun, 27 Jan 2002 20:12:13 +0000 "Paulo Andre'" <[email protected]>…

sym53c416.c: In function `sym53c416_intr_handle':
sym53c416.c:362: `io_request_lock' undeclared (first use in this function)
sym53c416.c:362: (Each undeclared identifier is reported only once sym53c416.c:362: for each function it appears in.)

I'm a newbie though I see <linux/blk.h> is included. Still it says io_request_lock is undeclared... should be trivial but goes beyond my knowledge :)

It seems that io_request_lock will be completely removed in 2.5 tree, so there is no io_request_lock in linux/blk.h. This global lock now exsist only in scsi layer, and it will be replaced by Scsi_Host->host_lock soon. So i hope this patch will help a bit in this direction.

2 Paulo Andre: DON'T use this patch before Jens Axboe will agree with it, because i even haven't scsi here, so this patch was written only with common sence. I hope this will help you.

Quoted 4 lines

Thanks in advance

// Paulo Andre'

Evgeniy Polyakov ( s0mbre ).

#2 lore raw
Quoted 2 lines

So i hope this patch will help a bit in this direction.

Ooops, forgot to attach.

Evgeniy Polyakov ( s0mbre ).

linux/drivers/scsi/sym53c416.c renamed from linux.orig/drivers/scsi/sym53c416.c +16 -15
@@ -337,6 +337,7 @@
 
 static void sym53c416_intr_handle(int irq, void *dev_id, struct pt_regs *regs)
 {
+	struct Scsi_Host *dev = dev_id;
 	int base = 0;
 	int i;
 	unsigned long flags = 0;
@@ -359,11 +360,11 @@
 	}
 	/* Now we have the base address and we can start handling the interrupt */
 
-	spin_lock_irqsave(&io_request_lock,flags);
+	spin_lock_irqsave(&dev->host_lock,flags);
 	status_reg = inb(base + STATUS_REG);
 	pio_int_reg = inb(base + PIO_INT_REG);
 	int_reg = inb(base + INT_REG);
-	spin_unlock_irqrestore(&io_request_lock, flags);
+	spin_unlock_irqrestore(&dev->host_lock, flags);
 
 	/* First, we handle error conditions */
 	if(int_reg & SCI)         /* SCSI Reset */
@@ -371,9 +372,9 @@
 		printk(KERN_DEBUG "sym53c416: Reset received\n");
 		current_command->SCp.phase = idle;
 		current_command->result = DID_RESET << 16;
-		spin_lock_irqsave(&io_request_lock, flags);
+		spin_lock_irqsave(&dev->host_lock, flags);
 		current_command->scsi_done(current_command);
-		spin_unlock_irqrestore(&io_request_lock, flags);
+		spin_unlock_irqrestore(&dev->host_lock, flags);
 		return;
 	}
 	if(int_reg & ILCMD)       /* Illegal Command */
@@ -381,9 +382,9 @@
 		printk(KERN_WARNING "sym53c416: Illegal Command: 0x%02x.\n", inb(base + COMMAND_REG));
 		current_command->SCp.phase = idle;
 		current_command->result = DID_ERROR << 16;
-		spin_lock_irqsave(&io_request_lock, flags);
+		spin_lock_irqsave(&dev->host_lock, flags);
 		current_command->scsi_done(current_command);
-		spin_unlock_irqrestore(&io_request_lock, flags);
+		spin_unlock_irqrestore(&dev->host_lock, flags);
 		return;
 	}
 	if(status_reg & GE)         /* Gross Error */
@@ -391,9 +392,9 @@
 		printk(KERN_WARNING "sym53c416: Controller reports gross error.\n");
 		current_command->SCp.phase = idle;
 		current_command->result = DID_ERROR << 16;
-		spin_lock_irqsave(&io_request_lock, flags);
+		spin_lock_irqsave(&dev->host_lock, flags);
 		current_command->scsi_done(current_command);
-		spin_unlock_irqrestore(&io_request_lock, flags);
+		spin_unlock_irqrestore(&dev->host_lock, flags);
 		return;
 	}
 	if(status_reg & PE)         /* Parity Error */
@@ -401,9 +402,9 @@
 		printk(KERN_WARNING "sym53c416:SCSI parity error.\n");
 		current_command->SCp.phase = idle;
 		current_command->result = DID_PARITY << 16;
-		spin_lock_irqsave(&io_request_lock, flags);
+		spin_lock_irqsave(&dev->host_lock, flags);
 		current_command->scsi_done(current_command);
-		spin_unlock_irqrestore(&io_request_lock, flags);
+		spin_unlock_irqrestore(&dev->host_lock, flags);
 		return;
 	}
 	if(pio_int_reg & (CE | OUE))
@@ -411,9 +412,9 @@
 		printk(KERN_WARNING "sym53c416: PIO interrupt error.\n");
 		current_command->SCp.phase = idle;
 		current_command->result = DID_ERROR << 16;
-		spin_lock_irqsave(&io_request_lock, flags);
+		spin_lock_irqsave(&dev->host_lock, flags);
 		current_command->scsi_done(current_command);
-		spin_unlock_irqrestore(&io_request_lock, flags);
+		spin_unlock_irqrestore(&dev->host_lock, flags);
 		return;
 	}
 	if(int_reg & DIS)           /* Disconnect */
@@ -423,9 +424,9 @@
 		else
 			current_command->result = (current_command->SCp.Status & 0xFF) | ((current_command->SCp.Message & 0xFF) << 8) | (DID_OK << 16);
 		current_command->SCp.phase = idle;
-		spin_lock_irqsave(&io_request_lock, flags);
+		spin_lock_irqsave(&dev->host_lock, flags);
 		current_command->scsi_done(current_command);
-		spin_unlock_irqrestore(&io_request_lock, flags);
+		spin_unlock_irqrestore(&dev->host_lock, flags);
 		return;
 	}
 	/* Now we handle SCSI phases         */
@@ -719,7 +720,7 @@
 				cli();
 				/* FIXME: Request_irq with CLI is not safe */
 				/* Request for specified IRQ */
-				if(request_irq(hosts[i].irq, sym53c416_intr_handle, 0, ID, NULL))
+				if(request_irq(hosts[i].irq, sym53c416_intr_handle, 0, ID, shpnt))
 				{
 					restore_flags(flags);
 					printk(KERN_ERR "sym53c416: Unable to assign IRQ %d\n", hosts[i].irq);
#3 lore raw
In reply to Paulo Andre'
Quoted 8 lines · On 2002.01.28 01:38 Evgeniy Polyakov wrote:

It seems that io_request_lock will be completely removed in 2.5 tree, so
there is no io_request_lock in linux/blk.h. This global lock now exsist
only in scsi layer, and it will be replaced by Scsi_Host->host_lock soon.
So i hope this patch will help a bit in this direction.

Quoted 4 lines

2 Paulo Andre: DON'T use this patch before Jens Axboe will agree with it,
because i even haven't scsi here, so this patch was written only with common sence. I hope this will help you.

I see your point. I was also thinking about something along those lines. Anyway, what patch are you talking about? Perhaps you forgot to paste/attach it to your email?

And perhaps Jens could also give me a word about this?

Cheers Evgeniy and thanks again,

// Paulo Andre'

#4 lore raw
In reply to Paulo Andre'
Quoted 7 lines · On 2002.01.28 01:41 Evgeniy Polyakov wrote:
Quoted 2 lines

So i hope this patch will help a bit in this direction.

Ooops, forgot to attach.

Evgeniy Polyakov ( s0mbre ).

Alright, I got it now, will investigate. It's not problematic to use it either way since it's not intended for production use. Not now, anyway. Thanks!

// Paulo Andre'