From: Suman Anna <hidden> Date: 2021-05-14 16:13:06
Hi All,
The following series includes various fixes for multiple minor
cleanup issues on failure paths in the TI K3 SA2UL Crypto driver.
The patches are all based on top of 5.13-rc1.
Patch 1 is the only non SA2UL patch, and allows the OMAP RNG driver
to be built for K3 platforms and probed properly when SA2UL is
selected, and the SA2UL driver is probed (the rng device is a child
of the sa2ul device).
regards
Suman
Suman Anna (6):
hwrng: omap - Enable driver for TI K3 family
crypto: sa2ul - Fix leaks on failure paths with sa_dma_init()
crypto: sa2ul - Fix pm_runtime enable in sa_ul_probe()
crypto: sa2ul - Use of_device_get_match_data() helper
crypto: sa2ul - Use devm_platform_ioremap_resource()
crypto: sa2ul - Remove child devices in remove
drivers/char/hw_random/Kconfig | 2 +-
drivers/crypto/sa2ul.c | 46 ++++++++++++++++++----------------
2 files changed, 25 insertions(+), 23 deletions(-)
--
2.30.1
From: Suman Anna <hidden> Date: 2021-05-14 16:13:03
The TI K3 family of SoCs have a SA2UL IP that contains a
SafeXcel IP-76 RNG block which is supported by the OMAP
RNG driver. Allow this driver to be built for TI K3
family as well.
Signed-off-by: Suman Anna <redacted>
---
drivers/char/hw_random/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
From: Suman Anna <hidden> Date: 2021-05-14 16:13:10
The sa_dma_init() function doesn't release the requested dma channels
on all failure paths. Any failure in this function also ends up
leaking the dma pool created in sa_init_mem() in the sa_ul_probe()
function. Fix all of these issues.
Fixes: 7694b6ca649f ("crypto: sa2ul - Add crypto driver")
Signed-off-by: Suman Anna <redacted>
---
drivers/crypto/sa2ul.c | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
From: Suman Anna <hidden> Date: 2021-05-14 16:13:14
The pm_runtime APIs added first in commit 7694b6ca649f ("crypto: sa2ul -
Add crypto driver") are not unwound properly and was fixed up partially
in commit 13343badae09 ("crypto: sa2ul - Fix PM reference leak in
sa_ul_probe()"). This fixed up the pm_runtime usage count but not the
state. Fix this properly.
Fixes: 13343badae09 ("crypto: sa2ul - Fix PM reference leak in sa_ul_probe()")
Signed-off-by: Suman Anna <redacted>
---
drivers/crypto/sa2ul.c | 1 +
1 file changed, 1 insertion(+)
@@ -2411,6 +2411,7 @@ static int sa_ul_probe(struct platform_device *pdev)if(ret<0){dev_err(&pdev->dev,"%s: failed to get sync: %d\n",__func__,ret);+pm_runtime_disable(dev);returnret;}
From: Suman Anna <hidden> Date: 2021-05-14 16:13:16
Simplify the probe function by using the of_device_get_match_data()
helper instead of open coding. The logic is also moved up to fix the
missing pm_runtime cleanup in case of a match failure.
Fixes: 0bc42311cdff ("crypto: sa2ul - Add support for AM64")
Signed-off-by: Suman Anna <redacted>
---
drivers/crypto/sa2ul.c | 12 ++++--------
1 file changed, 4 insertions(+), 8 deletions(-)
From: Suman Anna <hidden> Date: 2021-05-14 16:13:22
Simplify the platform_get_resource() and devm_ioremap_resource()
calls with devm_platform_ioremap_resource(). Also add error checking
and move up this block to simplify the cleanup in sa_ul_probe().
Signed-off-by: Suman Anna <redacted>
---
drivers/crypto/sa2ul.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
From: Suman Anna <hidden> Date: 2021-05-14 16:13:27
The sa_ul_probe creates child devices using of_platform_populate(),
but these are not cleaned up in driver remove. Clean these up
by removing the child devices using of_platform_depopulate().
Signed-off-by: Suman Anna <redacted>
---
drivers/crypto/sa2ul.c | 2 ++
1 file changed, 2 insertions(+)
From: Tero Kristo <kristo@kernel.org> Date: 2021-05-17 06:10:04
On 14/05/2021 19:12, Suman Anna wrote:
Hi All,
The following series includes various fixes for multiple minor
cleanup issues on failure paths in the TI K3 SA2UL Crypto driver.
The patches are all based on top of 5.13-rc1.
Patch 1 is the only non SA2UL patch, and allows the OMAP RNG driver
to be built for K3 platforms and probed properly when SA2UL is
selected, and the SA2UL driver is probed (the rng device is a child
of the sa2ul device).
regards
Suman
Suman Anna (6):
hwrng: omap - Enable driver for TI K3 family
crypto: sa2ul - Fix leaks on failure paths with sa_dma_init()
crypto: sa2ul - Fix pm_runtime enable in sa_ul_probe()
crypto: sa2ul - Use of_device_get_match_data() helper
crypto: sa2ul - Use devm_platform_ioremap_resource()
crypto: sa2ul - Remove child devices in remove
For the whole series:
Reviewed-by: Tero Kristo <kristo@kernel.org>
From: Herbert Xu <herbert@gondor.apana.org.au> Date: 2021-05-21 08:23:17
On Fri, May 14, 2021 at 11:12:40AM -0500, Suman Anna wrote:
Hi All,
The following series includes various fixes for multiple minor
cleanup issues on failure paths in the TI K3 SA2UL Crypto driver.
The patches are all based on top of 5.13-rc1.
Patch 1 is the only non SA2UL patch, and allows the OMAP RNG driver
to be built for K3 platforms and probed properly when SA2UL is
selected, and the SA2UL driver is probed (the rng device is a child
of the sa2ul device).
regards
Suman
Suman Anna (6):
hwrng: omap - Enable driver for TI K3 family
crypto: sa2ul - Fix leaks on failure paths with sa_dma_init()
crypto: sa2ul - Fix pm_runtime enable in sa_ul_probe()
crypto: sa2ul - Use of_device_get_match_data() helper
crypto: sa2ul - Use devm_platform_ioremap_resource()
crypto: sa2ul - Remove child devices in remove
drivers/char/hw_random/Kconfig | 2 +-
drivers/crypto/sa2ul.c | 46 ++++++++++++++++++----------------
2 files changed, 25 insertions(+), 23 deletions(-)