Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Merge crypto tree to pick up hisilicon patch.

+28 -11
+7
arch/arm/crypto/curve25519-glue.c
··· 38 38 } 39 39 EXPORT_SYMBOL(curve25519_arch); 40 40 41 + void curve25519_base_arch(u8 pub[CURVE25519_KEY_SIZE], 42 + const u8 secret[CURVE25519_KEY_SIZE]) 43 + { 44 + return curve25519_arch(pub, secret, curve25519_base_point); 45 + } 46 + EXPORT_SYMBOL(curve25519_base_arch); 47 + 41 48 static int curve25519_set_secret(struct crypto_kpp *tfm, const void *buf, 42 49 unsigned int len) 43 50 {
+3 -3
drivers/crypto/hisilicon/sec2/sec.h
··· 40 40 int req_id; 41 41 42 42 /* Status of the SEC request */ 43 - int fake_busy; 43 + atomic_t fake_busy; 44 44 }; 45 45 46 46 /** ··· 132 132 }; 133 133 134 134 struct sec_dfx { 135 - u64 send_cnt; 136 - u64 recv_cnt; 135 + atomic64_t send_cnt; 136 + atomic64_t recv_cnt; 137 137 }; 138 138 139 139 struct sec_debug {
+6 -6
drivers/crypto/hisilicon/sec2/sec_crypto.c
··· 120 120 return; 121 121 } 122 122 123 - __sync_add_and_fetch(&req->ctx->sec->debug.dfx.recv_cnt, 1); 123 + atomic64_inc(&req->ctx->sec->debug.dfx.recv_cnt); 124 124 125 125 req->ctx->req_op->buf_unmap(req->ctx, req); 126 126 ··· 135 135 mutex_lock(&qp_ctx->req_lock); 136 136 ret = hisi_qp_send(qp_ctx->qp, &req->sec_sqe); 137 137 mutex_unlock(&qp_ctx->req_lock); 138 - __sync_add_and_fetch(&ctx->sec->debug.dfx.send_cnt, 1); 138 + atomic64_inc(&ctx->sec->debug.dfx.send_cnt); 139 139 140 140 if (ret == -EBUSY) 141 141 return -ENOBUFS; 142 142 143 143 if (!ret) { 144 - if (req->fake_busy) 144 + if (atomic_read(&req->fake_busy)) 145 145 ret = -EBUSY; 146 146 else 147 147 ret = -EINPROGRESS; ··· 641 641 if (ctx->c_ctx.c_mode == SEC_CMODE_CBC && req->c_req.encrypt) 642 642 sec_update_iv(req); 643 643 644 - if (__sync_bool_compare_and_swap(&req->fake_busy, 1, 0)) 644 + if (atomic_cmpxchg(&req->fake_busy, 1, 0) != 1) 645 645 sk_req->base.complete(&sk_req->base, -EINPROGRESS); 646 646 647 647 sk_req->base.complete(&sk_req->base, req->err_type); ··· 672 672 } 673 673 674 674 if (ctx->fake_req_limit <= atomic_inc_return(&qp_ctx->pending_reqs)) 675 - req->fake_busy = 1; 675 + atomic_set(&req->fake_busy, 1); 676 676 else 677 - req->fake_busy = 0; 677 + atomic_set(&req->fake_busy, 0); 678 678 679 679 ret = ctx->req_op->get_res(ctx, req); 680 680 if (ret) {
+12 -2
drivers/crypto/hisilicon/sec2/sec_main.c
··· 608 608 .write = sec_debug_write, 609 609 }; 610 610 611 + static int debugfs_atomic64_t_get(void *data, u64 *val) 612 + { 613 + *val = atomic64_read((atomic64_t *)data); 614 + return 0; 615 + } 616 + DEFINE_DEBUGFS_ATTRIBUTE(fops_atomic64_t_ro, debugfs_atomic64_t_get, NULL, 617 + "%lld\n"); 618 + 611 619 static int sec_core_debug_init(struct sec_dev *sec) 612 620 { 613 621 struct hisi_qm *qm = &sec->qm; ··· 636 628 637 629 debugfs_create_regset32("regs", 0444, tmp_d, regset); 638 630 639 - debugfs_create_u64("send_cnt", 0444, tmp_d, &dfx->send_cnt); 631 + debugfs_create_file("send_cnt", 0444, tmp_d, &dfx->send_cnt, 632 + &fops_atomic64_t_ro); 640 633 641 - debugfs_create_u64("recv_cnt", 0444, tmp_d, &dfx->recv_cnt); 634 + debugfs_create_file("recv_cnt", 0444, tmp_d, &dfx->recv_cnt, 635 + &fops_atomic64_t_ro); 642 636 643 637 return 0; 644 638 }