hanfei69882

hanfei69882

2个粉丝

26

问答

0

专栏

2

资料

hanfei69882  发布于  2017-02-22 12:20:42
采纳率 0%
26个问答
4684

【已解决】海思dwc_otg模块dma是否有bug

 
本帖最后由 hanfei69882 于 2017-2-23 18:36 编辑

usb模块启动概率性不识别,打印内核错误信息,初步定位到dwc_otg模块dma处理,这里是否有bug,头疼一星期了,知道的朋友麻烦指点一下:handshake

gdb定位信息到398行dma处理如下:
[code](gdb) l *ep_queue+0x188
0xc0196df0 is in ep_queue (drivers/usb/gadget/hi_hs_dev/dwc_otg_pcd_linux.c:398).
393        #if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 28)
394                dma_addr = usb_req->dma;
395        #else
396                if (GET_CORE_IF(pcd)->dma_enable) {
397                        usb_gadget_map_request(&gadget_wrapper->gadget,
398                                        usb_req, ep->dwc_ep.is_in);
399                        dma_addr = usb_req->dma;
400                }
401        #endif
402       
[/code]

错误提示信息:

Unable to handle kernel NULL pointer dereference at virtual address 00000011
pgd = c1330000
[00000011] *pgd=812cf831, *pte=00000000, *ppte=00000000
Internal error: Oops: 17 [#1] ARM
Modules linked in: hi_cipher(O) g_hid(O) dwc_otg(O) hi708(O) wdt(O) motion_event(O) key(O) indled(O) illumin(O) debugfile(O) aimer(O) hi_tmrc(O) vsync(O) hi_mipi(O) hi3518e_ive(PO) hi3518e_vpss(PO) hi3518e_viu(PO) hi3518e_isp(PO) hi3518e_sys(PO) beep(O) hi_gpio(O) pwm(O) hi3518e_base(PO) hi_media(O) mmz(O) sysconf(O)
CPU: 0    Tainted: P           O  (3.4.35 #1)
PC is at ep_queue+0x188/0x2dc [dwc_otg]
LR is at 0xf
pc : []    lr : [<0000000f>]    psr: 20000013
sp : c1167eb8  ip : c113f4ec  fp : c1167eec
r10: 00000008  r9 : bf171968  r8 : 00000020
r7 : c113f000  r6 : c1272c40  r5 : 00000000  r4 : c1324128
r3 : 00000001  r2 : 00000000  r1 : 00000002  r0 : c1324000
Flags: nzCv  IRQs on  FIQs on  Mode SVC_32  ISA ARM  Segment user
Control: 0005317f  Table: 81330000  DAC: 00000015

SP: 0xc1167e38:
7e38  00000000 00800000 00000000 00000000 00800000 bf15cde0 20000013 ffffffff
7e58  c1167ea4 00000020 c1167eec c1167e70 c0008f78 c0008548 c1324000 00000002
7e78  00000000 00000001 c1324128 00000000 c1272c40 c113f000 00000020 bf171968
7e98  00000008 c1167eec c113f4ec c1167eb8 0000000f bf15cde0 20000013 ffffffff
7eb8  c10cbf1c c110f900 c1166000 00000008 c10cbf00 b65b6eb0 00000000 c10cbf1c
7ed8  00000001 c1166000 c1167f3c c1167ef0 bf18876c bf15cc68 c1166030 b65b6eb0
7ef8  00000000 00000000 01c9c380 00000001 c1167f70 c1167f70 c1166000 c110f900
7f18  b65b6eb0 c1167f78 b65b6eb0 00000008 c1166000 00000000 c1167f6c c1167f40

IP: 0xc113f46c:
f46c  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
f48c  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
f4ac  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
f4cc  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
f4ec  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
f50c  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
f52c  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
f54c  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000

FP: 0xc1167e6c:
7e6c  c0008548 c1324000 00000002 00000000 00000001 c1324128 00000000 c1272c40
7e8c  c113f000 00000020 bf171968 00000008 c1167eec c113f4ec c1167eb8 0000000f
7eac  bf15cde0 20000013 ffffffff c10cbf1c c110f900 c1166000 00000008 c10cbf00
7ecc  b65b6eb0 00000000 c10cbf1c 00000001 c1166000 c1167f3c c1167ef0 bf18876c
7eec  bf15cc68 c1166030 b65b6eb0 00000000 00000000 01c9c380 00000001 c1167f70
7f0c  c1167f70 c1166000 c110f900 b65b6eb0 c1167f78 b65b6eb0 00000008 c1166000
7f2c  00000000 c1167f6c c1167f40 c008866c bf1885ec c1167f70 b65b6df0 c1167f70
7f4c  00000000 00000000 c110f900 b65b6eb0 00000008 c1167fa4 c1167f70 c0088980

R0: 0xc1323f80:
3f80  73627573 65747379 c132006d bf16a144 c1323dd0 c13237d0 c1323e10 00000000
3fa0  68706963 11007265 bf171640 00000000 00002000 81a40002 00000e4a 00000000
3fc0  65776f70 00000072 c1323680 bf16a0f8 c1323890 00000000 00000000 00000000
3fe0  00000000 00000000 00000012 00000000 c1007470 c0c01580 c1007470 c0c0c800
4000  c113f000 00000000 bf1693c4 c1324104 c1324134 c13243bc 00000002 00000000
4020  00000000 bf171708 bf171340 c12aeb40 c1323580 c12e500c bf17134c bf171348
4040  c10044c0 c0238ce8 c11ab240 00000002 00000003 00000000 00000000 00000001
4060  c1324060 c1324060 00000000 00000000 c132405c 00000000 bf18b4b4 00000000

R4: 0xc13240a8:
40a8  00000000 00000000 00000000 00000000 00000000 00000000 00000000 c13240c4
40c8  c13240c4 00000000 00000000 00000000 00000000 c13240dc c13240dc 00000000
40e8  00000000 00000000 00000000 00000000 00000000 bf15c4c8 bf18b498 c11abec0
4108  bf16f1a4 bf1716e0 c1324110 c1324110 00000040 00000000 00000000 00000000
4128  00000000 bf16f23c bf1716e0 c1324158 c1324010 00000400 00008100 00000000
4148  00000000 00000000 bf16f24c bf1716e0 c132417c c1324134 00000400 00000000
4168  00000000 00000000 00000000 bf16f254 bf1716e0 c13241a0 c1324158 00000400
4188  00000000 00000000 00000000 00000000 bf16f25c bf1716e0 c1324374 c132417c

R6: 0xc1272bc0:
2bc0  bf14b000 bf17a000 00000004 c12722cd 00000000 00000000 c1272c18 c12722d8
2be0  00000000 00000000 c11fcbe0 00000000 00000000 00000000 00000000 00000000
2c00  bf17a000 bf188000 00000005 c11fe90c c100420c c12722cc c11ab498 c1272bd8
2c20  00000000 00000000 c11fcf20 00000000 00000000 00000000 00000000 00000000
2c40  c1323b00 00000008 ffffffff 00000000 00000000 00000000 00000000 bf188588
2c60  c10cbf00 00000000 00000000 ffffff8d 00000000 00000000 00000000 00000000
2c80  0000000b 00000000 c10402c0 c11fcf80 c11aa5d0 00000000 00000000 00000000
2ca0  00000000 23f2f69b bf171778 00000004 c1321f50 41ed0001 00000dc1 00000000

R7: 0xc113ef80:
ef80  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
efa0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
efc0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
efe0  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
f000  bf1693f4 c1323320 c117dc00 00000001 00000000 00000000 ffdfb000 811db000
f020  00000000 00000000 ffdfa000 8126e000 00000000 c113f034 c113f034 00000000
f040  01000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
f060  00000000 00000000 00000000 00000000 00000000 00000000 00000000 c113f000
Process bre (pid: 423, stack limit = 0xc1166270)
Stack: (0xc1167eb8 to 0xc1168000)
7ea0:                                                       c10cbf1c c110f900
7ec0: c1166000 00000008 c10cbf00 b65b6eb0 00000000 c10cbf1c 00000001 c1166000
7ee0: c1167f3c c1167ef0 bf18876c bf15cc68 c1166030 b65b6eb0 00000000 00000000
7f00: 01c9c380 00000001 c1167f70 c1167f70 c1166000 c110f900 b65b6eb0 c1167f78
7f20: b65b6eb0 00000008 c1166000 00000000 c1167f6c c1167f40 c008866c bf1885ec
7f40: c1167f70 b65b6df0 c1167f70 00000000 00000000 c110f900 b65b6eb0 00000008
7f60: c1167fa4 c1167f70 c0088980 c00885d8 00000007 00000001 00000000 00000000
7f80: b65b6df0 00000008 00000000 00000017 00000004 c0009508 00000000 c1167fa8
7fa0: c0009360 c0088950 00000008 00000000 00000017 b65b6eb0 00000008 00000008
7fc0: 00000008 00000000 00000017 00000004 b65b6df0 00000018 00000008 0017dfbc
7fe0: 00000000 b65b6de0 b6e99c38 b6e99424 80000010 00000017 00000000 00000000
Backtrace:
[] (ep_queue+0x0/0x2dc [dwc_otg]) from [] (f_hidg_write+0x190/0x27c [g_hid])
r9:c1166000 r8:00000001 r7:c10cbf1c r6:00000000 r5:b65b6eb0
r4:c10cbf00
[] (f_hidg_write+0x0/0x27c [g_hid]) from [] (vfs_write+0xa4/0x150)
[] (vfs_write+0x0/0x150) from [] (sys_write+0x40/0x80)
r8:00000008 r7:b65b6eb0 r6:c110f900 r5:00000000 r4:00000000
[] (sys_write+0x0/0x80) from [] (ret_fast_syscall+0x0/0x2c)
r8:c0009508 r7:00000004 r6:00000017 r5:00000000 r4:00000008
Code: ebffb94d e5953000 eaffffa9 e5990000 (e5d22011)
---[ end trace 423fba1f469914ea ]---
我来回答
回答2个
时间排序
认可量排序

hanfei69882

2个粉丝

26

问答

0

专栏

2

资料

hanfei69882 2017-02-23 18:35:55
认可0
已解决,usb驱动pc端未识别,进行通信引起usb异常:L

横贯八方

5个粉丝

34

问答

0

专栏

3

资料

横贯八方 2020-12-21 14:43:37
认可0

已解决,usb驱动pc端未识别,进行通信引起usb异常:L

楼主大大

我在实现gadget的过程也遇到了相似的问题
也是加载模块后有时候概率性无法被识别的问题
但是加载模块后是看不出的,只有运行对应驱动的应用程序的时候,才会跳出如下错误

Unable to handle kernel NULL pointer dereference at virtual address 00000011
pgd = c2e00000
[00000011] pgd=82e04831, pte=00000000, ppte=00000000
Internal error: Oops: 17 [#1] ARM
Modules linked in: g_hid dwc_otg hi_mipi(O) hi3516a_adec(PO) hi3516a_aenc(PO) hi3516a_ao(PO) hi3516a_ai(PO) hi3516a_aio(PO) acodec(PO) sil9024(O) piris(O) pwm(O) sensor_i2c(O) hi3516a_ive(PO) hi3516a_vda(PO) hi3516a_jpege(PO) hi3516a_h265e(PO) hi3516a_h264e(PO) hi3516a_chnl(PO) hi3516a_venc(PO) hi3516a_rc(PO) hifb(PO) hi3516a_vou(PO) hi3516a_vpss(PO) hi3516a_viu(PO) hi3516a_isp(PO) hi3516a_vgs(PO) hi3516a_region(PO) hi3516a_tde(PO) hi3516a_sys(PO) hi3516a_base(PO) hi_media(O) mmz(O)
CPU: 0 Tainted: P O (3.4.35 #6)
PC is at ep_queue+0x2dc/0x300 [dwc_otg]

起初我认为是ep端点分配不足的问题,但是追着程序定点到对应分配函数,发现返回值都是成功了的
我很奇怪的一点就是如果我把模块rmmod再重新insmod,这时是可以重新被识别成功的,这现象是为什么呢
你上面说的原因是usb驱动pc端未识别,和这种现象有什么关联吗

或将文件直接拖到这里
悬赏:
E币
网盘
* 网盘链接:
* 提取码:
悬赏:
E币

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
+ 添加网盘链接/附件

Markdown 语法

  • 加粗**内容**
  • 斜体*内容*
  • 删除线~~内容~~
  • 引用> 引用内容
  • 代码`代码`
  • 代码块```编程语言↵代码```
  • 链接[链接标题](url)
  • 无序列表- 内容
  • 有序列表1. 内容
  • 缩进内容
  • 图片![alt](url)
举报反馈

举报类型

  • 内容涉黄/赌/毒
  • 内容侵权/抄袭
  • 政治相关
  • 涉嫌广告
  • 侮辱谩骂
  • 其他

详细说明

易百纳技术社区