Bug 197187 - iwlwifi: 8260: FW ASSERT when using FTM
Summary: iwlwifi: 8260: FW ASSERT when using FTM
Status: CLOSED WILL_NOT_FIX
Alias: None
Product: Drivers
Classification: Unclassified
Component: network-wireless (show other bugs)
Hardware: All Linux
: P1 high
Assignee: DO NOT USE - assign "network-wireless-intel" component instead
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-10 17:58 UTC by mibrahim.ahmed
Modified: 2018-07-21 06:32 UTC (History)
5 users (show)

See Also:
Kernel Version: 3.19.0-61-lowlatency
Subsystem:
Regression: No
Bisected commit-id:


Attachments
patch adding tof to iw (13.90 KB, patch)
2017-10-12 10:38 UTC, Luca Coelho
Details | Diff

Description mibrahim.ahmed 2017-10-10 17:58:18 UTC
Hi,

I have been experimenting the FTM protocol using IWLWIFI on Intel 8260 (also tried using Intel 8265) through debugfs. Configured two nodes one as AP and the other one as STA.

Downloaded the Core30 release from this link https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/backport-iwlwifi.git/
And managed to build and install it successfully following the instructions here:
https://wireless.wiki.kernel.org/en/users/drivers/iwlwifi/core_release
Load the latest firmware (version 31) from here:
https://git.kernel.org/pub/scm/linux/kernel/git/iwlwifi/linux-firmware.git/
And used the hostapd (to configure the AP) v2.6 from here:
https://w1.fi/cgit/hostap/

Also, I followed the post here for ToF usage:
https://www.spinics.net/lists/linux-wireless/msg166565.html

There are two issues:
1. In the final step for sending request using $ echo 'send_range_request=1' > tof_range_request: it generates the following error:

