aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc')
-rw-r--r--arch/sparc/include/asm/ldc.h1
-rw-r--r--arch/sparc/include/asm/vio.h15
-rw-r--r--arch/sparc/kernel/ldc.c12
-rw-r--r--arch/sparc/kernel/leon_smp.c2
4 files changed, 26 insertions, 4 deletions
diff --git a/arch/sparc/include/asm/ldc.h b/arch/sparc/include/asm/ldc.h
index 58ab64de25d2..6e9004aa6f25 100644
--- a/arch/sparc/include/asm/ldc.h
+++ b/arch/sparc/include/asm/ldc.h
@@ -61,6 +61,7 @@ void ldc_free(struct ldc_channel *lp);
61 61
62/* Register TX and RX queues of the link with the hypervisor. */ 62/* Register TX and RX queues of the link with the hypervisor. */
63int ldc_bind(struct ldc_channel *lp); 63int ldc_bind(struct ldc_channel *lp);
64void ldc_unbind(struct ldc_channel *lp);
64 65
65/* For non-RAW protocols we need to complete a handshake before 66/* For non-RAW protocols we need to complete a handshake before
66 * communication can proceed. ldc_connect() does that, if the 67 * communication can proceed. ldc_connect() does that, if the
diff --git a/arch/sparc/include/asm/vio.h b/arch/sparc/include/asm/vio.h
index fb124feb363b..8174f6cdbbbb 100644
--- a/arch/sparc/include/asm/vio.h
+++ b/arch/sparc/include/asm/vio.h
@@ -300,6 +300,21 @@ static inline u32 vio_dring_avail(struct vio_dring_state *dr,
300 ((dr->prod - dr->cons) & (ring_size - 1)) - 1); 300 ((dr->prod - dr->cons) & (ring_size - 1)) - 1);
301} 301}
302 302
303static inline u32 vio_dring_next(struct vio_dring_state *dr, u32 index)
304{
305 if (++index == dr->num_entries)
306 index = 0;
307 return index;
308}
309
310static inline u32 vio_dring_prev(struct vio_dring_state *dr, u32 index)
311{
312 if (index == 0)
313 return dr->num_entries - 1;
314 else
315 return index - 1;
316}
317
303#define VIO_MAX_TYPE_LEN 32 318#define VIO_MAX_TYPE_LEN 32
304#define VIO_MAX_COMPAT_LEN 64 319#define VIO_MAX_COMPAT_LEN 64
305 320
diff --git a/arch/sparc/kernel/ldc.c b/arch/sparc/kernel/ldc.c
index 4310332872d4..274a9f59d95c 100644
--- a/arch/sparc/kernel/ldc.c
+++ b/arch/sparc/kernel/ldc.c
@@ -1222,11 +1222,12 @@ out_err:
1222} 1222}
1223EXPORT_SYMBOL(ldc_alloc); 1223EXPORT_SYMBOL(ldc_alloc);
1224 1224
1225void ldc_free(struct ldc_channel *lp) 1225void ldc_unbind(struct ldc_channel *lp)
1226{ 1226{
1227 if (lp->flags & LDC_FLAG_REGISTERED_IRQS) { 1227 if (lp->flags & LDC_FLAG_REGISTERED_IRQS) {
1228 free_irq(lp->cfg.rx_irq, lp); 1228 free_irq(lp->cfg.rx_irq, lp);
1229 free_irq(lp->cfg.tx_irq, lp); 1229 free_irq(lp->cfg.tx_irq, lp);
1230 lp->flags &= ~LDC_FLAG_REGISTERED_IRQS;
1230 } 1231 }
1231 1232
1232 if (lp->flags & LDC_FLAG_REGISTERED_QUEUES) { 1233 if (lp->flags & LDC_FLAG_REGISTERED_QUEUES) {
@@ -1240,10 +1241,15 @@ void ldc_free(struct ldc_channel *lp)
1240 lp->flags &= ~LDC_FLAG_ALLOCED_QUEUES; 1241 lp->flags &= ~LDC_FLAG_ALLOCED_QUEUES;
1241 } 1242 }
1242 1243
1243 hlist_del(&lp->list); 1244 ldc_set_state(lp, LDC_STATE_INIT);
1245}
1246EXPORT_SYMBOL(ldc_unbind);
1244 1247
1248void ldc_free(struct ldc_channel *lp)
1249{
1250 ldc_unbind(lp);
1251 hlist_del(&lp->list);
1245 kfree(lp->mssbuf); 1252 kfree(lp->mssbuf);
1246
1247 ldc_iommu_release(lp); 1253 ldc_iommu_release(lp);
1248 1254
1249 kfree(lp); 1255 kfree(lp);
diff --git a/arch/sparc/kernel/leon_smp.c b/arch/sparc/kernel/leon_smp.c
index ea2bad306f93..71e16f2241c2 100644
--- a/arch/sparc/kernel/leon_smp.c
+++ b/arch/sparc/kernel/leon_smp.c
@@ -368,7 +368,7 @@ static struct smp_funcall {
368 unsigned long arg5; 368 unsigned long arg5;
369 unsigned long processors_in[NR_CPUS]; /* Set when ipi entered. */ 369 unsigned long processors_in[NR_CPUS]; /* Set when ipi entered. */
370 unsigned long processors_out[NR_CPUS]; /* Set when ipi exited. */ 370 unsigned long processors_out[NR_CPUS]; /* Set when ipi exited. */
371} ccall_info; 371} ccall_info __attribute__((aligned(8)));
372 372
373static DEFINE_SPINLOCK(cross_call_lock); 373static DEFINE_SPINLOCK(cross_call_lock);
374 374