All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pascal Van Leeuwen <pvanleeuwen@verimatrix.com>
To: Antoine Tenart <antoine.tenart@bootlin.com>
Cc: Pascal van Leeuwen <pascalvanl@gmail.com>,
	"linux-crypto@vger.kernel.org" <linux-crypto@vger.kernel.org>,
	"herbert@gondor.apana.org.au" <herbert@gondor.apana.org.au>,
	"davem@davemloft.net" <davem@davemloft.net>
Subject: RE: [PATCHv3 4/4] crypto: inside-secure - add support for using the EIP197 without vendor firmware
Date: Mon, 5 Aug 2019 13:02:08 +0000	[thread overview]
Message-ID: <MN2PR20MB2973ECE2AB0598E32E088EDECADA0@MN2PR20MB2973.namprd20.prod.outlook.com> (raw)
In-Reply-To: <20190805124328.GK14470@kwain>

> -----Original Message-----
> From: Antoine Tenart <antoine.tenart@bootlin.com>
> Sent: Monday, August 5, 2019 2:43 PM
> To: Pascal Van Leeuwen <pvanleeuwen@verimatrix.com>
> Cc: Antoine Tenart <antoine.tenart@bootlin.com>; Pascal van Leeuwen
> <pascalvanl@gmail.com>; linux-crypto@vger.kernel.org; herbert@gondor.apana.org.au;
> davem@davemloft.net
> Subject: Re: [PATCHv3 4/4] crypto: inside-secure - add support for using the EIP197
> without vendor firmware
> 
> On Mon, Aug 05, 2019 at 10:12:07AM +0000, Pascal Van Leeuwen wrote:
> > > From: Antoine Tenart <antoine.tenart@bootlin.com>
> > > On Mon, Aug 05, 2019 at 09:48:13AM +0000, Pascal Van Leeuwen wrote:
> > > > > On Wed, Jul 31, 2019 at 05:29:19PM +0200, Pascal van Leeuwen wrote:
> > > > > >
> > > > > > -	/* Release engine from reset */
> > > > > > -	val = readl(EIP197_PE(priv) + ctrl);
> > > > > > -	val &= ~EIP197_PE_ICE_x_CTRL_SW_RESET;
> > > > > > -	writel(val, EIP197_PE(priv) + ctrl);
> > > > > > +	for (pe = 0; pe < priv->config.pes; pe++) {
> > > > > > +		base = EIP197_PE_ICE_SCRATCH_RAM(pe);
> > > > > > +		pollcnt = EIP197_FW_START_POLLCNT;
> > > > > > +		while (pollcnt &&
> > > > > > +		       (readl_relaxed(EIP197_PE(priv) + base +
> > > > > > +			      pollofs) != 1)) {
> > > > > > +			pollcnt--;
> > > > >
> > > > > You might want to use readl_relaxed_poll_timeout() here, instead of a
> > > > > busy polling.
> > > > >
> > > > Didn't know such a thing existed, but I also wonder how appropriate it
> > > > is in this case, condering it measures in whole microseconds, while the
> > > > response time I'm expecting here is in the order of a few dozen nano-
> > > > seconds internally ... i.e. 1 microsecond is already a *huge* overkill.
> > > >
> > > > The current implementation runs that loop for only 16 iterations which
> > > > should be both more than sufficient (it probably could be reduced
> > > > further, I picked 16 rather arbitrarily) and at the same time take so
> > > > few cycles on the CPU that I doubt it is worthwhile to reschedule/
> > > > preempt/whatever?
> > >
> > > Your choice, I was just making a suggestion :)
> > >
> > After reading the implementation code, I think using it with a
> > sleep_us value of 0 and a time-out value of 1 may be reasonable here,
> > as time-out means some serious error that shouldn't normally happen.
> > I just wouldn't want any microsecond delays for the "normal" case.
> 
> Using this function that is designed to sleep with a delay of 0 and
> designed to timeout with a value of 1 does not seem to follow what the
> function is designed for :) It could work but I would suggest to keep
> the polling as it is in the patch in this case.
> 
Ok, will do. Does that mean that patch 4/4 is good as is?
i.e. can I add an "Acked-by: Antoine Tenart" line when I resubmit?

> Thanks,
> Antoine
> 
> --
> Antoine Ténart, Bootlin
> Embedded Linux and Kernel engineering
> https://bootlin.com

Regards,
Pascal van Leeuwen
Silicon IP Architect, Multi-Protocol Engines @ Verimatrix
www.insidesecure.com

  reply	other threads:[~2019-08-05 13:02 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-31 15:29 [PATCHv3 0/4] crypto: inside-secure - broaden driver scope Pascal van Leeuwen
2019-07-31 15:29 ` [PATCHv3 1/4] crypto: inside-secure - make driver selectable for non-Marvell hardware Pascal van Leeuwen
2019-08-05  8:04   ` Antoine Tenart
2019-07-31 15:29 ` [PATCHv3 2/4] crypto: inside-secure - Remove redundant algo to engine mapping code Pascal van Leeuwen
2019-08-05  7:51   ` Antoine Tenart
2019-07-31 15:29 ` [PATCHv3 3/4] crypto: inside-secure - add support for PCI based FPGA development board Pascal van Leeuwen
2019-08-05  8:36   ` Antoine Tenart
2019-08-05  8:47     ` Pascal Van Leeuwen
2019-08-05  9:09       ` Antoine Tenart
2019-08-05  9:49         ` Pascal Van Leeuwen
2019-07-31 15:29 ` [PATCHv3 4/4] crypto: inside-secure - add support for using the EIP197 without vendor firmware Pascal van Leeuwen
2019-08-05  9:07   ` Antoine Tenart
2019-08-05  9:48     ` Pascal Van Leeuwen
2019-08-05  9:54       ` Antoine Tenart
2019-08-05 10:12         ` Pascal Van Leeuwen
2019-08-05 12:43           ` Antoine Tenart
2019-08-05 13:02             ` Pascal Van Leeuwen [this message]
2019-08-05 13:12               ` Antoine Tenart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=MN2PR20MB2973ECE2AB0598E32E088EDECADA0@MN2PR20MB2973.namprd20.prod.outlook.com \
    --to=pvanleeuwen@verimatrix.com \
    --cc=antoine.tenart@bootlin.com \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=linux-crypto@vger.kernel.org \
    --cc=pascalvanl@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.