[intel-linux-intel-lts:5.4/yocto 13/1142] drivers/crypto/keembay/keembay-ocs-ecc-core.c:659 kmb_ocs_ecdh_set_secret() error: we previously assumed 'params.key' could be null (see line 642)
by Dan Carpenter
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: eeb611e5394c56d45c5cc8f7dc484c9f19e93143
commit: d2a205db2c4ee2728f9be6d45f2361f05205408e [13/1142] crypto: keembay: Add Keem Bay offload ECC Driver
config: i386-randconfig-m021-20201211 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
smatch warnings:
drivers/crypto/keembay/keembay-ocs-ecc-core.c:659 kmb_ocs_ecdh_set_secret() error: we previously assumed 'params.key' could be null (see line 642)
drivers/crypto/keembay/keembay-ocs-ecc-core.c:680 kmb_ocs_ecc_do_one_request() warn: this array is probably non-NULL. 'ctx->private_key'
vim +659 drivers/crypto/keembay/keembay-ocs-ecc-core.c
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 619 static int kmb_ocs_ecdh_set_secret(struct crypto_kpp *tfm, const void *buf,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 620 unsigned int len)
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 621 {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 622 struct ecdh params;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 623 unsigned int ndigits;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 624
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 625 int ret = 0;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 626 struct ocs_ecc_ctx *ctx = kpp_tfm_ctx(tfm);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 627
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 628 ret = crypto_ecdh_decode_key(buf, len, ¶ms);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 629 if (ret)
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 630 goto cleanup;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 631
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 632 ndigits = kmb_ocs_ecdh_supported_curve(params.curve_id);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 633
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 634 if (!ndigits) {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 635 ret = -EOPNOTSUPP;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 636 goto cleanup;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 637 }
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 638
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 639 ctx->curve_id = params.curve_id;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 640 ctx->ndigits = ndigits;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 641
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 @642 if (!params.key || !params.key_size) {
^^^^^^^^^^
"params.key" is NULL.
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 643 ret = -EINVAL;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 644 #ifdef CONFIG_CRYPTO_DEV_KEEMBAY_OCS_ECDH_GEN_PRIV_KEY_SUPPORT
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 645 ret = kmb_ecc_gen_privkey(ctx->curve_id, ctx->ndigits,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 646 ctx->private_key);
We allocate a new key, but I don't see where it is assigned to
"params.key".
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 647 #endif /* CONFIG_CRYPTO_DEV_KEEMBAY_OCS_ECDH_GEN_PRIV_KEY_SUPPORT */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 648 if (ret)
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 649 goto cleanup;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 650 goto swap_digits;
^^^^^^^^^^^^^^^^^
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 651 }
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 652
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 653 ret = kmb_ecc_is_key_valid(ctx->curve_id, ctx->ndigits,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 654 (const u64 *)params.key, params.key_size);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 655 if (ret)
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 656 goto cleanup;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 657
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 658 swap_digits:
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 @659 ecc_swap_digits((u64 *)params.key, ctx->private_key, ctx->ndigits);
^^^^^^^^^^^^^^^^
NULL dereference.
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 660 cleanup:
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 661 memzero_explicit(¶ms, sizeof(params));
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 662
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 663 return ret;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 664 }
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 665
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 666 static int kmb_ocs_ecc_do_one_request(struct crypto_engine *engine,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 667 void *areq)
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 668 {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 669 size_t copied, nbytes;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 670 struct ecc_point *pk;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 671
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 672 u64 *public_key = NULL;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 673 int ret = -ENOMEM;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 674 size_t public_key_sz = 0;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 675 struct kpp_request *req = container_of(areq, struct kpp_request,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 676 base);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 677 struct ocs_ecc_ctx *ctx = kmb_ocs_kpp_ctx(req);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 678 const struct ecc_curve *curve = ecc_get_curve(ctx->curve_id);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 679
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 @680 if (!ctx->private_key || !curve ||
^^^^^^^^^^^^^^^^
Delete this check.
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 681 (ctx->ndigits > KMB_ECC_MAX_DIGITS)) {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 682 ret = -EINVAL;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 683 goto out;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 684 }
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 685
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 686 /* No spurious request checked at top level.*/
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 687 if ((!req->src) && (!req->dst)) {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 688 ret = -EINVAL;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 689 goto out;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 690 }
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 691
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 692 /* Store the request flag in ctx. */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 693 ctx->gfp = (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP) ? GFP_KERNEL
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 694 : GFP_ATOMIC;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 695
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 696 pk = ecc_alloc_point(ctx->ndigits, ctx->gfp);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 697 if (!pk) {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 698 ret = -ENOMEM;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 699 goto out;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 700 }
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 701
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 702 /* Store the kpp_request struct in the device context. */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 703 ctx->ecc_dev->req = req;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 704
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 705 /* In case shared_secret branch not taken. */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 706 ctx->pk = NULL;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 707
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 708 nbytes = data_size_u64_to_u8(ctx->ndigits);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 709 /* Public part is a point thus it has both coordinates */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 710 public_key_sz = 2 * nbytes;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 711
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 712 public_key = kzalloc(public_key_sz, ctx->gfp);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 713 if (!public_key) {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 714 ret = -ENOMEM;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 715 goto free_all;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 716 }
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 717
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 718 if (req->src) {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 719 /* from here on it's invalid parameters */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 720 ret = -EINVAL;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 721
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 722 /* must have exactly two points to be on the curve */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 723 if (public_key_sz != req->src_len)
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 724 goto free_all;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 725
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 726 copied = sg_copy_to_buffer(req->src,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 727 sg_nents_for_len(req->src,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 728 public_key_sz),
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 729 public_key, public_key_sz);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 730 if (copied != public_key_sz)
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 731 goto free_all;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 732 /* Store pk in the device context. */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 733 ctx->pk = pk;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 734 ecc_swap_digits(public_key, pk->x, ctx->ndigits);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 735 ecc_swap_digits(&public_key[ctx->ndigits], pk->y, ctx->ndigits);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 736 /*
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 737 * Check the public key for following
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 738 * Check 1: Verify key is not the zero point.
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 739 * Check 2: Verify key is in the range [1, p-1].
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 740 * Check 3: Verify that y^2 == (x^3 + a·x + b) mod p
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 741 */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 742 ret = kmb_ocs_ecc_is_pubkey_valid_partial(ctx->ecc_dev, curve,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 743 pk);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 744 } else {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 745 /* Public Key(pk) = priv * G. */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 746 ret = ecc_point_mult(ctx->ecc_dev, pk, &curve->g,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 747 ctx->private_key, curve, ctx->ndigits);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 748 }
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 749
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 750 if (ret)
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 751 goto free_all;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 752 goto return_success;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 753
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 754 /* follow through */
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 755 free_all:
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 756 ecc_free_point(pk);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 757 out:
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 758 crypto_finalize_kpp_request(ctx->ecc_dev->engine,
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 759 req, ret);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 760 return_success:
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 761 if (public_key) {
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 762 memzero_explicit(public_key, public_key_sz);
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 763 kzfree(public_key);
^^^^^^^^^^^^^^^^^^
I feel like memzero_explicit() and kzfree() are hopefully duplicative.
What is the point of kzfree() if it doesn't have a guaranteed memzero()?
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 764 }
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 765 return 0;
d2a205db2c4ee2 Prabhjot Khurana 2020-06-12 766 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 9 months
[intel-linux-intel-lts:5.4/yocto 2/3] drivers/tcc/tcc_buffer.c:629 tcc_buffer_init() warn: returning -1 instead of -ENOMEM is sloppy
by Dan Carpenter
tree: https://github.com/intel/linux-intel-lts.git 5.4/yocto
head: bda68cfc97bb728fbb144928c2269de95e433a76
commit: a83e0909a8eb378a3a62a3c14d2a555784216cec [2/3] tcc: this is kernel driver to interface to TCC PTCM pesudo SRAM
config: i386-randconfig-m021-20201211 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
Reported-by: Dan Carpenter <dan.carpenter(a)oracle.com>
New smatch warnings:
drivers/tcc/tcc_buffer.c:629 tcc_buffer_init() warn: returning -1 instead of -ENOMEM is sloppy
Old smatch warnings:
drivers/tcc/tcc_buffer.c:289 tcc_parse_ptct() warn: returning -1 instead of -ENOMEM is sloppy
drivers/tcc/tcc_buffer.c:312 tcc_parse_ptct() warn: returning -1 instead of -ENOMEM is sloppy
vim +629 drivers/tcc/tcc_buffer.c
a83e0909a8eb37 Qiang Rao 2020-05-26 614 static int __init tcc_buffer_init(void)
a83e0909a8eb37 Qiang Rao 2020-05-26 615 {
a83e0909a8eb37 Qiang Rao 2020-05-26 616 int ret;
a83e0909a8eb37 Qiang Rao 2020-05-26 617 struct device *dev_ret;
a83e0909a8eb37 Qiang Rao 2020-05-26 618 u32 new_minor = UNDEFINED_DEVNODE;
a83e0909a8eb37 Qiang Rao 2020-05-26 619 acpi_status status = AE_OK;
a83e0909a8eb37 Qiang Rao 2020-05-26 620
a83e0909a8eb37 Qiang Rao 2020-05-26 621 status = acpi_get_table(ACPI_SIG_PTCT, 0, &acpi_ptct_tbl);
a83e0909a8eb37 Qiang Rao 2020-05-26 622 if (ACPI_FAILURE(status) || !acpi_ptct_tbl) {
a83e0909a8eb37 Qiang Rao 2020-05-26 623 pr_err("Stop! ACPI doesn't provide PTCT.");
a83e0909a8eb37 Qiang Rao 2020-05-26 624 return -1;
a83e0909a8eb37 Qiang Rao 2020-05-26 625 }
a83e0909a8eb37 Qiang Rao 2020-05-26 626
a83e0909a8eb37 Qiang Rao 2020-05-26 627 p_tcc_config = kzalloc(sizeof(struct tcc_config), GFP_KERNEL);
a83e0909a8eb37 Qiang Rao 2020-05-26 628 if (!p_tcc_config)
a83e0909a8eb37 Qiang Rao 2020-05-26 @629 return -1;
^^^^^^^^^
return -ENOMEM;
a83e0909a8eb37 Qiang Rao 2020-05-26 630 INIT_LIST_HEAD(&p_tcc_config->psrams);
a83e0909a8eb37 Qiang Rao 2020-05-26 631
a83e0909a8eb37 Qiang Rao 2020-05-26 632 ret = tcc_parse_ptct();
a83e0909a8eb37 Qiang Rao 2020-05-26 633 if (ret != 0)
a83e0909a8eb37 Qiang Rao 2020-05-26 634 goto err_exit;
a83e0909a8eb37 Qiang Rao 2020-05-26 635
a83e0909a8eb37 Qiang Rao 2020-05-26 636 ret = register_chrdev(0, TCC_BUFFER_NAME, &tcc_buffer_fops);
a83e0909a8eb37 Qiang Rao 2020-05-26 637 if (ret < 0) {
a83e0909a8eb37 Qiang Rao 2020-05-26 638 pr_err("Couldn't regiter_chrdev, returen error=%d\n", ret);
a83e0909a8eb37 Qiang Rao 2020-05-26 639 goto err_exit;
a83e0909a8eb37 Qiang Rao 2020-05-26 640 }
a83e0909a8eb37 Qiang Rao 2020-05-26 641 tcc_buffer_device_major = ret;
a83e0909a8eb37 Qiang Rao 2020-05-26 642
a83e0909a8eb37 Qiang Rao 2020-05-26 643 ret = tcc_buffer_minor_get(&new_minor);
a83e0909a8eb37 Qiang Rao 2020-05-26 644 if (ret < 0) {
a83e0909a8eb37 Qiang Rao 2020-05-26 645 pr_err("Unable to obtain a new minor number\n");
a83e0909a8eb37 Qiang Rao 2020-05-26 646 goto err_class;
a83e0909a8eb37 Qiang Rao 2020-05-26 647 }
a83e0909a8eb37 Qiang Rao 2020-05-26 648
a83e0909a8eb37 Qiang Rao 2020-05-26 649 tcc_buffer_class = class_create(THIS_MODULE, TCC_BUFFER_NAME);
a83e0909a8eb37 Qiang Rao 2020-05-26 650 if (IS_ERR(tcc_buffer_class)) {
a83e0909a8eb37 Qiang Rao 2020-05-26 651 ret = PTR_ERR(tcc_buffer_class);
a83e0909a8eb37 Qiang Rao 2020-05-26 652 pr_err("Create class failed!\n");
a83e0909a8eb37 Qiang Rao 2020-05-26 653 goto err_class;
a83e0909a8eb37 Qiang Rao 2020-05-26 654 }
a83e0909a8eb37 Qiang Rao 2020-05-26 655
a83e0909a8eb37 Qiang Rao 2020-05-26 656 dev_ret = device_create(tcc_buffer_class, NULL,
a83e0909a8eb37 Qiang Rao 2020-05-26 657 MKDEV(tcc_buffer_device_major, new_minor), NULL,
a83e0909a8eb37 Qiang Rao 2020-05-26 658 TCC_BUFFER_NAME);
a83e0909a8eb37 Qiang Rao 2020-05-26 659
a83e0909a8eb37 Qiang Rao 2020-05-26 660 if (IS_ERR(dev_ret)) {
a83e0909a8eb37 Qiang Rao 2020-05-26 661 ret = PTR_ERR(dev_ret);
a83e0909a8eb37 Qiang Rao 2020-05-26 662 pr_err("Failed to create character device\n");
a83e0909a8eb37 Qiang Rao 2020-05-26 663 goto err_device;
a83e0909a8eb37 Qiang Rao 2020-05-26 664 }
a83e0909a8eb37 Qiang Rao 2020-05-26 665 tcc_init = 1;
a83e0909a8eb37 Qiang Rao 2020-05-26 666 p_tcc_config->minor = new_minor;
a83e0909a8eb37 Qiang Rao 2020-05-26 667
a83e0909a8eb37 Qiang Rao 2020-05-26 668 pr_err("TCC buffer init successfully\n");
a83e0909a8eb37 Qiang Rao 2020-05-26 669 return 0;
a83e0909a8eb37 Qiang Rao 2020-05-26 670
a83e0909a8eb37 Qiang Rao 2020-05-26 671 err_device:
a83e0909a8eb37 Qiang Rao 2020-05-26 672 class_destroy(tcc_buffer_class);
a83e0909a8eb37 Qiang Rao 2020-05-26 673 err_class:
a83e0909a8eb37 Qiang Rao 2020-05-26 674 unregister_chrdev(tcc_buffer_device_major, TCC_BUFFER_NAME);
a83e0909a8eb37 Qiang Rao 2020-05-26 675 err_exit:
a83e0909a8eb37 Qiang Rao 2020-05-26 676 tcc_cleanup();
a83e0909a8eb37 Qiang Rao 2020-05-26 677 kfree(p_tcc_config);
a83e0909a8eb37 Qiang Rao 2020-05-26 678 return ret;
a83e0909a8eb37 Qiang Rao 2020-05-26 679 }
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 9 months
[linux-stable-rc:linux-4.19.y 1674/2389] drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3824:35: sparse: sparse: incorrect type in assignment (different base types)
by kernel test robot
tree: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-4.19.y
head: a1b1c60de6b977bc1a2fc8176b647879030ab862
commit: 657441f1728e3870aee57d46cd26b78e55af6d2c [1674/2389] RDMA/hns: Fix missing sq_sig_type when querying QP
config: ia64-randconfig-s032-20201209 (attached as .config)
compiler: ia64-linux-gcc (GCC) 9.3.0
reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# apt-get install sparse
# sparse version: v0.6.3-179-ga00755aa-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gi...
git remote add linux-stable-rc https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
git fetch --no-tags linux-stable-rc linux-4.19.y
git checkout 657441f1728e3870aee57d46cd26b78e55af6d2c
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=ia64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
"sparse warnings: (new ones prefixed by >>)"
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1537:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1537:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1537:9: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1537:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1537:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1539:9: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1539:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1539:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1539:9: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1539:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1539:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1662:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] vf_smac_l @@ got unsigned int [assigned] [usertype] reg_smac_l @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1662:28: sparse: expected restricted __le32 [usertype] vf_smac_l
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1662:28: sparse: got unsigned int [assigned] [usertype] reg_smac_l
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1916:38: sparse: sparse: cast from restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1921:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] cqe_cur_blk_addr @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1921:38: sparse: expected restricted __le32 [usertype] cqe_cur_blk_addr
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1921:38: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1923:33: sparse: sparse: cast from restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1925:9: sparse: sparse: cast from restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1934:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] cqe_nxt_blk_addr @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1934:38: sparse: expected restricted __le32 [usertype] cqe_nxt_blk_addr
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1934:38: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1935:9: sparse: sparse: cast from restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1948:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] cqe_ba @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1948:28: sparse: expected restricted __le32 [usertype] cqe_ba
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1948:28: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1961:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] db_record_addr @@ got unsigned long long @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1961:36: sparse: expected restricted __le32 [usertype] db_record_addr
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1961:36: sparse: got unsigned long long
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1989:9: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1989:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1989:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1989:9: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1989:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1989:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1991:9: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1991:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1991:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1991:9: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1991:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1991:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1993:9: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1993:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1993:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1993:9: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1993:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1993:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1996:9: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1996:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1996:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1996:9: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1996:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1996:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1998:9: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1998:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1998:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1998:9: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1998:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:1998:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2001:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 [usertype] *val @@ got unsigned int * @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2001:28: sparse: expected restricted __le32 [usertype] *val
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2001:28: sparse: got unsigned int *
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2610:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] qkey_xrcd @@ got unsigned int const [usertype] qkey @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2610:36: sparse: expected restricted __le32 [usertype] qkey_xrcd
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2610:36: sparse: got unsigned int const [usertype] qkey
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2629:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] rq_db_record_addr @@ got unsigned long long @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2629:36: sparse: expected restricted __le32 [usertype] rq_db_record_addr
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2629:36: sparse: got unsigned long long
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2942:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] qkey_xrcd @@ got unsigned int const [usertype] qkey @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2942:36: sparse: expected restricted __le32 [usertype] qkey_xrcd
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:2942:36: sparse: got unsigned int const [usertype] qkey
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3017:29: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] wqe_sge_ba @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3017:29: sparse: expected restricted __le32 [usertype] wqe_sge_ba
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3017:29: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3080:34: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] rq_cur_blk_addr @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3080:34: sparse: expected restricted __le32 [usertype] rq_cur_blk_addr
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3080:34: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3093:34: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] rq_nxt_blk_addr @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3093:34: sparse: expected restricted __le32 [usertype] rq_nxt_blk_addr
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3093:34: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3117:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] trrl_ba @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3117:26: sparse: expected restricted __le32 [usertype] trrl_ba
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3117:26: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3125:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] irrl_ba @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3125:26: sparse: expected restricted __le32 [usertype] irrl_ba
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3125:26: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3136:9: sparse: sparse: cast from restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3280:34: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] sq_cur_blk_addr @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3280:34: sparse: expected restricted __le32 [usertype] sq_cur_blk_addr
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3280:34: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3291:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] sq_cur_sge_blk_addr @@ got unsigned int @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3291:38: sparse: expected restricted __le32 [usertype] sq_cur_sge_blk_addr
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3291:38: sparse: got unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3306:37: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] rx_sq_cur_blk_addr @@ got unsigned int [usertype] @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3306:37: sparse: expected restricted __le32 [usertype] rx_sq_cur_blk_addr
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3306:37: sparse: got unsigned int [usertype]
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3808:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned char [usertype] rnr_retry @@ got restricted __le32 [usertype] rq_rnr_timer @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3808:28: sparse: expected unsigned char [usertype] rnr_retry
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3808:28: sparse: got restricted __le32 [usertype] rq_rnr_timer
>> drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3824:35: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int enum ib_sig_type sq_sig_type @@ got restricted __le32 [usertype] sq_signal_bits @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3824:35: sparse: expected unsigned int enum ib_sig_type sq_sig_type
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:3824:35: sparse: got restricted __le32 [usertype] sq_signal_bits
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4042:17: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4042:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4042:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4042:17: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4042:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4042:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4048:17: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4048:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4048:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4048:17: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4048:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4048:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4051:17: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4051:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4051:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4051:17: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4051:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4051:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4058:9: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4058:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4058:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4058:9: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4058:9: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4058:9: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4062:28: sparse: sparse: incorrect type in argument 1 (different base types) @@ expected restricted __le32 [usertype] *val @@ got unsigned int * @@
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4062:28: sparse: expected restricted __le32 [usertype] *val
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4062:28: sparse: got unsigned int *
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4356:20: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4375:23: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4423:13: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4426:17: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4426:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4426:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4426:17: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4426:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4426:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4429:17: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4429:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4429:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4429:17: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4429:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4429:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4433:20: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4436:17: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4436:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4436:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4436:17: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4436:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4436:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4439:17: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4439:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4439:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4439:17: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4439:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4439:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4443:20: sparse: sparse: cast to restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4446:17: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4446:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4446:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4446:17: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4446:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4446:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4449:17: sparse: sparse: invalid assignment: &=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4449:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4449:17: sparse: right side has type restricted __le32
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4449:17: sparse: sparse: invalid assignment: |=
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4449:17: sparse: left side has type unsigned int
drivers/infiniband/hw/hns/hns_roce_hw_v2.c:4449:17: sparse: right side has type restricted __le32
In file included from arch/ia64/include/asm/pgtable.h:154,
from include/linux/memremap.h:7,
from include/linux/mm.h:27,
from arch/ia64/include/asm/uaccess.h:38,
from include/linux/uaccess.h:14,
from include/net/checksum.h:25,
from include/linux/skbuff.h:31,
from include/linux/if_ether.h:23,
from include/linux/etherdevice.h:25,
from drivers/infiniband/hw/hns/hns_roce_hw_v2.c:34:
arch/ia64/include/asm/mmu_context.h: In function 'reload_context':
arch/ia64/include/asm/mmu_context.h:137:41: warning: variable 'old_rr4' set but not used [-Wunused-but-set-variable]
137 | unsigned long rr0, rr1, rr2, rr3, rr4, old_rr4;
| ^~~~~~~
In file included from include/linux/ioport.h:13,
from include/linux/acpi.h:25,
from drivers/infiniband/hw/hns/hns_roce_hw_v2.c:33:
include/linux/dma-mapping.h: In function 'dma_map_resource':
arch/ia64/include/asm/page.h:118:36: error: 'max_mapnr' undeclared (first use in this function); did you mean 'set_max_mapnr'?
118 | # define pfn_valid(pfn) (((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
| ^~~~~~~~~
include/linux/compiler.h:77:42: note: in definition of macro 'unlikely'
77 | # define unlikely(x) __builtin_expect(!!(x), 0)
| ^
include/linux/dma-mapping.h:329:2: note: in expansion of macro 'BUG_ON'
329 | BUG_ON(pfn_valid(PHYS_PFN(phys_addr)));
| ^~~~~~
include/linux/dma-mapping.h:329:9: note: in expansion of macro 'pfn_valid'
329 | BUG_ON(pfn_valid(PHYS_PFN(phys_addr)));
| ^~~~~~~~~
vim +3824 drivers/infiniband/hw/hns/hns_roce_hw_v2.c
3698
3699 static int hns_roce_v2_query_qp(struct ib_qp *ibqp, struct ib_qp_attr *qp_attr,
3700 int qp_attr_mask,
3701 struct ib_qp_init_attr *qp_init_attr)
3702 {
3703 struct hns_roce_dev *hr_dev = to_hr_dev(ibqp->device);
3704 struct hns_roce_qp *hr_qp = to_hr_qp(ibqp);
3705 struct hns_roce_v2_qp_context *context;
3706 struct device *dev = hr_dev->dev;
3707 int tmp_qp_state;
3708 int state;
3709 int ret;
3710
3711 context = kzalloc(sizeof(*context), GFP_KERNEL);
3712 if (!context)
3713 return -ENOMEM;
3714
3715 memset(qp_attr, 0, sizeof(*qp_attr));
3716 memset(qp_init_attr, 0, sizeof(*qp_init_attr));
3717
3718 mutex_lock(&hr_qp->mutex);
3719
3720 if (hr_qp->state == IB_QPS_RESET) {
3721 qp_attr->qp_state = IB_QPS_RESET;
3722 ret = 0;
3723 goto done;
3724 }
3725
3726 ret = hns_roce_v2_query_qpc(hr_dev, hr_qp, context);
3727 if (ret) {
3728 dev_err(dev, "query qpc error\n");
3729 ret = -EINVAL;
3730 goto out;
3731 }
3732
3733 state = roce_get_field(context->byte_60_qpst_mapid,
3734 V2_QPC_BYTE_60_QP_ST_M, V2_QPC_BYTE_60_QP_ST_S);
3735 tmp_qp_state = to_ib_qp_st((enum hns_roce_v2_qp_state)state);
3736 if (tmp_qp_state == -1) {
3737 dev_err(dev, "Illegal ib_qp_state\n");
3738 ret = -EINVAL;
3739 goto out;
3740 }
3741 hr_qp->state = (u8)tmp_qp_state;
3742 qp_attr->qp_state = (enum ib_qp_state)hr_qp->state;
3743 qp_attr->path_mtu = (enum ib_mtu)roce_get_field(context->byte_24_mtu_tc,
3744 V2_QPC_BYTE_24_MTU_M,
3745 V2_QPC_BYTE_24_MTU_S);
3746 qp_attr->path_mig_state = IB_MIG_ARMED;
3747 qp_attr->ah_attr.type = RDMA_AH_ATTR_TYPE_ROCE;
3748 if (hr_qp->ibqp.qp_type == IB_QPT_UD)
3749 qp_attr->qkey = V2_QKEY_VAL;
3750
3751 qp_attr->rq_psn = roce_get_field(context->byte_108_rx_reqepsn,
3752 V2_QPC_BYTE_108_RX_REQ_EPSN_M,
3753 V2_QPC_BYTE_108_RX_REQ_EPSN_S);
3754 qp_attr->sq_psn = (u32)roce_get_field(context->byte_172_sq_psn,
3755 V2_QPC_BYTE_172_SQ_CUR_PSN_M,
3756 V2_QPC_BYTE_172_SQ_CUR_PSN_S);
3757 qp_attr->dest_qp_num = (u8)roce_get_field(context->byte_56_dqpn_err,
3758 V2_QPC_BYTE_56_DQPN_M,
3759 V2_QPC_BYTE_56_DQPN_S);
3760 qp_attr->qp_access_flags = ((roce_get_bit(context->byte_76_srqn_op_en,
3761 V2_QPC_BYTE_76_RRE_S)) << 2) |
3762 ((roce_get_bit(context->byte_76_srqn_op_en,
3763 V2_QPC_BYTE_76_RWE_S)) << 1) |
3764 ((roce_get_bit(context->byte_76_srqn_op_en,
3765 V2_QPC_BYTE_76_ATE_S)) << 3);
3766 if (hr_qp->ibqp.qp_type == IB_QPT_RC ||
3767 hr_qp->ibqp.qp_type == IB_QPT_UC) {
3768 struct ib_global_route *grh =
3769 rdma_ah_retrieve_grh(&qp_attr->ah_attr);
3770
3771 rdma_ah_set_sl(&qp_attr->ah_attr,
3772 roce_get_field(context->byte_28_at_fl,
3773 V2_QPC_BYTE_28_SL_M,
3774 V2_QPC_BYTE_28_SL_S));
3775 grh->flow_label = roce_get_field(context->byte_28_at_fl,
3776 V2_QPC_BYTE_28_FL_M,
3777 V2_QPC_BYTE_28_FL_S);
3778 grh->sgid_index = roce_get_field(context->byte_20_smac_sgid_idx,
3779 V2_QPC_BYTE_20_SGID_IDX_M,
3780 V2_QPC_BYTE_20_SGID_IDX_S);
3781 grh->hop_limit = roce_get_field(context->byte_24_mtu_tc,
3782 V2_QPC_BYTE_24_HOP_LIMIT_M,
3783 V2_QPC_BYTE_24_HOP_LIMIT_S);
3784 grh->traffic_class = roce_get_field(context->byte_24_mtu_tc,
3785 V2_QPC_BYTE_24_TC_M,
3786 V2_QPC_BYTE_24_TC_S);
3787
3788 memcpy(grh->dgid.raw, context->dgid, sizeof(grh->dgid.raw));
3789 }
3790
3791 qp_attr->port_num = hr_qp->port + 1;
3792 qp_attr->sq_draining = 0;
3793 qp_attr->max_rd_atomic = 1 << roce_get_field(context->byte_208_irrl,
3794 V2_QPC_BYTE_208_SR_MAX_M,
3795 V2_QPC_BYTE_208_SR_MAX_S);
3796 qp_attr->max_dest_rd_atomic = 1 << roce_get_field(context->byte_140_raq,
3797 V2_QPC_BYTE_140_RR_MAX_M,
3798 V2_QPC_BYTE_140_RR_MAX_S);
3799 qp_attr->min_rnr_timer = (u8)roce_get_field(context->byte_80_rnr_rx_cqn,
3800 V2_QPC_BYTE_80_MIN_RNR_TIME_M,
3801 V2_QPC_BYTE_80_MIN_RNR_TIME_S);
3802 qp_attr->timeout = (u8)roce_get_field(context->byte_28_at_fl,
3803 V2_QPC_BYTE_28_AT_M,
3804 V2_QPC_BYTE_28_AT_S);
3805 qp_attr->retry_cnt = roce_get_field(context->byte_212_lsn,
3806 V2_QPC_BYTE_212_RETRY_CNT_M,
3807 V2_QPC_BYTE_212_RETRY_CNT_S);
3808 qp_attr->rnr_retry = context->rq_rnr_timer;
3809
3810 done:
3811 qp_attr->cur_qp_state = qp_attr->qp_state;
3812 qp_attr->cap.max_recv_wr = hr_qp->rq.wqe_cnt;
3813 qp_attr->cap.max_recv_sge = hr_qp->rq.max_gs;
3814
3815 if (!ibqp->uobject) {
3816 qp_attr->cap.max_send_wr = hr_qp->sq.wqe_cnt;
3817 qp_attr->cap.max_send_sge = hr_qp->sq.max_gs;
3818 } else {
3819 qp_attr->cap.max_send_wr = 0;
3820 qp_attr->cap.max_send_sge = 0;
3821 }
3822
3823 qp_init_attr->cap = qp_attr->cap;
> 3824 qp_init_attr->sq_sig_type = hr_qp->sq_signal_bits;
3825
3826 out:
3827 mutex_unlock(&hr_qp->mutex);
3828 kfree(context);
3829 return ret;
3830 }
3831
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 9 months
Re: [PATCH v5 3/6] net: dsa: microchip: ksz8795: move register offsets and shifts to separate struct
by kernel test robot
Hi Michael,
I love your patch! Perhaps something to improve:
[auto build test WARNING on net-next/master]
[also build test WARNING on next-20201210]
[cannot apply to net/master ipvs/master linus/master v5.10-rc7]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Michael-Grzeschik/microchip-add-...
base: https://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next.git af3f4a85d90218bb59315d591bd2bffa5e646466
config: riscv-randconfig-r003-20201210 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1968804ac726e7674d5de22bc2204b45857da344)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/db1f7322c8fa2c28587f13ab3eebbb6ee...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Michael-Grzeschik/microchip-add-support-for-ksz88x3-driver-family/20201207-205945
git checkout db1f7322c8fa2c28587f13ab3eebbb6ee02874b1
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:87:48: note: expanded from macro 'readb_cpu'
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
^
In file included from drivers/net/dsa/microchip/ksz8795.c:11:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:564:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inw(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:88:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from drivers/net/dsa/microchip/ksz8795.c:11:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:57:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:89:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from drivers/net/dsa/microchip/ksz8795.c:11:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:91:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from drivers/net/dsa/microchip/ksz8795.c:11:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from drivers/net/dsa/microchip/ksz8795.c:11:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:61:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from drivers/net/dsa/microchip/ksz8795.c:11:
In file included from include/linux/gpio.h:62:
In file included from include/asm-generic/gpio.h:11:
In file included from include/linux/gpio/driver.h:7:
In file included from include/linux/irq.h:20:
In file included from include/linux/io.h:13:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:1005:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> drivers/net/dsa/microchip/ksz8795.c:69:27: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides]
[DYNAMIC_MAC_ENTRIES] = 29,
^~
drivers/net/dsa/microchip/ksz8795.c:64:29: note: previous initialization is here
[VLAN_TABLE_MEMBERSHIP] = 7,
^
8 warnings generated.
/tmp/ksz8795-ce9b6a.s: Assembler messages:
/tmp/ksz8795-ce9b6a.s:183: Error: unrecognized opcode `zext.b a2,s9'
/tmp/ksz8795-ce9b6a.s:447: Error: unrecognized opcode `zext.b a2,a1'
/tmp/ksz8795-ce9b6a.s:454: Error: unrecognized opcode `zext.b a2,a0'
/tmp/ksz8795-ce9b6a.s:521: Error: unrecognized opcode `zext.b a0,s3'
/tmp/ksz8795-ce9b6a.s:555: Error: unrecognized opcode `zext.b s6,s3'
/tmp/ksz8795-ce9b6a.s:568: Error: unrecognized opcode `zext.b s3,s1'
/tmp/ksz8795-ce9b6a.s:635: Error: unrecognized opcode `zext.b a0,s3'
/tmp/ksz8795-ce9b6a.s:654: Error: unrecognized opcode `zext.b a0,s3'
/tmp/ksz8795-ce9b6a.s:737: Error: unrecognized opcode `zext.b s3,s3'
/tmp/ksz8795-ce9b6a.s:753: Error: unrecognized opcode `zext.b s1,a1'
/tmp/ksz8795-ce9b6a.s:794: Error: unrecognized opcode `zext.b s3,s3'
/tmp/ksz8795-ce9b6a.s:836: Error: unrecognized opcode `zext.b s1,a1'
/tmp/ksz8795-ce9b6a.s:880: Error: unrecognized opcode `zext.b s1,a1'
/tmp/ksz8795-ce9b6a.s:1548: Error: unrecognized opcode `zext.b a2,a1'
/tmp/ksz8795-ce9b6a.s:1572: Error: unrecognized opcode `zext.b a2,a1'
/tmp/ksz8795-ce9b6a.s:1610: Error: unrecognized opcode `zext.b s3,a1'
/tmp/ksz8795-ce9b6a.s:1648: Error: unrecognized opcode `zext.b a2,a0'
/tmp/ksz8795-ce9b6a.s:1658: Error: unrecognized opcode `zext.b a2,a0'
/tmp/ksz8795-ce9b6a.s:1665: Error: unrecognized opcode `zext.b a2,a0'
/tmp/ksz8795-ce9b6a.s:1676: Error: unrecognized opcode `zext.b a2,a0'
/tmp/ksz8795-ce9b6a.s:1687: Error: unrecognized opcode `zext.b a2,a0'
/tmp/ksz8795-ce9b6a.s:2701: Error: unrecognized opcode `zext.b a2,s7'
/tmp/ksz8795-ce9b6a.s:2868: Error: unrecognized opcode `zext.b a4,a4'
/tmp/ksz8795-ce9b6a.s:2876: Error: unrecognized opcode `zext.b a1,a1'
/tmp/ksz8795-ce9b6a.s:3027: Error: unrecognized opcode `zext.b a1,a1'
/tmp/ksz8795-ce9b6a.s:3049: Error: unrecognized opcode `zext.b a2,a2'
clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
vim +69 drivers/net/dsa/microchip/ksz8795.c
62
63 static const u8 ksz8795_shifts[] = {
64 [VLAN_TABLE_MEMBERSHIP] = 7,
65 [VLAN_TABLE] = 16,
66 [STATIC_MAC_FWD_PORTS] = 16,
67 [STATIC_MAC_FID] = 24,
68 [DYNAMIC_MAC_ENTRIES_H] = 3,
> 69 [DYNAMIC_MAC_ENTRIES] = 29,
70 [DYNAMIC_MAC_FID] = 16,
71 [DYNAMIC_MAC_TIMESTAMP] = 27,
72 [DYNAMIC_MAC_SRC_PORT] = 24,
73 };
74
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 9 months
Re: [PATCH] mac80211: enable QoS support for nl80211 ctrl port
by kernel test robot
Hi Markus,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on mac80211-next/master]
[also build test WARNING on mac80211/master v5.10-rc7 next-20201210]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Markus-Theil/mac80211-enable-QoS...
base: https://git.kernel.org/pub/scm/linux/kernel/git/jberg/mac80211-next.git master
config: riscv-randconfig-r003-20201210 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1968804ac726e7674d5de22bc2204b45857da344)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install riscv cross compiling tool for clang build
# apt-get install binutils-riscv64-linux-gnu
# https://github.com/0day-ci/linux/commit/514b314825e19f7075eb375b3effa93ff...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Markus-Theil/mac80211-enable-QoS-support-for-nl80211-ctrl-port/20201210-065717
git checkout 514b314825e19f7075eb375b3effa93ff0f6a16e
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=riscv
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
In file included from net/mac80211/tx.c:15:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:556:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inb(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:55:76: note: expanded from macro 'inb'
#define inb(c) ({ u8 __v; __io_pbr(); __v = readb_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:87:48: note: expanded from macro 'readb_cpu'
#define readb_cpu(c) ({ u8 __r = __raw_readb(c); __r; })
^
In file included from net/mac80211/tx.c:15:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:564:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inw(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:56:76: note: expanded from macro 'inw'
#define inw(c) ({ u16 __v; __io_pbr(); __v = readw_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:88:76: note: expanded from macro 'readw_cpu'
#define readw_cpu(c) ({ u16 __r = le16_to_cpu((__force __le16)__raw_readw(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:36:51: note: expanded from macro '__le16_to_cpu'
#define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
^
In file included from net/mac80211/tx.c:15:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:572:9: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return inl(addr);
^~~~~~~~~
arch/riscv/include/asm/io.h:57:76: note: expanded from macro 'inl'
#define inl(c) ({ u32 __v; __io_pbr(); __v = readl_cpu((void*)(PCI_IOBASE + (c))); __io_par(__v); __v; })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:89:76: note: expanded from macro 'readl_cpu'
#define readl_cpu(c) ({ u32 __r = le32_to_cpu((__force __le32)__raw_readl(c)); __r; })
^
include/uapi/linux/byteorder/little_endian.h:34:51: note: expanded from macro '__le32_to_cpu'
#define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
^
In file included from net/mac80211/tx.c:15:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:580:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outb(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:59:68: note: expanded from macro 'outb'
#define outb(v,c) ({ __io_pbw(); writeb_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:91:52: note: expanded from macro 'writeb_cpu'
#define writeb_cpu(v, c) ((void)__raw_writeb((v), (c)))
^
In file included from net/mac80211/tx.c:15:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:588:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outw(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:60:68: note: expanded from macro 'outw'
#define outw(v,c) ({ __io_pbw(); writew_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:92:76: note: expanded from macro 'writew_cpu'
#define writew_cpu(v, c) ((void)__raw_writew((__force u16)cpu_to_le16(v), (c)))
^
In file included from net/mac80211/tx.c:15:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:596:2: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
outl(value, addr);
^~~~~~~~~~~~~~~~~
arch/riscv/include/asm/io.h:61:68: note: expanded from macro 'outl'
#define outl(v,c) ({ __io_pbw(); writel_cpu((v),(void*)(PCI_IOBASE + (c))); __io_paw(); })
~~~~~~~~~~ ^
arch/riscv/include/asm/mmio.h:93:76: note: expanded from macro 'writel_cpu'
#define writel_cpu(v, c) ((void)__raw_writel((__force u32)cpu_to_le32(v), (c)))
^
In file included from net/mac80211/tx.c:15:
In file included from include/linux/skbuff.h:31:
In file included from include/linux/dma-mapping.h:10:
In file included from include/linux/scatterlist.h:9:
In file included from arch/riscv/include/asm/io.h:149:
include/asm-generic/io.h:1005:55: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
return (port > MMIO_UPPER_LIMIT) ? NULL : PCI_IOBASE + port;
~~~~~~~~~~ ^
>> net/mac80211/tx.c:1206:6: warning: logical not is only applied to the left hand side of this bitwise operator [-Wlogical-not-parentheses]
!info->flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO) {
^ ~
net/mac80211/tx.c:1206:6: note: add parentheses after the '!' to evaluate the bitwise operator first
!info->flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO) {
^
( )
net/mac80211/tx.c:1206:6: note: add parentheses around left hand side expression to silence this warning
!info->flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO) {
^
( )
8 warnings generated.
/tmp/tx-d90b1d.s: Assembler messages:
/tmp/tx-d90b1d.s:1816: Error: unrecognized opcode `zext.b a1,s11'
/tmp/tx-d90b1d.s:1847: Error: unrecognized opcode `zext.b a3,a3'
/tmp/tx-d90b1d.s:2975: Error: unrecognized opcode `zext.b a1,s5'
/tmp/tx-d90b1d.s:3936: Error: unrecognized opcode `zext.b a2,a0'
/tmp/tx-d90b1d.s:4278: Error: unrecognized opcode `zext.b a0,a0'
/tmp/tx-d90b1d.s:4557: Error: unrecognized opcode `zext.b a1,a1'
/tmp/tx-d90b1d.s:5316: Error: unrecognized opcode `zext.b a0,a0'
/tmp/tx-d90b1d.s:9203: Error: unrecognized opcode `zext.b a0,s1'
/tmp/tx-d90b1d.s:9251: Error: unrecognized opcode `zext.b a0,s1'
/tmp/tx-d90b1d.s:9912: Error: unrecognized opcode `zext.b a1,a0'
/tmp/tx-d90b1d.s:9985: Error: unrecognized opcode `zext.b a1,a0'
clang-12: error: assembler command failed with exit code 1 (use -v to see invocation)
vim +1206 net/mac80211/tx.c
1156
1157 /*
1158 * initialises @tx
1159 * pass %NULL for the station if unknown, a valid pointer if known
1160 * or an ERR_PTR() if the station is known not to exist
1161 */
1162 static ieee80211_tx_result
1163 ieee80211_tx_prepare(struct ieee80211_sub_if_data *sdata,
1164 struct ieee80211_tx_data *tx,
1165 struct sta_info *sta, struct sk_buff *skb)
1166 {
1167 struct ieee80211_local *local = sdata->local;
1168 struct ieee80211_hdr *hdr;
1169 struct ieee80211_tx_info *info = IEEE80211_SKB_CB(skb);
1170 int tid;
1171
1172 memset(tx, 0, sizeof(*tx));
1173 tx->skb = skb;
1174 tx->local = local;
1175 tx->sdata = sdata;
1176 __skb_queue_head_init(&tx->skbs);
1177
1178 /*
1179 * If this flag is set to true anywhere, and we get here,
1180 * we are doing the needed processing, so remove the flag
1181 * now.
1182 */
1183 info->control.flags &= ~IEEE80211_TX_INTCFL_NEED_TXPROCESSING;
1184
1185 hdr = (struct ieee80211_hdr *) skb->data;
1186
1187 if (likely(sta)) {
1188 if (!IS_ERR(sta))
1189 tx->sta = sta;
1190 } else {
1191 if (sdata->vif.type == NL80211_IFTYPE_AP_VLAN) {
1192 tx->sta = rcu_dereference(sdata->u.vlan.sta);
1193 if (!tx->sta && sdata->wdev.use_4addr)
1194 return TX_DROP;
1195 } else if (tx->sdata->control_port_protocol == tx->skb->protocol) {
1196 tx->sta = sta_info_get_bss(sdata, hdr->addr1);
1197 }
1198 if (!tx->sta && !is_multicast_ether_addr(hdr->addr1))
1199 tx->sta = sta_info_get(sdata, hdr->addr1);
1200 }
1201
1202 if (tx->sta && ieee80211_is_data_qos(hdr->frame_control) &&
1203 !ieee80211_is_qos_nullfunc(hdr->frame_control) &&
1204 ieee80211_hw_check(&local->hw, AMPDU_AGGREGATION) &&
1205 !ieee80211_hw_check(&local->hw, TX_AMPDU_SETUP_IN_HW) &&
> 1206 !info->flags & IEEE80211_TX_CTRL_PORT_CTRL_PROTO) {
1207 struct tid_ampdu_tx *tid_tx;
1208
1209 tid = ieee80211_get_tid(hdr);
1210
1211 tid_tx = rcu_dereference(tx->sta->ampdu_mlme.tid_tx[tid]);
1212 if (tid_tx) {
1213 bool queued;
1214
1215 queued = ieee80211_tx_prep_agg(tx, skb, info,
1216 tid_tx, tid);
1217
1218 if (unlikely(queued))
1219 return TX_QUEUED;
1220 }
1221 }
1222
1223 if (is_multicast_ether_addr(hdr->addr1)) {
1224 tx->flags &= ~IEEE80211_TX_UNICAST;
1225 info->flags |= IEEE80211_TX_CTL_NO_ACK;
1226 } else
1227 tx->flags |= IEEE80211_TX_UNICAST;
1228
1229 if (!(info->flags & IEEE80211_TX_CTL_DONTFRAG)) {
1230 if (!(tx->flags & IEEE80211_TX_UNICAST) ||
1231 skb->len + FCS_LEN <= local->hw.wiphy->frag_threshold ||
1232 info->flags & IEEE80211_TX_CTL_AMPDU)
1233 info->flags |= IEEE80211_TX_CTL_DONTFRAG;
1234 }
1235
1236 if (!tx->sta)
1237 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
1238 else if (test_and_clear_sta_flag(tx->sta, WLAN_STA_CLEAR_PS_FILT)) {
1239 info->flags |= IEEE80211_TX_CTL_CLEAR_PS_FILT;
1240 ieee80211_check_fast_xmit(tx->sta);
1241 }
1242
1243 info->flags |= IEEE80211_TX_CTL_FIRST_FRAGMENT;
1244
1245 return TX_CONTINUE;
1246 }
1247
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 9 months
undefined reference to `cpu_sa110_suspend_size'
by kernel test robot
Hi Stephan,
FYI, the error/warning still remains.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 0477e92881850d44910a7e94fc2c46f96faa131f
commit: a871be6b8eee13a35a3e8e56c62770ef17ee9220 cpuidle: Convert Qualcomm SPM driver to a generic CPUidle driver
date: 7 months ago
config: arm-randconfig-r005-20201207 (attached as .config)
compiler: arm-linux-gnueabi-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit...
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout a871be6b8eee13a35a3e8e56c62770ef17ee9220
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arm-linux-gnueabi-ld: arch/arm/kernel/sleep.o: in function `__cpu_suspend':
>> (.text+0x60): undefined reference to `cpu_sa110_suspend_size'
arm-linux-gnueabi-ld: arch/arm/kernel/suspend.o: in function `__cpu_suspend_save':
>> suspend.c:(.text+0x140): undefined reference to `cpu_sa110_do_suspend'
>> arm-linux-gnueabi-ld: suspend.c:(.text+0x168): undefined reference to `cpu_sa110_do_resume'
arm-linux-gnueabi-ld: drivers/firmware/qcom_scm-smc.o: in function `__scm_smc_do_quirk':
qcom_scm-smc.c:(.text+0x5c): undefined reference to `__arm_smccc_smc'
arm-linux-gnueabi-ld: drivers/firmware/qcom_scm-legacy.o: in function `scm_legacy_call':
qcom_scm-legacy.c:(.text+0x1a4): undefined reference to `__arm_smccc_smc'
arm-linux-gnueabi-ld: drivers/firmware/qcom_scm-legacy.o: in function `scm_legacy_call_atomic':
qcom_scm-legacy.c:(.text+0x454): undefined reference to `__arm_smccc_smc'
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 9 months
Re: [RFC PATCH v2 5/6] power: supply: Add bd718(27/28/78) charger driver
by kernel test robot
Hi Matti,
[FYI, it's a private test report for your RFC patch.]
[auto build test WARNING on 09162bc32c880a791c6c0668ce0745cf7958f576]
url: https://github.com/0day-ci/linux/commits/Matti-Vaittinen/power-supply-Add...
base: 09162bc32c880a791c6c0668ce0745cf7958f576
config: arm64-randconfig-r005-20201210 (attached as .config)
compiler: clang version 12.0.0 (https://github.com/llvm/llvm-project 1968804ac726e7674d5de22bc2204b45857da344)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install arm64 cross compiling tool for clang build
# apt-get install binutils-aarch64-linux-gnu
# https://github.com/0day-ci/linux/commit/9509c087743c74e8a856860210f287d98...
git remote add linux-review https://github.com/0day-ci/linux
git fetch --no-tags linux-review Matti-Vaittinen/power-supply-Add-some-fuel-gauge-logic/20201204-205731
git checkout 9509c087743c74e8a856860210f287d980d5da1b
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All warnings (new ones prefixed by >>):
>> drivers/power/supply/bd71827-power.c:996:5: warning: no previous prototype for function 'bd71827_get_ocv' [-Wmissing-prototypes]
int bd71827_get_ocv(struct sw_gauge *sw, int dsoc, int temp, int *ocv)
^
drivers/power/supply/bd71827-power.c:996:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int bd71827_get_ocv(struct sw_gauge *sw, int dsoc, int temp, int *ocv)
^
static
>> drivers/power/supply/bd71827-power.c:1745:5: warning: no previous prototype for function 'bd7182x_get_irqs' [-Wmissing-prototypes]
int bd7182x_get_irqs(struct platform_device *pdev, struct bd71827_power *pwr)
^
drivers/power/supply/bd71827-power.c:1745:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int bd7182x_get_irqs(struct platform_device *pdev, struct bd71827_power *pwr)
^
static
>> drivers/power/supply/bd71827-power.c:1782:5: warning: no previous prototype for function 'bd7182x_get_rsens' [-Wmissing-prototypes]
int bd7182x_get_rsens(struct bd71827_power *pwr)
^
drivers/power/supply/bd71827-power.c:1782:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
int bd7182x_get_rsens(struct bd71827_power *pwr)
^
static
3 warnings generated.
vim +/bd71827_get_ocv +996 drivers/power/supply/bd71827-power.c
990
991 /*
992 * Standard batinfo supports only accuracy of 1% for SOC - which
993 * may not be sufficient for us. SWGAUGE provides soc in unts of 0.1% here
994 * to allow more accurate computation.
995 */
> 996 int bd71827_get_ocv(struct sw_gauge *sw, int dsoc, int temp, int *ocv)
997 {
998 int i = 0;
999
1000 if (dsoc > soc_table[0]) {
1001 *ocv = MAX_VOLTAGE_DEFAULT;
1002 return 0;
1003 }
1004 if (dsoc == 0) {
1005 *ocv = ocv_table[21];
1006 return 0;
1007 }
1008
1009 i = 0;
1010 while (i < 22) {
1011 if ((dsoc <= soc_table[i]) && (dsoc > soc_table[i+1])) {
1012 *ocv = (ocv_table[i] - ocv_table[i+1]) *
1013 (dsoc - soc_table[i+1]) / (soc_table[i] -
1014 soc_table[i+1]) + ocv_table[i+1];
1015 return 0;
1016 }
1017 i++;
1018 }
1019
1020 *ocv = ocv_table[22];
1021
1022 return 0;
1023 }
1024
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
1 year, 9 months