aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/message/i2o/exec-osm.c
diff options
context:
space:
mode:
authorMarkus Lidel <Markus.Lidel@shadowconnect.com>2005-06-24 01:02:21 -0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-24 03:05:29 -0400
commit9e87545f06930c1d294423a8091d1077e7444a47 (patch)
treeef05fca1becfa0e1584f234ddf9b1a430b7d018e /drivers/message/i2o/exec-osm.c
parentb2aaee33fbb354a2f08121aa1c1be55841102761 (diff)
[PATCH] I2O: second code cleanup of sparse warnings and unneeded syncronization
Changes: - Added header "core.h" for i2o_core.ko internal definitions - More sparse fixes - Changed display of TID's in sysfs attributes from XXX to 0xXXX - Use the right functions for accessing I/O and normal memory - Removed error handling of SCSI device errors and let the SCSI layer take care of it - Added new device / removed device handling to SCSI-OSM - Make status access volatile - Cleaned up activation of I2O controller - Removed unnecessary wmb() and rmb() calls - Use own struct i2o_io for I/O memory instead of struct i2o_dma Signed-off-by: Markus Lidel <Markus.Lidel@shadowconnect.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/message/i2o/exec-osm.c')
-rw-r--r--drivers/message/i2o/exec-osm.c27
1 files changed, 12 insertions, 15 deletions
diff --git a/drivers/message/i2o/exec-osm.c b/drivers/message/i2o/exec-osm.c
index 0160221c802a..ffe0cecfa060 100644
--- a/drivers/message/i2o/exec-osm.c
+++ b/drivers/message/i2o/exec-osm.c
@@ -30,6 +30,7 @@
30#include <linux/module.h> 30#include <linux/module.h>
31#include <linux/i2o.h> 31#include <linux/i2o.h>
32#include <linux/delay.h> 32#include <linux/delay.h>
33#include "core.h"
33 34
34#define OSM_NAME "exec-osm" 35#define OSM_NAME "exec-osm"
35 36
@@ -37,9 +38,6 @@ struct i2o_driver i2o_exec_driver;
37 38
38static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind); 39static int i2o_exec_lct_notify(struct i2o_controller *c, u32 change_ind);
39 40
40/* Module internal functions from other sources */
41extern int i2o_device_parse_lct(struct i2o_controller *);
42
43/* global wait list for POST WAIT */ 41/* global wait list for POST WAIT */
44static LIST_HEAD(i2o_exec_wait_list); 42static LIST_HEAD(i2o_exec_wait_list);
45 43
@@ -50,7 +48,7 @@ struct i2o_exec_wait {
50 u32 tcntxt; /* transaction context from reply */ 48 u32 tcntxt; /* transaction context from reply */
51 int complete; /* 1 if reply received otherwise 0 */ 49 int complete; /* 1 if reply received otherwise 0 */
52 u32 m; /* message id */ 50 u32 m; /* message id */
53 struct i2o_message __iomem *msg; /* pointer to the reply message */ 51 struct i2o_message *msg; /* pointer to the reply message */
54 struct list_head list; /* node in global wait list */ 52 struct list_head list; /* node in global wait list */
55}; 53};
56 54
@@ -162,7 +160,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long
162 barrier(); 160 barrier();
163 161
164 if (wait->complete) { 162 if (wait->complete) {
165 rc = readl(&wait->msg->body[0]) >> 24; 163 rc = le32_to_cpu(wait->msg->body[0]) >> 24;
166 i2o_flush_reply(c, wait->m); 164 i2o_flush_reply(c, wait->m);
167 i2o_exec_wait_free(wait); 165 i2o_exec_wait_free(wait);
168 } else { 166 } else {
@@ -202,8 +200,7 @@ int i2o_msg_post_wait_mem(struct i2o_controller *c, u32 m, unsigned long
202 * message must also be given back to the controller. 200 * message must also be given back to the controller.
203 */ 201 */
204static int i2o_msg_post_wait_complete(struct i2o_controller *c, u32 m, 202static int i2o_msg_post_wait_complete(struct i2o_controller *c, u32 m,
205 struct i2o_message __iomem *msg, 203 struct i2o_message *msg, u32 context)
206 u32 context)
207{ 204{
208 struct i2o_exec_wait *wait, *tmp; 205 struct i2o_exec_wait *wait, *tmp;
209 unsigned long flags; 206 unsigned long flags;
@@ -378,11 +375,11 @@ static void i2o_exec_lct_modified(struct i2o_controller *c)
378 * code on failure and if the reply should be flushed. 375 * code on failure and if the reply should be flushed.
379 */ 376 */
380static int i2o_exec_reply(struct i2o_controller *c, u32 m, 377static int i2o_exec_reply(struct i2o_controller *c, u32 m,
381 struct i2o_message __iomem *msg) 378 struct i2o_message *msg)
382{ 379{
383 u32 context; 380 u32 context;
384 381
385 if (readl(&msg->u.head[0]) & MSG_FAIL) { 382 if (le32_to_cpu(msg->u.head[0]) & MSG_FAIL) {
386 /* 383 /*
387 * If Fail bit is set we must take the transaction context of 384 * If Fail bit is set we must take the transaction context of
388 * the preserved message to find the right request again. 385 * the preserved message to find the right request again.
@@ -390,7 +387,7 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m,
390 struct i2o_message __iomem *pmsg; 387 struct i2o_message __iomem *pmsg;
391 u32 pm; 388 u32 pm;
392 389
393 pm = readl(&msg->body[3]); 390 pm = le32_to_cpu(msg->body[3]);
394 391
395 pmsg = i2o_msg_in_to_virt(c, pm); 392 pmsg = i2o_msg_in_to_virt(c, pm);
396 393
@@ -401,12 +398,12 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m,
401 /* Release the preserved msg */ 398 /* Release the preserved msg */
402 i2o_msg_nop(c, pm); 399 i2o_msg_nop(c, pm);
403 } else 400 } else
404 context = readl(&msg->u.s.tcntxt); 401 context = le32_to_cpu(msg->u.s.tcntxt);
405 402
406 if (context & 0x80000000) 403 if (context & 0x80000000)
407 return i2o_msg_post_wait_complete(c, m, msg, context); 404 return i2o_msg_post_wait_complete(c, m, msg, context);
408 405
409 if ((readl(&msg->u.head[1]) >> 24) == I2O_CMD_LCT_NOTIFY) { 406 if ((le32_to_cpu(msg->u.head[1]) >> 24) == I2O_CMD_LCT_NOTIFY) {
410 struct work_struct *work; 407 struct work_struct *work;
411 408
412 pr_debug("%s: LCT notify received\n", c->name); 409 pr_debug("%s: LCT notify received\n", c->name);
@@ -442,9 +439,9 @@ static int i2o_exec_reply(struct i2o_controller *c, u32 m,
442 */ 439 */
443static void i2o_exec_event(struct i2o_event *evt) 440static void i2o_exec_event(struct i2o_event *evt)
444{ 441{
445 if(likely(evt->i2o_dev)) 442 if (likely(evt->i2o_dev))
446 osm_info("Event received from device: %d\n", 443 osm_debug("Event received from device: %d\n",
447 evt->i2o_dev->lct_data.tid); 444 evt->i2o_dev->lct_data.tid);
448 kfree(evt); 445 kfree(evt);
449}; 446};
450 447