Skip to contentSkip to conversation

crypto: marvell - Remove the old CESA driver

PATCH New Boris Brezillon 4 participants 7 messages Oct 11, 2017 – Nov 3, 2017

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover crypto: marvell - Remove the old CESA driver

Hello,

It's been several releases since we added a new driver to support the CESA IP (the new driver was introduced in 4.2). It seems most major bugs have been discovered and fixed and now is probably a good time to kill the old driver and force remaining users to switch to the new one.

This series first add a platform_device_id table to the marvell CESA driver so that it can work on non-DT platforms. Then we patch all defconfigs to select the new driver instead of the old. And finally we remove the old driver.
These patches have to be applied in this order to make things bisectable, so, if this series is accepted it will have to go through a single tree (either ARM or crypto).

Regards,

Boris

Boris Brezillon (3):
crypto: marvell - Add a platform_device_id table
ARM: configs: Stop selecting the old CESA driver
crypto: marvell - Remove the old mv_cesa driver

 arch/arm/configs/dove_defconfig     |    2 +-
 arch/arm/configs/multi_v5_defconfig |    2 +-
 arch/arm/configs/orion5x_defconfig  |    2 +-
 drivers/crypto/Kconfig              |   22 +-
 drivers/crypto/Makefile             |    1 -
 drivers/crypto/marvell/cesa.c       |   13 +-
 drivers/crypto/mv_cesa.c            | 1216 -----------------------------------
 drivers/crypto/mv_cesa.h            |  150 -----
 8 files changed, 12 insertions(+), 1396 deletions(-)
 delete mode 100644 drivers/crypto/mv_cesa.c
 delete mode 100644 drivers/crypto/mv_cesa.h
Signature · 1 line
2.11.0
#1 lore raw

PATCH 1/3 crypto: marvell - Add a platform_device_id table

Add a platform_device_id table to allow using this driver on orion platforms that have not been converted to DT.

---
 drivers/crypto/marvell/cesa.c | 6 ++++++
 1 file changed, 6 insertions(+)
drivers/crypto/marvell/cesa.c +6 -0
index 6e7a5c77a00a..c14674c6c11d 100644
@@ -599,9 +599,15 @@ static int mv_cesa_remove(struct platform_device *pdev)
 	return 0;
 }
 
