On 2019/10/21 13:45, Herbert Xu wrote: > On Mon, Oct 21, 2019 at 12:00:00PM +0800, Zhou Wang wrote: >> >> seems it can not work, when I run insmod tcrypt.ko alg="zlib-deflate" type=10 mask=15 >> I got: insmod: can't insert 'tcrypt.ko': Resource temporarily unavailable > > This error is intentional. This is so that you can test again > without having to unload the module. Yes. > >> crypto_has_alg in case 0 in do_test does find "zlib-deflate", however, it breaks and >> do nothing about test. > > It doesn't have to do anything. As long as it causes the algorithm > to be registered the crypto API will test it automatically. So > after doing the modprobe, can you find the algorithm in /proc/crypto > and if so what does its test status say? I made CRYPTO_MANAGER_DISABLE_TESTS=n and CRYPTO_TEST=m. After loading hisi_qm and hisi_zip modules, I got: [ 138.232605] hisi_zip 0000:75:00.0: Adding to iommu group 40 [ 138.239325] hisi_zip 0000:75:00.0: enabling device (0000 -> 0002) [ 138.245896] hisi_zip 0000:b5:00.0: Adding to iommu group 41 [ 138.252435] hisi_zip 0000:b5:00.0: enabling device (0000 -> 0002) [ 138.260393] alg: No test for gzip (hisi-gzip-acomp) This is OK: as the test of zlib-deflate of hisi_zip was successful, so it was quiet, as there is no test case for gzip, so it printed above message. cat /proc/crypto, I got: name : gzip driver : hisi-gzip-acomp module : hisi_zip priority : 300 refcnt : 1 selftest : passed internal : no type : acomp name : zlib-deflate driver : hisi-zlib-acomp module : hisi_zip priority : 300 refcnt : 1 selftest : passed internal : no type : acomp [...] However, seems we can not trigger a test by loading tcrypto. Do you mean as crypto_has_alg can detect if an alg has already been tested, so it directly breaks in the case 0 in do test in tcrypto? Best, Zhou > > Cheers, >