Commit e35d710d authored by Bryan O'Sullivan's avatar Bryan O'Sullivan Committed by Roland Dreier

IB/ipath: fix return value from ipath_poll

This stops the generic poll code from waiting for a timeout.
Signed-off-by: default avatarBryan O'Sullivan <bryan.osullivan@qlogic.com>
Signed-off-by: default avatarRoland Dreier <rolandd@cisco.com>
parent d821f02a
...@@ -1150,6 +1150,7 @@ static unsigned int ipath_poll(struct file *fp, ...@@ -1150,6 +1150,7 @@ static unsigned int ipath_poll(struct file *fp,
struct ipath_portdata *pd; struct ipath_portdata *pd;
u32 head, tail; u32 head, tail;
int bit; int bit;
unsigned pollflag = 0;
struct ipath_devdata *dd; struct ipath_devdata *dd;
pd = port_fp(fp); pd = port_fp(fp);
...@@ -1186,9 +1187,12 @@ static unsigned int ipath_poll(struct file *fp, ...@@ -1186,9 +1187,12 @@ static unsigned int ipath_poll(struct file *fp,
clear_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag); clear_bit(IPATH_PORT_WAITING_RCV, &pd->port_flag);
pd->port_rcvwait_to++; pd->port_rcvwait_to++;
} }
else
pollflag = POLLIN | POLLRDNORM;
} }
else { else {
/* it's already happened; don't do wait_event overhead */ /* it's already happened; don't do wait_event overhead */
pollflag = POLLIN | POLLRDNORM;
pd->port_rcvnowait++; pd->port_rcvnowait++;
} }
...@@ -1196,7 +1200,7 @@ static unsigned int ipath_poll(struct file *fp, ...@@ -1196,7 +1200,7 @@ static unsigned int ipath_poll(struct file *fp,
ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl, ipath_write_kreg(dd, dd->ipath_kregs->kr_rcvctrl,
dd->ipath_rcvctrl); dd->ipath_rcvctrl);
return 0; return pollflag;
} }
static int try_alloc_port(struct ipath_devdata *dd, int port, static int try_alloc_port(struct ipath_devdata *dd, int port,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment