mbox series

[0/7] staging: ccree: bug fixes and TODO items for 4.13

Message ID 1498115276-1601-1-git-send-email-gilad@benyossef.com
Headers show
Series staging: ccree: bug fixes and TODO items for 4.13 | expand

Message

Gilad Ben-Yossef June 22, 2017, 7:07 a.m. UTC
An assortment of bug fixes and staging TODO items.
Highlights includes the driver passing crypto testmgr boot tests
and support of multiple HW revs. without build time changes.

Gilad Ben-Yossef (7):
  staging: ccree: fix hash import/export
  staging: ccree: register setkey for none hash macs
  staging: ccree: add support for older HW revisions
  staging: ccree: remove unused function
  staging: ccree: add clock management support
  staging: ccree: add DT bus coherency detection
  staging: ccree: use signal safe completion wait

 drivers/staging/ccree/Kconfig            |   7 +-
 drivers/staging/ccree/Makefile           |   2 +-
 drivers/staging/ccree/cc_crypto_ctx.h    |  16 --
 drivers/staging/ccree/cc_hw_queue_defs.h |  14 +-
 drivers/staging/ccree/cc_regs.h          |   7 +-
 drivers/staging/ccree/dx_crys_kernel.h   |   1 +
 drivers/staging/ccree/dx_host.h          |   3 +
 drivers/staging/ccree/dx_reg_common.h    |   2 -
 drivers/staging/ccree/ssi_aead.c         |  36 ++-
 drivers/staging/ccree/ssi_buffer_mgr.c   |  37 +--
 drivers/staging/ccree/ssi_cipher.c       |  27 +-
 drivers/staging/ccree/ssi_config.h       |  20 --
 drivers/staging/ccree/ssi_driver.c       | 170 +++++++++---
 drivers/staging/ccree/ssi_driver.h       |  32 ++-
 drivers/staging/ccree/ssi_fips_ll.c      |  59 +++--
 drivers/staging/ccree/ssi_hash.c         | 441 ++++++++++++++++++-------------
 drivers/staging/ccree/ssi_hash.h         |  12 +-
 drivers/staging/ccree/ssi_pm.c           |  13 +-
 drivers/staging/ccree/ssi_pm_ext.c       |  60 -----
 drivers/staging/ccree/ssi_pm_ext.h       |  33 ---
 drivers/staging/ccree/ssi_request_mgr.c  |  22 +-
 drivers/staging/ccree/ssi_sram_mgr.c     |  15 +-
 22 files changed, 564 insertions(+), 465 deletions(-)
 delete mode 100644 drivers/staging/ccree/ssi_pm_ext.c
 delete mode 100644 drivers/staging/ccree/ssi_pm_ext.h

-- 
2.1.4

Comments

Gilad Ben-Yossef June 22, 2017, 7:14 a.m. UTC | #1
On Thu, Jun 22, 2017 at 10:07 AM, Gilad Ben-Yossef <gilad@benyossef.com> wrote:
> An assortment of bug fixes and staging TODO items.

> Highlights includes the driver passing crypto testmgr boot tests

> and support of multiple HW revs. without build time changes.

>

> Gilad Ben-Yossef (7):

>   staging: ccree: fix hash import/export

>   staging: ccree: register setkey for none hash macs

>   staging: ccree: add support for older HW revisions

>   staging: ccree: remove unused function

>   staging: ccree: add clock management support

>   staging: ccree: add DT bus coherency detection

>   staging: ccree: use signal safe completion wait


One additional note: the patch set is on top of the current staging-next which
is d06838de4a015c7c4844ad3fcf63ad5e2c17b234 so it will conflict with
the coding style clean up patches from Jhin-Ming if you take them.

If you wish me to merge this patch set on top those just let me know.

Thanks,
Gilad

-- 
Gilad Ben-Yossef
Chief Coffee Drinker

"If you take a class in large-scale robotics, can you end up in a
situation where the homework eats your dog?"
 -- Jean-Baptiste Queru
Dan Carpenter June 22, 2017, 8:28 a.m. UTC | #2
On Thu, Jun 22, 2017 at 10:14:08AM +0300, Gilad Ben-Yossef wrote:
> On Thu, Jun 22, 2017 at 10:07 AM, Gilad Ben-Yossef <gilad@benyossef.com> wrote:

> > An assortment of bug fixes and staging TODO items.

> > Highlights includes the driver passing crypto testmgr boot tests

> > and support of multiple HW revs. without build time changes.

> >

> > Gilad Ben-Yossef (7):

> >   staging: ccree: fix hash import/export

> >   staging: ccree: register setkey for none hash macs

> >   staging: ccree: add support for older HW revisions

> >   staging: ccree: remove unused function

> >   staging: ccree: add clock management support

> >   staging: ccree: add DT bus coherency detection

> >   staging: ccree: use signal safe completion wait

> 

> One additional note: the patch set is on top of the current staging-next which

> is d06838de4a015c7c4844ad3fcf63ad5e2c17b234 so it will conflict with

> the coding style clean up patches from Jhin-Ming if you take them.

> 

> If you wish me to merge this patch set on top those just let me know.

> 


Yes.  Those are fine and will be merged most likely.  It's strictly
first in, first out.

regards,
dan carpenter
Dan Carpenter June 22, 2017, 8:58 a.m. UTC | #3
On Thu, Jun 22, 2017 at 10:07:51AM +0300, Gilad Ben-Yossef wrote:
> +int cc_clk_on(struct ssi_drvdata *drvdata)

> +{

> +	int rc = 0;

> +	struct clk *clk = drvdata->clk;

> +

> +	if (IS_ERR(clk))

> +	/* No all devices have a clock associated with CCREE */

> +		goto out;


Ugh...  I hate this.  The "goto out;" here is a waste of time
do-nothing-goto that returns diretly.  It's equivalent to "return 0;".
Is that intended?  Even with the comment, it's not clear...

People think do nothing gotos are a great idea but from reviewing tons
and tons of real life errors, I can assure you that in real life (as
opposed to theory) they don't prevent any future bugs and only introduce
"forgot to set the error code" bugs.

The indenting is messed up and multi-line indents get curly braces.

> +

> +	rc = clk_prepare_enable(clk);

> +	if (rc) {

> +		SSI_LOG_ERR("error enabling clock\n");

> +		clk_disable_unprepare(clk);


Don't unprepare something that hasn't been prepared.

> +	}

> +

> +out:

> +	return rc;

> +}


int cc_clk_on(struct ssi_drvdata *drvdata)
{
	struct clk *clk = drvdata->clk;
	int rc;

	if (IS_ERR(clk)) {
		/* Not all devices have a clock associated with CCREE */
		return 0;
	}

	rc = clk_prepare_enable(clk);
	if (rc)
		return rc;

	return 0;
}

regards,
dan carpenter