+static const struct platform_device_id mv_cesa_plat_id_table[] = {
+	{ .name = "mv_crypto" },
+};
+MODULE_DEVICE_TABLE(platform, mv_cesa_plat_id_table);
+
 static struct platform_driver marvell_cesa = {
 	.probe		= mv_cesa_probe,
 	.remove		= mv_cesa_remove,
+	.id_table	= mv_cesa_plat_id_table,
 	.driver		= {
 		.name	= "marvell-cesa",
 		.of_match_table = mv_cesa_of_match_table,
Signature · 1 line
2.11.0
#2 lore raw

PATCH 2/3 ARM: configs: Stop selecting the old CESA driver

In reply to Boris Brezillon

A new driver has been developed to support the CESA IP. Switch remaining users of the old driver to the new driver in order to remove the old one.

---
 arch/arm/configs/dove_defconfig     | 2 +-
 arch/arm/configs/multi_v5_defconfig | 2 +-
 arch/arm/configs/orion5x_defconfig  | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)
arch/arm/configs/dove_defconfig +1 -1
index a93cc2fcf791..2f01e84b3d8c 100644
@@ -140,6 +140,6 @@ CONFIG_CRYPTO_TWOFISH=y
 CONFIG_CRYPTO_DEFLATE=y
 CONFIG_CRYPTO_LZO=y
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRYPTO_DEV_MV_CESA=y
+CONFIG_CRYPTO_DEV_MARVELL_CESA=y
 CONFIG_CRC_CCITT=y
 CONFIG_LIBCRC32C=y
arch/arm/configs/multi_v5_defconfig +1 -1
index 69a4bd13eea5..7c41bee28463 100644
@@ -279,6 +279,6 @@ CONFIG_DEBUG_KERNEL=y
 CONFIG_DEBUG_USER=y
 CONFIG_CRYPTO_CBC=m
 CONFIG_CRYPTO_PCBC=m
-CONFIG_CRYPTO_DEV_MV_CESA=y
+CONFIG_CRYPTO_DEV_MARVELL_CESA=y
 CONFIG_CRC_CCITT=y
 CONFIG_LIBCRC32C=y
arch/arm/configs/orion5x_defconfig +1 -1
index e39ee282e6ca..b831baddae02 100644
@@ -163,5 +163,5 @@ CONFIG_CRYPTO_CBC=m
 CONFIG_CRYPTO_ECB=m
 CONFIG_CRYPTO_PCBC=m
 # CONFIG_CRYPTO_ANSI_CPRNG is not set
-CONFIG_CRYPTO_DEV_MV_CESA=y
+CONFIG_CRYPTO_DEV_MARVELL_CESA=y
 CONFIG_CRC_T10DIF=y
Signature · 1 line
2.11.0
#3 lore raw

PATCH 3/3 crypto: marvell - Remove the old mv_cesa driver

In reply to Boris Brezillon

All defconfigs selecting the old driver have been patched to select the new one instead. We can now remove the old driver along with the allhwsupports module parameter in the new driver that was used to check whether the new driver was allowed to take control of the CESA engine or not.

---
 drivers/crypto/Kconfig        |   22 +-
 drivers/crypto/Makefile       |    1 -
 drivers/crypto/marvell/cesa.c |    7 -
 drivers/crypto/mv_cesa.c      | 1216 -----------------------------------------
 drivers/crypto/mv_cesa.h      |  150 -----
 5 files changed, 3 insertions(+), 1393 deletions(-)
 delete mode 100644 drivers/crypto/mv_cesa.c
 delete mode 100644 drivers/crypto/mv_cesa.h
drivers/crypto/Kconfig +3 -19
index fe33c199fc1a..9b5e915d199a 100644
@@ -199,22 +199,8 @@ config CRYPTO_CRC32_S390
 
 	  It is available with IBM z13 or later.
 
-config CRYPTO_DEV_MV_CESA
-	tristate "Marvell's Cryptographic Engine"
-	depends on PLAT_ORION
-	select CRYPTO_AES
-	select CRYPTO_BLKCIPHER
-	select CRYPTO_HASH
-	select SRAM
-	help
-	  This driver allows you to utilize the Cryptographic Engines and
-	  Security Accelerator (CESA) which can be found on the Marvell Orion
-	  and Kirkwood SoCs, such as QNAP's TS-209.
-
-	  Currently the driver supports AES in ECB and CBC mode without DMA.
-
 config CRYPTO_DEV_MARVELL_CESA
-	tristate "New Marvell's Cryptographic Engine driver"
+	tristate "Marvell's Cryptographic Engine driver"
 	depends on PLAT_ORION || ARCH_MVEBU
 	select CRYPTO_AES
 	select CRYPTO_DES
@@ -223,12 +209,10 @@ config CRYPTO_DEV_MARVELL_CESA
 	select SRAM
 	help
 	  This driver allows you to utilize the Cryptographic Engines and
-	  Security Accelerator (CESA) which can be found on the Armada 370.
+	  Security Accelerator (CESA) which can be found on MVEBU and ORION
+	  platforms.
 	  This driver supports CPU offload through DMA transfers.
 
-	  This driver is aimed at replacing the mv_cesa driver. This will only
-	  happen once it has received proper testing.
-
 config CRYPTO_DEV_NIAGARA2
        tristate "Niagara2 Stream Processing Unit driver"
        select CRYPTO_DES
drivers/crypto/Makefile +0 -1
index 808432b44c6b..4292f254b01c 100644
@@ -14,7 +14,6 @@ obj-$(CONFIG_CRYPTO_DEV_GEODE) += geode-aes.o
 obj-$(CONFIG_CRYPTO_DEV_HIFN_795X) += hifn_795x.o
 obj-$(CONFIG_CRYPTO_DEV_IMGTEC_HASH) += img-hash.o
 obj-$(CONFIG_CRYPTO_DEV_IXP4XX) += ixp4xx_crypto.o
-obj-$(CONFIG_CRYPTO_DEV_MV_CESA) += mv_cesa.o
 obj-$(CONFIG_CRYPTO_DEV_MARVELL_CESA) += marvell/
 obj-$(CONFIG_CRYPTO_DEV_MEDIATEK) += mediatek/
 obj-$(CONFIG_CRYPTO_DEV_MXS_DCP) += mxs-dcp.o
drivers/crypto/marvell/cesa.c +0 -7
index c14674c6c11d..f870825bfbc2 100644
@@ -34,10 +34,6 @@
 /* Limit of the crypto queue before reaching the backlog */
 #define CESA_CRYPTO_DEFAULT_MAX_QLEN 128
 
-static int allhwsupport = !IS_ENABLED(CONFIG_CRYPTO_DEV_MV_CESA);
-module_param_named(allhwsupport, allhwsupport, int, 0444);
-MODULE_PARM_DESC(allhwsupport, "Enable support for all hardware (even it if overlaps with the mv_cesa driver)");
-
 struct mv_cesa_dev *cesa_dev;
 
 struct crypto_async_request *
@@ -459,9 +455,6 @@ static int mv_cesa_probe(struct platform_device *pdev)
 		caps = match->data;
 	}
 
-	if ((caps == &orion_caps || caps == &kirkwood_caps) && !allhwsupport)
-		return -ENOTSUPP;
-
 	cesa = devm_kzalloc(dev, sizeof(*cesa), GFP_KERNEL);
 	if (!cesa)
 		return -ENOMEM;
