All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] crypto: caam - handle interrupt lines shared across rings
@ 2011-04-12  0:15 ` Kim Phillips
  0 siblings, 0 replies; 8+ messages in thread
From: Kim Phillips @ 2011-04-12  0:15 UTC (permalink / raw)
  To: linux-crypto, linuxppc-dev; +Cc: Herbert Xu, Steve Cornelius

- add IRQF_SHARED to request_irq flags to support parts such as
the p1023 that has one IRQ line per couple of rings.

- resetting a job ring triggers an interrupt, so move request_irq
prior to jr_reset to avoid 'got IRQ but nobody cared' messages.

- disable IRQs in h/w to avoid contention between reset and
interrupt status

- delete invalid comment - if there were incomplete jobs,
module would be in use, preventing an unload.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
this, and the remaining patches in this series, tested on p1023, p3041,
p4080, and 32- and 64-bit p5020.

 drivers/crypto/caam/jr.c |   46 ++++++++++++++++++++--------------------------
 1 files changed, 20 insertions(+), 26 deletions(-)

diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index 68cb9af..340fa32 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -292,10 +292,10 @@ static int caam_reset_hw_jr(struct device *dev)
 	unsigned int timeout = 100000;
 
 	/*
-	 * FIXME: disabling IRQs here inhibits proper job completion
-	 * and error propagation
+	 * mask interrupts since we are going to poll
+	 * for reset completion status
 	 */
-	disable_irq(jrp->irq);
+	setbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK);
 
 	/* initiate flush (required prior to reset) */
 	wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET);
@@ -320,7 +320,8 @@ static int caam_reset_hw_jr(struct device *dev)
 		return -EIO;
 	}
 
-	enable_irq(jrp->irq);
+	/* unmask interrupts */
+	clrbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK);
 
 	return 0;
 }
@@ -336,6 +337,21 @@ static int caam_jr_init(struct device *dev)
 
 	jrp = dev_get_drvdata(dev);
 
+	/* Connect job ring interrupt handler. */
+	for_each_possible_cpu(i)
+		tasklet_init(&jrp->irqtask[i], caam_jr_dequeue,
+			     (unsigned long)dev);
+
+	error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED,
+			    "caam-jobr", dev);
+	if (error) {
+		dev_err(dev, "can't connect JobR %d interrupt (%d)\n",
+			jrp->ridx, jrp->irq);
+		irq_dispose_mapping(jrp->irq);
+		jrp->irq = 0;
+		return -EINVAL;
+	}
+
 	error = caam_reset_hw_jr(dev);
 	if (error)
 		return error;
@@ -404,28 +420,6 @@ static int caam_jr_init(struct device *dev)
 		  (JOBR_INTC_COUNT_THLD << JRCFG_ICDCT_SHIFT) |
 		  (JOBR_INTC_TIME_THLD << JRCFG_ICTT_SHIFT));
 
-	/* Connect job ring interrupt handler. */
-	for_each_possible_cpu(i)
-		tasklet_init(&jrp->irqtask[i], caam_jr_dequeue,
-			     (unsigned long)dev);
-
-	error = request_irq(jrp->irq, caam_jr_interrupt, 0,
-			    "caam-jobr", dev);
-	if (error) {
-		dev_err(dev, "can't connect JobR %d interrupt (%d)\n",
-			jrp->ridx, jrp->irq);
-		irq_dispose_mapping(jrp->irq);
-		jrp->irq = 0;
-		dma_unmap_single(dev, inpbusaddr, sizeof(u32 *) * JOBR_DEPTH,
-				 DMA_BIDIRECTIONAL);
-		dma_unmap_single(dev, outbusaddr, sizeof(u32 *) * JOBR_DEPTH,
-				 DMA_BIDIRECTIONAL);
-		kfree(jrp->inpring);
-		kfree(jrp->outring);
-		kfree(jrp->entinfo);
-		return -EINVAL;
-	}
-
 	jrp->assign = JOBR_UNASSIGNED;
 	return 0;
 }
-- 
1.7.4.3.dirty

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH 1/4] crypto: caam - handle interrupt lines shared across rings
@ 2011-04-12  0:15 ` Kim Phillips
  0 siblings, 0 replies; 8+ messages in thread
From: Kim Phillips @ 2011-04-12  0:15 UTC (permalink / raw)
  To: linux-crypto, linuxppc-dev; +Cc: Steve Cornelius, Herbert Xu

- add IRQF_SHARED to request_irq flags to support parts such as
the p1023 that has one IRQ line per couple of rings.

- resetting a job ring triggers an interrupt, so move request_irq
prior to jr_reset to avoid 'got IRQ but nobody cared' messages.

- disable IRQs in h/w to avoid contention between reset and
interrupt status

- delete invalid comment - if there were incomplete jobs,
module would be in use, preventing an unload.

Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
---
this, and the remaining patches in this series, tested on p1023, p3041,
p4080, and 32- and 64-bit p5020.

 drivers/crypto/caam/jr.c |   46 ++++++++++++++++++++--------------------------
 1 files changed, 20 insertions(+), 26 deletions(-)

diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c
index 68cb9af..340fa32 100644
--- a/drivers/crypto/caam/jr.c
+++ b/drivers/crypto/caam/jr.c
@@ -292,10 +292,10 @@ static int caam_reset_hw_jr(struct device *dev)
 	unsigned int timeout = 100000;
 
 	/*
-	 * FIXME: disabling IRQs here inhibits proper job completion
-	 * and error propagation
+	 * mask interrupts since we are going to poll
+	 * for reset completion status
 	 */
-	disable_irq(jrp->irq);
+	setbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK);
 
 	/* initiate flush (required prior to reset) */
 	wr_reg32(&jrp->rregs->jrcommand, JRCR_RESET);
@@ -320,7 +320,8 @@ static int caam_reset_hw_jr(struct device *dev)
 		return -EIO;
 	}
 
-	enable_irq(jrp->irq);
+	/* unmask interrupts */
+	clrbits32(&jrp->rregs->rconfig_lo, JRCFG_IMSK);
 
 	return 0;
 }
@@ -336,6 +337,21 @@ static int caam_jr_init(struct device *dev)
 
 	jrp = dev_get_drvdata(dev);
 
+	/* Connect job ring interrupt handler. */
+	for_each_possible_cpu(i)
+		tasklet_init(&jrp->irqtask[i], caam_jr_dequeue,
+			     (unsigned long)dev);
+
+	error = request_irq(jrp->irq, caam_jr_interrupt, IRQF_SHARED,
+			    "caam-jobr", dev);
+	if (error) {
+		dev_err(dev, "can't connect JobR %d interrupt (%d)\n",
+			jrp->ridx, jrp->irq);
+		irq_dispose_mapping(jrp->irq);
+		jrp->irq = 0;
+		return -EINVAL;
+	}
+
 	error = caam_reset_hw_jr(dev);
 	if (error)
 		return error;
@@ -404,28 +420,6 @@ static int caam_jr_init(struct device *dev)
 		  (JOBR_INTC_COUNT_THLD << JRCFG_ICDCT_SHIFT) |
 		  (JOBR_INTC_TIME_THLD << JRCFG_ICTT_SHIFT));
 
-	/* Connect job ring interrupt handler. */
-	for_each_possible_cpu(i)
-		tasklet_init(&jrp->irqtask[i], caam_jr_dequeue,
-			     (unsigned long)dev);
-
-	error = request_irq(jrp->irq, caam_jr_interrupt, 0,
-			    "caam-jobr", dev);
-	if (error) {
-		dev_err(dev, "can't connect JobR %d interrupt (%d)\n",
-			jrp->ridx, jrp->irq);
-		irq_dispose_mapping(jrp->irq);
-		jrp->irq = 0;
-		dma_unmap_single(dev, inpbusaddr, sizeof(u32 *) * JOBR_DEPTH,
-				 DMA_BIDIRECTIONAL);
-		dma_unmap_single(dev, outbusaddr, sizeof(u32 *) * JOBR_DEPTH,
-				 DMA_BIDIRECTIONAL);
-		kfree(jrp->inpring);
-		kfree(jrp->outring);
-		kfree(jrp->entinfo);
-		return -EINVAL;
-	}
-
 	jrp->assign = JOBR_UNASSIGNED;
 	return 0;
 }
-- 
1.7.4.3.dirty

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] crypto: caam - handle interrupt lines shared across rings
  2011-04-12  0:15 ` Kim Phillips
@ 2011-04-15  9:50   ` Herbert Xu
  -1 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2011-04-15  9:50 UTC (permalink / raw)
  To: Kim Phillips; +Cc: linux-crypto, linuxppc-dev, Steve Cornelius

On Mon, Apr 11, 2011 at 07:15:16PM -0500, Kim Phillips wrote:
> - add IRQF_SHARED to request_irq flags to support parts such as
> the p1023 that has one IRQ line per couple of rings.
> 
> - resetting a job ring triggers an interrupt, so move request_irq
> prior to jr_reset to avoid 'got IRQ but nobody cared' messages.
> 
> - disable IRQs in h/w to avoid contention between reset and
> interrupt status
> 
> - delete invalid comment - if there were incomplete jobs,
> module would be in use, preventing an unload.
> 
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
> this, and the remaining patches in this series, tested on p1023, p3041,
> p4080, and 32- and 64-bit p5020.

All four patches applied.  Thanks Kim!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] crypto: caam - handle interrupt lines shared across rings
@ 2011-04-15  9:50   ` Herbert Xu
  0 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2011-04-15  9:50 UTC (permalink / raw)
  To: Kim Phillips; +Cc: Steve Cornelius, linuxppc-dev, linux-crypto

On Mon, Apr 11, 2011 at 07:15:16PM -0500, Kim Phillips wrote:
> - add IRQF_SHARED to request_irq flags to support parts such as
> the p1023 that has one IRQ line per couple of rings.
> 
> - resetting a job ring triggers an interrupt, so move request_irq
> prior to jr_reset to avoid 'got IRQ but nobody cared' messages.
> 
> - disable IRQs in h/w to avoid contention between reset and
> interrupt status
> 
> - delete invalid comment - if there were incomplete jobs,
> module would be in use, preventing an unload.
> 
> Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> ---
> this, and the remaining patches in this series, tested on p1023, p3041,
> p4080, and 32- and 64-bit p5020.

All four patches applied.  Thanks Kim!
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] crypto: caam - handle interrupt lines shared across rings
  2011-04-15  9:50   ` Herbert Xu
@ 2011-05-02 23:27     ` Kim Phillips
  -1 siblings, 0 replies; 8+ messages in thread
From: Kim Phillips @ 2011-05-02 23:27 UTC (permalink / raw)
  To: Herbert Xu; +Cc: linux-crypto, linuxppc-dev, Steve Cornelius

On Fri, 15 Apr 2011 17:50:49 +0800
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> On Mon, Apr 11, 2011 at 07:15:16PM -0500, Kim Phillips wrote:
> > - add IRQF_SHARED to request_irq flags to support parts such as
> > the p1023 that has one IRQ line per couple of rings.
> > 
> > - resetting a job ring triggers an interrupt, so move request_irq
> > prior to jr_reset to avoid 'got IRQ but nobody cared' messages.
> > 
> > - disable IRQs in h/w to avoid contention between reset and
> > interrupt status
> > 
> > - delete invalid comment - if there were incomplete jobs,
> > module would be in use, preventing an unload.
> > 
> > Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> > ---
> > this, and the remaining patches in this series, tested on p1023, p3041,
> > p4080, and 32- and 64-bit p5020.
> 
> All four patches applied.  Thanks Kim!

I don't see them in cryptodev-2.6 - did you forget to push them?

Thanks,

Kim

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] crypto: caam - handle interrupt lines shared across rings
@ 2011-05-02 23:27     ` Kim Phillips
  0 siblings, 0 replies; 8+ messages in thread
From: Kim Phillips @ 2011-05-02 23:27 UTC (permalink / raw)
  To: Herbert Xu; +Cc: Steve Cornelius, linuxppc-dev, linux-crypto

On Fri, 15 Apr 2011 17:50:49 +0800
Herbert Xu <herbert@gondor.apana.org.au> wrote:

> On Mon, Apr 11, 2011 at 07:15:16PM -0500, Kim Phillips wrote:
> > - add IRQF_SHARED to request_irq flags to support parts such as
> > the p1023 that has one IRQ line per couple of rings.
> > 
> > - resetting a job ring triggers an interrupt, so move request_irq
> > prior to jr_reset to avoid 'got IRQ but nobody cared' messages.
> > 
> > - disable IRQs in h/w to avoid contention between reset and
> > interrupt status
> > 
> > - delete invalid comment - if there were incomplete jobs,
> > module would be in use, preventing an unload.
> > 
> > Signed-off-by: Kim Phillips <kim.phillips@freescale.com>
> > ---
> > this, and the remaining patches in this series, tested on p1023, p3041,
> > p4080, and 32- and 64-bit p5020.
> 
> All four patches applied.  Thanks Kim!

I don't see them in cryptodev-2.6 - did you forget to push them?

Thanks,

Kim

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] crypto: caam - handle interrupt lines shared across rings
  2011-05-02 23:27     ` Kim Phillips
@ 2011-05-02 23:56       ` Herbert Xu
  -1 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2011-05-02 23:56 UTC (permalink / raw)
  To: Kim Phillips; +Cc: linux-crypto, linuxppc-dev, Steve Cornelius

On Mon, May 02, 2011 at 06:27:27PM -0500, Kim Phillips wrote:
>
> I don't see them in cryptodev-2.6 - did you forget to push them?

Indeed, they were stuck on my other machine.  They should be on
master now and should show up on the public mirror soon.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH 1/4] crypto: caam - handle interrupt lines shared across rings
@ 2011-05-02 23:56       ` Herbert Xu
  0 siblings, 0 replies; 8+ messages in thread
From: Herbert Xu @ 2011-05-02 23:56 UTC (permalink / raw)
  To: Kim Phillips; +Cc: Steve Cornelius, linuxppc-dev, linux-crypto

On Mon, May 02, 2011 at 06:27:27PM -0500, Kim Phillips wrote:
>
> I don't see them in cryptodev-2.6 - did you forget to push them?

Indeed, they were stuck on my other machine.  They should be on
master now and should show up on the public mirror soon.

Thanks,
-- 
Email: Herbert Xu <herbert@gondor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2011-05-02 23:56 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-04-12  0:15 [PATCH 1/4] crypto: caam - handle interrupt lines shared across rings Kim Phillips
2011-04-12  0:15 ` Kim Phillips
2011-04-15  9:50 ` Herbert Xu
2011-04-15  9:50   ` Herbert Xu
2011-05-02 23:27   ` Kim Phillips
2011-05-02 23:27     ` Kim Phillips
2011-05-02 23:56     ` Herbert Xu
2011-05-02 23:56       ` Herbert Xu

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.