Commit 53523d52 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile

* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  arch/tile: use new generic {enable,disable}_percpu_irq() routines
  drivers/net/ethernet/tile: use skb_frag_page() API
  asm-generic/unistd.h: support new process_vm_{readv,write} syscalls
  arch/tile: fix double-free bug in homecache_free_pages()
  arch/tile: add a few #includes and an EXPORT to catch up with kernel changes.
parents 592d44a5 0c90547b
...@@ -74,16 +74,6 @@ enum { ...@@ -74,16 +74,6 @@ enum {
*/ */
void tile_irq_activate(unsigned int irq, int tile_irq_type); void tile_irq_activate(unsigned int irq, int tile_irq_type);
/*
* For onboard, non-PCI (e.g. TILE_IRQ_PERCPU) devices, drivers know
* how to use enable/disable_percpu_irq() to manage interrupts on each
* core. We can't use the generic enable/disable_irq() because they
* use a single reference count per irq, rather than per cpu per irq.
*/
void enable_percpu_irq(unsigned int irq);
void disable_percpu_irq(unsigned int irq);
void setup_irq_regs(void); void setup_irq_regs(void);
#endif /* _ASM_TILE_IRQ_H */ #endif /* _ASM_TILE_IRQ_H */
...@@ -152,14 +152,13 @@ void tile_dev_intr(struct pt_regs *regs, int intnum) ...@@ -152,14 +152,13 @@ void tile_dev_intr(struct pt_regs *regs, int intnum)
* Remove an irq from the disabled mask. If we're in an interrupt * Remove an irq from the disabled mask. If we're in an interrupt
* context, defer enabling the HW interrupt until we leave. * context, defer enabling the HW interrupt until we leave.
*/ */
void enable_percpu_irq(unsigned int irq) static void tile_irq_chip_enable(struct irq_data *d)
{ {
get_cpu_var(irq_disable_mask) &= ~(1UL << irq); get_cpu_var(irq_disable_mask) &= ~(1UL << d->irq);
if (__get_cpu_var(irq_depth) == 0) if (__get_cpu_var(irq_depth) == 0)
unmask_irqs(1UL << irq); unmask_irqs(1UL << d->irq);
put_cpu_var(irq_disable_mask); put_cpu_var(irq_disable_mask);
} }
EXPORT_SYMBOL(enable_percpu_irq);
/* /*
* Add an irq to the disabled mask. We disable the HW interrupt * Add an irq to the disabled mask. We disable the HW interrupt
...@@ -167,13 +166,12 @@ EXPORT_SYMBOL(enable_percpu_irq); ...@@ -167,13 +166,12 @@ EXPORT_SYMBOL(enable_percpu_irq);
* in an interrupt context, the return path is careful to avoid * in an interrupt context, the return path is careful to avoid
* unmasking a newly disabled interrupt. * unmasking a newly disabled interrupt.
*/ */
void disable_percpu_irq(unsigned int irq) static void tile_irq_chip_disable(struct irq_data *d)
{ {
get_cpu_var(irq_disable_mask) |= (1UL << irq); get_cpu_var(irq_disable_mask) |= (1UL << d->irq);
mask_irqs(1UL << irq); mask_irqs(1UL << d->irq);
put_cpu_var(irq_disable_mask); put_cpu_var(irq_disable_mask);
} }
EXPORT_SYMBOL(disable_percpu_irq);
/* Mask an interrupt. */ /* Mask an interrupt. */
static void tile_irq_chip_mask(struct irq_data *d) static void tile_irq_chip_mask(struct irq_data *d)
...@@ -209,6 +207,8 @@ static void tile_irq_chip_eoi(struct irq_data *d) ...@@ -209,6 +207,8 @@ static void tile_irq_chip_eoi(struct irq_data *d)
static struct irq_chip tile_irq_chip = { static struct irq_chip tile_irq_chip = {
.name = "tile_irq_chip", .name = "tile_irq_chip",
.irq_enable = tile_irq_chip_enable,
.irq_disable = tile_irq_chip_disable,
.irq_ack = tile_irq_chip_ack, .irq_ack = tile_irq_chip_ack,
.irq_eoi = tile_irq_chip_eoi, .irq_eoi = tile_irq_chip_eoi,
.irq_mask = tile_irq_chip_mask, .irq_mask = tile_irq_chip_mask,
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/dma-mapping.h> #include <linux/dma-mapping.h>
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/export.h>
#include <asm/tlbflush.h> #include <asm/tlbflush.h>
#include <asm/homecache.h> #include <asm/homecache.h>
......
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <linux/irq.h> #include <linux/irq.h>
#include <linux/io.h> #include <linux/io.h>
#include <linux/uaccess.h> #include <linux/uaccess.h>
#include <linux/export.h>
#include <asm/processor.h> #include <asm/processor.h>
#include <asm/sections.h> #include <asm/sections.h>
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include <linux/cpu.h> #include <linux/cpu.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp.h> #include <linux/smp.h>
#include <linux/stat.h>
#include <hv/hypervisor.h> #include <hv/hypervisor.h>
/* Return a string queried from the hypervisor, truncated to page size. */ /* Return a string queried from the hypervisor, truncated to page size. */
......
...@@ -39,6 +39,9 @@ EXPORT_SYMBOL(finv_user_asm); ...@@ -39,6 +39,9 @@ EXPORT_SYMBOL(finv_user_asm);
EXPORT_SYMBOL(current_text_addr); EXPORT_SYMBOL(current_text_addr);
EXPORT_SYMBOL(dump_stack); EXPORT_SYMBOL(dump_stack);
/* arch/tile/kernel/head.S */
EXPORT_SYMBOL(empty_zero_page);
/* arch/tile/lib/, various memcpy files */ /* arch/tile/lib/, various memcpy files */
EXPORT_SYMBOL(memcpy); EXPORT_SYMBOL(memcpy);
EXPORT_SYMBOL(__copy_to_user_inatomic); EXPORT_SYMBOL(__copy_to_user_inatomic);
......
...@@ -449,9 +449,12 @@ void homecache_free_pages(unsigned long addr, unsigned int order) ...@@ -449,9 +449,12 @@ void homecache_free_pages(unsigned long addr, unsigned int order)
VM_BUG_ON(!virt_addr_valid((void *)addr)); VM_BUG_ON(!virt_addr_valid((void *)addr));
page = virt_to_page((void *)addr); page = virt_to_page((void *)addr);
if (put_page_testzero(page)) { if (put_page_testzero(page)) {
int pages = (1 << order);
homecache_change_page_home(page, order, initial_page_home()); homecache_change_page_home(page, order, initial_page_home());
while (pages--) if (order == 0) {
__free_page(page++); free_hot_cold_page(page, 0);
} else {
init_page_count(page);
__free_pages(page, order);
}
} }
} }
...@@ -926,7 +926,7 @@ static int tile_net_poll(struct napi_struct *napi, int budget) ...@@ -926,7 +926,7 @@ static int tile_net_poll(struct napi_struct *napi, int budget)
goto done; goto done;
/* Re-enable the ingress interrupt. */ /* Re-enable the ingress interrupt. */
enable_percpu_irq(priv->intr_id); enable_percpu_irq(priv->intr_id, 0);
/* HACK: Avoid the "rotting packet" problem (see above). */ /* HACK: Avoid the "rotting packet" problem (see above). */
if (qup->__packet_receive_read != if (qup->__packet_receive_read !=
...@@ -1296,7 +1296,7 @@ static void tile_net_open_enable(void *dev_ptr) ...@@ -1296,7 +1296,7 @@ static void tile_net_open_enable(void *dev_ptr)
info->napi_enabled = true; info->napi_enabled = true;
/* Enable the ingress interrupt. */ /* Enable the ingress interrupt. */
enable_percpu_irq(priv->intr_id); enable_percpu_irq(priv->intr_id, 0);
} }
...@@ -1697,7 +1697,7 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags, ...@@ -1697,7 +1697,7 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags,
for (i = 0; i < sh->nr_frags; i++) { for (i = 0; i < sh->nr_frags; i++) {
skb_frag_t *f = &sh->frags[i]; skb_frag_t *f = &sh->frags[i];
unsigned long pfn = page_to_pfn(f->page); unsigned long pfn = page_to_pfn(skb_frag_page(f));
/* FIXME: Compute "hash_for_home" properly. */ /* FIXME: Compute "hash_for_home" properly. */
/* ISSUE: The hypervisor checks CHIP_HAS_REV1_DMA_PACKETS(). */ /* ISSUE: The hypervisor checks CHIP_HAS_REV1_DMA_PACKETS(). */
...@@ -1706,7 +1706,7 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags, ...@@ -1706,7 +1706,7 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags,
/* FIXME: Hmmm. */ /* FIXME: Hmmm. */
if (!hash_default) { if (!hash_default) {
void *va = pfn_to_kaddr(pfn) + f->page_offset; void *va = pfn_to_kaddr(pfn) + f->page_offset;
BUG_ON(PageHighMem(f->page)); BUG_ON(PageHighMem(skb_frag_page(f)));
finv_buffer_remote(va, f->size, 0); finv_buffer_remote(va, f->size, 0);
} }
......
...@@ -685,9 +685,15 @@ __SYSCALL(__NR_syncfs, sys_syncfs) ...@@ -685,9 +685,15 @@ __SYSCALL(__NR_syncfs, sys_syncfs)
__SYSCALL(__NR_setns, sys_setns) __SYSCALL(__NR_setns, sys_setns)
#define __NR_sendmmsg 269 #define __NR_sendmmsg 269
__SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg) __SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg)
#define __NR_process_vm_readv 270
__SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \
compat_sys_process_vm_readv)
#define __NR_process_vm_writev 271
__SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \
compat_sys_process_vm_writev)
#undef __NR_syscalls #undef __NR_syscalls
#define __NR_syscalls 270 #define __NR_syscalls 272
/* /*
* All syscalls below here should go away really, * All syscalls below here should go away really,
......
...@@ -552,5 +552,14 @@ extern ssize_t compat_rw_copy_check_uvector(int type, ...@@ -552,5 +552,14 @@ extern ssize_t compat_rw_copy_check_uvector(int type,
extern void __user *compat_alloc_user_space(unsigned long len); extern void __user *compat_alloc_user_space(unsigned long len);
asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid,
const struct compat_iovec __user *lvec,
unsigned long liovcnt, const struct compat_iovec __user *rvec,
unsigned long riovcnt, unsigned long flags);
asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
const struct compat_iovec __user *lvec,
unsigned long liovcnt, const struct compat_iovec __user *rvec,
unsigned long riovcnt, unsigned long flags);
#endif /* CONFIG_COMPAT */ #endif /* CONFIG_COMPAT */
#endif /* _LINUX_COMPAT_H */ #endif /* _LINUX_COMPAT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment