diff options
author | Sowmini Varadhan <sowmini.varadhan@oracle.com> | 2014-08-01 09:50:40 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-08-14 10:09:44 +0800 |
commit | e27d22dcded6787cfe69882b8c817d651e02a265 (patch) | |
tree | 9ac737a23fe9e51b8f974fb4e7e26ec86f979bcb | |
parent | b843176fd0fb16d32c5c13ea4f2a6e6f2835ffc8 (diff) | |
download | lwn-e27d22dcded6787cfe69882b8c817d651e02a265.tar.gz lwn-e27d22dcded6787cfe69882b8c817d651e02a265.zip |
sparc64: ldc_connect() should not return EINVAL when handshake is in progress.
[ Upstream commit 4ec1b01029b4facb651b8ef70bc20a4be4cebc63 ]
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: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Karl Volz <karl.volz@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | arch/sparc/kernel/ldc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c index e01d75d40329..66dacd56bb10 100644 --- a/arch/sparc/kernel/ldc.c +++ b/arch/sparc/kernel/ldc.c @@ -1336,7 +1336,7 @@ int ldc_connect(struct ldc_channel *lp) if (!(lp->flags & LDC_FLAG_ALLOCED_QUEUES) || !(lp->flags & LDC_FLAG_REGISTERED_QUEUES) || lp->hs_state != LDC_HS_OPEN) - err = -EINVAL; + err = ((lp->hs_state > LDC_HS_OPEN) ? 0 : -EINVAL); else err = start_handshake(lp); |