* [PATCH] I2O support on alpha.
@ 2002-06-03 9:23 Pierrick Hascoet
2002-06-03 15:29 ` Alan Cox
0 siblings, 1 reply; 2+ messages in thread
From: Pierrick Hascoet @ 2002-06-03 9:23 UTC (permalink / raw)
To: linux-kernel
[-- Attachment #1: Type: TEXT/PLAIN, Size: 243 bytes --]
Hi,
Please find enclosed a little patch to support i2o controllers on alpha.
This patch is against 2.4.19-pre9 and works correctly with my i2o
controller used with the i2o_block driver.
Best regards,
Pierrick.
PS: Please, cc me to reply.
[-- Attachment #2: Type: TEXT/PLAIN, Size: 6735 bytes --]
diff -Naur linux-2.4.19-pre9/arch/alpha/config.in linux-2.4.19-pre9-ph/arch/alpha/config.in
--- linux-2.4.19-pre9/arch/alpha/config.in Mon Jun 3 11:13:47 2002
+++ linux-2.4.19-pre9-ph/arch/alpha/config.in Wed May 29 11:56:44 2002
@@ -326,6 +326,7 @@
if [ "$CONFIG_PCI" = "y" ]; then
source drivers/message/fusion/Config.in
+ source drivers/message/i2o/Config.in
fi
if [ "$CONFIG_NET" = "y" ]; then
diff -Naur linux-2.4.19-pre9/drivers/message/i2o/i2o_block.c linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_block.c
--- linux-2.4.19-pre9/drivers/message/i2o/i2o_block.c Mon Jun 3 11:14:04 2002
+++ linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_block.c Sun Jun 2 16:50:56 2002
@@ -56,12 +56,12 @@
#include <linux/errno.h>
#include <linux/file.h>
#include <linux/ioctl.h>
-#include <linux/i2o.h>
#include <linux/blkdev.h>
#include <linux/blkpg.h>
#include <linux/slab.h>
#include <linux/hdreg.h>
#include <linux/spinlock.h>
+#include <linux/init.h>
#include <linux/notifier.h>
#include <linux/reboot.h>
@@ -73,6 +73,7 @@
#include <asm/atomic.h>
#include <linux/smp_lock.h>
#include <linux/wait.h>
+#include <linux/i2o.h>
#define MAJOR_NR I2O_MAJOR
@@ -1104,7 +1105,7 @@
msg[0] = (FIVE_WORD_MSG_SIZE|SGL_OFFSET_0);
msg[1] = I2O_CMD_BLOCK_CFLUSH<<24|HOST_TID<<12|dev->tid;
msg[2] = i2ob_context|0x40000000;
- msg[3] = (u32)query_done;
+ msg[3] = (unsigned long)query_done;
msg[4] = 60<<16;
DEBUG("Flushing...");
i2o_post_wait(dev->controller, msg, 20, 60);
@@ -1115,7 +1116,7 @@
msg[0] = FIVE_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1] = I2O_CMD_BLOCK_MUNLOCK<<24|HOST_TID<<12|dev->tid;
msg[2] = i2ob_context|0x40000000;
- msg[3] = (u32)query_done;
+ msg[3] = (unsigned long)query_done;
msg[4] = -1;
DEBUG("Unlocking...");
i2o_post_wait(dev->controller, msg, 20, 2);
@@ -1718,7 +1719,7 @@
msg[0] = FIVE_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1] = I2O_CMD_BLOCK_CFLUSH<<24|HOST_TID<<12|dev->tid;
msg[2] = i2ob_context|0x40000000;
- msg[3] = (u32)query_done;
+ msg[3] = (unsigned long)query_done;
msg[4] = 60<<16;
DEBUG("Flushing...");
@@ -1731,7 +1732,7 @@
msg[0] = FIVE_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1] = I2O_CMD_BLOCK_MUNLOCK<<24|HOST_TID<<12|dev->tid;
msg[2] = i2ob_context|0x40000000;
- msg[3] = (u32)query_done;
+ msg[3] = (unsigned long)query_done;
msg[4] = -1;
i2o_post_wait(dev->controller, msg, 20, 2);
@@ -1934,3 +1935,4 @@
module_init(i2o_block_init);
module_exit(i2o_block_exit);
+
diff -Naur linux-2.4.19-pre9/drivers/message/i2o/i2o_config.c linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_config.c
--- linux-2.4.19-pre9/drivers/message/i2o/i2o_config.c Mon Jun 3 11:14:04 2002
+++ linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_config.c Sun Jun 2 16:31:05 2002
@@ -28,7 +28,6 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
-#include <linux/i2o.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
@@ -39,6 +38,7 @@
#include <asm/uaccess.h>
#include <asm/io.h>
+#include <linux/i2o.h>
static int i2o_cfg_context = -1;
static void *page_buf;
@@ -776,7 +776,7 @@
msg[0] = FOUR_WORD_MSG_SIZE|SGL_OFFSET_0;
msg[1] = I2O_CMD_UTIL_EVT_REGISTER<<24 | HOST_TID<<12 | kdesc.tid;
msg[2] = (u32)i2o_cfg_context;
- msg[3] = (u32)fp->private_data;
+ msg[3] = (unsigned long)fp->private_data;
msg[4] = kdesc.evt_mask;
i2o_post_this(iop, msg, 20);
@@ -786,7 +786,7 @@
static int ioctl_evt_get(unsigned long arg, struct file *fp)
{
- u32 id = (u32)fp->private_data;
+ unsigned long id = (unsigned long)fp->private_data;
struct i2o_cfg_info *p = NULL;
struct i2o_evt_get *uget = (struct i2o_evt_get*)arg;
struct i2o_evt_get kget;
@@ -824,10 +824,10 @@
if(!tmp)
return -ENOMEM;
- file->private_data = (void*)(i2o_cfg_info_id++);
+ file->private_data = (void*)((long)i2o_cfg_info_id++);
tmp->fp = file;
tmp->fasync = NULL;
- tmp->q_id = (u32)file->private_data;
+ tmp->q_id = (unsigned long)file->private_data;
tmp->q_len = 0;
tmp->q_in = 0;
tmp->q_out = 0;
@@ -843,7 +843,7 @@
static int cfg_release(struct inode *inode, struct file *file)
{
- u32 id = (u32)file->private_data;
+ unsigned long id = (unsigned long)file->private_data;
struct i2o_cfg_info *p1, *p2;
unsigned long flags;
@@ -877,7 +877,7 @@
static int cfg_fasync(int fd, struct file *fp, int on)
{
- u32 id = (u32)fp->private_data;
+ unsigned long id = (unsigned long)fp->private_data;
struct i2o_cfg_info *p;
for(p = open_files; p; p = p->next)
diff -Naur linux-2.4.19-pre9/drivers/message/i2o/i2o_core.c linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_core.c
--- linux-2.4.19-pre9/drivers/message/i2o/i2o_core.c Mon Jun 3 11:14:04 2002
+++ linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_core.c Sun Jun 2 16:33:27 2002
@@ -27,8 +27,6 @@
#include <linux/kernel.h>
#include <linux/pci.h>
-#include <linux/i2o.h>
-
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
@@ -46,6 +44,7 @@
#include <linux/completion.h>
#include <asm/io.h>
+#include <linux/i2o.h>
#include <linux/reboot.h>
#include "i2o_lan.h"
diff -Naur linux-2.4.19-pre9/drivers/message/i2o/i2o_pci.c linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_pci.c
--- linux-2.4.19-pre9/drivers/message/i2o/i2o_pci.c Mon Jun 3 11:14:04 2002
+++ linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_pci.c Mon Jun 3 10:53:08 2002
@@ -23,11 +23,11 @@
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/pci.h>
-#include <linux/i2o.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/slab.h>
#include <asm/io.h>
+#include <linux/i2o.h>
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
@@ -384,4 +384,4 @@
MODULE_PARM_DESC(dpt, "Set this if you want to drive DPT cards normally handled by dpt_i2o");
module_init(i2o_pci_core_attach);
module_exit(i2o_pci_core_detach);
-
\ No newline at end of file
+
diff -Naur linux-2.4.19-pre9/drivers/message/i2o/i2o_proc.c linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_proc.c
--- linux-2.4.19-pre9/drivers/message/i2o/i2o_proc.c Mon Jun 3 11:14:05 2002
+++ linux-2.4.19-pre9-ph/drivers/message/i2o/i2o_proc.c Sun Jun 2 16:35:31 2002
@@ -35,7 +35,6 @@
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/pci.h>
-#include <linux/i2o.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/module.h>
@@ -43,6 +42,7 @@
#include <linux/spinlock.h>
#include <asm/io.h>
+#include <linux/i2o.h>
#include <asm/uaccess.h>
#include <asm/byteorder.h>
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] I2O support on alpha.
2002-06-03 9:23 [PATCH] I2O support on alpha Pierrick Hascoet
@ 2002-06-03 15:29 ` Alan Cox
0 siblings, 0 replies; 2+ messages in thread
From: Alan Cox @ 2002-06-03 15:29 UTC (permalink / raw)
To: Pierrick Hascoet; +Cc: linux-kernel
On Mon, 2002-06-03 at 10:23, Pierrick Hascoet wrote:
> msg[0] = (FIVE_WORD_MSG_SIZE|SGL_OFFSET_0);
> msg[1] = I2O_CMD_BLOCK_CFLUSH<<24|HOST_TID<<12|dev->tid;
> msg[2] = i2ob_context|0x40000000;
> - msg[3] = (u32)query_done;
> + msg[3] = (unsigned long)query_done;
query_done is a 64bit value, msg[3] is 32bit. On your box it happens
that the query_done value fits into 32 bits. Really the pointer needs
replacing with something saner. I have some ideas. One would be to add
val = i2o_query_alloc(address);
i2o_query_done(val);
i2o_query_free(val);
functionality that tracked the pointers in a seperate array
Similar problems in the fp->private_data casting too. That wants pushing
into an array of some sort. I'll apply the header changes and other
fixes and think about the harder ones
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-06-03 14:26 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-03 9:23 [PATCH] I2O support on alpha Pierrick Hascoet
2002-06-03 15:29 ` Alan Cox
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®