Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Aug 24, 2012
2 parents 62688e5 + ce026cb commit 2d809dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions drivers/crypto/caam/jr.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static void caam_jr_dequeue(unsigned long devarg)

head = ACCESS_ONCE(jrp->head);

spin_lock_bh(&jrp->outlock);
spin_lock(&jrp->outlock);

sw_idx = tail = jrp->tail;
hw_idx = jrp->out_ring_read_index;
Expand Down Expand Up @@ -115,7 +115,7 @@ static void caam_jr_dequeue(unsigned long devarg)
jrp->tail = tail;
}

spin_unlock_bh(&jrp->outlock);
spin_unlock(&jrp->outlock);

/* Finally, execute user's callback */
usercall(dev, userdesc, userstatus, userarg);
Expand Down Expand Up @@ -236,14 +236,14 @@ int caam_jr_enqueue(struct device *dev, u32 *desc,
return -EIO;
}

spin_lock(&jrp->inplock);
spin_lock_bh(&jrp->inplock);

head = jrp->head;
tail = ACCESS_ONCE(jrp->tail);

if (!rd_reg32(&jrp->rregs->inpring_avail) ||
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);
return -EBUSY;
}
Expand All @@ -265,7 +265,7 @@ int caam_jr_enqueue(struct device *dev, u32 *desc,

wr_reg32(&jrp->rregs->inpring_jobadd, 1);

spin_unlock(&jrp->inplock);
spin_unlock_bh(&jrp->inplock);

return 0;
}
Expand Down
4 changes: 2 additions & 2 deletions drivers/crypto/hifn_795x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
dev->rng_wait_time = DIV_ROUND_UP(NSEC_PER_SEC, dev->pk_clk_freq) *
256;
dev->rng_wait_time = DIV_ROUND_UP_ULL(NSEC_PER_SEC,
dev->pk_clk_freq) * 256;

dev->rng.name = dev->name;
dev->rng.data_present = hifn_rng_data_present,
Expand Down

0 comments on commit 2d809dc

Please sign in to comment.