crypto: rockchip: Optimized the exception handling of clock enable failure

[    1.951687][    T1] rk-crypto 2a400000.crypto: invalid resource
[    1.951972][    T1] Failed to prepare clk 'aclk': -95
[    1.951989][    T1] rk-crypto 2a400000.crypto: failed to enable clks -95
[    1.952221][    T1] ------------[ cut here ]------------
[    1.952231][    T1] clk_pka_crypto_ns already disabled
[    1.952272][    T1] WARNING: CPU: 0 PID: 1 at drivers/clk/clk.c:1040 clk_core_disable+0x88/0x220
[    1.952295][    T1] Modules linked in:
[    1.952308][    T1] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.1.75 #1956
[    1.952321][    T1] Hardware name: Rockchip RK3576 EVB1 V10 Board (DT)
[    1.952331][    T1] pstate: 604000c5 (nZCv daIF +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
[    1.952344][    T1] pc : clk_core_disable+0x88/0x220
[    1.952358][    T1] lr : clk_core_disable+0x88/0x220
[    1.952371][    T1] sp : ffffffc00a48b740
[    1.952380][    T1] x29: ffffffc00a48b740 x28: 0000000000000001 x27: ffffffc009704780
[    1.952398][    T1] x26: 0000000000000001 x25: ffffffc00a25d838 x24: ffffffc009704dd0
[    1.952415][    T1] x23: ffffff80c0368000 x22: ffffffc00a3ef000 x21: ffffffc00a3ef000
[    1.952432][    T1] x20: ffffff80c0172e00 x19: ffffff80c0172e00 x18: ffffffc00a4650c0
[    1.952449][    T1] x17: 0000000000000013 x16: ffffffffffffffff x15: 0000000000000004
[    1.952466][    T1] x14: ffffffc009f8d6e0 x13: 0000000000003fff x12: 0000000000000003
[    1.952483][    T1] x11: 00000000ffffbfff x10: c0000000ffffbfff x9 : 0c33c05c11861400
[    1.952500][    T1] x8 : 0c33c05c11861400 x7 : 205b5d3133323235 x6 : 392e31202020205b
[    1.952517][    T1] x5 : ffffffc00a3c0617 x4 : ffffffc00a48b477 x3 : 0000000000000000
[    1.952533][    T1] x2 : 0000000000000000 x1 : ffffffc00a48b4e0 x0 : 0000000000000022
[    1.952551][    T1] Call trace:
[    1.952560][    T1]  clk_core_disable+0x88/0x220
[    1.952573][    T1]  clk_core_disable_lock+0x9c/0x130
[    1.952586][    T1]  clk_disable+0x20/0x2c
[    1.952597][    T1]  clk_bulk_disable+0x2c/0x48
[    1.952613][    T1]  rk_crypto_release+0x24/0x40
[    1.952626][    T1]  rk_crypto_register+0x1b0/0x2b8
[    1.952638][    T1]  rk_crypto_probe+0x398/0x3f4

Signed-off-by: Lin Jinhan <troy.lin@rock-chips.com>
Change-Id: I34c41cea4844fdac28051401c472358c9e8042ea
This commit is contained in:
Lin Jinhan
2024-06-14 16:07:22 +08:00
parent 3a151492f1
commit 2fde6adc97
2 changed files with 6 additions and 4 deletions

View File

@@ -515,7 +515,9 @@ static int rk_crypto_register(struct rk_crypto_dev *rk_dev)
algs_name = soc_data->valid_algs_name;
rk_dev->request_crypto(rk_dev, __func__);
err = rk_dev->request_crypto(rk_dev, __func__);
if (err)
return err;
for (i = 0; i < soc_data->valid_algs_num; i++, algs_name++) {
tmp_algs = rk_crypto_find_algs(rk_dev, *algs_name);
@@ -622,11 +624,11 @@ static void rk_crypto_unregister(struct rk_crypto_dev *rk_dev)
rk_dev->release_crypto(rk_dev, __func__);
}
static void rk_crypto_request(struct rk_crypto_dev *rk_dev, const char *name)
static int rk_crypto_request(struct rk_crypto_dev *rk_dev, const char *name)
{
CRYPTO_TRACE("Crypto is requested by %s\n", name);
rk_crypto_enable_clk(rk_dev);
return rk_crypto_enable_clk(rk_dev);
}
static void rk_crypto_release(struct rk_crypto_dev *rk_dev, const char *name)

View File

@@ -95,7 +95,7 @@ struct rk_crypto_dev {
struct timer_list timer;
bool busy;
void (*request_crypto)(struct rk_crypto_dev *rk_dev, const char *name);
int (*request_crypto)(struct rk_crypto_dev *rk_dev, const char *name);
void (*release_crypto)(struct rk_crypto_dev *rk_dev, const char *name);
int (*load_data)(struct rk_crypto_dev *rk_dev,
struct scatterlist *sg_src,