Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp4011019ybz; Tue, 28 Apr 2020 04:18:52 -0700 (PDT) X-Google-Smtp-Source: APiQypKW+m+b6jsiVb5D8/DzUMrqXxRF5xAD+5HkaHUv/P6xYNKFG9DS023xFWhc1QLSqx1j/J50 X-Received: by 2002:a17:906:328c:: with SMTP id 12mr22772647ejw.69.1588072732772; Tue, 28 Apr 2020 04:18:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588072732; cv=none; d=google.com; s=arc-20160816; b=RhYCRMEShGdZ3lzwz6j9lRhQP3KPfX4M8jy9DkYMicCsMcQr5WfhFOwRjBHhLKvZCq DtfYlSWE/3t9NYxScYshEdDS9l7BdUYezVY1YCYTHZUOnA7NQqPjLHPgUC+h4ooIhR6B QmmLoUySDgcabFWpdOGROEsSEp4SLHMA79Jev5q8epVlJNL5b7Ewg7z0kTlpNeTO2n4W wmMkc41u+FQgkEJsNiJ1Um1pcogybthKiYvMLrRT0ftevH1IRdjxC+ylCe7DOcFzom+w RP6AIifG4mreDo6tRGYmm7NAN+tSkKSoobNw76ltSg+KawJjgDLEIZb9L08R6wvFJKVj 5UIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:autocrypt:from:references:cc:to:subject:dkim-signature; bh=XOhDfptpwh2eyxeLvzb+d+hOxPoOaH2iB/kxQVxTMjU=; b=xi65Fl5UwgiUDeoYa2zxwkIvU6VMVrwVTU+5lFaT46inCFX1KgvqLhYFMo6b2RyDh/ h7COYLSj2LcRTyP6UIkiQJRLJZ8ePWuTiEifYnBz5e33H/SVn23KOkZeH9DFrQzkGgB4 7aMT+jdEVo/G2D3pzsBMPUGuaRF5kxXozFFya7gXuES/+YUxsD2mhHBMgKg1wICuzgvT vfDw6tmZotjWe2FT1GoHHHb6hJTC/nr8PdzWZ9MaLadT4l+LvHGq0ToRCstv2mBg6tAF oluw3Vu/x9RJ7ifh8D28bi8N2jlaJUMhOtj+uw6Hg2C5TWudagZWue50D3POaJmYHnRw flOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=h+vklNke; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t5si1272095edq.384.2020.04.28.04.18.28; Tue, 28 Apr 2020 04:18:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=h+vklNke; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726776AbgD1LRH (ORCPT + 99 others); Tue, 28 Apr 2020 07:17:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726740AbgD1LRG (ORCPT ); Tue, 28 Apr 2020 07:17:06 -0400 Received: from nbd.name (nbd.name [IPv6:2a01:4f8:221:3d45::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7944BC03C1A9 for ; Tue, 28 Apr 2020 04:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:Content-Type:In-Reply-To: MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender:Reply-To: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=XOhDfptpwh2eyxeLvzb+d+hOxPoOaH2iB/kxQVxTMjU=; b=h+vklNke7tDARomiV32fLLXcqE c0ikX46g+ToZh/daC5uxCo39tXdxw1Fl330bhsYG3eIpPh0xDE0V8OGsqd0LSrDYIGaognX3uJ+VN DZhCEt0KL7nZTigZr0lqIRObH10ZuGkluowmTkMkc6NYF8dlsOckmVfJ4PbukrMZSrDA=; Received: from [80.255.7.108] (helo=nf.local) by ds12 with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.89) (envelope-from ) id 1jTOET-0000qa-RX; Tue, 28 Apr 2020 13:16:57 +0200 Subject: Re: [PATCH] mt76: mt7663: add the possibility to load firmware v2 To: Kalle Valo , Lorenzo Bianconi Cc: linux-wireless@vger.kernel.org, lorenzo.bianconi@redhat.com, sean.wang@mediatek.com, linux-mediatek@lists.infradead.org References: <87ftcnj2be.fsf@tynnyri.adurom.net> From: Felix Fietkau Autocrypt: addr=nbd@nbd.name; prefer-encrypt=mutual; keydata= xsDiBEah5CcRBADIY7pu4LIv3jBlyQ/2u87iIZGe6f0f8pyB4UjzfJNXhJb8JylYYRzIOSxh ExKsdLCnJqsG1PY1mqTtoG8sONpwsHr2oJ4itjcGHfn5NJSUGTbtbbxLro13tHkGFCoCr4Z5 Pv+XRgiANSpYlIigiMbOkide6wbggQK32tC20QxUIwCg4k6dtV/4kwEeiOUfErq00TVqIiEE AKcUi4taOuh/PQWx/Ujjl/P1LfJXqLKRPa8PwD4j2yjoc9l+7LptSxJThL9KSu6gtXQjcoR2 vCK0OeYJhgO4kYMI78h1TSaxmtImEAnjFPYJYVsxrhay92jisYc7z5R/76AaELfF6RCjjGeP wdalulG+erWju710Bif7E1yjYVWeA/9Wd1lsOmx6uwwYgNqoFtcAunDaMKi9xVQW18FsUusM TdRvTZLBpoUAy+MajAL+R73TwLq3LnKpIcCwftyQXK5pEDKq57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56 +0200 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <87ftcnj2be.fsf@tynnyri.adurom.net> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On 2020-04-28 13:07, Kalle Valo wrote: > Lorenzo Bianconi writes: > >> mt7663 firmware v2 is used for embedded devices since it has more completed >> features in AP mode. >> Add the capability to specify in mt7615 Kconfig which firmware load first >> (v3 or v2) and fallback to the other one if the selected firmware fails >> to load >> >> Signed-off-by: Lorenzo Bianconi >> --- >> .../net/wireless/mediatek/mt76/mt7615/Kconfig | 13 +++++ >> .../net/wireless/mediatek/mt76/mt7615/mcu.c | 50 ++++++++++++++++--- >> .../wireless/mediatek/mt76/mt7615/mt7615.h | 6 ++- >> .../net/wireless/mediatek/mt76/mt7615/pci.c | 2 + >> .../net/wireless/mediatek/mt76/mt7615/usb.c | 2 + >> 5 files changed, 65 insertions(+), 8 deletions(-) >> >> diff --git a/drivers/net/wireless/mediatek/mt76/mt7615/Kconfig b/drivers/net/wireless/mediatek/mt76/mt7615/Kconfig >> index e25db1135eda..c04d6a182bf0 100644 >> --- a/drivers/net/wireless/mediatek/mt76/mt7615/Kconfig >> +++ b/drivers/net/wireless/mediatek/mt76/mt7615/Kconfig >> @@ -38,3 +38,16 @@ config MT7663U >> This adds support for MT7663U 802.11ax 2x2:2 wireless devices. >> >> To compile this driver as a module, choose M here. >> + >> +config MT7615_OFFLOAD_FIRMWARE >> + bool "Prefer client mode offload firmware (MT7663)" >> + depends on MT7615E || MT7663U >> + default y >> + help >> + Load MT7663 client mode offload firmware (v3) as primary option >> + and fallback to MT7663 firmware v2 in case of failure. >> + If MT7615_OFFLOAD_FIRMWARE is not selected MT7663 firmware v2 >> + will be used as primary option. >> + MT7663 client mode offload firmware supports low power features >> + (hw frequency scanning, scheduled frequency scanning, WoW, >> + 802.11 power save) but is more limited in AP mode > > Why does this need a compile time config? Wouldn't some kind of runtime > configuration be better? I don't think supporting runtime configuration is worth the extra complexity of adding an API for shutting down and restarting the firmware and dealing with potential errors along the way. Both firmware types support AP and client mode. Which one you use depends on the kind of system you're building for. If you're building an embedded AP, you don't need any low power offloads and may want to support more than 32 clients, so you'd disable this configuration option. If you run the driver on a laptop or desktop machine, you will most likely stick to the default. If you want to switch without recompiling, you can always just delete the set of firmware files you don't want to use. The driver will fall back to the other type. - Felix