20181225_jeffrey - silenceuncrio/diary GitHub Wiki

0910

一早來就收到 areil 表示 M360P kernel panic

發生的時間點是在 icos init 結束之後

### module <lan_control> init
### module <vrrp> init
### module <route> init
### module <zebra> init
### module <smtp> init
### module <bgp> init
### module <ip_alias> init
### module <gre> init
### module <pptpd> init
### module <l2tp> init
### module <statsticMD> init
procd: - init complete -
[25309.316000] Unhandled kernel unaligned access[#1]:
[25309.316000] CPU: 0 PID: 1293 Comm: icospromsg Tainted: G           O 3.10.14 #2
[25309.316000] task: 87d2bad8 ti: 86b26000 task.ti: 86b26000
[25309.316000] $ 0   : 00000000 00a406a0 00000000 0e7fe002
[25309.316000] $ 4   : 86c0df80 85ee07da 00000010 00000000
[25309.316000] $ 8   : 85ee07b4 876d6600 85ee07b4 00000000
[25309.316000] $12   : 00000007 0000000e 00000000 803f53c0
[25309.316000] $16   : 85e6e880 86c0df80 85ee07da 80490000
[25309.316000] $20   : 00200200 00100100 0000003a 00000000
[25309.316000] $24   : 00000002 8029bbc0
[25309.316000] $28   : 86b26000 86b274f0 8046a898 803ba71c
[25309.316000] Hi    : 000000f0
[25309.316000] Lo    : 0000003c
[25309.316000] epc   : 803ba758 find_ip6_nat.constprop.9+0x88/0x118
[25309.316000]     Tainted: G           O
[25309.316000] ra    : 803ba71c find_ip6_nat.constprop.9+0x4c/0x118
[25309.316000] Status: 1100fc03 KERNEL EXL IE
[25309.316000] Cause : 80800014
[25309.316000] BadVA : 0e7fe002
[25309.316000] PrId  : 0001992f (MIPS 1004Kc)
[25309.316000] Modules linked in: mt7603e(O) option iptable_nat usb_wwan nf_nat_ipv4 nf_conntrack_ipv4 ipt_MASQUERADE ftdi_sio xt_time xt_tcpmss xt_string xt_statistic xt_state xt_recent xt_policy xt_nat xt_multiport xt_mark xt_mac xt_limit xt_length xt_layer7 xt_hl xt_helper xt_esp xt_ecn xt_dscp xt_conntrack xt_connmark xt_connlimit xt_connbytes xt_comment xt_TCPMSS xt_REDIRECT xt_LOG xt_HL xt_DSCP xt_CT xt_CLASSIFY usbserial usbhid ts_kmp ts_fsm ts_bm ralink_wdt nfnetlink nf_nat_irc nf_nat_ftp nf_nat nf_defrag_ipv4 nf_conntrack_irc nf_conntrack_ftp iptable_raw iptable_mangle iptable_filter ipt_ah ipt_REJECT ipt_ECN hid_generic cdc_wdm GobiNet(O) usbnet sch_teql sch_tbf sch_sfq sch_red sch_prio sch_gred sch_dsmark sch_codel em_text act_police act_ipt act_connmark act_skbedit cls_tcindex cls_flow cls_route sch_hfsc hid evdev input_core ip6t_REJECT ip6table_raw ip6table_mangle ip6table_filter ip6_tables nf_conntrack_ipv6 nf_conntrack ip_tables nf_defrag_ipv6 ip_gre gre ifb ip_tunnel tun ohci_hcd
[25309.316000] Process icospromsg (pid: 1293, threadinfo=86b26000, task=87d2bad8, tls=77e73440)
[25309.316000] Stack : 874f30a4 80306214 86b27570 802d34f8 802e0830 80530000 8773c800 80530000
          00000000 85ee07c2 86b276e8 803bc4a4 80499364 85e8ba80 804b9800 80499364
          00000000 8030905c 00000002 804a0000 fffffffb 802d3598 00010000 804a0000
          00000008 8049983c 00000000 86b27570 874f3090 80000000 85ee07b4 80499364
          80530000 80530000 8773c800 804c0000 00000000 00000000 876d6600 86b276e8
          ...
[25309.316000] Call Trace:
[25309.316000] [<803ba758>] find_ip6_nat.constprop.9+0x88/0x118
[25309.316000] [<803bc4a4>] do_ip6_in+0x144/0x6d0
[25309.316000] [<803b6ea4>] do_in+0x758/0x1be0
[25309.316000] [<803b8520>] ebt_target_arpnat+0x64/0x1604
[25309.316000] [<803b04d0>] ebt_do_table+0x580/0x76c
[25309.316000] [<802d34f8>] nf_iterate+0xf0/0x100
[25309.316000] [<802d3598>] nf_hook_slow+0x90/0x1c8
[25309.316000] [<803a4218>] br_handle_frame+0x22c/0x3b4
[25309.316000] [<8029b4e4>] __netif_receive_skb_core+0x308/0x9e4
[25309.316000] [<8029d2d8>] process_backlog+0xbc/0x1c0
[25309.316000] [<8029d11c>] net_rx_action+0xf0/0x1f0
[25309.316000] [<8003242c>] __do_softirq+0x128/0x230
[25309.316000] [<8003288c>] irq_exit+0x78/0x84
[25309.316000] [<800052b0>] ret_from_irq+0x0/0x4
[25309.316000] [<801a7550>] MatchFinder_ReadBlock+0x28/0x100
[25309.316000] [<801a7690>] MatchFinder_Init+0x68/0x7c
[25309.316000] [<801aa20c>] LzmaEnc_CodeOneBlock+0x5c/0x2bac
[25309.316000] [<801acdac>] LzmaEnc_Encode2+0x50/0xd8
[25309.316000] [<801ae354>] LzmaEnc_MemEncode+0xb4/0xe4
[25309.316000] [<8014c6d0>] jffs2_lzma_compress+0x74/0xb4
[25309.316000] [<80137210>] jffs2_selected_compress+0x110/0x230
[25309.316000] [<8013738c>] jffs2_compress+0x5c/0x394
[25309.316000] [<8013f3f0>] jffs2_write_inode_range+0xd0/0x31c
[25309.316000] [<801393d4>] jffs2_write_end+0x14c/0x350
[25309.316000] [<80086ca4>] generic_file_buffered_write+0x1c4/0x314
[25309.316000] [<80088ba0>] __generic_file_aio_write+0x204/0x524
[25309.316000] [<80088f38>] generic_file_aio_write+0x78/0x100
[25309.316000] [<800c6590>] do_sync_write+0x88/0xc0
[25309.316000] [<800c70cc>] vfs_write+0xb8/0x1d8
[25309.316000] [<800c781c>] SyS_write+0x58/0xbc
[25309.316000] [<8000fedc>] stack_done+0x20/0x44
[25309.316000]
[25309.316000]
Code: 8e020000  8e030004  10400002 <ac620000> ac430004  ae150000  ae140004  0c030e10  00000000
[25310.100000] ---[ end trace 0806ab5f558be8e1 ]---
[25310.112000] Kernel panic - not syncing: Fatal exception in interrupt

===================================================================
                MT7621   stage1 code 10:33:11 (ASIC)
                CPU=50000000 HZ BUS=12500000 HZ
==================================================================
Change MPLL source from XTAL to CR...
do MEMPLL setting..
MEMPLL Config : 0x31100000
3PLL mode + External loopback
=== XTAL-40Mhz === DDR-800Mhz ===
PLL3 FB_DL: 0x0, 1/0 = 959/65 01000000
PLL4 FB_DL: 0x7, 1/0 = 541/483 1D000000
MEMPLL 3PLL mode calibration fail
do DDR setting..[00320381]
Apply DDR2 Setting...(use customer AC)
          0    8   16   24   32   40   48   56   64   72   80   88   96  104  112  120
      --------------------------------------------------------------------------------
0000:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0001:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0002:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0003:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0004:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0005:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0006:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    1
0007:|    0    0    0    0    0    0    0    1    1    1    1    1    1    1    1    1
0008:|    1    1    1    1    1    1    1    1    1    1    1    1    1    1    0    0
0009:|    1    1    1    1    1    1    0    0    0    0    0    0    0    0    0    0
000A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
000F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0010:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0011:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0012:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0013:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0014:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0015:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0016:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0017:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0018:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
0019:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001A:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001B:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001C:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001D:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001E:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
001F:|    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0    0
rank 0 coarse = 8
rank 0 fine = 56
B:|    0    0    0    0    0    0    0    1    1    1    0    0    0    0    0    0
opt_dle value:8
DRAMC_R0DELDLY[018]=00003231
==================================================================
                RX      DQS perbit delay software calibration
==================================================================
1.0-15 bit dq delay value
==================================================================
bit|     0  1  2  3  4  5  6  7  8  9
--------------------------------------
0 |    6 4 5 12 5 9 4 7 3 5
10 |    10 9 11 7 7 9
--------------------------------------

==================================================================
2.dqs window
x=pass dqs delay value (min~max)center
y=0-7bit DQ of every group
input delay:DQS0 =49 DQS1 = 50
==================================================================
bit     DQS0     bit      DQS1
0  (1~94)47  8  (0~94)47
1  (1~95)48  9  (1~94)47
2  (1~90)45  10  (1~95)48
3  (1~98)49  11  (1~94)47
4  (1~94)47  12  (1~100)50
5  (1~98)49  13  (2~93)47
6  (1~93)47  14  (1~96)48
7  (1~98)49  15  (1~93)47
==================================================================
3.dq delay value last
==================================================================
bit|    0  1  2  3  4  5  6  7  8   9
--------------------------------------
0 |    8 5 9 12 7 9 6 7 6 8
10 |    12 12 11 10 9 12
==================================================================
==================================================================
     TX  perbyte calibration
==================================================================
DQS loop = 15, cmp_err_1 = ffff0000
dqs_perbyte_dly.last_dqsdly_pass[0]=15,  finish count=1
dqs_perbyte_dly.last_dqsdly_pass[1]=15,  finish count=2
DQ loop=15, cmp_err_1 = ffff0000
dqs_perbyte_dly.last_dqdly_pass[0]=15,  finish count=1
dqs_perbyte_dly.last_dqdly_pass[1]=15,  finish count=2
byte:0, (DQS,DQ)=(8,8)
byte:1, (DQS,DQ)=(8,8)
20,data:88
[EMI] DRAMC calibration passed

===================================================================
                MT7621   stage1 code done
                CPU=50000000 HZ BUS=12500000 HZ
===================================================================


U-Boot 1.1.3 (Mar  6 2018 - 03:49:09)

Board: Ralink APSoC DRAM:  128 MB
relocate_code Pointer at: 87fac000

Config XHCI 40M PLL
***********************
Watchdog Reset Occurred
***********************
Allocate 16 byte aligned buffer: 87fe04b0
Enable NFI Clock
# MTK NAND # : Use HW ECC
NAND ID [C2 DA 90 95 06]
Device found in MTK table, ID: c2da, EXT_ID: 909506
Support this Device in MTK table! c2da
select_chip
[NAND]select ecc bit:4, sparesize :64 spare_per_sector=16
Signature matched and data read!
load_fact_bbt success 2047
load fact bbt success
[mtk_nand] probe successfully!
mtd->writesize=2048 mtd->oobsize=64,    mtd->erasesize=131072  devinfo.iowidth=8
..============================================
Ralink UBoot Version: 5.0.0.0
--------------------------------------------

看來是我們 icos 哪邊出了問題

我想我目前還是先把 wizard 繼續完成才對

關於每次做完 firmware upgrade 後的第一次 login 重導到 wizard

很直覺的就是在 login 後判斷有沒有做過 wizard

沒有的話就重導過去

所以我需要有個地方像 config 一樣記錄著作過 wizard 了沒

作過 wizard (不包含中途放棄) 就記錄下來

那下次 login 之後便不再觸發

我想我需要盤一下目前的 login.js

(function() {
    'use strict';

angular
    .module('app')
    .config(config);

function config($routeProvider) {
    $routeProvider
    .when("/login", {
        templateUrl:  'app/feature/login.html?uuid=' + Math.random(),
        controller: 'loginController',
        controllerAs: 'vm',
    })
}

angular
    .module('app')
    .controller('loginController', loginController);

function loginController($http, $location, $timeout, icos, share) {
    var vm = this;

    vm.config = {};
    vm.doLogin = function() {
        ...
    };
}

})();

重點應該放在 vm.doLogin

    vm.doLogin = function() {

        $http({
            method: 'POST',
            url: '/api/login',
            headers: {'Content-Type': 'application/x-www-form-urlencoded'},
            transformRequest: function(obj) {
                var str = [];
                for(var p in obj)
                str.push(encodeURIComponent(p) + "=" + encodeURIComponent(obj[p]));
                return str.join("&");
            },
            data: {user: vm.config.user, pass: vm.config.pass}
        })
        .then( function(response) {

            if (response.data.ok) {


                ////////////////////////////////////////////////////////////////////////////////////////////////
                // workaround
                // use following action to let iweb be killed once at the first time after power on
                icos.syslog.gen_log();
                ////////////////////////////////////////////////////////////////////////////////////////////////



                icos.api.whoAmI().then(function(result) {
                    // update to share service data
                    share.data.whoAmI = result.data;
                });

                if (
                    (vm.config.user == 'admin' && vm.config.pass == 'admin') || 
                    (vm.config.user == 'admin' && vm.config.pass == '')
                ) {
                    swal({
                        title:"Login ok", 
                        text:"For Security Reason, Please Changes Password First!!", 
                        type:"warning", 
                        timer: 2000, 
                        showConfirmButton: false,
                        html: true
                    }, 
                    function(){

                        $timeout(function() {
                            $location.url("/administration");                        
                        }, 2000);

                        swal.close();
                    });

                } else {

                    swal({title:"Login ok", text:"", type:"success", timer: 1000, showConfirmButton: false}, function(){
                        if (typeof share.data.originalPath != 'undefined') {
                            $timeout(function() {
                                $location.url(share.data.originalPath);
                            }, 2000);
                        } else {
                            $timeout(function() {
                                $location.url("/");                        
                            }, 2000);
                        }
                        swal.close();
                    });

                }

            } else {
                swal({title:"Login fail", text:response.data.info, type:"error", timer: 1000, showConfirmButton: false});
            }

        });


    };

試著利用 $timeout 來整理一下

把裏頭的邏輯拉出來包成一個 function

1010

john 有 hotfix/v1.76 的需求

先切過去吧

build 個 image 先

mfgtool 燒錄

因應 john 的需求作修改

commit e67353dd76869ecb2e22c6a6dfecf6080014862c
Refs: [hotfix/v1.76], {origin/hotfix/v1.76}
Author: jeffrey <[email protected]>
Date:   Tue Dec 25 10:49:04 2018 +0800

    only show 'VLAN Isolation' field at 'Tag Base' mode

 proscend/prosrc/www/app/feature/vlan.html | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

1050

改來 build 一個 M300/16_MTK_WIFI

1140

臨時有需求要插隊了

目前 M300 HYTEC 反應 remote HTTPS 非常難建起來

在 MTU 1500 的時候

故意修改 iptable 讓遠端能透過 LTE 存取 HTTP

HTTP 開啟網頁都沒問題

HTTPS 就時好時壞的

目前 DQA 反應的現象是

Summary:                    [Remote Access M300] sometimes hang up
Description: 
我使用今天的版本 013600531752C3E8, 據說這版 INPUT chain 有加入
相關規則

但是我測試從 Remote 來 access M300, 一樣會發生網頁卡住的現象,
所以 INPUT Chain

加入相關規則似乎沒用....

目前測試過 MTU = 1280, 1460 都會卡住....

我先試著找一下現成的 yocto 現成的 recipe 看看有沒有小一點的 web server

一樣是在 hotfix/v1.76 上作實驗

Product/Vendor 選擇 M300/10_GPS_HYTEC

OpenEmbedded - meta-webserver 可以看到不少現成的 web server

找一個沒那麼大的 也 google 一下評價

先以 github 星星數為主

1300

不過在更換 web server 之前

先把 mongoose 換成最新版的試試

目前用的 mongoose 是 6.9

換成最新版本的 6.13 試試

github - mongoose 下載

並置換掉 M300 上的 mongoose.c 以及 mongoose.h

趕緊 build 個 image

1325

mail 給 DQA 同步進行測試看看最新的 mongoose 是否有一樣的現象

我這邊也同步用 mfgtool 燒錄一片來看看

1330

OpenEmbedded - meta-webserver 列出的 web server

apache 和 nginx 不算

其他的 web server 有 github 專案的星星數都遠小於 mongoose

直接 build 個 nginx 試試好了

不過先試一下最新的 mongoose 是否能抵抗第一次的 syslog cgi 掛掉重啟的靈異現象

一開機的 iweb process

root@HWL-2501-DS:~# ps aux | grep iweb
root      2122  0.1  0.3  10612  1740 pts/3    Ss+  05:13   0:00 iweb -p 80 -d /www
root      4718  2.4  0.5  10612  2728 pts/5    Ss+  05:14   0:00 iweb -p 443 -d /www -s
root      5418  0.0  0.0   1768   320 ttymxc0  S+   05:14   0:00 grep iweb

web login 之後

已經重啟一次了

d-trip min/avg/max = 1.414/1.414/1.414 ms
root@HWL-2501-DS:~# ps aux | grep iweb
root      8697  0.8  0.4  10612  2428 pts/5    Ss+  05:15   0:00 iweb -p 80 -d /www
root      8698  4.3  0.6  10612  3136 pts/8    Ss+  05:15   0:00 iweb -p 443 -d /www -s
root      9083  0.0  0.0   1768   320 ttymxc0  S+   05:15   0:00 grep iweb

奇怪的是明明使用的是 HTTP 為何 HTTPS 也會一起掛掉

這是一直以來的奇妙現象

HTTPS 從 LTE 很難連就交給 DQA 了

1500

DQA 目前表示正在忙 M360

沒有時間作 M300 我把 遠傳 說有 public ip 的 SIM 卡先拿過來測試

DQA 表示 apn 要設定成 fetnet88

先試著讓 LTE 作連線吧

LTE 連線後資訊如下

image

HTTPS 連線試了兩次都沒問題

不過我還是換回 mongoose 6.9 確認 HTTPS 很難連這件事情

目前 mongoose 6.13 在 partition a

build 一版 mongoose 6.9 把它利用 web ui firmware upgrade 的方式寫到 partition b 去

目前 mongoose 6.13 的 web ui 的 firmware page 異常無法使用(原因待查)

先用 tftp 搭配 shell script 作 upgrade

1610

mongoose 換成原本的 6.9

在 partition b

LTE 已經連線

開始進行 HTTPS remote access 測試

MTU 保持原本的 1500

開始測試

使用 chrome 無痕視窗 - https://110.25.88.183

image

按繼續前往 110.25.88.183 網站

然後就不停的轉圈圈 status page 顯示不出來

目前把這個稱為 fail

不過第二次很順利的就進去 status page 了

就叫這 status page ok

先做個 10 次

status page 轉圈圈超過 10 秒就判定 fail

每作完一次就把無痕視窗關掉再重新開一個無痕視窗

  • 01 - fail
  • 02 - status page ok
  • 03 - status page ok
  • 04 - fail
  • 05 - fail
  • 06 - fail
  • 07 - status page ok
  • 08 - fail
  • 09 - status page ok
  • 10 - status page ok

10 次測試 5 次失敗

反正也不花什麼時間 再來個 20 次

  • status page ok - 8
  • fail - 12

再來 20 次

  • status page ok - 5
  • fail - 15

總結 mongoose 6.9 50 次

  • status page ok - 18
  • fail - 32

成功率 36 %

換成 mongoose 6.13 試試

先觀察個 10 次

連續成功 4 次

然後連續失敗 6 次

奇怪的是 mongoose 6.13 HTTPS 連線時

chrome 完全沒出現

image

mongoose 6.13 就試這 10 次就好了

來把 MTU 從 1500 改成 1000

先從 mongoose 6.9 開始試

1710

直接來個 20 次

O 表示成功 X 表示失敗

10 個一排

https://110.25.88.183 remote access with MTU 1000

OOOOOOOOOO
OOOOOOOOOO

20 次測試 20 次都成功

不試了

把 MTU 拉高

https://110.25.88.183 remote access with MTU 1200

OOOOOOOOOO
OOOOOOOOOO

20 次測試 20 次都成功

再拉高 MTU 到 1279

https://110.25.88.183 remote access with MTU 1279

OOOOXOOOOO
OOOOOOOOOO

20 次測試 19 次成功

再拉高 MTU 到 1280

https://110.25.88.183 remote access with MTU 1280

OXXXOOXOXX
XOXOXOOXXO

20 次測試 9 次成功

MTU 1279 與 MTU 1280 差別相當明顯

⚠️ **GitHub.com Fallback** ⚠️