Sean Anderson
7d35690974
crypto: mxs-dcp - Use sg_mapping_iter to copy data
...
[ Upstream commit 2e6d793e1bf07fe5e20cfbbdcec9e1af7e5097eb ]
This uses the sg_pcopy_from_buffer to copy data, instead of doing it
ourselves.
In addition to reducing code size, this fixes the following oops
resulting from failing to kmap the page:
[ 68.896381] Unable to handle kernel NULL pointer dereference at virtual address 00000ab8
[ 68.904539] pgd = 3561adb3
[ 68.907475] [00000ab8] *pgd=00000000
[ 68.911153] Internal error: Oops: 805 [#1 ] ARM
[ 68.915618] Modules linked in: cfg80211 rfkill des_generic libdes arc4 libarc4 cbc ecb algif_skcipher sha256_generic libsha256 sha1_generic hmac aes_generic libaes cmac sha512_generic md5 md4 algif_hash af_alg i2c_imx i2c_core ci_hdrc_imx ci_hdrc mxs_dcp ulpi roles udc_core imx_sdma usbmisc_imx usb_common firmware_class virt_dma phy_mxs_usb nf_tables nfnetlink ip_tables x_tables ipv6 autofs4
[ 68.950741] CPU: 0 PID: 139 Comm: mxs_dcp_chan/ae Not tainted 5.10.34 #296
[ 68.958501] Hardware name: Freescale i.MX6 Ultralite (Device Tree)
[ 68.964710] PC is at memcpy+0xa8/0x330
[ 68.968479] LR is at 0xd7b2bc9d
[ 68.971638] pc : [<c053e7c8>] lr : [<d7b2bc9d>] psr: 000f0013
[ 68.977920] sp : c2cbbee4 ip : 00000010 fp : 00000010
[ 68.983159] r10: 00000000 r9 : c3283a40 r8 : 1a5a6f08
[ 68.988402] r7 : 4bfe0ecc r6 : 76d8a220 r5 : c32f9050 r4 : 00000001
[ 68.994945] r3 : 00000ab8 r2 : fffffff0 r1 : c32f9050 r0 : 00000ab8
[ 69.001492] Flags: nzcv IRQs on FIQs on Mode SVC_32 ISA ARM Segment none
[ 69.008646] Control: 10c53c7d Table: 83664059 DAC: 00000051
[ 69.014414] Process mxs_dcp_chan/ae (pid: 139, stack limit = 0x667b57ab)
[ 69.021133] Stack: (0xc2cbbee4 to 0xc2cbc000)
[ 69.025519] bee0: c32f9050 c3235408 00000010 00000010 00000ab8 00000001 bf10406c
[ 69.033720] bf00: 00000000 00000000 00000010 00000000 c32355d0 832fb080 00000000 c13de2fc
[ 69.041921] bf20: c3628010 00000010 c33d5780 00000ab8 bf1067e8 00000002 c21e5010 c2cba000
[ 69.050125] bf40: c32f8040 00000000 bf106a40 c32f9040 c3283a80 00000001 bf105240 c3234040
[ 69.058327] bf60: ffffe000 c3204100 c2c69800 c2cba000 00000000 bf103b84 00000000 c2eddc54
[ 69.066530] bf80: c3204144 c0140d1c c2cba000 c2c69800 c0140be8 00000000 00000000 00000000
[ 69.074730] bfa0: 00000000 00000000 00000000 c0100114 00000000 00000000 00000000 00000000
[ 69.082932] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 69.091131] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000 00000000 00000000
[ 69.099364] [<c053e7c8>] (memcpy) from [<bf10406c>] (dcp_chan_thread_aes+0x4e8/0x840 [mxs_dcp])
[ 69.108117] [<bf10406c>] (dcp_chan_thread_aes [mxs_dcp]) from [<c0140d1c>] (kthread+0x134/0x160)
[ 69.116941] [<c0140d1c>] (kthread) from [<c0100114>] (ret_from_fork+0x14/0x20)
[ 69.124178] Exception stack(0xc2cbbfb0 to 0xc2cbbff8)
[ 69.129250] bfa0: 00000000 00000000 00000000 00000000
[ 69.137450] bfc0: 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000
[ 69.145648] bfe0: 00000000 00000000 00000000 00000000 00000013 00000000
[ 69.152289] Code: e320f000 e4803004 e4804004 e4805004 (e4806004)
Signed-off-by: Sean Anderson <sean.anderson@seco.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-09-22 12:26:26 +02:00
..
2020-12-30 11:51:10 +01:00
2020-02-14 16:34:18 -05:00
2021-03-04 10:26:21 +01:00
2020-10-29 09:57:29 +01:00
2021-07-14 16:53:22 +02:00
2021-07-19 08:53:14 +02:00
2020-08-19 08:15:55 +02:00
2021-03-04 10:26:17 +01:00
2020-08-19 08:16:27 +02:00
2020-12-30 11:51:03 +01:00
2019-09-09 23:48:40 +10:00
2020-10-29 09:57:33 +01:00
2021-07-14 16:53:24 +02:00
2021-09-15 09:47:29 +02:00
2019-08-22 14:57:32 +10:00
2019-08-22 14:57:32 +10:00
2021-05-11 14:04:07 +02:00
2021-03-04 10:26:45 +01:00
2021-07-14 16:53:20 +02:00
2020-06-17 16:40:32 +02:00
2020-02-01 09:34:52 +00:00
2020-02-11 04:35:31 -08:00
2019-12-31 16:45:12 +01:00
2019-08-30 18:05:31 +10:00
2019-08-30 18:05:31 +10:00
2019-08-02 14:43:59 +10:00
2020-02-14 16:34:18 -05:00
2019-08-22 14:39:38 +10:00
2019-08-09 15:11:59 +10:00
2020-01-17 19:48:46 +01:00
2020-01-17 19:48:46 +01:00
2019-08-22 14:39:40 +10:00
2019-08-09 15:11:59 +10:00
2021-07-14 16:53:20 +02:00
2020-12-30 11:51:24 +01:00
2019-05-30 15:35:45 +08:00
2021-09-22 12:26:26 +02:00
2019-09-05 14:54:54 +10:00
2019-06-19 17:09:55 +02:00
2021-05-11 14:04:07 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-06-19 17:09:55 +02:00
2019-08-22 14:57:31 +10:00
2021-09-15 09:47:26 +02:00
2019-07-26 14:56:02 +10:00
2019-05-30 11:26:32 -07:00
2019-05-30 11:26:35 -07:00
2020-10-29 09:57:31 +01:00
2019-08-09 15:12:03 +10:00
2019-08-30 18:05:28 +10:00
2019-08-09 15:11:38 +10:00
2021-03-04 10:26:23 +01:00
2021-03-04 10:26:23 +01:00