diff options
author | Ruchika Gupta <ruchika.gupta@freescale.com> | 2013-07-31 06:18:56 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2013-07-31 20:55:40 -0400 |
commit | 6dad41158db696d77eb17df12d5b1f3e196a7f2f (patch) | |
tree | 08ef3d8894ea10a7cab292cf961cf903f385c157 /drivers/crypto | |
parent | 674349f365ce7ac2b826edc619907a19c7136822 (diff) |
crypto: caam - Remove unused functions from Job Ring
Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/caam/ctrl.c | 3 | ||||
-rw-r--r-- | drivers/crypto/caam/intern.h | 5 | ||||
-rw-r--r-- | drivers/crypto/caam/jr.c | 67 | ||||
-rw-r--r-- | drivers/crypto/caam/jr.h | 2 |
4 files changed, 0 insertions, 77 deletions
diff --git a/drivers/crypto/caam/ctrl.c b/drivers/crypto/caam/ctrl.c index 86c96009faad..b010d42a1803 100644 --- a/drivers/crypto/caam/ctrl.c +++ b/drivers/crypto/caam/ctrl.c | |||
@@ -313,9 +313,6 @@ static int caam_probe(struct platform_device *pdev) | |||
313 | 313 | ||
314 | /* NOTE: RTIC detection ought to go here, around Si time */ | 314 | /* NOTE: RTIC detection ought to go here, around Si time */ |
315 | 315 | ||
316 | /* Initialize queue allocator lock */ | ||
317 | spin_lock_init(&ctrlpriv->jr_alloc_lock); | ||
318 | |||
319 | caam_id = rd_reg64(&topregs->ctrl.perfmon.caam_id); | 316 | caam_id = rd_reg64(&topregs->ctrl.perfmon.caam_id); |
320 | 317 | ||
321 | /* Report "alive" for developer to see */ | 318 | /* Report "alive" for developer to see */ |
diff --git a/drivers/crypto/caam/intern.h b/drivers/crypto/caam/intern.h index e4a16b741371..34c4b9f7fbfa 100644 --- a/drivers/crypto/caam/intern.h +++ b/drivers/crypto/caam/intern.h | |||
@@ -9,9 +9,6 @@ | |||
9 | #ifndef INTERN_H | 9 | #ifndef INTERN_H |
10 | #define INTERN_H | 10 | #define INTERN_H |
11 | 11 | ||
12 | #define JOBR_UNASSIGNED 0 | ||
13 | #define JOBR_ASSIGNED 1 | ||
14 | |||
15 | /* Currently comes from Kconfig param as a ^2 (driver-required) */ | 12 | /* Currently comes from Kconfig param as a ^2 (driver-required) */ |
16 | #define JOBR_DEPTH (1 << CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE) | 13 | #define JOBR_DEPTH (1 << CONFIG_CRYPTO_DEV_FSL_CAAM_RINGSIZE) |
17 | 14 | ||
@@ -46,7 +43,6 @@ struct caam_drv_private_jr { | |||
46 | struct caam_job_ring __iomem *rregs; /* JobR's register space */ | 43 | struct caam_job_ring __iomem *rregs; /* JobR's register space */ |
47 | struct tasklet_struct irqtask; | 44 | struct tasklet_struct irqtask; |
48 | int irq; /* One per queue */ | 45 | int irq; /* One per queue */ |
49 | int assign; /* busy/free */ | ||
50 | 46 | ||
51 | /* Job ring info */ | 47 | /* Job ring info */ |
52 | int ringsize; /* Size of rings (assume input = output) */ | 48 | int ringsize; /* Size of rings (assume input = output) */ |
@@ -68,7 +64,6 @@ struct caam_drv_private { | |||
68 | 64 | ||
69 | struct device *dev; | 65 | struct device *dev; |
70 | struct device **jrdev; /* Alloc'ed array per sub-device */ | 66 | struct device **jrdev; /* Alloc'ed array per sub-device */ |
71 | spinlock_t jr_alloc_lock; | ||
72 | struct platform_device *pdev; | 67 | struct platform_device *pdev; |
73 | 68 | ||
74 | /* Physical-presence section */ | 69 | /* Physical-presence section */ |
diff --git a/drivers/crypto/caam/jr.c b/drivers/crypto/caam/jr.c index b4aa773ecbc8..105ba4da6180 100644 --- a/drivers/crypto/caam/jr.c +++ b/drivers/crypto/caam/jr.c | |||
@@ -126,72 +126,6 @@ static void caam_jr_dequeue(unsigned long devarg) | |||
126 | } | 126 | } |
127 | 127 | ||
128 | /** | 128 | /** |
129 | * caam_jr_register() - Alloc a ring for someone to use as needed. Returns | ||
130 | * an ordinal of the rings allocated, else returns -ENODEV if no rings | ||
131 | * are available. | ||
132 | * @ctrldev: points to the controller level dev (parent) that | ||
133 | * owns rings available for use. | ||
134 | * @dev: points to where a pointer to the newly allocated queue's | ||
135 | * dev can be written to if successful. | ||
136 | **/ | ||
137 | int caam_jr_register(struct device *ctrldev, struct device **rdev) | ||
138 | { | ||
139 | struct caam_drv_private *ctrlpriv = dev_get_drvdata(ctrldev); | ||
140 | struct caam_drv_private_jr *jrpriv = NULL; | ||
141 | int ring; | ||
142 | |||
143 | /* Lock, if free ring - assign, unlock */ | ||
144 | spin_lock(&ctrlpriv->jr_alloc_lock); | ||
145 | for (ring = 0; ring < ctrlpriv->total_jobrs; ring++) { | ||
146 | jrpriv = dev_get_drvdata(ctrlpriv->jrdev[ring]); | ||
147 | if (jrpriv->assign == JOBR_UNASSIGNED) { | ||
148 | jrpriv->assign = JOBR_ASSIGNED; | ||
149 | *rdev = ctrlpriv->jrdev[ring]; | ||
150 | spin_unlock(&ctrlpriv->jr_alloc_lock); | ||
151 | return ring; | ||
152 | } | ||
153 | } | ||
154 | |||
155 | /* If assigned, write dev where caller needs it */ | ||
156 | spin_unlock(&ctrlpriv->jr_alloc_lock); | ||
157 | *rdev = NULL; | ||
158 | |||
159 | return -ENODEV; | ||
160 | } | ||
161 | EXPORT_SYMBOL(caam_jr_register); | ||
162 | |||
163 | /** | ||
164 | * caam_jr_deregister() - Deregister an API and release the queue. | ||
165 | * Returns 0 if OK, -EBUSY if queue still contains pending entries | ||
166 | * or unprocessed results at the time of the call | ||
167 | * @dev - points to the dev that identifies the queue to | ||
168 | * be released. | ||
169 | **/ | ||
170 | int caam_jr_deregister(struct device *rdev) | ||
171 | { | ||
172 | struct caam_drv_private_jr *jrpriv = dev_get_drvdata(rdev); | ||
173 | struct caam_drv_private *ctrlpriv; | ||
174 | |||
175 | /* Get the owning controller's private space */ | ||
176 | ctrlpriv = dev_get_drvdata(jrpriv->parentdev); | ||
177 | |||
178 | /* | ||
179 | * Make sure ring empty before release | ||
180 | */ | ||
181 | if (rd_reg32(&jrpriv->rregs->outring_used) || | ||
182 | (rd_reg32(&jrpriv->rregs->inpring_avail) != JOBR_DEPTH)) | ||
183 | return -EBUSY; | ||
184 | |||
185 | /* Release ring */ | ||
186 | spin_lock(&ctrlpriv->jr_alloc_lock); | ||
187 | jrpriv->assign = JOBR_UNASSIGNED; | ||
188 | spin_unlock(&ctrlpriv->jr_alloc_lock); | ||
189 | |||
190 | return 0; | ||
191 | } | ||
192 | EXPORT_SYMBOL(caam_jr_deregister); | ||
193 | |||
194 | /** | ||
195 | * caam_jr_enqueue() - Enqueue a job descriptor head. Returns 0 if OK, | 129 | * caam_jr_enqueue() - Enqueue a job descriptor head. Returns 0 if OK, |
196 | * -EBUSY if the queue is full, -EIO if it cannot map the caller's | 130 | * -EBUSY if the queue is full, -EIO if it cannot map the caller's |
197 | * descriptor. | 131 | * descriptor. |
@@ -379,7 +313,6 @@ static int caam_jr_init(struct device *dev) | |||
379 | (JOBR_INTC_COUNT_THLD << JRCFG_ICDCT_SHIFT) | | 313 | (JOBR_INTC_COUNT_THLD << JRCFG_ICDCT_SHIFT) | |
380 | (JOBR_INTC_TIME_THLD << JRCFG_ICTT_SHIFT)); | 314 | (JOBR_INTC_TIME_THLD << JRCFG_ICTT_SHIFT)); |
381 | 315 | ||
382 | jrp->assign = JOBR_UNASSIGNED; | ||
383 | return 0; | 316 | return 0; |
384 | } | 317 | } |
385 | 318 | ||
diff --git a/drivers/crypto/caam/jr.h b/drivers/crypto/caam/jr.h index c23df395b622..9d8741a59037 100644 --- a/drivers/crypto/caam/jr.h +++ b/drivers/crypto/caam/jr.h | |||
@@ -8,8 +8,6 @@ | |||
8 | #define JR_H | 8 | #define JR_H |
9 | 9 | ||
10 | /* Prototypes for backend-level services exposed to APIs */ | 10 | /* Prototypes for backend-level services exposed to APIs */ |
11 | int caam_jr_register(struct device *ctrldev, struct device **rdev); | ||
12 | int caam_jr_deregister(struct device *rdev); | ||
13 | int caam_jr_enqueue(struct device *dev, u32 *desc, | 11 | int caam_jr_enqueue(struct device *dev, u32 *desc, |
14 | void (*cbk)(struct device *dev, u32 *desc, u32 status, | 12 | void (*cbk)(struct device *dev, u32 *desc, u32 status, |
15 | void *areq), | 13 | void *areq), |