diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-12 15:36:40 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-12-12 15:36:40 -0800 |
commit | a7e8ddd813c20e3e10c9012f1625a5a02f870b15 (patch) | |
tree | 8060fc23bc406d0035145cf34620b208ca6ab625 /arch | |
parent | ad8f723afbfe242ad2bc5067e06ca438b6a5c8a9 (diff) | |
parent | 76e74bbe0a38c6720217425ed64dbb448c643b9d (diff) | |
download | linux-a7e8ddd813c20e3e10c9012f1625a5a02f870b15.tar.bz2 |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Pull sparc update from David Miller:
"Not a lot of stuff this time around, mostly bug fixing:
- Fix alignment of 32-bit crosscall datastructure on Leon, from
Andreas Larsson.
- Several fixes to the virtual disk driver on sparc64 by Dwight
Engen, including handling resets of the service domain properly"
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
sunvdc: reconnect ldc after vds service domain restarts
sparc/ldc: create separate ldc_unbind from ldc_free
vio: create routines for inc,dec vio dring indexes
sunvdc: fix module unload/reload
sparc32, leon: Align ccall_info to prevent unaligned traps on crosscall
Diffstat (limited to 'arch')
-rw-r--r-- | arch/sparc/include/asm/ldc.h | 1 | ||||
-rw-r--r-- | arch/sparc/include/asm/vio.h | 15 | ||||
-rw-r--r-- | arch/sparc/kernel/ldc.c | 12 | ||||
-rw-r--r-- | arch/sparc/kernel/leon_smp.c | 2 |
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); /* Register TX and RX queues of the link with the hypervisor. */ int ldc_bind(struct ldc_channel *lp); +void ldc_unbind(struct ldc_channel *lp); /* For non-RAW protocols we need to complete a handshake before * 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, ((dr->prod - dr->cons) & (ring_size - 1)) - 1); } +static inline u32 vio_dring_next(struct vio_dring_state *dr, u32 index) +{ + if (++index == dr->num_entries) + index = 0; + return index; +} + +static inline u32 vio_dring_prev(struct vio_dring_state *dr, u32 index) +{ + if (index == 0) + return dr->num_entries - 1; + else + return index - 1; +} + #define VIO_MAX_TYPE_LEN 32 #define VIO_MAX_COMPAT_LEN 64 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: } EXPORT_SYMBOL(ldc_alloc); -void ldc_free(struct ldc_channel *lp) +void ldc_unbind(struct ldc_channel *lp) { if (lp->flags & LDC_FLAG_REGISTERED_IRQS) { free_irq(lp->cfg.rx_irq, lp); free_irq(lp->cfg.tx_irq, lp); + lp->flags &= ~LDC_FLAG_REGISTERED_IRQS; } if (lp->flags & LDC_FLAG_REGISTERED_QUEUES) { @@ -1240,10 +1241,15 @@ void ldc_free(struct ldc_channel *lp) lp->flags &= ~LDC_FLAG_ALLOCED_QUEUES; } - hlist_del(&lp->list); + ldc_set_state(lp, LDC_STATE_INIT); +} +EXPORT_SYMBOL(ldc_unbind); +void ldc_free(struct ldc_channel *lp) +{ + ldc_unbind(lp); + hlist_del(&lp->list); kfree(lp->mssbuf); - ldc_iommu_release(lp); 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 { unsigned long arg5; unsigned long processors_in[NR_CPUS]; /* Set when ipi entered. */ unsigned long processors_out[NR_CPUS]; /* Set when ipi exited. */ -} ccall_info; +} ccall_info __attribute__((aligned(8))); static DEFINE_SPINLOCK(cross_call_lock); |