From patchwork Tue Feb 21 19:47:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kalle Valo X-Patchwork-Id: 9585475 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 76706600CA for ; Tue, 21 Feb 2017 19:48:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 65AEC2861E for ; Tue, 21 Feb 2017 19:48:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5AA8C28622; Tue, 21 Feb 2017 19:48:14 +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=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B58B02861E for ; Tue, 21 Feb 2017 19:48:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=Y7P2Z0HJfHRdbBWTGJuPwks7P6dEBsw2aNidqrbzWHA=; b=i9NlYrIbAnRH5+ VDUOVxHDfLZe9WCsAS52td0yG9hmUmd0ez8v00XjhLeTdFA1ThNqyEcvqNNUZAIY+Kmm6x7ez2zkJ bMCSUH4RfKEkZfs//ohJwZVi16dFKefIgPoFtAtXVk8TruhnxOUeF6ZjDn8xeL5DUSQi9K6MgkTfl Z7j+D5XQjZkijmZe6rBke/wMrqjblNnsGfssZYqI6RQJUT3dxOZJNA8Pvlk8WA04vYd8cvSfQNyOo 3LhxaTZbadYSQ/NbWWmQEdm3BQOx4tfc1CbgnbrFQPKRzL9nuLwJ6p6wbdxE5VUj9pGcy1/kypxhW No7GBsnkCcqbIOFxt/eQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1cgGPn-000352-BL; Tue, 21 Feb 2017 19:47:59 +0000 Received: from wolverine01.qualcomm.com ([199.106.114.254]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1cgGPi-0002yl-5U for ath10k@lists.infradead.org; Tue, 21 Feb 2017 19:47:57 +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=1487706474; x=1519242474; h=from:to:cc:subject:date:message-id:mime-version; bh=3d7tZvHrBZUOpIm82XrXa1atxIcR3iL2wR/yWlFsuQY=; b=AXR8JI5SshcX0TwM+DESPYV4NWWIRalNfPrw9uiPJKn/aY37C7NMPP2S kKvPBWHYGtEskATD4Oj6NmP/Cu0kDX1lO0s56NwBRuq0RCyeSnCXcoX4R 9nFmNs2dhZULpRWmFOSKE22fLIfHwMAgLjo8Z8eryNaZroLMLpUhN/I6H M=; X-IronPort-AV: E=Sophos;i="5.35,190,1484035200"; d="scan'208";a="264707879" Received: from unknown (HELO ironmsg02-L.qualcomm.com) ([10.53.140.109]) by wolverine01.qualcomm.com with ESMTP; 21 Feb 2017 11:47:32 -0800 X-IronPort-AV: E=McAfee;i="5800,7501,8446"; a="871137822" Received: from nasanexm02c.na.qualcomm.com ([10.85.0.43]) by ironmsg02-L.qualcomm.com with ESMTP/TLS/RC4-SHA; 21 Feb 2017 11:47:31 -0800 Received: from euamsexm01a.eu.qualcomm.com (10.251.127.40) by NASANEXM02C.na.qualcomm.com (10.85.0.43) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 21 Feb 2017 11:47:30 -0800 Received: from potku.adurom.net.com (10.80.80.8) by euamsexm01a.eu.qualcomm.com (10.251.127.40) with Microsoft SMTP Server (TLS) id 15.0.1178.4; Tue, 21 Feb 2017 20:47:25 +0100 From: Kalle Valo To: Subject: [PATCH] Revert "ath10k: Search SMBIOS for OEM board file extension" Date: Tue, 21 Feb 2017 21:47:06 +0200 Message-ID: <1487706426-31172-1-git-send-email-kvalo@qca.qualcomm.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01B.na.qualcomm.com (10.85.0.82) To euamsexm01a.eu.qualcomm.com (10.251.127.40) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170221_114754_324724_B1A2813F X-CRM114-Status: GOOD ( 14.10 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-wireless@vger.kernel.org, ath10k@lists.infradead.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP This reverts commit f2593cb1b29185d38db706cbcbe22ed538720ae1. Paul reported that this patch with older board-2.bin ath10k initialisation fails on Dell XPS 13: ath10k_pci 0000:3a:00.0: failed to fetch board data for bus=pci,vendor=168c, device=003e,subsystem-vendor=1a56,subsystem-device=1535,variant=RV_0520 from ath10k/QCA6174/hw3.0/board-2.bin The reason is that the older board-2.bin does not have the variant version of the image name and ath10k does not fallback to the older naming scheme. Reported-by: Paul Menzel Link: https://bugzilla.kernel.org/show_bug.cgi?id=185621#c9 Fixes: f2593cb1b291 ("ath10k: Search SMBIOS for OEM board file extension") Signed-off-by: Kalle Valo --- Dave, please take this directly if you can. drivers/net/wireless/ath/ath10k/core.c | 84 ++-------------------------------- drivers/net/wireless/ath/ath10k/core.h | 19 -------- 2 files changed, 3 insertions(+), 100 deletions(-) diff --git a/drivers/net/wireless/ath/ath10k/core.c b/drivers/net/wireless/ath/ath10k/core.c index 59729aa8cd82..dd902b43f8f7 100644 --- a/drivers/net/wireless/ath/ath10k/core.c +++ b/drivers/net/wireless/ath/ath10k/core.c @@ -18,8 +18,6 @@ #include #include #include -#include -#include #include #include "core.h" @@ -713,72 +711,6 @@ static int ath10k_core_get_board_id_from_otp(struct ath10k *ar) return 0; } -static void ath10k_core_check_bdfext(const struct dmi_header *hdr, void *data) -{ - struct ath10k *ar = data; - const char *bdf_ext; - const char *magic = ATH10K_SMBIOS_BDF_EXT_MAGIC; - u8 bdf_enabled; - int i; - - if (hdr->type != ATH10K_SMBIOS_BDF_EXT_TYPE) - return; - - if (hdr->length != ATH10K_SMBIOS_BDF_EXT_LENGTH) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, - "wrong smbios bdf ext type length (%d).\n", - hdr->length); - return; - } - - bdf_enabled = *((u8 *)hdr + ATH10K_SMBIOS_BDF_EXT_OFFSET); - if (!bdf_enabled) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not found.\n"); - return; - } - - /* Only one string exists (per spec) */ - bdf_ext = (char *)hdr + hdr->length; - - if (memcmp(bdf_ext, magic, strlen(magic)) != 0) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, - "bdf variant magic does not match.\n"); - return; - } - - for (i = 0; i < strlen(bdf_ext); i++) { - if (!isascii(bdf_ext[i]) || !isprint(bdf_ext[i])) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, - "bdf variant name contains non ascii chars.\n"); - return; - } - } - - /* Copy extension name without magic suffix */ - if (strscpy(ar->id.bdf_ext, bdf_ext + strlen(magic), - sizeof(ar->id.bdf_ext)) < 0) { - ath10k_dbg(ar, ATH10K_DBG_BOOT, - "bdf variant string is longer than the buffer can accommodate (variant: %s)\n", - bdf_ext); - return; - } - - ath10k_dbg(ar, ATH10K_DBG_BOOT, - "found and validated bdf variant smbios_type 0x%x bdf %s\n", - ATH10K_SMBIOS_BDF_EXT_TYPE, bdf_ext); -} - -static int ath10k_core_check_smbios(struct ath10k *ar) -{ - ar->id.bdf_ext[0] = '\0'; - dmi_walk(ath10k_core_check_bdfext, ar); - - if (ar->id.bdf_ext[0] == '\0') - return -ENODATA; - - return 0; -} - static int ath10k_download_and_run_otp(struct ath10k *ar) { u32 result, address = ar->hw_params.patch_load_addr; @@ -1125,9 +1057,6 @@ static int ath10k_core_fetch_board_data_api_n(struct ath10k *ar, static int ath10k_core_create_board_name(struct ath10k *ar, char *name, size_t name_len) { - /* strlen(',variant=') + strlen(ar->id.bdf_ext) */ - char variant[9 + ATH10K_SMBIOS_BDF_EXT_STR_LENGTH] = { 0 }; - if (ar->id.bmi_ids_valid) { scnprintf(name, name_len, "bus=%s,bmi-chip-id=%d,bmi-board-id=%d", @@ -1137,15 +1066,12 @@ static int ath10k_core_create_board_name(struct ath10k *ar, char *name, goto out; } - if (ar->id.bdf_ext[0] != '\0') - scnprintf(variant, sizeof(variant), ",variant=%s", - ar->id.bdf_ext); - scnprintf(name, name_len, - "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x%s", + "bus=%s,vendor=%04x,device=%04x,subsystem-vendor=%04x,subsystem-device=%04x", ath10k_bus_str(ar->hif.bus), ar->id.vendor, ar->id.device, - ar->id.subsystem_vendor, ar->id.subsystem_device, variant); + ar->id.subsystem_vendor, ar->id.subsystem_device); + out: ath10k_dbg(ar, ATH10K_DBG_BOOT, "boot using board name '%s'\n", name); @@ -2202,10 +2128,6 @@ static int ath10k_core_probe_fw(struct ath10k *ar) goto err_free_firmware_files; } - ret = ath10k_core_check_smbios(ar); - if (ret) - ath10k_dbg(ar, ATH10K_DBG_BOOT, "bdf variant name not set.\n"); - ret = ath10k_core_fetch_board_file(ar); if (ret) { ath10k_err(ar, "failed to fetch board file: %d\n", ret); diff --git a/drivers/net/wireless/ath/ath10k/core.h b/drivers/net/wireless/ath/ath10k/core.h index 88d14be7fcce..757242ef52ac 100644 --- a/drivers/net/wireless/ath/ath10k/core.h +++ b/drivers/net/wireless/ath/ath10k/core.h @@ -69,23 +69,6 @@ #define ATH10K_NAPI_BUDGET 64 #define ATH10K_NAPI_QUOTA_LIMIT 60 -/* SMBIOS type containing Board Data File Name Extension */ -#define ATH10K_SMBIOS_BDF_EXT_TYPE 0xF8 - -/* SMBIOS type structure length (excluding strings-set) */ -#define ATH10K_SMBIOS_BDF_EXT_LENGTH 0x9 - -/* Offset pointing to Board Data File Name Extension */ -#define ATH10K_SMBIOS_BDF_EXT_OFFSET 0x8 - -/* Board Data File Name Extension string length. - * String format: BDF__\0 - */ -#define ATH10K_SMBIOS_BDF_EXT_STR_LENGTH 0x20 - -/* The magic used by QCA spec */ -#define ATH10K_SMBIOS_BDF_EXT_MAGIC "BDF_" - struct ath10k; enum ath10k_bus { @@ -815,8 +798,6 @@ struct ath10k { bool bmi_ids_valid; u8 bmi_board_id; u8 bmi_chip_id; - - char bdf_ext[ATH10K_SMBIOS_BDF_EXT_STR_LENGTH]; } id; int fw_api;