Commit 2d809dcd authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6

Pull crypto fixes from Herbert Xu:
 "This push fixes a build error on 32-bit archs in the hifn driver as
  well as a potential deadlock in the caam driver."

* git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
  crypto: caam - fix possible deadlock condition
  crypto: hifn_795x - fix 64bit division and undefined __divdi3 on 32bit archs
parents 62688e5b ce026cb9
...@@ -63,7 +63,7 @@ static void caam_jr_dequeue(unsigned long devarg) ...@@ -63,7 +63,7 @@ static void caam_jr_dequeue(unsigned long devarg)
head = ACCESS_ONCE(jrp->head); head = ACCESS_ONCE(jrp->head);
spin_lock_bh(&jrp->outlock); spin_lock(&jrp->outlock);
sw_idx = tail = jrp->tail; sw_idx = tail = jrp->tail;
hw_idx = jrp->out_ring_read_index; hw_idx = jrp->out_ring_read_index;
...@@ -115,7 +115,7 @@ static void caam_jr_dequeue(unsigned long devarg) ...@@ -115,7 +115,7 @@ static void caam_jr_dequeue(unsigned long devarg)
jrp->tail = tail; jrp->tail = tail;
} }
spin_unlock_bh(&jrp->outlock); spin_unlock(&jrp->outlock);
/* Finally, execute user's callback */ /* Finally, execute user's callback */
usercall(dev, userdesc, userstatus, userarg); usercall(dev, userdesc, userstatus, userarg);
...@@ -236,14 +236,14 @@ int caam_jr_enqueue(struct device *dev, u32 *desc, ...@@ -236,14 +236,14 @@ int caam_jr_enqueue(struct device *dev, u32 *desc,
return -EIO; return -EIO;
} }
spin_lock(&jrp->inplock); spin_lock_bh(&jrp->inplock);
head = jrp->head; head = jrp->head;
tail = ACCESS_ONCE(jrp->tail); tail = ACCESS_ONCE(jrp->tail);
if (!rd_reg32(&jrp->rregs->inpring_avail) || if (!rd_reg32(&jrp->rregs->inpring_avail) ||
CIRC_SPACE(head, tail, JOBR_DEPTH) <= 0) { CIRC_SPACE(head, tail, JOBR_DEPTH) <= 0) {
spin_unlock(&jrp->inplock); spin_unlock_bh(&jrp->inplock);
dma_unmap_single(dev, desc_dma, desc_size, DMA_TO_DEVICE); dma_unmap_single(dev, desc_dma, desc_size, DMA_TO_DEVICE);
return -EBUSY; return -EBUSY;
} }
...@@ -265,7 +265,7 @@ int caam_jr_enqueue(struct device *dev, u32 *desc, ...@@ -265,7 +265,7 @@ int caam_jr_enqueue(struct device *dev, u32 *desc,
wr_reg32(&jrp->rregs->inpring_jobadd, 1); wr_reg32(&jrp->rregs->inpring_jobadd, 1);
spin_unlock(&jrp->inplock); spin_unlock_bh(&jrp->inplock);
return 0; return 0;
} }
......
...@@ -821,8 +821,8 @@ static int hifn_register_rng(struct hifn_device *dev) ...@@ -821,8 +821,8 @@ static int hifn_register_rng(struct hifn_device *dev)
/* /*
* We must wait at least 256 Pk_clk cycles between two reads of the rng. * We must wait at least 256 Pk_clk cycles between two reads of the rng.
*/ */
dev->rng_wait_time = DIV_ROUND_UP(NSEC_PER_SEC, dev->pk_clk_freq) * dev->rng_wait_time = DIV_ROUND_UP_ULL(NSEC_PER_SEC,
256; dev->pk_clk_freq) * 256;
dev->rng.name = dev->name; dev->rng.name = dev->name;
dev->rng.data_present = hifn_rng_data_present, dev->rng.data_present = hifn_rng_data_present,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment