Tool/software: Linux
There is a problem in the crypto framework,The following:
(1)The environment:
linux3.2,am335x,Hardware encryption card(use sm1 and sm3),Communication with spi
(2)The problem:
in the frame of the crypto must used directly spidev_sync_write and spidev_sync_read,this Will produce OOPS-->BUG: scheduling while atomic
and I have already solved the Ping out direction,The concrete is :
crypto_cbc_decrypt->blkcipher_walk_virt->blkcipher_walk_first->blkcipher_walk_next->blkcipher_next_fast->blkcipher_map_src->scatterwalk_map->crypto_kmap->kmap_atomic ->__kmap_atomic
kmap_atomic --->>kmap------> OK!
but still the Ping in direction,the OOPS is:
[ 26.207733] BUG: scheduling while atomic: swapper/0/0x00000100
[ 26.213836] Modules linked in: procfs(O) sta(O) key(O) do(O) di(O) option usb_wwan smX(O) spidev(O) spi_omap2_mcspi
[ 26.224822]
[ 26.226379] Pid: 0, comm: swapper
[ 26.231048] CPU: 0 Tainted: G O (3.2.0-BonsonInfo #1165)
[ 26.237884] PC is at am33xx_enter_idle+0x74/0xac
[ 26.242736] LR is at getnstimeofday+0x50/0x144
[ 26.247375] pc : [<c0026988>] lr : [<c005f8dc>] psr: 80000013
[ 26.247375] sp : c0657f40 ip : 38764ee2 fp : c0657f6c
[ 26.259399] r10: 00000000 r9 : 413fc082 r8 : 80004059
[ 26.264862] r7 : 00000000 r6 : c065eaa8 r5 : 00000000 r4 : 00000000
[ 26.271697] r3 : 0008a052 r2 : 38764ee2 r1 : 0008a052 r0 : d2c87265
[ 26.278533] Flags: Nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment kernel
[ 26.286193] Control: 10c5387d Table: 870cc019 DAC: 00000015
[ 26.292205]
[ 26.292205] PC: 0xc0026908:
[ 26.296661] 6908 e3a02000 e5832038 e89da800 e1a0c00d e92dd870 e24cb004 e24dd014 e0823082
[ 26.305267] 6928 e1a05002 e1a06000 e0803183 e5934010 f10c0080 e24b0024 eb00e434 e3540000
[ 26.313842] 6948 0a00001a e5943000 e3530000 0a000001 e5940008 e12fff33 ebffdb0b e5943004
[ 26.322448] 6968 e3530000 0a000001 e5940008 e12fff33 e24b002c eb00e425 f1080080 e51b1028
[ 26.331024] 6988 e3043240 e51b2020 e340300f e51bc02c e1a00005 e0622001 e51b1024 e061100c
[ 26.339630] 69a8 e0232193 e5863008 e24bd018 e89da870 ebffdaf5 eaffffed e1a0c00d e92dd800
[ 26.348205] 69c8 e24cb004 e3002000 e34f29e1 e5921908 f57ff04f e3043c60 e34c306a e5831000
[ 26.356811] 69e8 e592190c f57ff04f e5831004 e5921910 f57ff04f e5831008 e5921914 f57ff04f
[ 26.365386]
[ 26.365386] LR: 0xc005f85c:
[ 26.369873] f85c e0a57003 e1c860f0 e24bd028 e89daff0 e59f0014 e3a010f5 ebff705d eaffffbf
[ 26.378448] f87c eaffffc0 c06580ec c06c7230 c0590700 e1a0c00d e92ddff0 e24cb004 e24dd01c
[ 26.387054] f89c e59f3120 e1a05000 e5933000 e3530000 1a00003f e59f4110 e2849068 e5998000
[ 26.395629] f8bc e3180001 1a00003e e8940003 e8850003 e594a018 e1a0000a e59a3000 e12fff33
[ 26.404235] f8dc e1ca20d8 e14b23f4 e1ca61d0 e5942054 e594301c e14b63fc e14b63d4 e263a020
[ 26.412811] f8fc e0506006 e0c17007 e14b03dc e253c020 e0066000 e0077001 e14b63f4 e0810296
[ 26.421417] f91c e0211792 e1a06330 e1866a11 e1a07331 51a06c31 e5943068 e1580003 1affffde
[ 26.429992] f93c e5951004 e595c000 e0962001 e0a73fc1 e3530000 0a000010 e30c09ff e3036600
[ 26.438598]
[ 26.438598] SP: 0xc0657ec0:
[ 26.443054] 7ec0 fa200000 c0657ef8 ffffffff c0657f2c c0657ef4 c0657ee0 c0008500 c001520c
[ 26.451660] 7ee0 c0026988 80000013 c0657f6c c0657ef8 c04a3b80 c00084bc d2c87265 0008a052
[ 26.460235] 7f00 38764ee2 0008a052 00000000 00000000 c065eaa8 00000000 80004059 413fc082
[ 26.468811] 7f20 00000000 c0657f6c 38764ee2 c0657f40 c005f8dc c0026988 80000013 ffffffff
[ 26.477416] 7f40 38764ee2 0008a052 38764ee2 00087f4d 00000000 c065eaa8 c065e850 c06d8f3c
[ 26.485992] 7f60 c0657f94 c0657f70 c0362530 c0026920 c0656000 c06a42c4 c065c970 c065c964
[ 26.494598] 7f80 80004059 413fc082 c0657fb4 c0657f98 c0015938 c0362494 c065812c c064a324
[ 26.503204] 7fa0 bfffffff c065c964 c0657fc4 c0657fb8 c049a940 c00158cc c0657ff4 c0657fc8
[ 26.511779]
[ 26.511779] FP: 0xc0657eec:
[ 26.516235] 7eec c0657ef8 c04a3b80 c00084bc d2c87265 0008a052 38764ee2 0008a052 00000000
[ 26.524841] 7f0c 00000000 c065eaa8 00000000 80004059 413fc082 00000000 c0657f6c 38764ee2
[ 26.533447] 7f2c c0657f40 c005f8dc c0026988 80000013 ffffffff 38764ee2 0008a052 38764ee2
[ 26.542022] 7f4c 00087f4d 00000000 c065eaa8 c065e850 c06d8f3c c0657f94 c0657f70 c0362530
[ 26.550628] 7f6c c0026920 c0656000 c06a42c4 c065c970 c065c964 80004059 413fc082 c0657fb4
[ 26.559204] 7f8c c0657f98 c0015938 c0362494 c065812c c064a324 bfffffff c065c964 c0657fc4
[ 26.567779] 7fac c0657fb8 c049a940 c00158cc c0657ff4 c0657fc8 c061e808 c049a8d8 c061e32c
[ 26.576385] 7fcc 00000000 00000000 c064a324 00000000 10c53c7d c0658044 c064a2f4 00000000
[ 26.584991]
[ 26.584991] R0: 0xd2c871e5:
[ 26.589447] 71e4 ******** ******** ******** ******** ******** ******** ******** ********
[ 26.598052] 7204 ******** ******** ******** ******** ******** ******** ******** ********
[ 26.606658] 7224 ******** ******** ******** ******** ******** ******** ******** ********
[ 26.615234] 7244 ******** ******** ******** ******** ******** ******** ******** ********
[ 26.623840] 7264 ******** ******** ******** ******** ******** ******** ******** ********
[ 26.632446] 7284 ******** ******** ******** ******** ******** ******** ******** ********
[ 26.641021] 72a4 ******** ******** ******** ******** ******** ******** ******** ********
[ 26.649627] 72c4 ******** ******** ******** ******** ******** ******** ******** ********
[ 26.658203] 72e4 ******** ******** ******** ******** ******** ******** ******** ********
[ 26.666809]
[ 26.666809] R6: 0xc065ea28:
[ 26.671295] ea28 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 26.679870] ea48 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 26.688446] ea68 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 26.697052] ea88 00000002 00000000 00000000 00000000 00000000 c00268c4 c00268ec 00000001
[ 26.705627] eaa8 00000003 00000000 000026dd 00000002 00000000 00000000 00000aa8 00000000
[ 26.714233] eac8 010cd369 00000000 c065ea9c 00000000 00000000 00000000 00000000 00000000
[ 26.722808] eae8 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 26.731414] eb08 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 26.740020] Backtrace:
[ 40.508087] Backtrace:
[ 40.510681] [<c00181e0>] (dump_backtrace+0x0/0x10c) from [<c04a1a08>] (dump_stack+0x18/0x1c)
[ 40.519500] r7:c0675f78 r6:c0656000 r5:c0675f78 r4:c0657ef8
[ 40.525482] [<c04a19f0>] (dump_stack+0x0/0x1c) from [<c0015ddc>] (show_regs+0x4c/0x50)
[ 40.533782] [<c0015d90>] (show_regs+0x0/0x50) from [<c0036614>] (__schedule_bug+0x4c/0x60)
[ 40.542449] r5:c0675f78 r4:c0657ef8
[ 40.546203] [<c00365c8>] (__schedule_bug+0x0/0x60) from [<c04a236c>] (__schedule+0x308/0x368)
[ 40.555114] r5:c0675f78 r4:c065b9b8
[ 40.558868] [<c04a2064>] (__schedule+0x0/0x368) from [<c04a24e8>] (schedule+0x50/0x68)
[ 40.567169] [<c04a2498>] (schedule+0x0/0x68) from [<c04a27c4>] (schedule_timeout+0x12c/0x188)
[ 40.576110] [<c04a2698>] (schedule_timeout+0x0/0x188) from [<c04a1e80>] (wait_for_common+0xb0/0x144)
[ 40.585662] r8:bf008d68 r7:00000000 r6:00000002 r5:c0656000 r4:bf008d64
[ 40.592712] [<c04a1dd0>] (wait_for_common+0x0/0x144) from [<c04a1fbc>] (wait_for_completion+0x18/0x1c)
[ 40.602478] [<c04a1fa4>] (wait_for_completion+0x0/0x1c) from [<bf0061ac>] (spidev_sync+0x6c/0x94 [spidev])
[ 40.612609] [<bf006140>] (spidev_sync+0x0/0x94 [spidev]) from [<bf006558>] (sm1CbcEncrypt+0x370/0x77c [spidev])
[ 40.623168] r7:000000b0 r6:bf008d60 r5:00000000 r4:c7be3900
[ 40.629119] [<bf0061e8>] (sm1CbcEncrypt+0x0/0x77c [spidev]) from [<bf00ec94>] (cbc_sm1_crypt+0x254/0x2b8 [smX])
[ 40.639678] [<bf00ea40>] (cbc_sm1_crypt+0x0/0x2b8 [smX]) from [<bf00ed64>] (sm1blkcbc_decrypt+0x6c/0x78 [smX])
[ 40.650177] [<bf00ecf8>] (sm1blkcbc_decrypt+0x0/0x78 [smX]) from [<c01e9be4>] (async_decrypt+0x48/0x50)
[ 40.660034] [<c01e9b9c>] (async_decrypt+0x0/0x50) from [<c01f9fb4>] (crypto_authenc_decrypt+0x1e8/0x33c)
[ 40.669982] [<c01f9dcc>] (crypto_authenc_decrypt+0x0/0x33c) from [<c0406d84>] (esp_input+0x1b4/0x334)
[ 40.679656] [<c0406bd0>] (esp_input+0x0/0x334) from [<c041bb68>] (xfrm_input+0x380/0x40c)
[ 40.688232] [<c041b7e8>] (xfrm_input+0x0/0x40c) from [<c04125cc>] (xfrm4_rcv_encap+0x24/0x28)
[ 40.697143] [<c04125a8>] (xfrm4_rcv_encap+0x0/0x28) from [<c04125f0>] (xfrm4_rcv+0x20/0x24)
[ 40.705932] [<c04125d0>] (xfrm4_rcv+0x0/0x24) from [<c03c9c30>] (ip_local_deliver_finish+0x118/0x280)
[ 40.715576] [<c03c9b18>] (ip_local_deliver_finish+0x0/0x280) from [<c03c9e44>] (ip_local_deliver+0xac/0xb8)
[ 40.725799] [<c03c9d98>] (ip_local_deliver+0x0/0xb8) from [<c03c960c>] (ip_rcv_finish+0x118/0x314)
[ 40.735168] r4:c78515c0
[ 40.737823] [<c03c94f4>] (ip_rcv_finish+0x0/0x314) from [<c03c9a54>] (ip_rcv+0x24c/0x310)
[ 40.746398] r9:00000000 r8:00007960 r7:00000000 r6:000079fc r5:c78515c0
[ 40.753234] r4:c78515c0
[ 40.755981] [<c03c9808>] (ip_rcv+0x0/0x310) from [<c039a26c>] (__netif_receive_skb+0x250/0x3ac)
[ 40.765106] [<c039a01c>] (__netif_receive_skb+0x0/0x3ac) from [<c039a564>] (netif_receive_skb+0x4c/0x70)
[ 40.775054] [<c039a518>] (netif_receive_skb+0x0/0x70) from [<c02c54a8>] (cpsw_rx_handler+0x60/0x144)
[ 40.784606] r4:c7b29800
[ 40.787292] [<c02c5448>] (cpsw_rx_handler+0x0/0x144) from [<c02c1174>] (__cpdma_chan_free+0xa8/0xb4)
[ 40.796844] r8:000000aa r7:c78515c0 r6:c7ae3140 r5:60000113 r4:c7ab47c0
[ 40.803894] [<c02c10cc>] (__cpdma_chan_free+0x0/0xb4) from [<c02c1238>] (__cpdma_chan_process+0xb8/0xf0)
[ 40.813812] [<c02c1180>] (__cpdma_chan_process+0x0/0xf0) from [<c02c12c4>] (cpdma_chan_process+0x54/0x64)
[ 40.823822] r7:c7b29bd0 r6:00000040 r5:00000000 r4:c7ae3140
[ 40.829772] [<c02c1270>] (cpdma_chan_process+0x0/0x64) from [<c02c4248>] (cpsw_poll+0x34/0xec)
[ 40.838806] r7:c7b29bd0 r6:00000040 r5:c7b29bd0 r4:c7b29bc0
[ 40.844757] [<c02c4214>] (cpsw_poll+0x0/0xec) from [<c039a844>] (net_rx_action+0xb8/0x1a0)
[ 40.853393] r9:c06a3dc8 r8:c06a3dc0 r7:0000012c r6:00000040 r5:c7b29bd0
[ 40.860260] r4:00000001
[ 40.863006] [<c039a78c>] (net_rx_action+0x0/0x1a0) from [<c00411ac>] (__do_softirq+0x90/0x120)
[ 40.872039] [<c004111c>] (__do_softirq+0x0/0x120) from [<c0041404>] (irq_exit+0x90/0xac)
[ 40.880523] [<c0041374>] (irq_exit+0x0/0xac) from [<c001523c>] (handle_IRQ+0x3c/0x8c)
[ 40.888732] [<c0015200>] (handle_IRQ+0x0/0x8c) from [<c0008500>] (omap3_intc_handle_irq+0x50/0x54)
[ 40.898101] r7:c0657f2c r6:ffffffff r5:c0657ef8 r4:fa200000
[ 40.904052] [<c00084b0>] (omap3_intc_handle_irq+0x0/0x54) from [<c04a3bc0>] (__irq_svc+0x40/0x60)
[ 40.913360] Exception stack(0xc0657ef8 to 0xc0657f40)
[ 40.918640] 7ee0: 0154674d 00061421
[ 40.927215] 7f00: 386e7351 00061421 00000000 00000000 c065eaa8 00000000 80004059 413fc082
[ 40.935791] 7f20: 00000000 c0657f6c 386e7351 c0657f40 c005f8dc c0026988 80000013 ffffffff
[ 40.944335] r5:80000013 r4:c0026988
[ 40.948120] [<c0026914>] (am33xx_enter_idle+0x0/0xac) from [<c0362550>] (cpuidle_idle_call+0xa8/0x128)
[ 40.957855] r6:c06d8f3c r5:c065e850 r4:c065eaa8
[ 40.962707] [<c03624a8>] (cpuidle_idle_call+0x0/0x128) from [<c0015938>] (cpu_idle+0x78/0xc0)
[ 40.971649] r9:413fc082 r8:80004059 r7:c065c964 r6:c065c970 r5:c06a42c4
[ 40.978485] r4:c0656000
[ 40.981231] [<c00158c0>] (cpu_idle+0x0/0xc0) from [<c049a960>] (rest_init+0x74/0x78)
[ 40.989318] r7:c065c964 r6:bfffffff r5:c064a324 r4:c065812c
[ 40.995300] [<c049a8ec>] (rest_init+0x0/0x78) from [<c061e808>] (start_kernel+0x288/0x2dc)
[ 41.003936] [<c061e580>] (start_kernel+0x0/0x2dc) from [<80008040>] (0x80008040)
[ 41.011688] bad: scheduling from the idle thread!
Have any reference materials about encryption framework USES hardware encryption card,or The use of asynchronous encryption framework example in the linux3.2 crypto
thanks

