Skip to contentSkip to conversation

I2O Updates + Questions

PATCH Alan Cox 2 participants 3 messages Sep 14, 2004

lore
Share & tools
lore

Alan Cox

author
#0 lore raw

Markus, the new I2O stuff mostly looks nice. I found a few bits that seem wrong and some of my old cleanup bits still needed

The attached patch files

- Fix misformed error messages in i2o_block
- Add recieve_to_virt and send_to_virt to clean up remaining virt_to_* usage. (I've tweaked them to reflect the i2o_dma objects) so hopefully I got it right
- Post an 8 byte startup message area. Some Promises scribble on the wrong dword. Also catch this
- Fix several cases where messages got written to I/O space without i2o_raw_writel
- Fix a case where we skipped dpt controllers on quiesce and didnt skip them on enable
- Add some bits to try and get promise behaving again
- Cleaned up the probe loop
- Removed the remainder of i2o_retry and used the trick I was using in my test code from back whenever- on congestion report BUS_BUSY and leave it to the scsi layer

Looking at the code the event stuff seems totally broken in the new code both in core and the commented out i2o_block code (which now leaks memory). Also i2o_scsi error path does a readl on msg->body[3] which is wrong as msg->body[3] is in kernel space and its contents are an I2O side message value so should get fed to i2o_send_to_virt().

Other question is message size - right now it uses the 2.4 message size which is twice what all the vendors recommend as working best (and doesn't work at all on AMI)

Alan

drivers/message/i2o/i2o_block.c +2 -3
diff -u -p --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.9rc2/drivers/message/i2o/i2o_block.c linux-2.6.9rc2/drivers/message/i2o/i2o_block.c
@@ -420,7 +420,6 @@ static int i2o_block_reply(struct i2o_co
 		struct i2o_message *pmsg;
 		u32 pm;
 
-		printk(KERN_WARNING "FAIL");
 		/*
 		 * FAILed message from controller
 		 * We increment the error count and abort it
@@ -538,7 +537,7 @@ static int i2o_block_reply(struct i2o_co
 		 *      Don't stick a supertrak100 into cache aggressive modes
 		 */
 
-		printk(KERN_ERR "\n/dev/%s error: %s", dev->gd->disk_name,
+		printk(KERN_ERR "/dev/%s error: %s", dev->gd->disk_name,
 		       bsa_errors[readl(&msg->body[0]) & 0xffff]);
 		if (readl(&msg->body[0]) & 0x00ff0000)
 			printk(" - DDM attempted %d retries",
@@ -563,7 +562,7 @@ static int i2o_block_reply(struct i2o_co
 		i2o_block_sglist_free(ireq);
 		i2o_block_request_free(ireq);
 	} else
-		printk(KERN_ERR "still remaining chunks\n");
+		printk(KERN_ERR "i2o_block: still remaining chunks\n");
 
 	return 1;
 };
drivers/message/i2o/i2o_core.c +177 -55

362 lines not on this page · raw message

drivers/message/i2o/i2o_scsi.c +11 -55

96 lines not on this page · raw message

include/linux/i2o.h +5 -1
diff -u -p --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.9rc2/include/linux/i2o.h linux-2.6.9rc2/include/linux/i2o.h
@@ -47,7 +47,7 @@ struct i2o_message {
 			u32 function:8;
 			u32 icntxt;	/* initiator context */
 			u32 tcntxt;	/* transaction context */
-		} s;
+		} __attribute((packed)) s;
 		u32 head[4];
 	} u;
 	/* List follows */
@@ -597,6 +597,10 @@ extern int i2o_parm_field_get(struct i2o
 extern int i2o_parm_field_set(struct i2o_device *, int, int, void *, int);
 extern int i2o_parm_table_get(struct i2o_device *, int, int, int, void *, int,
 			      void *, int);
+ 
+extern void *i2o_send_to_virt(struct i2o_controller *, u32);
+extern void *i2o_receive_to_virt(struct i2o_controller *, u32);
+
 /* FIXME: remove
 extern int i2o_query_table(int, struct i2o_controller *, int, int, int,
 			   void *, int, void *, int);
#1 lore raw

Hello,

Quoted 4 lines · Alan Cox

Markus, the new I2O stuff mostly looks nice. I found a few bits that seem wrong and some of my old cleanup bits still needed The attached patch files
- Fix misformed error messages in i2o_block

Okay...

Quoted 6 lines

- Add recieve_to_virt and send_to_virt to clean up remaining virt_to_* usage. (I've tweaked them to reflect the i2o_dma objects) so hopefully I got it right
- Post an 8 byte startup message area. Some Promises scribble on the wrong dword. Also catch this
- Fix several cases where messages got written to I/O space without

Quoted 8 lines

i2o_raw_writel
- Fix a case where we skipped dpt controllers on quiesce and didnt skip them on enable
- Add some bits to try and get promise behaving again
- Cleaned up the probe loop
- Removed the remainder of i2o_retry and used the trick I was using in my test code from back whenever- on congestion report BUS_BUSY and leave it to the scsi layer

Ohohhh... i2o_core.c shouldn't be there anymore... I've split up i2o_core.c in own files e. g. iop.c, pci.c, ...

Probably i've made a mistake with the patch i've submitted...

Will try to get it removed...

Quoted 2 lines

Looking at the code the event stuff seems totally broken in the new code both in core and the commented out i2o_block code (which now leaks

The I2O Block driver doesn't use the event notifaction anymore, instead it uses the probe and remove functions to add or remove disks...

Quoted 3 lines

memory). Also i2o_scsi error path does a readl on msg->body[3] which is wrong as msg->body[3] is in kernel space and its contents are an I2O side message value so should get fed to i2o_send_to_virt().

The msg points to the outbound queue of the controller, don't i need a readl there?

Quoted 3 lines

Other question is message size - right now it uses the 2.4 message size which is twice what all the vendors recommend as working best (and doesn't work at all on AMI)

The message size from the outbound queue of the I2O controller?

Yep, the dpt_i2o driver even set it to 17 instead of 128 :-)

Sorry for the mistake with the i2o_core.c.

Thanks for taking time to look at the I2O driver!

Best regards,

Markus Lidel
------------------------------------------
Markus Lidel (Senior IT Consultant)

Shadow Connect GmbH
Carl-Reisch-Weg 12
D-86381 Krumbach
Germany

Phone:  +49 82 82/99 51-0
Fax:    +49 82 82/99 51-11
E-Mail: [email protected]
URL:    http://www.shadowconnect.com
author
#2 lore raw
Quoted 15 lines · Markus Lidel
Quoted 6 lines

- Add recieve_to_virt and send_to_virt to clean up remaining virt_to_* usage. (I've tweaked them to reflect the i2o_dma objects) so hopefully I got it right
- Post an 8 byte startup message area. Some Promises scribble on the wrong dword. Also catch this
- Fix several cases where messages got written to I/O space without

Quoted 8 lines

i2o_raw_writel
- Fix a case where we skipped dpt controllers on quiesce and didnt skip them on enable
- Add some bits to try and get promise behaving again
- Cleaned up the probe loop
- Removed the remainder of i2o_retry and used the trick I was using in my test code from back whenever- on congestion report BUS_BUSY and leave it to the scsi layer

Quoted 2 lines

Ohohhh... i2o_core.c shouldn't be there anymore... I've split up i2o_core.c in own files e. g. iop.c, pci.c, ...

Ah probably someone didnt propogate the deletion. That happens.

Quoted 5 lines
Quoted 2 lines

Looking at the code the event stuff seems totally broken in the new code both in core and the commented out i2o_block code (which now leaks

The I2O Block driver doesn't use the event notifaction anymore, instead it uses the probe and remove functions to add or remove disks...

It sets the event pointer so seems to get called with an event which it fails to reply to (as required) and fails to kfree the kmalloc'd message. It would also be nice to keep the 0x20 message watch for promise cards (at least when testing) since a promise firmware crash isnt otherwise visible except as 16Mb of I/O going missing

Quoted 7 lines
Quoted 4 lines

memory). Also i2o_scsi error path does a readl on msg->body[3] which is wrong as msg->body[3] is in kernel space and its contents are an I2O side message value so should get fed to i2o_send_to_virt().

The msg points to the outbound queue of the controller, don't i need a readl there?

Messages from the controller to the kernel are in kernel memory. They are the ones we allocated and posted. The data in body[3] is a message offset in I2O space if I remember rightly.

Quoted 11 lines
Quoted 3 lines

Other question is message size - right now it uses the 2.4 message size which is twice what all the vendors recommend as working best (and doesn't work at all on AMI)

The message size from the outbound queue of the I2O controller?

Yep, the dpt_i2o driver even set it to 17 instead of 128 :-)

Sorry for the mistake with the i2o_core.c.

Thanks for taking time to look at the I2O driver!

No problem. I'll take a look at the split version of the driver and see if the same fixes are needed. Since the bugs involved go back to my original code they may well do.

Alan