[PATCH] drivers: staging: Add support for nCipher HSM devices

gregkh at linuxfoundation.org gregkh at linuxfoundation.org
Mon Dec 9 15:33:10 UTC 2019


On Mon, Dec 09, 2019 at 01:56:55PM +0000, Kim, David wrote:
> 
> Hi everybody,
>> This patch introduces a driver for nCipher's Solo and Solo XC range of PCIe
> hardware security modules (HSM), which provide key creation/management
> and cryptography services.
> 
> Upstreaming the nCipher driver into the kernel will allow early adopters
> of the latest kernel to upgrade and maintain their working systems when
> using an nCipher PCIe HSM. Further, having this driver in the kernel will be
> more convenient to our users and make a Linux based solution a more
> attractive option for others.​

Odd characters at your line-end here :(

> 
> Regards,
> Dave Kim


No need for the "Hi" and "regards" in a changelog text :)

Most importantly, why is this being submitted for the staging directory?
What is keeping it from being added to the "real" part of the kernel
now?

If you need/want it in drivers/staging/ then you need a TODO file that
lists what needs to be done to it in order to get out of
drivers/staging/

thanks,

greg k-h

> 
> Co-developed-by: Tim Magee <tim.magee at ncipher.com>
> Signed-off-by: Tim Magee <tim.magee at ncipher.com>
> Signed-off-by: David Kim <david.kim at ncipher.com>​

Odd line-end here :(


> 
> 
>  MAINTAINERS                       |    8 +
>  drivers/staging/Kconfig           |    1 +
>  drivers/staging/Makefile          |    1 +
>  drivers/staging/ncipher/Kconfig   |    8 +
>  drivers/staging/ncipher/Makefile  |    7 +
>  drivers/staging/ncipher/fsl.c     |  911 ++++++++++++++++++++++
>  drivers/staging/ncipher/fsl.h     |  117 +++
>  drivers/staging/ncipher/hostif.c  | 1521 +++++++++++++++++++++++++++++++++++++
>  drivers/staging/ncipher/i21555.c  |  553 ++++++++++++++
>  drivers/staging/ncipher/i21555.h  |   68 ++
>  drivers/staging/ncipher/solo.h    |  316 ++++++++
>  include/uapi/linux/nshield_solo.h |  181 +++++
>  12 files changed, 3692 insertions(+)
> 
> 
> 
> diff --git a/MAINTAINERS b/MAINTAINERS
> index 061d59a4a80b..c1125c999b95 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -12605,6 +12605,14 @@ L: linux-pci at vger.kernel.org
>  S: Supported
>  F: drivers/pci/controller/vmd.c
> 
> +PCI DRIVER FOR NSHIELD SOLO AND SOLO XC HARDWARE SECURITY MODULES (HSM)
> +M: Tim Magee <tim.magee at ncipher.com>
> +M: David Kim <david.kim at ncipher.com>
> +M: Hamish Cameron <hamish.cameron at ncipher.com>
> +L: linux-crypto at vger.kernel.org
> +S: Supported
> +F: drivers/staging/ncipher/
> +
>  PCI DRIVER FOR MICROSEMI SWITCHTEC
>  M: Kurt Schwemmer <kurt.schwemmer at microsemi.com>
>  M: Logan Gunthorpe <logang at deltatee.com>
> diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
> index eaf753b70ec5..0b5498d2415c 100644
> --- a/drivers/staging/Kconfig
> +++ b/drivers/staging/Kconfig
> @@ -124,6 +124,7 @@ source "drivers/staging/uwb/Kconfig"
>  source "drivers/staging/exfat/Kconfig"
> 
>  source "drivers/staging/qlge/Kconfig"
> +source "drivers/staging/ncipher/Kconfig"
> 
>  source "drivers/staging/hp/Kconfig"
> 
> diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
> index 0a4396c9067b..be9f2e811528 100644
> --- a/drivers/staging/Makefile
> +++ b/drivers/staging/Makefile
> @@ -55,3 +55,4 @@ obj-$(CONFIG_EXFAT_FS) += exfat/
>  obj-$(CONFIG_QLGE) += qlge/
>  obj-$(CONFIG_NET_VENDOR_HP) += hp/
>  obj-$(CONFIG_WFX) += wfx/
> +obj-$(CONFIG_NCIPHER) += ncipher/
> diff --git a/drivers/staging/ncipher/Kconfig b/drivers/staging/ncipher/Kconfig
> new file mode 100644
> index 000000000000..5b466cd1896a
> --- /dev/null
> +++ b/drivers/staging/ncipher/Kconfig
> @@ -0,0 +1,8 @@
> +# SPDX-License-Identifier: GPL-2.0
> +# Enable support for nCipher's nShield Solo and Solo XC
> +config HSM_NCIPHER_NSHIELD_SOLO
> + tristate "nCipher Solo and Solo XC family of PCIe HSMs"
> + depends on PCI
> + help
> +   Select this as built-in or module if you expect to use
> +   a Hardware Security Module from nCipher's Solo or Solo XC range.
> diff --git a/drivers/staging/ncipher/Makefile b/drivers/staging/ncipher/Makefile
> new file mode 100644
> index 000000000000..b4d5f92addee
> --- /dev/null
> +++ b/drivers/staging/ncipher/Makefile
> @@ -0,0 +1,7 @@
> +# SPDX-License-Identifier: GPL-2.0
> +#
> +# Makefile for nCipher nShield HSM drivers
> +#
> +
> +obj-$(CONFIG_HSM_NCIPHER_NSHIELD_SOLO) := nshield_solo.o
> +nshield_solo-y := hostif.o fsl.o i21555.o
> diff --git a/drivers/staging/ncipher/fsl.c b/drivers/staging/ncipher/fsl.c
> new file mode 100644
> index 000000000000..5c4edeef64c0
> --- /dev/null
> +++ b/drivers/staging/ncipher/fsl.c
> @@ -0,0 +1,911 @@
> +// SPDX-License-Identifier: GPL-2.0+
> +/*
> + *
> + * fsl.c: nCipher PCI HSM FSL command driver
> + * Copyright 2019 nCipher Security Ltd
> + *
> + */
> +
> +#include "solo.h"
> +#include "fsl.h"
> +
> +/**
> + * Resets FSL device.
> + *
> + * Extra device info is initialized the first time created.
> + *
> + * @param ndev common device.
> + * @returns 0 if successful, other value if error.
> + */
> +static int fsl_create(struct nfp_dev *ndev)
> +{
> + /* check for device */
> + if (!ndev) {
> + pr_err("%s: error: no device", __func__);
> + return -ENODEV;
> + }

Patch is totally corrupted and could not be applied even if I wanted to
:(

Can you just use 'git send-email' to send patches out?  web clients do
not work at all (as you saw with your first attempt in html format...)

thanks,

greg k-h


More information about the devel mailing list