[  202.367326] Loading modules backported from iwlwifi
[  202.367328] iwlwifi-stack-public:release/LinuxCore30:6399:0b6afc5b
[  202.376502] iwlwifi 0000:01:00.0: Direct firmware load for iwl-dbg-cfg.ini failed with error -2
[  202.376517] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-33.ucode failed with error -2
[  202.376525] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-32.ucode failed with error -2
[  202.376918] iwlwifi 0000:01:00.0: capa flags index 3 larger than supported by driver
[  202.377688] iwlwifi 0000:01:00.0: loaded firmware version 31.532993.0 op_mode iwlmvm
[  202.384634] iwlwifi 0000:01:00.0: Detected Intel(R) Dual Band Wireless AC 8260, REV=0x208
[  202.456899] iwlwifi 0000:01:00.0: base HW address: 00:c2:c6:f5:9b:46
[  513.119382] iwlwifi 0000:01:00.0: Microcode SW error detected.  Restarting 0x2000000.
[  513.120033] iwlwifi 0000:01:00.0: Start IWL Error Log Dump:
[  513.120339] iwlwifi 0000:01:00.0: Status: 0x00000100, count: 6
[  513.120661] iwlwifi 0000:01:00.0: Loaded firmware version: 31.532993.0
[  513.121023] iwlwifi 0000:01:00.0: 0x00000071 | ADVANCED_SYSASSERT          
[  513.121407] iwlwifi 0000:01:00.0: 0x000006F7 | trm_hw_status0
[  513.121727] iwlwifi 0000:01:00.0: 0x00000000 | trm_hw_status1
[  513.122045] iwlwifi 0000:01:00.0: 0x00010040 | branchlink2
[  513.122348] iwlwifi 0000:01:00.0: 0x00028DA6 | interruptlink1
[  513.122665] iwlwifi 0000:01:00.0: 0x00010F16 | interruptlink2
[  513.122985] iwlwifi 0000:01:00.0: 0x00000000 | data1
[  513.123263] iwlwifi 0000:01:00.0: 0x00001000 | data2
[  513.123540] iwlwifi 0000:01:00.0: 0x02039842 | data3
[  513.123818] iwlwifi 0000:01:00.0: 0x234013CC | beacon time
[  513.124124] iwlwifi 0000:01:00.0: 0x112E5C04 | tsf low
[  513.124410] iwlwifi 0000:01:00.0: 0x00000000 | tsf hi
[  513.124692] iwlwifi 0000:01:00.0: 0x00000000 | time gp1
[  513.124983] iwlwifi 0000:01:00.0: 0x108BDD5A | time gp2
[  513.125274] iwlwifi 0000:01:00.0: 0x00000001 | uCode revision type
[  513.125616] iwlwifi 0000:01:00.0: 0x0000001F | uCode version major
[  513.125959] iwlwifi 0000:01:00.0: 0x00082201 | uCode version minor
[  513.126300] iwlwifi 0000:01:00.0: 0x00000201 | hw version
[  513.126599] iwlwifi 0000:01:00.0: 0x00C89008 | board version
[  513.126914] iwlwifi 0000:01:00.0: 0x0000001C | hcmd
[  513.127186] iwlwifi 0000:01:00.0: 0xA2F22080 | isr0
[  513.127459] iwlwifi 0000:01:00.0: 0x00804000 | isr1
[  513.127733] iwlwifi 0000:01:00.0: 0x18001802 | isr2
[  513.128005] iwlwifi 0000:01:00.0: 0x40400084 | isr3
[  513.128277] iwlwifi 0000:01:00.0: 0x00000000 | isr4
[  513.128550] iwlwifi 0000:01:00.0: 0x0407001C | last cmd Id
[  513.128857] iwlwifi 0000:01:00.0: 0x00000000 | wait_event
[  513.129157] iwlwifi 0000:01:00.0: 0x0000EF7E | l2p_control
[  513.129462] iwlwifi 0000:01:00.0: 0x00002820 | l2p_duration
[  513.129774] iwlwifi 0000:01:00.0: 0x00000000 | l2p_mhvalid
[  513.130078] iwlwifi 0000:01:00.0: 0x00000030 | l2p_addr_match
[  513.130397] iwlwifi 0000:01:00.0: 0x0000000F | lmpm_pmg_sel
[  513.130708] iwlwifi 0000:01:00.0: 0x15062149 | timestamp
[  513.131003] iwlwifi 0000:01:00.0: 0x00005870 | flow_handler
[  513.131459] iwlwifi 0000:01:00.0: Start IWL Error Log Dump:
[  513.132092] iwlwifi 0000:01:00.0: Status: 0x00000100, count: 7
[  513.132742] iwlwifi 0000:01:00.0: 0x00100327 | ADVANCED_SYSASSERT
[  513.133403] iwlwifi 0000:01:00.0: 0x00000000 | umac branchlink1
[  513.134046] iwlwifi 0000:01:00.0: 0xC0086B70 | umac branchlink2
[  513.134673] iwlwifi 0000:01:00.0: 0xC00818AC | umac interruptlink1
[  513.135302] iwlwifi 0000:01:00.0: 0x00000000 | umac interruptlink2
[  513.135925] iwlwifi 0000:01:00.0: 0xDEADBEEF | umac data1
[  513.136494] iwlwifi 0000:01:00.0: 0xDEADBEEF | umac data2
[  513.137050] iwlwifi 0000:01:00.0: 0xDEADBEEF | umac data3
[  513.137588] iwlwifi 0000:01:00.0: 0x0000001F | umac major
[  513.138120] iwlwifi 0000:01:00.0: 0x00082201 | umac minor
[  513.138647] iwlwifi 0000:01:00.0: 0xC0886E58 | frame pointer
[  513.139187] iwlwifi 0000:01:00.0: 0xC0886E58 | stack pointer
[  513.139720] iwlwifi 0000:01:00.0: 0x00490800 | last host cmd
[  513.140251] iwlwifi 0000:01:00.0: 0x00000000 | isr status reg
[  513.140806] iwlwifi 0000:01:00.0: FW error in SYNC CMD TOF_RANGE_REQ_CMD
[  513.141429]  [<ffffffffc0741ba1>] iwl_trans_pcie_send_hcmd+0x5b1/0x5e0 [iwlwifi]
[  513.141437]  [<ffffffffc0736c78>] iwl_trans_send_cmd+0x68/0x130 [iwlwifi]
[  513.141475] iwlwifi 0000:01:00.0: Failed to send ToF cmd! err: -5

 
2. How to configure the AP as responder? just setting ftm_responder=1 in the hostapd.conf? And call tof_responder_config? or I have to call tof_responder_params? 
the tof_responder_params file is not generated automatically in the debugfs directory. The only way that I know to generate it is by setting IWL_MVM_TOF_IS_RESPONDER in the constants.h file.