drivers/crypto/mv_cesa.c deleted +0 -1216

1,216 lines not on this page · raw message

drivers/crypto/mv_cesa.h deleted +0 -150

150 lines not on this page · raw message

Signature · 1 line
2.11.0
#4 lore raw

cover crypto: marvell - Remove the old CESA driver

In reply to Boris Brezillon

Hey Boris,

Quoted 7 lines · Boris Brezillon

Hello,

It's been several releases since we added a new driver to support the CESA IP (the new driver was introduced in 4.2). It seems most major bugs have been discovered and fixed and now is probably a good time to kill the old driver and force remaining users to switch to the new one.

Quoted 7 lines

This series first add a platform_device_id table to the marvell CESA driver so that it can work on non-DT platforms. Then we patch all defconfigs to select the new driver instead of the old. And finally we remove the old driver.
These patches have to be applied in this order to make things bisectable, so, if this series is accepted it will have to go through a single tree (either ARM or crypto).

Thanks for keeping this on your radar. As I was the one who originally requested this transitioning time,

For the series.

thx,

Jason.

#5 lore raw

cover crypto: marvell - Remove the old CESA driver

In reply to Boris Brezillon

Hi Boris,

Quoted 7 lines · Boris Brezillon

Hello,

It's been several releases since we added a new driver to support the CESA IP (the new driver was introduced in 4.2). It seems most major bugs have been discovered and fixed and now is probably a good time to kill the old driver and force remaining users to switch to the new one.

Quoted 7 lines

This series first add a platform_device_id table to the marvell CESA driver so that it can work on non-DT platforms. Then we patch all defconfigs to select the new driver instead of the old. And finally we remove the old driver.
These patches have to be applied in this order to make things bisectable, so, if this series is accepted it will have to go through a single tree (either ARM or crypto).

For the whole series

And I am OK for this series going through crypto because I don't expect any changes in the mvebu files so there won't be any merge conflict. But I am also fine to take the series in my tree, it is up to Herbert Xu.

Thanks,

Gregory

Quoted 25 lines

Regards,

Boris

Boris Brezillon (3):
crypto: marvell - Add a platform_device_id table
ARM: configs: Stop selecting the old CESA driver
crypto: marvell - Remove the old mv_cesa driver

 arch/arm/configs/dove_defconfig     |    2 +-
 arch/arm/configs/multi_v5_defconfig |    2 +-
 arch/arm/configs/orion5x_defconfig  |    2 +-
 drivers/crypto/Kconfig              |   22 +-
 drivers/crypto/Makefile             |    1 -
 drivers/crypto/marvell/cesa.c       |   13 +-
 drivers/crypto/mv_cesa.c            | 1216 -----------------------------------
 drivers/crypto/mv_cesa.h            |  150 -----
 8 files changed, 12 insertions(+), 1396 deletions(-)
 delete mode 100644 drivers/crypto/mv_cesa.c
 delete mode 100644 drivers/crypto/mv_cesa.h
Signature · 1 line
2.11.0
Signature · 4 lines
Gregory Clement, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com
maintainer
#6 lore raw

cover crypto: marvell - Remove the old CESA driver

In reply to Boris Brezillon
Quoted 24 lines · Boris Brezillon

Hello,

It's been several releases since we added a new driver to support the CESA IP (the new driver was introduced in 4.2). It seems most major bugs have been discovered and fixed and now is probably a good time to kill the old driver and force remaining users to switch to the new one.

This series first add a platform_device_id table to the marvell CESA driver so that it can work on non-DT platforms. Then we patch all defconfigs to select the new driver instead of the old. And finally we remove the old driver.
These patches have to be applied in this order to make things bisectable, so, if this series is accepted it will have to go through a single tree (either ARM or crypto).

Regards,

Boris

Boris Brezillon (3):
crypto: marvell - Add a platform_device_id table
ARM: configs: Stop selecting the old CESA driver
crypto: marvell - Remove the old mv_cesa driver

Quoted 11 lines
 arch/arm/configs/dove_defconfig     |    2 +-
 arch/arm/configs/multi_v5_defconfig |    2 +-
 arch/arm/configs/orion5x_defconfig  |    2 +-
 drivers/crypto/Kconfig              |   22 +-
 drivers/crypto/Makefile             |    1 -
 drivers/crypto/marvell/cesa.c       |   13 +-
 drivers/crypto/mv_cesa.c            | 1216 -----------------------------------
 drivers/crypto/mv_cesa.h            |  150 -----
 8 files changed, 12 insertions(+), 1396 deletions(-)
 delete mode 100644 drivers/crypto/mv_cesa.c
 delete mode 100644 drivers/crypto/mv_cesa.h

All applied. Thanks.

Signature · 3 lines
Email: Herbert Xu <[email protected]>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt