[PATCH] I2O: fix and workaround for Motorola/Freescale controller
- This controller violates the I2O spec for the I/O registers. The patch contains a workaround which moves the registers to the proper location. (originally author: Matthew Starzewski) - If a message frame is beyond the mapped address range a error is returned. 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>
This commit is contained in:
committed by
Linus Torvalds
parent
15d8ec7d08
commit
8b3e09e199
@@ -1115,9 +1115,11 @@ static inline struct i2o_message *i2o_msg_get(struct i2o_controller *c)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
mmsg->mfa = readl(c->in_port);
|
||||
if (mmsg->mfa == I2O_QUEUE_EMPTY) {
|
||||
if (unlikely(mmsg->mfa >= c->in_queue.len)) {
|
||||
mempool_free(mmsg, c->in_msg.mempool);
|
||||
return ERR_PTR(-EBUSY);
|
||||
if(mmsg->mfa == I2O_QUEUE_EMPTY)
|
||||
return ERR_PTR(-EBUSY);
|
||||
return ERR_PTR(-EFAULT);
|
||||
}
|
||||
|
||||
return &mmsg->msg;
|
||||
|
Reference in New Issue
Block a user