Bug 11935

Summary: Connman fails to scan wifi ap on automatic refresh due to firmware loading errors
Product: [Build System, Metadata & Runtime] BSPs Reporter: oscar lopez arandas <oscarx.lopez.arandas>
Component: bsps-oe-coreAssignee: Libertad <libertad.gonzalez.de.la.cruz>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Medium+ CC: california.l.sullivan, mikko.ylinen, sgw
Version: 2.4   
Target Milestone: 2.4 M3   
Hardware: NUC   
OS: x86_64   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Attachments:
Description Flags
test.log
none
test.log
none
wifi_ap
none
test.log none

Description oscar lopez arandas 2017-08-15 18:57:12 UTC
Created attachment 3943 [details]
test.log

WIFI cannot automatically be refresh, connman does not scan the WIFI APP and no networks are listed. this fault is present in orei7-64_NUC, corei7-64_WIC_NUC, corei7-64_CherryHill

MACHINE           = "intel-corei7-64"
meta-yocto-bsp    = "HEAD:9ed748a542b520c1cb763d981969233c0f5efd4e"
meta-intel        = "master:0d32b245e44574a612b9b48789498a78d80e9098"


STEPS TO REPRODUCE: 
1. Prepare a WIFI AP, setting it as SSID broadcast.
2. Make sure ConnMan is launched, and list all networks, check if the WIFI AP can be scaned.

EXPECTED OUTCOME:
The WIFI AP can be scanned automatically in the ConnMan.
ACTUAL OUTCOME:
The WIFI AP can not be automatically scanned into the ConnMan.
*****************************************************************************
Central error: [    7.128459] iwlwifi 0000:01:00.0: Direct firmware load for iwl-dbg-cfg.ini failed with error -2
*****************************************************************************
NOTE:
Bugs that might be related.... 11925 and 11894
log in attachment
Comment 1 California Sullivan 2017-08-15 22:37:06 UTC
The new backport-iwlwifi module requires new firmware that we weren't including.

This patch Mikko sent addresses the issue:

https://lists.yoctoproject.org/pipermail/meta-intel/2017-August/004929.html
Comment 2 Mikko Ylinen 2017-08-16 12:54:50 UTC
Resolve as duplicate of bug #11925?
Comment 3 California Sullivan 2017-08-16 18:06:24 UTC
Yep.

*** This bug has been marked as a duplicate of bug 11925 ***
Comment 4 oscar lopez arandas 2017-09-04 22:49:07 UTC
the error is still present you can scan the wifi ap but it has no connection can not ping.
this fault is present in corei7-64_NUC, corei7-64_WIC_NUC, corei7-64_CherryHill


meta-intel : 8d44e72d6eff173d96eb5b2571e8c1e10de53816 
poky : 5f6945f5031e1a4ca116cc1eccf4c2f9dc228547

STEPS TO REPRODUCE: 
1. Prepare a WIFI AP, setting it as SSID broadcast.
2. Make sure ConnMan is launched, and list all networks, check if the WIFI AP can be scaned.

EXPECTED OUTCOME:
The WIFI AP can be scanned automatically in the ConnMan.
ACTUAL OUTCOME:
The WIFI AP can not be automatically scanned into the ConnMan.
*****************************************************************************
[    8.044438] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-25.ucode failed with error -2
[    8.055324] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-24.ucode failed with error -2

*****************************************************************************
NOTE:
log in attachment
Comment 5 oscar lopez arandas 2017-09-04 22:49:51 UTC
Created attachment 3973 [details]
test.log
Comment 6 Saul Wold 2017-09-05 17:17:24 UTC
In this case the failed firmware loads are part of the searching for a valid version, note the line following the failures shows a successful firmware load

[    8.044438] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-25.ucode failed with error -2
[    8.055324] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-24.ucode failed with error -2
[    8.065735] iwlwifi 0000:01:00.0: Direct firmware load for iwlwifi-8000C-23.ucode failed with error -2
[    8.094206] iwlwifi 0000:01:00.0: loaded firmware version 22.391740.0 op_mode iwlmvm

So it tried going backwards from the 25 version and finally fond the 22 version which it loaded.

This is a difficult one, since I don't really want to whitelist the failed loads in case it really fails to load. In which case we get something along the lines of

[   23.782467] iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-23.ucode failed with error -2
[   23.782472] iwlwifi 0000:04:00.0: Direct firmware load for iwlwifi-8000C-22.ucode failed with error -2
[   23.782472] iwlwifi 0000:04:00.0: no suitable firmware found!
[   23.782474] iwlwifi 0000:04:00.0: minimum version required: iwlwifi-8000C-22
[   23.782475] iwlwifi 0000:04:00.0: maximum version supported: iwlwifi-8000C-30
[   23.782476] iwlwifi 0000:04:00.0: check git://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git

So maybe the check should include a search for "no suitable firmware found" and ignore the "Direct firmware load" failures. Thoughts on this approach?

Now, so we know that in this case it loaded the firmware correctly, but now we need to understand why Connman did not work correctly with a supposedly working 
interface.  Can you confirm that the interface is there with ifconfig?

Also, we might want to try a build with the backport-wifi driver included, as we disabled it for M3 due to conflicting with non-intel wifi drivers.
Comment 7 California Sullivan 2017-09-05 20:50:26 UTC
I tested the yocto-2.4_M3.rc1 core-image-sato-sdk-intel-corei7-64.wic image. It worked for me.

I'm not sure what your procedure is, so here is mine:

$ ifconfig -a <-- checks that there is wifi device, not necessary
$ rfkill unblock all <-- this is necessary to unblock wifi
$ connmanctl
> scan wifi
> services
> connect <wifi_id_string>
> exit
$ curl google.com
Comment 8 oscar lopez arandas 2017-09-05 21:45:26 UTC
WIFI can automatically be refresh, connman can scan the WIFI APP and  networks are listed.
I tested the yocto 2.4_M3.rc1 core-image-sato-sdk-intel-corei7-64.NUC 
MACHINE           = "intel-corei7-64"
poky              = 5f6945f5031e1a4ca116cc1eccf4c2f9dc228547
meta-intel        = 8d44e72d6eff173d96eb5b2571e8c1e10de53816 
NUC 6i5SYH 

STEPS TO REPRODUCE: 
1. Prepare a WIFI AP, setting it as SSID broadcast.
2. Make sure ConnMan is launched, and list all networks, check if the WIFI AP can be scaned.

EXPECTED OUTCOME:
The WIFI AP can be scanned automatically in the ConnMan.

ACTUAL OUTCOME:
The WIFI AP can  be automatically scanned into the ConnMan.
****************************************************************
[   10.645603] iwlwifi 0000:01:00.0: L1 Enabled - LTR Enabled
[   10.646819] iwlwifi 0000:01:00.0: L1 Enabled - LTR Enabled
*****************************************************************

Note:log in attchment
Comment 9 oscar lopez arandas 2017-09-05 21:47:23 UTC
Created attachment 3977 [details]
wifi_ap
Comment 10 oscar lopez arandas 2017-09-05 21:48:38 UTC
Created attachment 3978 [details]
test.log