diff options
author | Markus Lidel <Markus.Lidel@shadowconnect.com> | 2006-01-06 03:19:32 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:54 -0500 |
commit | dcceafe25a5f47cf69e5b46b4da6f15186ec8386 (patch) | |
tree | 4a3d581b2a1d239daf5d42cd9d2e1e5d838d817a /drivers/message/i2o/i2o_config.c | |
parent | 24791bd48f643194d806654b587251b0f92233e8 (diff) |
[PATCH] I2O: Bugfixes
- Removed some kmalloc's with __GFP_ZERO and replace it with memset()
because it didn't work properly.
- Fixed returned message frame in i2o_cfg_passthru() which caused raidutils
to display wrong error message in case a disk was missing.
- Fixed size of printk() in i2o_scsi.c.
- Fixed get_device() and put_device() in probing of the I2O controller.
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/message/i2o/i2o_config.c')
-rw-r--r-- | drivers/message/i2o/i2o_config.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/drivers/message/i2o/i2o_config.c b/drivers/message/i2o/i2o_config.c index 4fe73d628c5b..286fef3240c4 100644 --- a/drivers/message/i2o/i2o_config.c +++ b/drivers/message/i2o/i2o_config.c | |||
@@ -36,12 +36,12 @@ | |||
36 | 36 | ||
37 | #include <asm/uaccess.h> | 37 | #include <asm/uaccess.h> |
38 | 38 | ||
39 | #include "core.h" | ||
40 | |||
41 | #define SG_TABLESIZE 30 | 39 | #define SG_TABLESIZE 30 |
42 | 40 | ||
43 | static int i2o_cfg_ioctl(struct inode *inode, struct file *fp, unsigned int cmd, | 41 | extern int i2o_parm_issue(struct i2o_device *, int, void *, int, void *, int); |
44 | unsigned long arg); | 42 | |
43 | static int i2o_cfg_ioctl(struct inode *, struct file *, unsigned int, | ||
44 | unsigned long); | ||
45 | 45 | ||
46 | static spinlock_t i2o_config_lock; | 46 | static spinlock_t i2o_config_lock; |
47 | 47 | ||
@@ -593,9 +593,6 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
593 | 593 | ||
594 | sg_offset = (msg->u.head[0] >> 4) & 0x0f; | 594 | sg_offset = (msg->u.head[0] >> 4) & 0x0f; |
595 | 595 | ||
596 | msg->u.s.icntxt = cpu_to_le32(i2o_config_driver.context); | ||
597 | msg->u.s.tcntxt = cpu_to_le32(i2o_cntxt_list_add(c, reply)); | ||
598 | |||
599 | memset(sg_list, 0, sizeof(sg_list[0]) * SG_TABLESIZE); | 596 | memset(sg_list, 0, sizeof(sg_list[0]) * SG_TABLESIZE); |
600 | if (sg_offset) { | 597 | if (sg_offset) { |
601 | struct sg_simple_element *sg; | 598 | struct sg_simple_element *sg; |
@@ -629,7 +626,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
629 | goto cleanup; | 626 | goto cleanup; |
630 | } | 627 | } |
631 | sg_size = sg[i].flag_count & 0xffffff; | 628 | sg_size = sg[i].flag_count & 0xffffff; |
632 | p = &(sg_list[sg_index++]); | 629 | p = &(sg_list[sg_index]); |
633 | /* Allocate memory for the transfer */ | 630 | /* Allocate memory for the transfer */ |
634 | if (i2o_dma_alloc | 631 | if (i2o_dma_alloc |
635 | (&c->pdev->dev, p, sg_size, | 632 | (&c->pdev->dev, p, sg_size, |
@@ -640,6 +637,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
640 | rcode = -ENOMEM; | 637 | rcode = -ENOMEM; |
641 | goto sg_list_cleanup; | 638 | goto sg_list_cleanup; |
642 | } | 639 | } |
640 | sg_index++; | ||
643 | /* Copy in the user's SG buffer if necessary */ | 641 | /* Copy in the user's SG buffer if necessary */ |
644 | if (sg[i]. | 642 | if (sg[i]. |
645 | flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { | 643 | flag_count & 0x04000000 /*I2O_SGL_FLAGS_DIR */ ) { |
@@ -661,8 +659,10 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
661 | } | 659 | } |
662 | 660 | ||
663 | rcode = i2o_msg_post_wait(c, msg, 60); | 661 | rcode = i2o_msg_post_wait(c, msg, 60); |
664 | if (rcode) | 662 | if (rcode) { |
663 | reply[4] = ((u32) rcode) << 24; | ||
665 | goto sg_list_cleanup; | 664 | goto sg_list_cleanup; |
665 | } | ||
666 | 666 | ||
667 | if (sg_offset) { | 667 | if (sg_offset) { |
668 | u32 msg[I2O_OUTBOUND_MSG_FRAME_SIZE]; | 668 | u32 msg[I2O_OUTBOUND_MSG_FRAME_SIZE]; |
@@ -712,6 +712,7 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
712 | } | 712 | } |
713 | } | 713 | } |
714 | 714 | ||
715 | sg_list_cleanup: | ||
715 | /* Copy back the reply to user space */ | 716 | /* Copy back the reply to user space */ |
716 | if (reply_size) { | 717 | if (reply_size) { |
717 | // we wrote our own values for context - now restore the user supplied ones | 718 | // we wrote our own values for context - now restore the user supplied ones |
@@ -729,7 +730,6 @@ static int i2o_cfg_passthru32(struct file *file, unsigned cmnd, | |||
729 | } | 730 | } |
730 | } | 731 | } |
731 | 732 | ||
732 | sg_list_cleanup: | ||
733 | for (i = 0; i < sg_index; i++) | 733 | for (i = 0; i < sg_index; i++) |
734 | i2o_dma_free(&c->pdev->dev, &sg_list[i]); | 734 | i2o_dma_free(&c->pdev->dev, &sg_list[i]); |
735 | 735 | ||
@@ -827,9 +827,6 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
827 | 827 | ||
828 | sg_offset = (msg->u.head[0] >> 4) & 0x0f; | 828 | sg_offset = (msg->u.head[0] >> 4) & 0x0f; |
829 | 829 | ||
830 | msg->u.s.icntxt = cpu_to_le32(i2o_config_driver.context); | ||
831 | msg->u.s.tcntxt = cpu_to_le32(i2o_cntxt_list_add(c, reply)); | ||
832 | |||
833 | memset(sg_list, 0, sizeof(sg_list[0]) * SG_TABLESIZE); | 830 | memset(sg_list, 0, sizeof(sg_list[0]) * SG_TABLESIZE); |
834 | if (sg_offset) { | 831 | if (sg_offset) { |
835 | struct sg_simple_element *sg; | 832 | struct sg_simple_element *sg; |
@@ -892,8 +889,10 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
892 | } | 889 | } |
893 | 890 | ||
894 | rcode = i2o_msg_post_wait(c, msg, 60); | 891 | rcode = i2o_msg_post_wait(c, msg, 60); |
895 | if (rcode) | 892 | if (rcode) { |
893 | reply[4] = ((u32) rcode) << 24; | ||
896 | goto sg_list_cleanup; | 894 | goto sg_list_cleanup; |
895 | } | ||
897 | 896 | ||
898 | if (sg_offset) { | 897 | if (sg_offset) { |
899 | u32 msg[128]; | 898 | u32 msg[128]; |
@@ -943,6 +942,7 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
943 | } | 942 | } |
944 | } | 943 | } |
945 | 944 | ||
945 | sg_list_cleanup: | ||
946 | /* Copy back the reply to user space */ | 946 | /* Copy back the reply to user space */ |
947 | if (reply_size) { | 947 | if (reply_size) { |
948 | // we wrote our own values for context - now restore the user supplied ones | 948 | // we wrote our own values for context - now restore the user supplied ones |
@@ -959,7 +959,6 @@ static int i2o_cfg_passthru(unsigned long arg) | |||
959 | } | 959 | } |
960 | } | 960 | } |
961 | 961 | ||
962 | sg_list_cleanup: | ||
963 | for (i = 0; i < sg_index; i++) | 962 | for (i = 0; i < sg_index; i++) |
964 | kfree(sg_list[i]); | 963 | kfree(sg_list[i]); |
965 | 964 | ||