Thanks,
Mohamed
Comment 1 Luca Coelho 2017-10-11 08:02:12 UTC
Can you try to apply the patch Johannes created for the iw tool and use it to try to use it instead of debugfs? Just to check whether it's a problem in the debugfs entries...

https://p.sipsolutions.net/bef149ad0c1b8c8f.txt

This patch needs to be completed by copying the driver’s “include/uapi/linux/nl80211.h” file over the “nl80211.h” file in iw, before it will even compile.  This is not part of the patch itself because it depends on which driver version you are using.  So please copy it from the Core30 release you took.
Comment 2 mibrahim.ahmed 2017-10-11 13:31:02 UTC
Thanks a lot, 

Any hints about where I should copy this file to? What is the directory of iw?

Also, how I use this patch?


Thanks,
Mohamed
Comment 3 mibrahim.ahmed 2017-10-11 14:32:46 UTC
Hello Luca,

I have download the latest version of iw:
https://git.kernel.org/pub/scm/linux/kernel/git/jberg/iw.git
Copied the nl80211.h file from the Core30 to the iw folder then built successfully

And patched the file you mentioned using:
patch -p1 < bef149ad0c1b8c8f.txt


Then I created config file with this entry:
bb:bb:bb:bb:bb:bb bw=20 cf=2412

And there is no error, got this result:
phy #1: FTM result! Status: 0
Target: 00:c2:c6:f2:76:eb, status: 4, rtt: 0 psec, distance: 0 cm


On the AP side, I get this message from hostapd:
IEEE 802.11: Failed to send Action frame

I checked the status, and it means 'Time event was scheduled but not called yet'

What that means? Do I need to do special configuration on the AP.


Thanks,
Mohamed
Comment 4 Luca Coelho 2017-10-12 10:38:16 UTC
Created attachment 258801 [details]
patch adding tof to iw

For the record, I'm adding the patch here as an attachment.
Comment 5 Luca Coelho 2017-10-12 10:40:36 UTC
What are you running on the AP side?
Comment 6 mibrahim.ahmed 2017-10-12 11:36:14 UTC
I am using Core30 (31 firmware) also on the AP side. I run hostapd (2.6 version) with this configuration:
driver=nl80211
interface=wlan0
hw_mode=g
channel=13
wmm_enabled=1
ssid=tof_test
ftm_responder=1
ftm_initiator=1

Also, tried to configure it as responder through debugfs, but also no response from AP.
Comment 7 mibrahim.ahmed 2017-10-12 11:42:56 UTC
While on the STA side, using the following configuration for iw:
bb:bb:bb:bb:bb:bb bw=20 cf=2472
Comment 8 mibrahim.ahmed 2017-10-16 16:14:14 UTC
Hello Luca,

I am still not able to get response from AP. The request is being sent successfully from the STA, and the AP receives it, but it doesn't reply.

Is there any missing configuration for the AP to configure it as a responder?
I have already showed to you, in my previous comments, the hostapd configuration.

I tried also to configure the responder through debugfs using tof_responder_params (with the AP BSSID, channel number and bandwidth) and tof_responder_config, after this step, I don't see this error: "EEE 802.11: Failed to send Action frame
", while running hostapd. However, still no response from the AP to the STA/requester. 


Thanks,
Mohamed
Comment 9 Luca Coelho 2017-10-16 19:24:10 UTC
Thanks for the details.  I'll ask the FTM expert in our team and come back to you.
Comment 10 mibrahim.ahmed 2017-10-20 16:09:50 UTC
Thanks, I am waiting for your reply.
Comment 11 mibrahim.ahmed 2017-10-26 20:50:10 UTC
Hello, 

Have you asked the FTM expert?
Any hints to solve this problem?
Comment 12 mibrahim.ahmed 2017-11-13 14:47:16 UTC
It works for 8260 cards, however the error is ranging from 1.5 meter to 6 meters (while varying the distance between the two nodes from 1 meter to 14 meters) for line-of-sight measurements.

