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

Pull crypto fixes from Herbert Xu:
"This fixes the following issues:

- check the return value of platform_get_irq as signed int in xgene.

- skip adf_dev_restore on virtual functions in qat.

- fix double-free with backlogged requests in marvell_cesa"

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
hwrng: xgene - fix handling platform_get_irq
crypto: qat - VF should never trigger SBR on PH
crypto: marvell - properly handle CRYPTO_TFM_REQ_MAY_BACKLOG-flagged requests

+40 -12
+4 -3
drivers/char/hw_random/xgene-rng.c
··· 344 344 if (IS_ERR(ctx->csr_base)) 345 345 return PTR_ERR(ctx->csr_base); 346 346 347 - ctx->irq = platform_get_irq(pdev, 0); 348 - if (ctx->irq < 0) { 347 + rc = platform_get_irq(pdev, 0); 348 + if (rc < 0) { 349 349 dev_err(&pdev->dev, "No IRQ resource\n"); 350 - return ctx->irq; 350 + return rc; 351 351 } 352 + ctx->irq = rc; 352 353 353 354 dev_dbg(&pdev->dev, "APM X-Gene RNG BASE %p ALARM IRQ %d", 354 355 ctx->csr_base, ctx->irq);
+27
drivers/crypto/marvell/cesa.h
··· 687 687 688 688 int mv_cesa_queue_req(struct crypto_async_request *req); 689 689 690 + /* 691 + * Helper function that indicates whether a crypto request needs to be 692 + * cleaned up or not after being enqueued using mv_cesa_queue_req(). 693 + */ 694 + static inline int mv_cesa_req_needs_cleanup(struct crypto_async_request *req, 695 + int ret) 696 + { 697 + /* 698 + * The queue still had some space, the request was queued 699 + * normally, so there's no need to clean it up. 700 + */ 701 + if (ret == -EINPROGRESS) 702 + return false; 703 + 704 + /* 705 + * The queue had not space left, but since the request is 706 + * flagged with CRYPTO_TFM_REQ_MAY_BACKLOG, it was added to 707 + * the backlog and will be processed later. There's no need to 708 + * clean it up. 709 + */ 710 + if (ret == -EBUSY && req->flags & CRYPTO_TFM_REQ_MAY_BACKLOG) 711 + return false; 712 + 713 + /* Request wasn't queued, we need to clean it up */ 714 + return true; 715 + } 716 + 690 717 /* TDMA functions */ 691 718 692 719 static inline void mv_cesa_req_dma_iter_init(struct mv_cesa_dma_iter *iter,
+3 -4
drivers/crypto/marvell/cipher.c
··· 189 189 { 190 190 struct ablkcipher_request *ablkreq = ablkcipher_request_cast(req); 191 191 struct mv_cesa_ablkcipher_req *creq = ablkcipher_request_ctx(ablkreq); 192 - 193 192 creq->req.base.engine = engine; 194 193 195 194 if (creq->req.base.type == CESA_DMA_REQ) ··· 430 431 return ret; 431 432 432 433 ret = mv_cesa_queue_req(&req->base); 433 - if (ret && ret != -EINPROGRESS) 434 + if (mv_cesa_req_needs_cleanup(&req->base, ret)) 434 435 mv_cesa_ablkcipher_cleanup(req); 435 436 436 437 return ret; ··· 550 551 return ret; 551 552 552 553 ret = mv_cesa_queue_req(&req->base); 553 - if (ret && ret != -EINPROGRESS) 554 + if (mv_cesa_req_needs_cleanup(&req->base, ret)) 554 555 mv_cesa_ablkcipher_cleanup(req); 555 556 556 557 return ret; ··· 692 693 return ret; 693 694 694 695 ret = mv_cesa_queue_req(&req->base); 695 - if (ret && ret != -EINPROGRESS) 696 + if (mv_cesa_req_needs_cleanup(&req->base, ret)) 696 697 mv_cesa_ablkcipher_cleanup(req); 697 698 698 699 return ret;
+3 -5
drivers/crypto/marvell/hash.c
··· 739 739 return 0; 740 740 741 741 ret = mv_cesa_queue_req(&req->base); 742 - if (ret && ret != -EINPROGRESS) { 742 + if (mv_cesa_req_needs_cleanup(&req->base, ret)) 743 743 mv_cesa_ahash_cleanup(req); 744 - return ret; 745 - } 746 744 747 745 return ret; 748 746 } ··· 764 766 return 0; 765 767 766 768 ret = mv_cesa_queue_req(&req->base); 767 - if (ret && ret != -EINPROGRESS) 769 + if (mv_cesa_req_needs_cleanup(&req->base, ret)) 768 770 mv_cesa_ahash_cleanup(req); 769 771 770 772 return ret; ··· 789 791 return 0; 790 792 791 793 ret = mv_cesa_queue_req(&req->base); 792 - if (ret && ret != -EINPROGRESS) 794 + if (mv_cesa_req_needs_cleanup(&req->base, ret)) 793 795 mv_cesa_ahash_cleanup(req); 794 796 795 797 return ret;
+3
drivers/crypto/qat/qat_common/adf_aer.c
··· 88 88 struct pci_dev *parent = pdev->bus->self; 89 89 uint16_t bridge_ctl = 0; 90 90 91 + if (accel_dev->is_vf) 92 + return; 93 + 91 94 dev_info(&GET_DEV(accel_dev), "Resetting device qat_dev%d\n", 92 95 accel_dev->accel_id); 93 96