[LEDE-DEV] [PATCH v2] ath10k-ct driver: use dma_alloc_coherent, 4.13 based driver
Hauke Mehrtens
hauke at hauke-m.de
Thu Oct 12 13:46:56 PDT 2017
On 10/12/2017 10:31 PM, Hauke Mehrtens wrote:
> On 10/04/2017 12:45 AM, greearb at candelatech.com wrote:
>> From: Ben Greear <greearb at candelatech.com>
>>
>> This should help ath10k work on systems with little or no IOMMU
>> memory. apu2 can boot two 9888 NICs now, for instance. From
>> upstream patch by Adrian Chadd.
>>
>> And, start building the 4.13 based CT ath10k driver.
>>
>> Signed-off-by: Ben Greear <greearb at candelatech.com>
>> ---
>>
>> v2: Update the pkg-mirror-hash, update to latest 4.13 ct driver with
>> optimized coverage-class settings for 10.1 CT firmware.
>>
>> package/kernel/ath10k-ct/Makefile | 17 +++++++++++------
>> 1 file changed, 11 insertions(+), 6 deletions(-)
>>
>> diff --git a/package/kernel/ath10k-ct/Makefile b/package/kernel/ath10k-ct/Makefile
>> index 85fe4eb..a894773 100644
>> --- a/package/kernel/ath10k-ct/Makefile
>> +++ b/package/kernel/ath10k-ct/Makefile
>> @@ -8,13 +8,18 @@ PKG_LICENSE_FILES:=
>>
>> PKG_SOURCE_URL:=https://github.com/greearb/ath10k-ct.git
>> PKG_SOURCE_PROTO:=git
>> -PKG_SOURCE_DATE:=2017-05-16
>> -PKG_SOURCE_VERSION:=c048ef0c3eedf99b41bc12b3f4e47ef3d9fab484
>> -PKG_MIRROR_HASH:=7936293962a10a0da7469759623013fc151019a6a584cfc6416bc0b605bd74d7
>> +PKG_SOURCE_DATE:=2017-06-13
>> +PKG_SOURCE_VERSION:=bded1823912549017d819d1796273b3134c3de20
>> +PKG_MIRROR_HASH:=616174650e12a82edb6b6bd18ac186e2c6a48fdad0082df9d2011ab20940814b
>>
>> PKG_MAINTAINER:=Ben Greear <greearb at candelatech.com>
>> PKG_BUILD_PARALLEL:=1
>>
>> +# Build the 4.13 ath10k-ct driver version. Other options are "-4.9", or
>> +# leave un-defined for 4.7 kernel. Probably this should match as closely as
>> +# possible to whatever mac80211 backports version is being used.
>> +CT_KVER="-4.13"
>> +
>> STAMP_CONFIGURED_DEPENDS := $(STAGING_DIR)/usr/include/mac80211-backport/backport/autoconf.h
>>
>> include $(INCLUDE_DIR)/kernel.mk
>> @@ -25,8 +30,8 @@ define KernelPackage/ath10k-ct
>> TITLE:=ath10k-ct driver optimized for CT ath10k firmware
>> DEPENDS:=+kmod-mac80211 +kmod-ath + at DRIVER_11N_SUPPORT + at DRIVER_11AC_SUPPORT @PCI_SUPPORT + at KERNEL_RELAY +kmod-hwmon-core
>> FILES:=\
>> - $(PKG_BUILD_DIR)/ath10k/ath10k_pci.ko \
>> - $(PKG_BUILD_DIR)/ath10k/ath10k_core.ko
>> + $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_pci.ko \
>> + $(PKG_BUILD_DIR)/ath10k$(CT_KVER)/ath10k_core.ko
>> AUTOLOAD:=$(call AutoLoad,50,mac80211 ath ath10k_core ath10k_pci)
>> endef
>>
>> @@ -75,7 +80,7 @@ define Build/Compile
>> +$(MAKE) $(CT_MAKEDEFS) $(PKG_JOBS) -C "$(LINUX_DIR)" \
>> ARCH="$(LINUX_KARCH)" \
>> CROSS_COMPILE="$(TARGET_CROSS)" \
>> - SUBDIRS="$(PKG_BUILD_DIR)/ath10k" \
>> + SUBDIRS="$(PKG_BUILD_DIR)/ath10k$(CT_KVER)" \
>> NOSTDINC_FLAGS="$(NOSTDINC_FLAGS)" \
>> modules
>> endef
>>
> Hi,
>
> I just tried this on my BT Home Hub 5A (lantiq) but it failed.
>
> It looks like it gets stuck when loading the module, at least the init
> process stops.
>
> The calibration data is loaded by a user space script from the flash, so
> user space FW loading has to be activated and supported by ath10k-ct.
>
> Here is the relevant log file:
> [ 9.814110] Loading modules backported from Linux version
> v4.14-rc2-0-ge19b205be43d
> [ 9.820424] Backport generated by backports.git v4.14-rc2-1-0-g8bfe0960
> [ 9.890549] ath10k 4.13 driver, optimized for CT firmware, probing
> pci device: 0x3c.
> [ 9.898579] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
> [ 9.902975] PCI: Enabling device 0000:02:00.0 (0000 -> 0002)
> [ 9.908839] ath10k_pci 0000:02:00.0: pci irq legacy oper_irq_mode 1
> irq_mode 0 reset_mode 0
> [ 10.119697] ath10k_pci 0000:02:00.0: qca988x hw2.0 target 0x4100016c
> chip_id 0x043202ff sub 0000:0000
> [ 10.127579] ath10k_pci 0000:02:00.0: kconfig debug 0 debugfs 1
> tracing 0 dfs 1 testmode 0
> [ 10.141865] ath10k_pci 0000:02:00.0: firmware ver
> 10.1-ct-8x-__fW-019-395e9f1 api 2 features
> wmi-10.x,has-wmi-mgmt-tx,txstatus-noack,wmi-10.x-CT,ratemask-CT,get-temp-CT
> crc32 a63684ee
> [ 10.184894] ath10k_pci 0000:02:00.0: board_file api 1 bmi_id N/A
> crc32 bebc7c08
> [ 10.223847] ath10k_pci 0000:02:00.0: otp calibration failed: 2
> [ 10.228286] ath10k_pci 0000:02:00.0: failed to run otp: -22
> (download-cal-data)
> [ 10.235580] ath10k_pci 0000:02:00.0: could not init core (-22)
> [ 10.241510] ath10k_pci 0000:02:00.0: could not probe fw (-22),
> releasing napi
> [ 24.843191] random: crng init done
>
>
> Log of old driver without your patches:
> [ 9.852646] Loading modules backported from Linux version
> v4.14-rc2-0-ge19b205be43d
> [ 9.858973] Backport generated by backports.git v4.14-rc2-1-0-g8bfe0960
> [ 9.865617] lantiq,xrx200-net 1e108000.eth eth0: port 2 lost link
> [ 9.935543] ath10k driver, optimized for CT firmware, probing pci
> device: 0x3c.
> [ 9.943128] PCI: Enabling device 0000:01:00.0 (0000 -> 0002)
> [ 9.947576] PCI: Enabling device 0000:02:00.0 (0000 -> 0002)
> [ 9.953300] ath10k_pci 0000:02:00.0: pci irq legacy oper_irq_mode 1
> irq_mode 0 reset_mode 0
> [ 10.149348] ath10k_pci 0000:02:00.0: Direct firmware load for
> ath10k/pre-cal-pci-0000:02:00.0.bin failed with error -2
> [ 10.158696] ath10k_pci 0000:02:00.0: Falling back to user helper
> [ 10.286920] firmware ath10k!pre-cal-pci-0000:02:00.0.bin:
> firmware_loading_store: map pages failed
> [ 10.295079] ath10k_pci 0000:02:00.0: Direct firmware load for
> ath10k/cal-pci-0000:02:00.0.bin failed with error -2
> [ 10.304878] ath10k_pci 0000:02:00.0: Falling back to user helper
> [ 11.077973] ath10k_pci 0000:02:00.0: Direct firmware load for
> ath10k/fwcfg-pci-0000:02:00.0.txt failed with error -2
> [ 11.087180] ath10k_pci 0000:02:00.0: Falling back to user helper
> [ 11.246765] firmware ath10k!fwcfg-pci-0000:02:00.0.txt:
> firmware_loading_store: map pages failed
> [ 11.254706] ath10k_pci 0000:02:00.0: Direct firmware load for
> ath10k/QCA988X/hw2.0/firmware-5.bin failed with error -2
> [ 11.264881] ath10k_pci 0000:02:00.0: Falling back to user helper
> [ 11.510041] firmware ath10k!QCA988X!hw2.0!firmware-5.bin:
> firmware_loading_store: map pages failed
> [ 11.517964] ath10k_pci 0000:02:00.0: could not fetch firmware file
> 'ath10k/QCA988X/hw2.0/firmware-5.bin': -11
> [ 11.528056] ath10k_pci 0000:02:00.0: Direct firmware load for
> ath10k/QCA988X/hw2.0/firmware-4.bin failed with error -2
> [ 11.538260] ath10k_pci 0000:02:00.0: Falling back to user helper
> [ 11.777217] firmware ath10k!QCA988X!hw2.0!firmware-4.bin:
> firmware_loading_store: map pages failed
> [ 11.785115] ath10k_pci 0000:02:00.0: could not fetch firmware file
> 'ath10k/QCA988X/hw2.0/firmware-4.bin': -11
> [ 11.795036] ath10k_pci 0000:02:00.0: Direct firmware load for
> ath10k/QCA988X/hw2.0/firmware-3.bin failed with error -2
> [ 11.805426] ath10k_pci 0000:02:00.0: Falling back to user helper
> [ 12.045487] firmware ath10k!QCA988X!hw2.0!firmware-3.bin:
> firmware_loading_store: map pages failed
> [ 12.053399] ath10k_pci 0000:02:00.0: could not fetch firmware file
> 'ath10k/QCA988X/hw2.0/firmware-3.bin': -11
> [ 12.065745] ath10k_pci 0000:02:00.0: qca988x hw2.0 target 0x4100016c
> chip_id 0x043202ff sub 0000:0000
> [ 12.073667] ath10k_pci 0000:02:00.0: kconfig debug 0 debugfs 1
> tracing 0 dfs 1 testmode 0
> [ 12.090937] ath10k_pci 0000:02:00.0: firmware ver
> 10.1-ct-8x-__fW-019-6375cb7 api 2 features
> wmi-10.x,has-wmi-mgmt-tx,txstatus-noack,wmi-10.x-CT,ratemask-CT crc32
> 10d5163b
> [ 12.105210] ath10k_pci 0000:02:00.0: Direct firmware load for
> ath10k/QCA988X/hw2.0/board-2.bin failed with error -2
> [ 12.115380] ath10k_pci 0000:02:00.0: Falling back to user helper
> [ 12.337505] firmware ath10k!QCA988X!hw2.0!board-2.bin:
> firmware_loading_store: map pages failed
> [ 12.345557] ath10k_pci 0000:02:00.0: board_file api 1 bmi_id N/A
> crc32 bebc7c08
> [ 13.212405] ath10k_pci 0000:02:00.0: 10.1 wmi init: vdevs: 16 peers:
> 127 tid: 256
> [ 13.227705] ath10k_pci 0000:02:00.0: wmi print 'P 128 V 8 T 410'
> [ 13.232317] ath10k_pci 0000:02:00.0: wmi print 'msdu-desc: 1424
> sw-crypt: 0'
> [ 13.239583] ath10k_pci 0000:02:00.0: wmi print 'alloc rem: 25908
> iram: 25776'
> [ 13.291502] ath10k_pci 0000:02:00.0: htt-ver 2.1 wmi-op 2 htt-op 2
> cal file max-sta 128 raw 0 hwcrypto 1
>
I fixed this by backporting this commit from kernel 4.14:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=c0cc00f250e19c717fc9cdbdb7f55aaa569c7498
Hauke
More information about the Lede-dev
mailing list