linux/drivers/crypto/caam
Vakul Garg 3862de1f6c crypto: caam - fix job ring cleanup code
The job ring init function creates a platform device for each job ring.
While the job ring is shutdown, e.g. while caam module removal, its
platform device was not being removed. This leads to failure while
reinsertion and then removal of caam module second time.

The following kernel crash dump appears when caam module is reinserted
and then removed again. This patch fixes it.

root@p4080ds:~# rmmod caam.ko
Unable to handle kernel paging request for data at address 0x00000008
Faulting instruction address: 0xf94aca18
Oops: Kernel access of bad area, sig: 11 [#1]
SMP NR_CPUS=8 P4080 DS
Modules linked in: caam(-) qoriq_dbg(O) [last unloaded: caam]
NIP: f94aca18 LR: f94aca18 CTR: c029f950
REGS: eac47d60 TRAP: 0300   Tainted: G           O  (3.8.4-rt2)
MSR: 00029002 <CE,EE,ME>  CR: 22022484  XER: 20000000
DEAR: 00000008, ESR: 00000000
TASK = e49dfaf0[2110] 'rmmod' THREAD: eac46000 CPU: 1
GPR00: f94ad3f4 eac47e10 e49dfaf0 00000000 00000005 ea2ac210 ffffffff 00000000
GPR08: c286de68 e4977ce0 c029b1c0 00000001 c029f950 10029738 00000000 100e0000
GPR16: 00000000 10023d00 1000cbdc 1000cb8c 1000cbb8 00000000 c07dfecc 00000000
GPR24: c07e0000 00000000 1000cbd8 f94e0000 ffffffff 00000000 ea53cd40 00000000
NIP [f94aca18] caam_reset_hw_jr+0x18/0x1c0 [caam]
LR [f94aca18] caam_reset_hw_jr+0x18/0x1c0 [caam]
Call Trace:
[eac47e10] [eac47e30] 0xeac47e30 (unreliable)
[eac47e20] [f94ad3f4] caam_jr_shutdown+0x34/0x220 [caam]
[eac47e60] [f94ac0e4] caam_remove+0x54/0xb0 [caam]
[eac47e80] [c029fb38] __device_release_driver+0x68/0x120
[eac47e90] [c02a05c8] driver_detach+0xd8/0xe0
[eac47eb0] [c029f8e0] bus_remove_driver+0xa0/0x110
[eac47ed0] [c00768e4] sys_delete_module+0x144/0x270
[eac47f40] [c000e2f0] ret_from_syscall+0x0/0x3c

Signed-off-by: Vakul Garg <vakul@freescale.com>
Signed-off-by: Bharat Bhushan <bharat.bhushan@freescale.com>
Reviewed-by: Horia Geanta <horia.geanta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2013-04-25 21:09:07 +08:00
..
caamalg.c crypto: caam - Fix missing init of '.type' in AEAD algos. 2013-03-22 18:13:54 +08:00
caamhash.c crypto: caam - change key gen functions to return signed int 2013-04-25 21:01:43 +08:00
caamrng.c crypto: caam - set descriptor sharing type to SERIAL 2012-08-01 17:47:31 +08:00
compat.h crypto: caam - add IPsec ESN support 2012-09-07 04:17:07 +08:00
ctrl.c crypto: caam - set RDB bit in security configuration register 2013-03-22 18:13:54 +08:00
ctrl.h crypto: caam - ERA retrieval and printing for SEC device 2012-07-11 11:06:11 +08:00
desc_constr.h crypto: caam - support external seq in/out lengths 2012-06-27 14:42:04 +08:00
desc.h crypto: caam - add support for SEC v5.x RNG4 2012-06-27 14:42:06 +08:00
error.c crypto: caam - static constify error data 2013-04-25 21:01:43 +08:00
error.h crypto: caam - fix printk recursion for long error texts 2011-05-04 15:15:06 +10:00
intern.h crypto: caam - fix job ring cleanup code 2013-04-25 21:09:07 +08:00
jr.c crypto: caam - fix job ring cleanup code 2013-04-25 21:09:07 +08:00
jr.h crypto: caam - Add support for the Freescale SEC4/CAAM 2011-03-27 10:45:16 +08:00
Kconfig crypto: caam - fix typo "CRYPTO_AHASH" 2013-03-10 18:16:36 +08:00
key_gen.c crypto: caam - change key gen functions to return signed int 2013-04-25 21:01:43 +08:00
key_gen.h crypto: caam - change key gen functions to return signed int 2013-04-25 21:01:43 +08:00
Makefile crypto: caam - hwrng support 2012-06-27 14:42:06 +08:00
pdb.h crypto: caam - add PDB (Protocol Descriptor Block) definitions 2012-06-27 14:42:04 +08:00
regs.h crypto: caam - set RDB bit in security configuration register 2013-03-22 18:13:54 +08:00
sg_sw_sec4.h crypto: caam - chaining support 2012-06-27 14:42:05 +08:00