From patchwork Thu Dec 22 23:02:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ryan Hsu X-Patchwork-Id: 9486939 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5BD6C62AAA for ; Thu, 22 Dec 2016 23:03:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E68127D13 for ; Thu, 22 Dec 2016 23:03:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4368D28113; Thu, 22 Dec 2016 23:03:24 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B950527D13 for ; Thu, 22 Dec 2016 23:03:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941736AbcLVXDV (ORCPT ); Thu, 22 Dec 2016 18:03:21 -0500 Received: from wolverine02.qualcomm.com ([199.106.114.251]:60727 "EHLO wolverine02.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933423AbcLVXDV (ORCPT ); Thu, 22 Dec 2016 18:03:21 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=qca.qualcomm.com; i=@qca.qualcomm.com; q=dns/txt; s=qcdkim; t=1482447801; x=1513983801; h=from:to:cc:subject:date:message-id:mime-version; bh=sR5fVtTk3vzJOoTJyMYDBmW7wa9elVWoqBBntVcrJZE=; b=R4BGue/I28l/BsHS9Gj4Vwo/hqqUM8moTBwXYLV3rMN4iI6MWI5J2S+/ cH7BKepkGmvG1uLOY00VOfhzX8ocETGsH832Ofhg4ZUkR8YjbNyjKjv1c vwgmTJTqi7uP6cM40cMjhAneFUS1Jjia5J6yJClCJOwXjaDHTNVtpZDsW 8=; X-IronPort-AV: E=Sophos;i="5.33,390,1477983600"; d="scan'208";a="345926244" Received: from ironmsg04-lv.qualcomm.com ([10.47.202.184]) by wolverine02.qualcomm.com with ESMTP; 22 Dec 2016 15:03:20 -0800 X-IronPort-AV: E=McAfee;i="5700,7163,8387"; a="29749554" X-Amp-Result: CLEAN Received: from nalasexr01g.na.qualcomm.com ([10.49.56.53]) by ironmsg04-lv.qualcomm.com with ESMTP/TLS/RC4-SHA; 22 Dec 2016 15:03:19 -0800 Received: from ryanhsu-linux2.qualcomm.com (10.80.80.8) by NALASEXR01G.na.qualcomm.com (10.49.56.53) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Thu, 22 Dec 2016 15:03:19 -0800 From: To: , CC: Subject: [PATCH] ath10k: ignore configuring the incorrect board_id Date: Thu, 22 Dec 2016 15:02:37 -0800 Message-ID: <1482447757-23577-1-git-send-email-ryanhsu@qca.qualcomm.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01F.na.qualcomm.com (10.85.0.32) To NALASEXR01G.na.qualcomm.com (10.49.56.53) Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Ryan Hsu With command to get board_id from otp, in the case of following boot get otp board id result 0x00000000 board_id 0 chip_id 0 boot using board name 'bus=pci,bmi-chip-id=0,bmi-board-id=0" ... failed to fetch board data for bus=pci,bmi-chip-id=0,bmi-board-id=0 from ath10k/QCA6174/hw3.0/board-2.bin The invalid board_id=0 will be used as index to search in the board-2.bin. Ignore the case with board_id=0, as it means the otp is not carrying the board id information. Signed-off-by: Ryan Hsu --- drivers/net/wireless/ath/ath10k/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 749e381..1bf67ad 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -694,8 +694,11 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar) "boot get otp board id result 0x%08x board_id %d chip_id %d\n", result, board_id, chip_id); - if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0) + if ((result & ATH10K_BMI_BOARD_ID_STATUS_MASK) != 0 || + (board_id == 0)) { + ath10k_warn(ar, "board id is not exist in otp, ignore it\n"); return -EOPNOTSUPP; + } ar->id.bmi_ids_valid = true; ar->id.bmi_board_id = board_id;