From patchwork Sun Jan 17 15:49:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Reichel X-Patchwork-Id: 8050811 Return-Path: X-Original-To: patchwork-linux-omap@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 391589F6FA for ; Sun, 17 Jan 2016 15:50:14 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5BADA20266 for ; Sun, 17 Jan 2016 15:50:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6F7A920268 for ; Sun, 17 Jan 2016 15:50:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751081AbcAQPuH (ORCPT ); Sun, 17 Jan 2016 10:50:07 -0500 Received: from ring0.de ([5.45.101.7]:58915 "EHLO ring0.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751281AbcAQPtk (ORCPT ); Sun, 17 Jan 2016 10:49:40 -0500 Received: by ring0.de (Postfix, from userid 110) id E01A8A4A5D3; Sun, 17 Jan 2016 16:49:36 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Relay-Country: Received: from sre.ring0.de (dyndsl-031-150-140-084.ewe-ip-backbone.de [31.150.140.84]) by ring0.de (Postfix) with ESMTPSA id 56FFAA4A5C9; Sun, 17 Jan 2016 16:49:20 +0100 (CET) From: Sebastian Reichel To: Sebastian Reichel , Tony Lindgren , =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Paul Walmsley , Aaro Koskinen Cc: Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 4/5] HSI: ssi-protocol: Use handshake logic from n950 Date: Sun, 17 Jan 2016 16:49:08 +0100 Message-Id: <1453045749-22642-5-git-send-email-sre@kernel.org> X-Mailer: git-send-email 2.7.0.rc3 In-Reply-To: <1453045749-22642-1-git-send-email-sre@kernel.org> References: <1453045749-22642-1-git-send-email-sre@kernel.org> Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Sebastian Reichel --- drivers/hsi/clients/ssi_protocol.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/hsi/clients/ssi_protocol.c b/drivers/hsi/clients/ssi_protocol.c index a38af68cf326..6595d2091268 100644 --- a/drivers/hsi/clients/ssi_protocol.c +++ b/drivers/hsi/clients/ssi_protocol.c @@ -521,13 +521,7 @@ static void ssip_start_rx(struct hsi_client *cl) * high transition. Therefore we need to ignore the sencond UP event. */ if ((ssi->main_state != ACTIVE) || (ssi->recv_state == RECV_READY)) { - if (ssi->main_state == INIT) { - ssi->main_state = HANDSHAKE; - spin_unlock(&ssi->lock); - ssip_send_bootinfo_req_cmd(cl); - } else { - spin_unlock(&ssi->lock); - } + spin_unlock(&ssi->lock); return; } ssip_set_rxstate(ssi, RECV_READY); @@ -671,6 +665,7 @@ static void ssip_rx_bootinforeq(struct hsi_client *cl, u32 cmd) ssip_error(cl); /* Fall through */ case INIT: + case HANDSHAKE: spin_lock(&ssi->lock); ssi->main_state = HANDSHAKE; if (!ssi->waketest) { @@ -688,9 +683,6 @@ static void ssip_rx_bootinforeq(struct hsi_client *cl, u32 cmd) msg->complete = ssip_release_cmd; hsi_async_write(cl, msg); break; - case HANDSHAKE: - /* Ignore */ - break; default: dev_dbg(&cl->device, "Wrong state M(%d)\n", ssi->main_state); break; @@ -939,9 +931,11 @@ static int ssip_pn_open(struct net_device *dev) ssi->waketest = 1; ssi_waketest(cl, 1); /* FIXME: To be removed */ } - ssi->main_state = INIT; + ssi->main_state = HANDSHAKE; spin_unlock_bh(&ssi->lock); + ssip_send_bootinfo_req_cmd(cl); + return 0; }