Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Linus Torvalds committed Dec 12, 2014
2 parents ad8f723 + 76e74bb commit a7e8ddd
Show file tree
Hide file tree
Showing 6 changed files with 230 additions and 52 deletions.
1 change: 1 addition & 0 deletions arch/sparc/include/asm/ldc.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 15 additions & 0 deletions arch/sparc/include/asm/vio.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 9 additions & 3 deletions arch/sparc/kernel/ldc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1222,11 +1222,12 @@ struct ldc_channel *ldc_alloc(unsigned long id,
}
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) {
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/sparc/kernel/leon_smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
Loading

0 comments on commit a7e8ddd

Please sign in to comment.