Linux驱动基础:MSM平台AP/CP通信机制
點擊打開鏈接
概述
MSM平臺AP和CP封裝到一個芯片,共享內容。所以之前也說過,高通的MSM解決方案中,CP的代碼都是由AP放到指定地址的內存中以供CP運行。那上傳完代碼,CP開始跑之后,AP/CP之間的通信又是怎么弄的呢??
其實也是在內存中開辟一段共享內存進行通信的。高通文檔中有介紹以下三種。
- SMD : Shared Memory Driver
- SMEM : Shared Memory Manager
- SMSM : Shared State Machine
來看一下上面三種共享內存的具體說明:
SMEM :
- Shared memory service, provides basic SMEM allocation services
- Section of physical RAM is located at a predetermined location, sharing between?
processors - Provides low-level interprocessor communication primitives (apps processor to?
modem processor) that can be called from interrupt context
SMSM:
- Shared memory state machine
- Provides low-level synchronization between different processors
SMD :
- Shared memory driver
- Provides multiple data channels
smd channel setup過程
1.首先Modem會調用sio_open()等函數接口,根據port id打開一個smd port。smd_sio_open()函數會被調用。然后smdi_alloc_channel_info()函數會在shared memory分配一個port.
2.在AP端,msm_smd_probe()會啟動一個wrker thread,叫smd_channel_probe_worker()。這個函數會detect所有已經被modem端分配過的smd channel。通過這一步之后,驅動函數就可以通過smd channel名字打開一個smd channel。
實際在smd_init_dt.c的 msm_smd_probe()函數中添加log輸出結果為:
<6>[0.538769] [0:swapper/0:1] msm_smd_probe remote_pid=1 <6>[0.539232] [0:swapper/0:1] msm_smd_probe remote_pid=4 <6>[0.539665] [0:swapper/0:1] msm_smd_probe remote_pid=6- 1
- 2
- 3
- 1
- 2
- 3
當然這個結果是根據dtsi文件定義里讀出來的內容。
qcom,smd-modem {compatible = "qcom,smd";qcom,smd-edge = <0>;qcom,smd-irq-offset = <0x0>;qcom,smd-irq-bitmask = <0x1000>;interrupts = <0 25 1>;label = "modem";};...qcom,smd-wcnss {compatible = "qcom,smd";qcom,smd-edge = <6>;qcom,smd-irq-offset = <0x0>;qcom,smd-irq-bitmask = <0x20000>;interrupts = <0 142 1>;label = "wcnss";};...qcom,smd-rpm {compatible = "qcom,smd";qcom,smd-edge = <15>;qcom,smd-irq-offset = <0x0>;qcom,smd-irq-bitmask = <0x1>;interrupts = <0 168 1>;label = "rpm";qcom,irq-no-suspend;qcom,not-loadable;};- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
上面定義的edge,用來根據edge_to_pids變量來轉換成remote pid。edge對應的值是以下枚舉類型。
enum {SMD_APPS_MODEM = 0,SMD_APPS_QDSP,SMD_MODEM_QDSP,SMD_APPS_DSPS,SMD_MODEM_DSPS,SMD_QDSP_DSPS,SMD_APPS_WCNSS,SMD_MODEM_WCNSS,SMD_QDSP_WCNSS,SMD_DSPS_WCNSS,SMD_APPS_Q6FW,SMD_MODEM_Q6FW,SMD_QDSP_Q6FW,SMD_DSPS_Q6FW,SMD_WCNSS_Q6FW,SMD_APPS_RPM,SMD_MODEM_RPM,SMD_QDSP_RPM,SMD_WCNSS_RPM,SMD_TZ_RPM,SMD_NUM_TYPE, };- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
然后在smd_channel_probe_worker()->scan_alloc_table函數中添加log。
static void smd_channel_probe_worker(struct work_struct *work) {struct smd_alloc_elm *shared;struct remote_proc_info *r_info;unsigned tbl_size;r_info = container_of(work, struct remote_proc_info, probe_work);//ID_CH_ALLOC_TBL,SMEM_CHANNEL_ALLOC_TBL_2 到底是什么??shared = smem_get_entry(ID_CH_ALLOC_TBL, &tbl_size,r_info->remote_pid, 0);if (!shared) {pr_err("%s: allocation table not initialized\n", __func__);return;}mutex_lock(&smd_probe_lock);scan_alloc_table(shared, r_info->ch_allocated, PRI_ALLOC_TBL,tbl_size / sizeof(*shared),r_info);shared = smem_get_entry(SMEM_CHANNEL_ALLOC_TBL_2, &tbl_size,r_info->remote_pid, 0);if (shared)scan_alloc_table(shared,&(r_info->ch_allocated[SMEM_NUM_SMD_STREAM_CHANNELS]),SEC_ALLOC_TBL,tbl_size / sizeof(*shared),r_info);mutex_unlock(&smd_probe_lock); }static void scan_alloc_table(struct smd_alloc_elm *shared,char *smd_ch_allocated,int table_id,unsigned num_entries,struct remote_proc_info *r_info) {if (!smd_alloc_channel(&shared[n], table_id, r_info)) {pr_info("shared[%d].name = %s, r_info->remote_pid = %d table_id=%d\n",n,shared[n].name,r_info->remote_pid,table_id);smd_ch_allocated[n] = 1;}elseSMD_INFO("Probe skipping proc %d, tbl %d, ch %d, not allocated\n",r_info->remote_pid, table_id, n); }- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
輸出的log結果為:
//以下log里邊shared[x]中,x代表port ID,和打印所有的qc_smd_ch_xxx.log里邊的ID對應! <6>[0.544016][0:kworker/0:1:34] shared[4].name = rpm_requests, r_info->remote_pid = 6 table_id=1 <6>[10.294419][0:kworker/0:1:34] shared[1].name = IPCRTR, r_info->remote_pid = 1 table_id=1 <6>[10.295081][0:kworker/0:1:34] shared[2].name = SSM_RTR_MODEM_APPS, r_info->remote_pid = 1 table_id=1 <6>[10.848152][0:kworker/0:1:34] shared[3].name = sys_mon, r_info->remote_pid = 1 table_id=1 <6>[10.863365][0:kworker/0:1:34] shared[4].name = DIAG_2_CMD, r_info->remote_pid = 1 table_id=1 <6>[10.864631][0:kworker/0:1:34] shared[5].name = DIAG_2, r_info->remote_pid = 1 table_id=1 <6>[10.866978][0:kworker/0:1:34] shared[6].name = DIAG_CNTL, r_info->remote_pid = 1 table_id=1 <6>[10.868057][0:kworker/0:1:34] shared[7].name = DIAG_CMD, r_info->remote_pid = 1 table_id=1 <6>[10.869126][0:kworker/0:1:34] shared[8].name = DIAG, r_info->remote_pid = 1 table_id=1 <6>[10.874224][0:kworker/0:1:34] shared[9].name = apr_audio_svc, r_info->remote_pid = 1 table_id=1 <6>[10.874991][0:kworker/0:1:34] shared[10].name = apr_apps2, r_info->remote_pid = 1 table_id=1 <6>[12.453190][0:kworker/0:1:34] shared[1].name = IPCRTR, r_info->remote_pid = 4 table_id=1 <6>[12.454124][0:kworker/0:1:34] shared[2].name = sys_mon, r_info->remote_pid = 4 table_id=1 <6>[12.455103][0:kworker/0:1:34] shared[3].name = APPS_RIVA_CTRL, r_info->remote_pid = 4 table_id=1 <6>[12.456004][0:kworker/0:1:34] shared[4].name = APPS_RIVA_DATA, r_info->remote_pid = 4 table_id=1 <6>[12.583796][0:kworker/0:1:34] shared[5].name = WCNSS_CTRL, r_info->remote_pid = 4 table_id=1 <6>[12.584751][0:kworker/0:1:34] shared[6].name = WLAN_CTRL, r_info->remote_pid = 4 table_id=1 <6>[12.836919][0:kworker/0:1:34] shared[7].name = APPS_RIVA_BT_CMD, r_info->remote_pid = 4 table_id=1 <6>[12.837876][0:kworker/0:1:34] shared[8].name = APPS_RIVA_BT_ACL, r_info->remote_pid = 4 table_id=1 <6>[12.838729][0:kworker/0:1:34] shared[9].name = APPS_RIVA_ANT_CMD, r_info->remote_pid = 4 table_id=1 <6>[12.839399][0:kworker/0:1:34] shared[10].name = APPS_RIVA_ANT_DATA, r_info->remote_pid = 4 table_id=1 <6>[12.843247][0:kworker/0:1:34] shared[11].name = APPS_FM, r_info->remote_pid = 4 table_id=1- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
這里顯示的都是在啟動的時候掃描smd之后,調用smd_alloc_channel()函數初始化相應的數據結構之后的結果。?
在smd_alloc_channel()函數中,會根據上面的名字,初始化一個platform device!!之后也是會根據這個名字來注冊platform driver。這些platform driver當然可以在/sys/devices/platform/目錄下是看得到的。
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
qc_smd_ch_xxx.log
Primary allocation table: ID|CHANNEL NAME |T|PROC |STATE |FIFO SZ|RDPTR |WRPTR |FLAGS |DATAPEN ------------------------------------------------------------------------------- 4|rpm_requests |P|APPS |OPENED |0x00400|0x00188|0x00188|DCCiwRsB|0x00000 | | |RPM |OPENED |0x00400|0x000A0|0x000A0|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 5|rpm_requests |P|MDMSW| Access Restricted | | |RPM | Access Restricted ------------------------------------------------------------------------------- 6|rpm_requests |P|WCNSS| Access Restricted | | |RPM | Access Restricted ------------------------------------------------------------------------------- 7|rpm_requests |P|TZ | Access Restricted | | |RPM | Access Restricted -------------------------------------------------------------------------------APPS <-> MDMSW Primary allocation table: ID|CHANNEL NAME |T|PROC |STATE |FIFO SZ|RDPTR |WRPTR |FLAGS |DATAPEN ------------------------------------------------------------------------------- 0|DS |S|APPS |OPENED |0x02000|0x00000|0x00000|DCCiwrsB|0x00000 | | |MDMSW|OPENED |0x02000|0x00000|0x00000|dCciwrsb|0x00000 ------------------------------------------------------------------------------- 1|IPCRTR |P|APPS |OPENED |0x02000|0x00F28|0x00F28|DCCiwrsB|0x00000 | | |MDMSW|OPENED |0x02000|0x00DAC|0x00DAC|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 2|SSM_RTR_MODEM_APPS |P|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000 | | |MDMSW|OPENING|0x02000|0x00000|0x00000|DCCiwrSb|0x00000 ------------------------------------------------------------------------------- 3|sys_mon |P|APPS |OPENED |0x00400|0x002BE|0x002BE|DCCiwrsB|0x00000 | | |MDMSW|OPENED |0x00400|0x00060|0x00060|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 4|DIAG_2_CMD |P|APPS |OPENED |0x02000|0x00000|0x00000|DCCiwrsb|0x00000 | | |MDMSW|OPENED |0x02000|0x00000|0x00000|DCCiwrsb|0x00000 ------------------------------------------------------------------------------- 5|DIAG_2 |P|APPS |OPENED |0x02000|0x00000|0x00000|DCCiwrsb|0x00000 | | |MDMSW|OPENED |0x02000|0x00000|0x00000|DCCiwrsb|0x00000 ------------------------------------------------------------------------------- 6|DIAG_CNTL |P|APPS |OPENED |0x02000|0x00083|0x00083|DCCiwrsb|0x00000 | | |MDMSW|OPENED |0x02000|0x00471|0x00471|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 7|DIAG_CMD |P|APPS |OPENED |0x02000|0x00000|0x00000|DCCiwrsb|0x00000 | | |MDMSW|OPENED |0x02000|0x00000|0x00000|DCCiwrsb|0x00000 ------------------------------------------------------------------------------- 8|DIAG |P|APPS |OPENED |0x02000|0x00000|0x00000|DCCiwrsb|0x00000 | | |MDMSW|OPENED |0x02000|0x00026|0x00026|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 9|apr_audio_svc |P|APPS |OPENED |0x02000|0x0064E|0x0064E|DCCiwrsB|0x00000 | | |MDMSW|OPENED |0x02000|0x01C70|0x01C70|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 10|apr_apps2 |P|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000| | |MDMSW|OPENING|0x02000|0x00000|0x00000|DCCiwrSb|0x00000 ------------------------------------------------------------------------------- 11|DATA1 |P|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000| | |MDMSW|OPENING|0x02000|0x00000|0x00000|dCciwrSb|0x00000 ------------------------------------------------------------------------------- 12|DATA2 |P|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000| | |MDMSW|OPENING|0x02000|0x00000|0x00000|dCciwrSb|0x00000 ------------------------------------------------------------------------------- 13|DATA3 |P|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000| | |MDMSW|OPENING|0x02000|0x00000|0x00000|dCciwrSb|0x00000 ------------------------------------------------------------------------------- 14|DATA4 |P|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000| | |MDMSW|OPENING|0x02000|0x00000|0x00000|dCciwrSb|0x00000 ------------------------------------------------------------------------------- 15|DATA11 |S|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000| | |MDMSW|OPENING|0x02000|0x00000|0x00000|dCciwrSb|0x00000 ------------------------------------------------------------------------------- 16|DATA40 |P|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000| | |MDMSW|OPENING|0x02000|0x00000|0x00000|dcciwrSb|0x00000 ------------------------------------------------------------------------------- 17|DATA5_CNTL |P|APPS |OPENED |0x00400|0x001AA|0x001AA|DCCiwrsB|0x00000 | | |MDMSW|OPENED |0x00400|0x00208|0x00208|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 18|DATA6_CNTL |P|APPS |OPENED |0x00400|0x00338|0x00338|DCCiwrsB|0x00000| | |MDMSW|OPENED |0x00400|0x00363|0x00363|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 19|DATA7_CNTL |P|APPS |OPENED |0x00400|0x001A2|0x001A2|DCCiwrsB|0x00000 | | |MDMSW|OPENED |0x00400|0x001F7|0x001F7|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 20|DATA8_CNTL |P|APPS |OPENED |0x00400|0x001A2|0x001A2|DCCiwrsB|0x00000| | |MDMSW|OPENED |0x00400|0x001F7|0x001F7|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 21|DATA9_CNTL |P|APPS |OPENED |0x00400|0x001A2|0x001A2|DCCiwrsB|0x00000 | | |MDMSW|OPENED |0x00400|0x001F7|0x001F7|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 22|DATA12_CNTL |P|APPS |OPENED |0x00400|0x001A2|0x001A2|DCCiwrsB|0x00000| | |MDMSW|OPENED |0x00400|0x001F7|0x001F7|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 23|DATA13_CNTL |P|APPS |OPENED |0x00400|0x001A2|0x001A2|DCCiwrsB|0x00000 | | |MDMSW|OPENED |0x00400|0x001F7|0x001F7|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 24|DATA14_CNTL |P|APPS |OPENED |0x00400|0x001A2|0x001A2|DCCiwrsB|0x00000| | |MDMSW|OPENED |0x00400|0x001F7|0x001F7|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 25|DATA15_CNTL |P|APPS |CLOSED |0x00400|0x00000|0x00000|dcciwrsb|0x00000 | | |MDMSW|OPENING|0x00400|0x00000|0x00000|DCCiwrSb|0x00000 ------------------------------------------------------------------------------- 26|DATA16_CNTL |P|APPS |CLOSED |0x00400|0x00000|0x00000|dcciwrsb|0x00000| | |MDMSW|OPENING|0x00400|0x00000|0x00000|DCCiwrSb|0x00000 ------------------------------------------------------------------------------- 27|DATA40_CNTL |P|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000 | | |MDMSW|OPENING|0x02000|0x00000|0x00000|DCCiwrSb|0x00000 -------------------------------------------------------------------------------APPS <-> WCNSS Primary allocation table: ID|CHANNEL NAME |T|PROC |STATE |FIFO SZ|RDPTR |WRPTR |FLAGS |DATAPEN ------------------------------------------------------------------------------- 1|IPCRTR |P|APPS |OPENED |0x02000|0x00168|0x00168|DCCiwrsB|0x00000 | | |WCNSS|OPENED |0x02000|0x000D8|0x000D8|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 2|sys_mon |P|APPS |OPENED |0x00400|0x00267|0x00267|DCCiwRsB|0x00000 | | |WCNSS|OPENED |0x00400|0x003D4|0x003D4|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 3|APPS_RIVA_CTRL |P|APPS |OPENED |0x02000|0x00062|0x00062|DCCiwrsb|0x00000 | | |WCNSS|OPENED |0x02000|0x00282|0x00282|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 4|APPS_RIVA_DATA |P|APPS |OPENED |0x02000|0x00000|0x00000|DCCiwrsb|0x00000 | | |WCNSS|OPENED |0x02000|0x00000|0x00000|DCCiwrsb|0x00000 ------------------------------------------------------------------------------- 5|WCNSS_CTRL |P|APPS |OPENED |0x02000|0x01638|0x01638|DCCiwrsB|0x00000 | | |WCNSS|OPENED |0x02000|0x00175|0x00175|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 6|WLAN_CTRL |P|APPS |OPENED |0x02000|0x00277|0x00277|DCCiwrsB|0x00000 | | |WCNSS|OPENED |0x02000|0x01115|0x01115|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 7|APPS_RIVA_BT_CMD |P|APPS |OPENED |0x02000|0x0182C|0x0182C|DCCiwrsB|0x00000 | | |WCNSS|OPENED |0x02000|0x01AE5|0x01AE5|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 8|APPS_RIVA_BT_ACL |P|APPS |OPENED |0x02000|0x01904|0x01904|DCCiwrsB|0x00000 | | |WCNSS|OPENED |0x02000|0x015E8|0x015E8|DCCiwrsB|0x00000 ------------------------------------------------------------------------------- 9|APPS_RIVA_ANT_CMD |P|APPS |CLOSED |0x00400|0x00000|0x00000|dcciwrsb|0x00000 | | |WCNSS|OPENING|0x00400|0x00000|0x00000|DCCiwrSb|0x00000 ------------------------------------------------------------------------------- 10|APPS_RIVA_ANT_DATA |P|APPS |CLOSED |0x00800|0x00000|0x00000|dcciwrsb|0x00000| | |WCNSS|OPENING|0x00800|0x00000|0x00000|DCCiwrSb|0x00000 ------------------------------------------------------------------------------- 11|APPS_FM |P|APPS |CLOSED |0x02000|0x00000|0x00000|dcciwrsb|0x00000 | | |WCNSS|OPENING|0x02000|0x00000|0x00000|DCCiwrSb|0x00000 -------------------------------------------------------------------------------- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
每個port名字和對應的生成的節點之間的關系,可以再msm8916.dtsi文件中找得到。?
比如在msm_smd_pkt.c文件中,parse_smdpkt_devicetree()函數中可以看到在讀qcom,smdpkt-dev-name的信息,然后后面會根據這個名字調用device_create()函數!!雖然msm_smd_tty.c對應的”qcom,smdtty”中沒有用”qcom,smdpkt-dev-name”定義設備名字,但一般在alias{}那里都定義了一個別名,好像都是根據這個別名來定的設備的名字!!
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 104
- 105
- 106
- 107
- 108
- 109
- 110
- 111
- 112
- 113
- 114
- 115
- 116
- 117
- 118
- 119
- 120
- 121
- 122
- 123
- 124
- 125
- 126
- 127
- 128
- 129
- 130
- 131
- 132
- 133
- 134
- 135
- 136
- 137
- 138
- 139
- 140
- 141
- 142
- 143
- 144
- 145
- 146
- 147
- 148
- 149
- 150
- 151
- 152
- 153
- 154
- 155
- 156
- 157
- 158
- 159
- 160
- 161
- 162
- 163
- 164
- 165
- 166
- 167
- 168
- 169
- 170
- 171
- 172
- 173
- 174
- 175
- 176
- 177
- 178
- 179
- 180
- 181
- 182
- 183
- 184
- 185
- 186
- 187
- 188
- 189
- 190
- 191
- 192
- 193
- 194
- 195
- 196
- 197
- 198
- 199
- 200
- 201
- 202
- 203
- 204
- 205
- 206
- 207
- 208
- 209
- 210
- 211
- 212
- 213
- 214
- 215
- 216
- 217
- 218
- 219
- 220
- 221
- 222
- 223
- 224
- 225
- 226
- 227
- 228
- 229
- 230
- 231
- 232
- 233
- 234
- 235
- 236
- 237
- 238
- 239
至此,就知道在哪里會初始化smd channel,然后AP檢測到smd channel之后打開相應的smd channel等內容了。相應的節點創建也可以知道了,但這些節點不管smd channel有沒有打開都會創建!!?
在Ril代碼中,可以看到有打開/dev/smd0等節點。?
這些節點的ops函數組其實都差不多,msm_smd_pkt.c中是smd_pkt_fops,msm_smd_tty中是smd_tty_ops。?
都是在調用到之后,才根據文件名等,再找出來是哪個smd channel,然后調用smd_named_open_on_edge函數打開smd channel。讀寫等操作的話,還要看當初smd_alloc_channel()的時候的相應的channel是packet傳輸還是stream傳輸!!這個估計都不是AP這邊決定的,但可以在smd_alloc_channel()函數中打log查看每個smd channel的類型。
SMD_DBG()這種函數用來輸出smd等log信息。看這些內容可以在/d/ipc_logging下看的到的,如果是SMD_INFO和SMD_DBG內容就是在/d/ipc_logging/smd目錄下。這個是因為~~看下面代碼注釋
//msm_smd_debug_mask這個默認沒有打開debug信息,需要調試更多可以加一個MSM_SMD_DEBUG。 #define SMD_DBG(x...) do { \if (msm_smd_debug_mask & MSM_SMD_DEBUG) \IPC_LOG_SMD(KERN_DEBUG, x); \} while (0) #define SMD_INFO(x...) do { \if (msm_smd_debug_mask & MSM_SMD_INFO) \IPC_LOG_SMD(KERN_INFO, x); \} while (0)//如果smd_log_ctx已經像下面這樣定義,那就是到/d/ipc_logging目錄下找相應名字的文件夾下看 //或者如果不想的話,就可以把smd_log_ctx的定義去掉,直接打印到內核里邊。當然內核的debug level那塊自己需要改一下!! smd_log_ctx = ipc_log_context_create(NUM_LOG_PAGES, "smd", 0); #define IPC_LOG_SMD(level, x...) do { \if (smd_log_ctx) \ipc_log_string(smd_log_ctx, x); \else \printk(level x); \} while (0)- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
以下是qc_smdpkt_xxx.log:
[ 11247.679255802] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11247.679286896] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11247.679292469] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11247.679332781] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11247.679372521] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11247.679430594] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11247.679436479] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11247.679462677] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0 [ 11253.959471134] <SMD_PKT>: Begin smd_pkt_write on smd_pkt_dev id:0 data_size 13 [ 11253.959521967] <SMD_PKT>: Finished smd_pkt_write on smd_pkt_dev id:0 13 bytes [ 11253.959942853] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11253.959981186] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11253.959982748] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11253.959985248] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11253.960014207] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11253.960050561] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11253.960054780] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11253.960072123] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0 [ 11260.707648550] <SMD_PKT>: Begin smd_pkt_write on smd_pkt_dev id:0 data_size 13 [ 11260.707704800] <SMD_PKT>: Finished smd_pkt_write on smd_pkt_dev id:0 13 bytes [ 11260.708084957] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11260.708118811] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11260.708123290] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11260.708154540] <SMD_PKT>: packet_arrival_worker locking smd_pkt_dev id:0 wakeup source [ 11260.708218654] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11260.708571415] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11260.708609384] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11260.708613863] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11260.708631832] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0 [ 11264.686568250] <SMD_PKT>: Begin smd_pkt_write on smd_pkt_dev id:0 data_size 13 [ 11264.686618146] <SMD_PKT>: Finished smd_pkt_write on smd_pkt_dev id:0 13 bytes [ 11264.686985281] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11264.687013979] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11264.687018406] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11264.687091062] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11264.687141010] <SMD_PKT>: packet_arrival_worker locking smd_pkt_dev id:0 wakeup source [ 11264.687145906] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11264.687185073] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11264.687189917] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11264.687207937] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0 [ 11271.507262281] <SMD_PKT>: Begin smd_pkt_write on smd_pkt_dev id:0 data_size 13 [ 11271.507305719] <SMD_PKT>: Finished smd_pkt_write on smd_pkt_dev id:0 13 bytes [ 11271.507728167] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11271.507759625] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11271.507763583] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11271.507796604] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11271.507822854] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11271.507862333] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11271.507866500] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11271.507884364] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0 [ 11274.734097551] <SMD_PKT>: Begin smd_pkt_write on smd_pkt_dev id:0 data_size 13 [ 11274.734160676] <SMD_PKT>: Finished smd_pkt_write on smd_pkt_dev id:0 13 bytes [ 11274.734588697] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11274.734628333] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11274.734633645] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11274.735154999] <SMD_PKT>: packet_arrival_worker locking smd_pkt_dev id:0 wakeup source [ 11274.735238385] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11274.735276614] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11274.735333906] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11274.735339374] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11274.735361145] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0 [ 11281.493969135] <SMD_PKT>: Begin smd_pkt_write on smd_pkt_dev id:0 data_size 13 [ 11281.494015593] <SMD_PKT>: Finished smd_pkt_write on smd_pkt_dev id:0 13 bytes [ 11281.496142103] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11281.496202520] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11281.496207780] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11281.496255801] <SMD_PKT>: packet_arrival_worker locking smd_pkt_dev id:0 wakeup source [ 11281.496423249] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11281.496776582] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11281.496824707] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11281.496828822] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11281.496848614] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0 [ 11284.784395968] <SMD_PKT>: Begin smd_pkt_write on smd_pkt_dev id:0 data_size 13 [ 11284.784449301] <SMD_PKT>: Finished smd_pkt_write on smd_pkt_dev id:0 13 bytes [ 11284.786411332] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11284.786464301] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11284.786469197] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11284.786477790] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11284.786504093] <SMD_PKT>: packet_arrival_worker locking smd_pkt_dev id:0 wakeup source [ 11284.786811645] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11284.786848363] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11284.786852582] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11284.786870290] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0 [ 11288.184812488] <SMD_PKT>: Begin smd_pkt_write on smd_pkt_dev id:0 data_size 13 [ 11288.184869311] <SMD_PKT>: Finished smd_pkt_write on smd_pkt_dev id:0 13 bytes [ 11288.187012645] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11288.187054572] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11288.187060145] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11288.187062592] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11288.187099884] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11288.187139363] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11288.187143530] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11288.187161499] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0 [ 11294.361732247] <SMD_PKT>: Begin smd_pkt_write on smd_pkt_dev id:0 data_size 13 [ 11294.361781205] <SMD_PKT>: Finished smd_pkt_write on smd_pkt_dev id:0 13 bytes [ 11294.362070320] <SMD_PKT>: ch_notify: DATA event in smd_pkt_dev id:0 [ 11294.362108132] <SMD_PKT>: check_and_wakeup_reader: wake_up smd_pkt_dev id:0 [ 11294.362108288] <SMD_PKT>: smd_pkt_poll sets POLLIN for smd_pkt_dev id: 0 [ 11294.362112403] <SMD_PKT>: check_and_wakeup_writer: 1000 bytes write space in smd_pkt_dev id:0 [ 11294.362459851] <SMD_PKT>: Begin smd_pkt_read on smd_pkt_dev id:0 buffer_size 5086 [ 11294.362544070] <SMD_PKT>: smd_pkt_read unlocked smd_pkt_dev id:0 wakeup_source [ 11294.362548393] <SMD_PKT>: Finished smd_pkt_read on smd_pkt_dev id:0 20 bytes [ 11294.362567299] <SMD_PKT>: check_and_wakeup_reader: No packet in smd_pkt_dev id:0- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56
- 57
- 58
- 59
- 60
- 61
- 62
- 63
- 64
- 65
- 66
- 67
- 68
- 69
- 70
- 71
- 72
- 73
- 74
- 75
- 76
- 77
- 78
- 79
- 80
- 81
- 82
- 83
- 84
- 85
- 86
- 87
- 88
- 89
- 90
- 91
- 92
- 93
- 94
- 95
- 96
- 97
- 98
- 99
- 100
- 101
- 102
- 103
后續,,
smd,smem,smsm等共享內存所占據的內存范圍,大小???
/system/bin/smdexe 這個代碼在哪里,都干嘛的?init.rc里邊這樣定義了一個service,但沒有找到代碼,后續需要說明。
- 1
- 2
- 3
- 4
- 1
- 2
- 3
- 4
這個service注冊還在oemclientreceiver.cpp文件中添加了下面的一段內容。
ProcessInfo allowedProcess[] = {...{ AID_SYSTEM, -1, "/system/bin/smdexe" },... };- 1
- 2
- 3
- 4
- 5
- 1
- 2
- 3
- 4
- 5
debug需要的一些log抓取
Some diag related issues seen when doing factory/RF tests are hard to debug and related to multiple technical areas, like diag/smd/usb/qmsl based tools.?
we always need comprehensive logs from all sides to begin our analysis and finally find root cause.
Here is a list of what logs are expected to be provided to Qcom to begin analysis.
QMSL log, Port trace log, USB analyzer log, diag debugfs status dump, ipc logging for diag smd channels, and ramdump with matchable elfs.
How the log collected:?
1. Power on device?
2. QPST recognized DIAG port?
3. Echo pr_debug for diagfwd.c/ diagchar_core.c?
4. Collect ipc_logging for smd channels?
5. Enable Port trace log?
6. Start USB analyzer log collection?
7. Begin the test - -when doing test, qmsl log is collected?
8. After see failure, stop Port trace log, stop USB analyzer log collection.?
9. Dump diag debugfs status?
10. Echo c to sysrq-trigger to trigger a panic and collect ramdump.
Where step 3-4 is done by script named “test.bat”?
If no usb analyzer, ignore step 6.?
9-10 is done by script named “diag_panic.bat”
test.bat
adb wait-for-devices?
adb shell “echo 1 >/sys/module/msm_poweroff/parameters/download_mode”?
adb shell “echo 1 > /proc/sys/kernel/sysrq”?
adb shell “echo ‘file diagfwd.c +p’ > /sys/kernel/debug/dynamic_debug/control”?
adb shell “echo ‘file diagchar_core.c +p’ > /sys/kernel/debug/dynamic_debug/control”?
adb shell cat /d/ipc_logging/smd/log_cont
diag_panic.bat
adb shell cat /sys/kernel/debug/diag/work_pending;?
adb shell cat /sys/kernel/debug/diag/status;?
adb shell cat /sys/kernel/debug/diag/table;?
adb shell cat /sys/kernel/debug/diag/mempool;?
adb shell dmesg >dmesg.txt?
adb shell “echo c > /proc/sysrq-trigger”
Appendix:
how to capture port trace log:
If you do not see ‘Port Trace’ in the drop-down menu, you may not have pressed ‘Shift’ while right-clicking
The port trace log will be saved in following location
it is better you can enable the port trace before doing test. and disable it immediately after issue reproduced.?
Too much logs is not preferred and it is hard for us to do filtering and analysis.
總結
以上是生活随笔為你收集整理的Linux驱动基础:MSM平台AP/CP通信机制的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: lk中内联调用的dsb()
- 下一篇: Android5.1设备无法识别exFA