On 2020/7/9 13:36, Herbert Xu wrote:
On Wed, Jul 01, 2020 at 03:19:54PM +0800, Yang Shen wrote:
When the devices are removed or not existing, the corresponding algorithms
which are registered by 'hisi-zip' driver can't be used.
Move 'hisi_zip_register_to_crypto' from 'hisi_zip_init' to
'hisi_zip_probe'. The algorithms will be registered to crypto only when
there is device bind on the driver. And when the devices are removed,
the algorithms will be unregistered.
You can't just unregister a live algorithm because if someone
holds a reference count on it then the Crypto API will crash.
Yes, this patch just fixes the bug for 'hisi_zip'. As for 'hisi_hpre'
and 'hisi_sec2', this patch doesn't change the logic.
We have noticed the problem you say, and the patch is prepared. We fix
this in 'hisi_qm', and you will see it soon.
Cheers,
Thanks
Yang