From patchwork Mon Apr 27 14:24:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 6281191 Return-Path: X-Original-To: patchwork-ath10k@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 874D5BF4A6 for ; Mon, 27 Apr 2015 14:27:06 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3351320445 for ; Mon, 27 Apr 2015 14:26:07 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 80102202AE for ; Mon, 27 Apr 2015 14:25:24 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ymjy9-0006Kz-Cm; Mon, 27 Apr 2015 14:25:09 +0000 Received: from sabertooth02.qualcomm.com ([65.197.215.38]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ymjy7-0005NT-Pa for ath10k@lists.infradead.org; Mon, 27 Apr 2015 14:25:08 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1430144709; x=1461680709; h=subject:to:from:cc:date:message-id:mime-version: content-transfer-encoding; bh=j4Yni5FEWjR2fb3mua6w1kY7x0InLnHKgWjTfe8/x3U=; b=iECiObm0f5v6dBVDRz0QBUfazDEGV2r5X4OY1XME8dWgoP7v+UIr4HqW Bmf2xmbUGU0u9+EKvw9Q/NM/aua3MfSxMHR2dEahoAu+MPMofmhdav34I qkJei/xBHFvnjqY5xX8/p90LDEZNDWytD/hbJzoU2PwfblbOXLeMX8UMx o=; X-IronPort-AV: E=McAfee;i="5700,7163,7783"; a="88803893" Received: from ironmsg02-lv.qualcomm.com ([10.47.202.183]) by sabertooth02.qualcomm.com with ESMTP; 27 Apr 2015 07:24:47 -0700 X-IronPort-AV: E=Sophos;i="5.11,657,1422950400"; d="scan'208";a="32364217" Received: from nasanexm01g.na.qualcomm.com ([10.85.0.33]) by ironmsg02-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 27 Apr 2015 07:24:45 -0700 Received: from potku.adurom.net (10.80.80.8) by NASANEXM01G.na.qualcomm.com (10.85.0.33) with Microsoft SMTP Server (TLS) id 15.0.1044.25; Mon, 27 Apr 2015 07:24:43 -0700 Subject: [PATCH] ath10k: add ATH10K_FW_FEATURE_IGNORE_OTP_RESULT To: From: Kalle Valo Date: Mon, 27 Apr 2015 17:24:38 +0300 Message-ID: <20150427142438.25600.26537.stgit@potku.adurom.net> User-Agent: StGit/0.15 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanexm01a.na.qualcomm.com (10.85.0.81) To NASANEXM01G.na.qualcomm.com (10.85.0.33) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150427_072507_898773_BD8A2FAC X-CRM114-Status: GOOD ( 10.62 ) X-Spam-Score: -5.1 (-----) Cc: linux-wireless@vger.kernel.org X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP qca6174 otp binary seems to always return an error to the host, even if the calibration succeeded. Add a firmware feature flag to detect if the firmware image which have this problem and workaround the issue in ath10k by ignoring the error code. I was also considering making this hw specific flag but as this is strictly a firmware issue it's best to handle this via a firmware feature flag so that it will be easy to disable the workaround. Signed-off-by: Kalle Valo --- drivers/net/wireless/ath/ath10k/core.c | 4 +++- drivers/net/wireless/ath/ath10k/core.h | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 987b266278a8..bcccae19325d 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -387,7 +387,9 @@ static int ath10k_download_and_run_otp(struct ath10k *ar) ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot otp execute result %d\n", result); - if (!skip_otp && result != 0) { + if (!(skip_otp || test_bit(ATH10K_FW_FEATURE_IGNORE_OTP_RESULT, + ar->fw_features)) + && result != 0) { ath10k_err(ar, "otp calibration failed: %d", result); return -EINVAL; } diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 8444adf42195..827b3d79ed0c 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -460,6 +460,9 @@ enum ath10k_fw_features { */ ATH10K_FW_FEATURE_WOWLAN_SUPPORT = 6, + /* Don't trust error code from otp.bin */ + ATH10K_FW_FEATURE_IGNORE_OTP_RESULT, + /* keep last */ ATH10K_FW_FEATURE_COUNT, };