From: kernel test robot <lkp@intel.com>
To: Corentin Labbe <clabbe@baylibre.com>,
davem@davemloft.net, herbert@gondor.apana.org.au,
mripard@kernel.org, wens@csie.org
Cc: kbuild-all@lists.01.org, linux-arm-kernel@lists.infradead.org,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-sunxi@googlegroups.com,
Corentin Labbe <clabbe@baylibre.com>
Subject: Re: [PATCH v3 14/14] crypto: sun8i-ce: Add support for the TRNG
Date: Mon, 22 Jun 2020 06:26:08 +0800 [thread overview]
Message-ID: <202006220654.MXClJxqd%lkp@intel.com> (raw)
In-Reply-To: <1592767867-35982-15-git-send-email-clabbe@baylibre.com>
[-- Attachment #1: Type: text/plain, Size: 4989 bytes --]
Hi Corentin,
I love your patch! Perhaps something to improve:
[auto build test WARNING on sunxi/sunxi/for-next]
[also build test WARNING on cryptodev/master crypto/master v5.8-rc1]
[cannot apply to next-20200621]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use as documented in
https://git-scm.com/docs/git-format-patch]
url: https://github.com/0day-ci/linux/commits/Corentin-Labbe/crypto-allwinner-add-xRNG-and-hashes/20200622-033401
base: https://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git sunxi/for-next
config: sh-allmodconfig (attached as .config)
compiler: sh4-linux-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
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=sh
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>, old ones prefixed by <<):
>> drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c:22:5: warning: no previous prototype for 'sun8i_ce_trng_read' [-Wmissing-prototypes]
22 | int sun8i_ce_trng_read(struct hwrng *rng, void *data, size_t max, bool wait)
| ^~~~~~~~~~~~~~~~~~
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c: In function 'sun8i_ce_hwrng_register':
>> drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c:105:24: warning: comparison is always false due to limited range of data type [-Wtype-limits]
105 | if (ce->variant->trng == CE_ID_NOTSUPP) {
| ^~
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c: In function 'sun8i_ce_hwrng_unregister':
drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c:121:24: warning: comparison is always false due to limited range of data type [-Wtype-limits]
121 | if (ce->variant->trng == CE_ID_NOTSUPP)
| ^~
vim +/sun8i_ce_trng_read +22 drivers/crypto/allwinner/sun8i-ce/sun8i-ce-trng.c
> 22 int sun8i_ce_trng_read(struct hwrng *rng, void *data, size_t max, bool wait)
23 {
24 struct sun8i_ce_dev *ce;
25 dma_addr_t dma_dst;
26 int err = 0;
27 int flow = 3;
28 unsigned int todo;
29 struct sun8i_ce_flow *chan;
30 struct ce_task *cet;
31 u32 common;
32 void *d;
33
34 ce = container_of(rng, struct sun8i_ce_dev, trng);
35
36 /* round the data length to a multiple of 32*/
37 todo = max + 32;
38 todo -= todo % 32;
39
40 d = kzalloc(todo, GFP_KERNEL | GFP_DMA);
41 if (!d)
42 return -ENOMEM;
43
44 #ifdef CONFIG_CRYPTO_DEV_SUN8I_CE_DEBUG
45 ce->hwrng_stat_req++;
46 ce->hwrng_stat_bytes += todo;
47 #endif
48
49 dma_dst = dma_map_single(ce->dev, d, todo, DMA_FROM_DEVICE);
50 if (dma_mapping_error(ce->dev, dma_dst)) {
51 dev_err(ce->dev, "Cannot DMA MAP DST\n");
52 err = -EFAULT;
53 goto err_dst;
54 }
55
56 err = pm_runtime_get_sync(ce->dev);
57 if (err < 0)
58 goto err_pm;
59
60 mutex_lock(&ce->rnglock);
61 chan = &ce->chanlist[flow];
62
63 cet = &chan->tl[0];
64 memset(cet, 0, sizeof(struct ce_task));
65
66 cet->t_id = cpu_to_le32(flow);
67 common = ce->variant->trng | CE_COMM_INT;
68 cet->t_common_ctl = cpu_to_le32(common);
69
70 /* recent CE (H6) need length in bytes, in word otherwise */
71 if (ce->variant->trng_t_dlen_in_bytes)
72 cet->t_dlen = cpu_to_le32(todo);
73 else
74 cet->t_dlen = cpu_to_le32(todo / 4);
75
76 cet->t_sym_ctl = 0;
77 cet->t_asym_ctl = 0;
78
79 cet->t_dst[0].addr = cpu_to_le32(dma_dst);
80 cet->t_dst[0].len = cpu_to_le32(todo / 4);
81 ce->chanlist[flow].timeout = todo;
82
83 err = sun8i_ce_run_task(ce, 3, "TRNG");
84 mutex_unlock(&ce->rnglock);
85
86 pm_runtime_put(ce->dev);
87
88 err_pm:
89 dma_unmap_single(ce->dev, dma_dst, todo, DMA_FROM_DEVICE);
90
91 if (!err) {
92 memcpy(data, d, max);
93 err = max;
94 }
95 memzero_explicit(d, todo);
96 err_dst:
97 kfree(d);
98 return err;
99 }
100
101 int sun8i_ce_hwrng_register(struct sun8i_ce_dev *ce)
102 {
103 int ret;
104
> 105 if (ce->variant->trng == CE_ID_NOTSUPP) {
106 dev_info(ce->dev, "TRNG not supported\n");
107 return 0;
108 }
109 ce->trng.name = "sun8i Crypto Engine TRNG";
110 ce->trng.read = sun8i_ce_trng_read;
111 ce->trng.quality = 1000;
112
113 ret = hwrng_register(&ce->trng);
114 if (ret)
115 dev_err(ce->dev, "Fail to register the TRNG\n");
116 return ret;
117 }
118
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 54904 bytes --]
next prev parent reply other threads:[~2020-06-21 22:26 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-21 19:30 [PATCH v3 00/14] crypto: allwinner: add xRNG and hashes Corentin Labbe
2020-06-21 19:30 ` [PATCH v3 01/14] crypto: sun8i-ss: Add SS_START define Corentin Labbe
2020-06-21 19:30 ` [PATCH v3 02/14] crypto: sun8i-ss: Add support for the PRNG Corentin Labbe
2020-06-21 19:30 ` [PATCH v3 03/14] crypto: sun8i-ss: support hash algorithms Corentin Labbe
2020-06-21 21:06 ` kernel test robot
2020-06-21 19:30 ` [PATCH v3 04/14] crypto: sun8i-ss: fix a trivial typo Corentin Labbe
2020-06-21 19:30 ` [PATCH v3 05/14] crypto: sun8i-ss: Add more comment on some structures Corentin Labbe
2020-06-21 19:30 ` [PATCH v3 06/14] crypto: sun8i-ss: better debug printing Corentin Labbe
2020-06-21 19:31 ` [PATCH v3 07/14] crypto: sun8i-ce: move iv data to request context Corentin Labbe
2020-06-21 19:31 ` [PATCH v3 08/14] crypto: sun8i-ce: split into prepare/run/unprepare Corentin Labbe
2020-06-21 20:36 ` kernel test robot
2020-06-21 21:32 ` kernel test robot
2020-06-21 19:31 ` [PATCH v3 09/14] crypto: sun8i-ce: handle different error registers Corentin Labbe
2020-06-21 19:31 ` [PATCH v3 10/14] crypto: sun8i-ce: rename has_t_dlen_in_bytes to cipher_t_dlen_in_bytes Corentin Labbe
2020-06-21 19:31 ` [PATCH v3 11/14] crypto: sun8i-ce: support hash algorithms Corentin Labbe
2020-06-21 21:07 ` kernel test robot
2020-06-21 22:29 ` kernel test robot
2020-06-21 19:31 ` [PATCH v3 12/14] crypto: sun8i-ce: Add stat_bytes debugfs Corentin Labbe
2020-06-21 19:31 ` [PATCH v3 13/14] crypto: sun8i-ce: Add support for the PRNG Corentin Labbe
2020-06-21 21:56 ` kernel test robot
2020-06-21 23:38 ` kernel test robot
2020-06-21 19:31 ` [PATCH v3 14/14] crypto: sun8i-ce: Add support for the TRNG Corentin Labbe
2020-06-21 22:26 ` kernel test robot [this message]
2020-06-22 0:27 ` kernel test robot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=202006220654.MXClJxqd%lkp@intel.com \
--to=lkp@intel.com \
--cc=clabbe@baylibre.com \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=kbuild-all@lists.01.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-sunxi@googlegroups.com \
--cc=mripard@kernel.org \
--cc=wens@csie.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).