For the 8265 cards, they produce FW error. I get the FW error at the requester, if I used the 8265 as requester. On the other hand, if I used it as responder and used 8260 as requester, I get the FW error at the responder, when it receives the request.
Comment 13 mibrahim.ahmed 2017-12-22 15:11:35 UTC
Hello Luca,

I have something weird here. I have been using two NUC nodes with builtin 8260 cards. The ranging system was working reliably on these nodes, but I needed to test with external antennas. So, I purchased new 8260 cards with external antennas and adaptors to convert from M.2 to MPCIe.

I have installed the same version for Linux kernel, IWLWIFI backport, firmware, hostapd and iw. However, I am really getting different readings.
I am getting negative readings. For example, starting from -5 meters at almost zero actual distance, -4 meters at 1 meter actual distance, and it goes up when increase the distance.

As I mentioned everything is the same, same software and same cards, the only difference that I can see is the adapter. Please let me know what is the problem here?
Comment 14 Emmanuel Grumbach 2017-12-26 06:57:45 UTC
I am afraid I'll disappoint here but after having contacted the FTM folks it appears that:

1) 8265 doesn't support FTM, only 8260 does.
2) we can't provide real product level support for FTM on 8260 since it requires special calibrations which aren't run on standard devices.


The bottom line is that we can return results on 8260, we can't commit on their accuracy.

I'll update our wiki page in order not to mislead users.

Sorry for the inconvenience.
Comment 15 bdaddr.macaddr 2018-07-21 06:25:24 UTC
Hi, Grumbach

How did you get the result of 1.5m, 6m with 8260 card?
I would like to know the settings and steps even if the measurement result has big error.

my setting is,
AP side: hostapd2.6, set conf file(ftm_responder=1,ftm_initiator=1), set tof_responder_params (channel_num, bssid,..)
STA side: iw with patch discusssed here

my step is,
just "iw dev wlp2s0 measurement ftm_request xxx.conf"

my result is,
phy #0: FTM result! Status: 0
Target: 44:85:00:32:70:8f, status: 4, rtt: 0 psec, distance: 0 cm


Best regards,


(In reply to mibrahim.ahmed from comment #12)
> It works for 8260 cards, however the error is ranging from 1.5 meter to 6
> meters (while varying the distance between the two nodes from 1 meter to 14
> meters) for line-of-sight measurements.
> 
> For the 8265 cards, they produce FW error. I get the FW error at the
> requester, if I used the 8265 as requester. On the other hand, if I used it
> as responder and used 8260 as requester, I get the FW error at the
> responder, when it receives the request.
Comment 16 bdaddr.macaddr 2018-07-21 06:32:57 UTC
Hi ahmed,

sorry for my mistake.
this is for your question.


(In reply to bdaddr.macaddr from comment #15)
> Hi, Grumbach
> 
> How did you get the result of 1.5m, 6m with 8260 card?
> I would like to know the settings and steps even if the measurement result
> has big error.
> 
> my setting is,
> AP side: hostapd2.6, set conf file(ftm_responder=1,ftm_initiator=1), set
> tof_responder_params (channel_num, bssid,..)
> STA side: iw with patch discusssed here
> 
> my step is,
> just "iw dev wlp2s0 measurement ftm_request xxx.conf"
> 
> my result is,
> phy #0: FTM result! Status: 0
> Target: 44:85:00:32:70:8f, status: 4, rtt: 0 psec, distance: 0 cm
> 
> 
> Best regards,
> 
> 
> (In reply to mibrahim.ahmed from comment #12)
> > It works for 8260 cards, however the error is ranging from 1.5 meter to 6
> > meters (while varying the distance between the two nodes from 1 meter to 14
> > meters) for line-of-sight measurements.
> > 
> > For the 8265 cards, they produce FW error. I get the FW error at the
> > requester, if I used the 8265 as requester. On the other hand, if I used it
> > as responder and used 8260 as requester, I get the FW error at the
> > responder, when it receives the request.

Note You need to log in before you can comment on or make changes to this bug.