From patchwork Tue Mar 19 04:18:35 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: rmani@qca.qualcomm.com X-Patchwork-Id: 2298601 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id 454D5DFB79 for ; Tue, 19 Mar 2013 04:19:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752950Ab3CSES7 (ORCPT ); Tue, 19 Mar 2013 00:18:59 -0400 Received: from wolverine02.qualcomm.com ([199.106.114.251]:15733 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752698Ab3CSES6 (ORCPT ); Tue, 19 Mar 2013 00:18:58 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1363666738; x=1395202738; h=from:to:cc:subject:date:message-id:mime-version; bh=DSVAQ0u5cqVlIFMOe0SbRZrNGCJwOp0wOzpBDRrYWsw=; b=PC8nzIq/MS3TsCN/IkG8QqOfzG5zFuALq4pOLf5Mpm+KfwLyVvm8cqOR Kz0pGbpGNmUQg0kflIdPJCyTjSfWojqstN5TtjFP/OnLmC0p3lUmMdV8t gCOXIRK1eJufSZ4mPlgK30sqjzGJxQkwM9JJ/8sFwilxea+GwGf8ylz5L 4=; X-IronPort-AV: E=Sophos;i="4.84,870,1355126400"; d="scan'208";a="30765055" Received: from ironmsg03-r.qualcomm.com ([172.30.46.17]) by wolverine02.qualcomm.com with ESMTP; 18 Mar 2013 21:18:58 -0700 X-IronPort-AV: E=Sophos;i="4.84,868,1355126400"; d="scan'208";a="453624955" Received: from nasanexhc07.na.qualcomm.com ([172.30.39.190]) by Ironmsg03-R.qualcomm.com with ESMTP/TLS/RC4-SHA; 18 Mar 2013 21:18:58 -0700 Received: from qcmail1.qualcomm.com (172.30.39.5) by qcmail1.qualcomm.com (172.30.39.190) with Microsoft SMTP Server (TLS) id 14.2.318.4; Mon, 18 Mar 2013 21:18:56 -0700 Received: by qcmail1.qualcomm.com (sSMTP sendmail emulation); Tue, 19 Mar 2013 09:48:50 +0530 From: Raja Mani To: CC: , Raja Mani Subject: [PATCH] ath6kl: Check wmi ready event status before validating abi version Date: Tue, 19 Mar 2013 09:48:35 +0530 Message-ID: <1363666715-10854-1-git-send-email-rmani@qca.qualcomm.com> X-Mailer: git-send-email 1.7.1 MIME-Version: 1.0 X-Originating-IP: [172.30.39.5] Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org There is no point to check firmware ABI version when the driver fails to wait for WMI_READY event during the boot time. For such failures, the driver should assume the firmware is not booted and start doing cleanup. Signed-off-by: Raja Mani --- drivers/net/wireless/ath/ath6kl/init.c | 14 +++++++------- 1 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/net/wireless/ath/ath6kl/init.c b/drivers/net/wireless/ath/ath6kl/init.c index 072a229..4c54432 100644 --- a/drivers/net/wireless/ath/ath6kl/init.c +++ b/drivers/net/wireless/ath/ath6kl/init.c @@ -1604,10 +1604,16 @@ static int __ath6kl_init_hw_start(struct ath6kl *ar) test_bit(WMI_READY, &ar->flag), WMI_TIMEOUT); + if (timeleft <= 0) { + clear_bit(WMI_READY, &ar->flag); + ath6kl_err("wmi is not ready or wait was interrupted: %ld\n", + timeleft); + ret = -EIO; + goto err_htc_stop; + } ath6kl_dbg(ATH6KL_DBG_BOOT, "firmware booted\n"); - if (test_and_clear_bit(FIRST_BOOT, &ar->flag)) { ath6kl_info("%s %s fw %s api %d%s\n", ar->hw.name, @@ -1624,12 +1630,6 @@ static int __ath6kl_init_hw_start(struct ath6kl *ar) goto err_htc_stop; } - if (!timeleft || signal_pending(current)) { - ath6kl_err("wmi is not ready or wait was interrupted\n"); - ret = -EIO; - goto err_htc_stop; - } - ath6kl_dbg(ATH6KL_DBG_TRC, "%s: wmi is ready\n", __func__); /* communicate the wmi protocol verision to the target */