Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Sowmini Varadhan <sowmini.varadhan@oracle.com>
Acked-by: Karl Volz <karl.volz@oracle.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sowmini Varadhan and committed by
David S. Miller
4ec1b010 4ca9a237

+1 -1
+1 -1
arch/sparc/kernel/ldc.c
··· 1336 1336 if (!(lp->flags & LDC_FLAG_ALLOCED_QUEUES) || 1337 1337 !(lp->flags & LDC_FLAG_REGISTERED_QUEUES) || 1338 1338 lp->hs_state != LDC_HS_OPEN) 1339 - err = -EINVAL; 1339 + err = ((lp->hs_state > LDC_HS_OPEN) ? 0 : -EINVAL); 1340 1340 else 1341 1341 err = start_handshake(lp); 1342 1342