Commit 4ec1b010 authored by Sowmini Varadhan's avatar Sowmini Varadhan Committed by David S. Miller

sparc64: ldc_connect() should not return EINVAL when handshake is in progress.

The LDC handshake could have been asynchronously triggered
after ldc_bind() enables the ldc_rx() receive interrupt-handler
(and thus intercepts incoming control packets)
and before vio_port_up() calls ldc_connect(). If that is the case,
ldc_connect() should return 0 and let the state-machine
progress.
Signed-off-by: default avatarSowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: default avatarKarl Volz <karl.volz@oracle.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4ca9a237
...@@ -1336,7 +1336,7 @@ int ldc_connect(struct ldc_channel *lp) ...@@ -1336,7 +1336,7 @@ int ldc_connect(struct ldc_channel *lp)
if (!(lp->flags & LDC_FLAG_ALLOCED_QUEUES) || if (!(lp->flags & LDC_FLAG_ALLOCED_QUEUES) ||
!(lp->flags & LDC_FLAG_REGISTERED_QUEUES) || !(lp->flags & LDC_FLAG_REGISTERED_QUEUES) ||
lp->hs_state != LDC_HS_OPEN) lp->hs_state != LDC_HS_OPEN)
err = -EINVAL; err = ((lp->hs_state > LDC_HS_OPEN) ? 0 : -EINVAL);
else else
err = start_handshake(lp); err = start_handshake(lp);
......
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