On Tue, Nov 12, 2024 at 01:45:53PM +0100, Harald Freudenberger wrote: . > Well, we had a similar discussion once with paes (See > https://lore.kernel.org/linux-crypto/20191113105523.8007-1-freude@xxxxxxxxxxxxx/) Thanks for refreshing my memroy. > Why not convert in the setkey() function? As of now this could be an option > as the invocation of convert_key() in the end within the PKEY pkey_pckmo > kernel module only calls PCKMO to generate the wrapped pkey. However, long > term we will have another path using a crypto card for this action and > then we are clearly in a sleeping context which must not be used from > setkey(). So make it correct now means to delay the conversion from setkey() > to later: the init of the hash context is the next chance to do this. I'm not sure I get this justification for putting it in init instead of setkey. If you can't do it in setkey because it has to sleep, then surely you can't do it from init/udpate either as they too can be called from atomic contexts? Cheers, -- Email: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt