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

HSI: ssi-protocol: Use handshake logic from n950

When using the ssi-protocol driver with the Nokia N950, the
following error is thrown during modem powered up sequence.

[13852.274993] port0: SSI error: 0x01
[13852.279205] ssi-protocol ssi-protocol: RX error detected
[13852.284820] ssi-protocol ssi-protocol: Main state: 1
[13852.290069] ssi-protocol ssi-protocol: Recv state: 0
[13852.295288] ssi-protocol ssi-protocol: Send state: 0
[13852.300537] ssi-protocol ssi-protocol: CMT Offline
[13852.305603] ssi-protocol ssi-protocol: Wake test 1
[13852.310638] ssi-protocol ssi-protocol: Data RX id: 0
[13852.315887] ssi-protocol ssi-protocol: Data TX id: 0
[13856.001464] ssi-protocol ssi-protocol: Watchdog trigerred
[13856.007293] ssi-protocol ssi-protocol: Main state: 1
[13856.012542] ssi-protocol ssi-protocol: Recv state: 0
[13856.017761] ssi-protocol ssi-protocol: Send state: 0
[13856.023010] ssi-protocol ssi-protocol: CMT Offline
[13856.028045] ssi-protocol ssi-protocol: Wake test 0
[13856.033111] ssi-protocol ssi-protocol: Data RX id: 0
[13856.038330] ssi-protocol ssi-protocol: Data TX id: 0

This patch fixes the issue by using the handshake setup from
the Nokia N950 kernel. The new handshake sequence also works
with the N900, so there is no need to differentiate between
both modems.

Tested-by: Aaro Koskinen <aaro.koskinen@iki.fi>
Signed-off-by: Sebastian Reichel <sre@kernel.org>

+5 -11
+5 -11
drivers/hsi/clients/ssi_protocol.c
··· 521 521 * high transition. Therefore we need to ignore the sencond UP event. 522 522 */ 523 523 if ((ssi->main_state != ACTIVE) || (ssi->recv_state == RECV_READY)) { 524 - if (ssi->main_state == INIT) { 525 - ssi->main_state = HANDSHAKE; 526 - spin_unlock(&ssi->lock); 527 - ssip_send_bootinfo_req_cmd(cl); 528 - } else { 529 - spin_unlock(&ssi->lock); 530 - } 524 + spin_unlock(&ssi->lock); 531 525 return; 532 526 } 533 527 ssip_set_rxstate(ssi, RECV_READY); ··· 665 671 ssip_error(cl); 666 672 /* Fall through */ 667 673 case INIT: 674 + case HANDSHAKE: 668 675 spin_lock(&ssi->lock); 669 676 ssi->main_state = HANDSHAKE; 670 677 if (!ssi->waketest) { ··· 682 687 ssip_set_cmd(msg, SSIP_BOOTINFO_RESP_CMD(SSIP_LOCAL_VERID)); 683 688 msg->complete = ssip_release_cmd; 684 689 hsi_async_write(cl, msg); 685 - break; 686 - case HANDSHAKE: 687 - /* Ignore */ 688 690 break; 689 691 default: 690 692 dev_dbg(&cl->device, "Wrong state M(%d)\n", ssi->main_state); ··· 931 939 ssi->waketest = 1; 932 940 ssi_waketest(cl, 1); /* FIXME: To be removed */ 933 941 } 934 - ssi->main_state = INIT; 942 + ssi->main_state = HANDSHAKE; 935 943 spin_unlock_bh(&ssi->lock); 944 + 945 + ssip_send_bootinfo_req_cmd(cl); 936 946 937 947 return 0; 938 948 }