Skip to content

Commit 53523d5

Browse files
committed
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.
2 parents 592d44a + 0c90547 commit 53523d5

File tree

10 files changed

+40
-26
lines changed

10 files changed

+40
-26
lines changed

arch/tile/include/asm/irq.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,16 +74,6 @@ enum {
7474
*/
7575
void tile_irq_activate(unsigned int irq, int tile_irq_type);
7676

77-
/*
78-
* For onboard, non-PCI (e.g. TILE_IRQ_PERCPU) devices, drivers know
79-
* how to use enable/disable_percpu_irq() to manage interrupts on each
80-
* core. We can't use the generic enable/disable_irq() because they
81-
* use a single reference count per irq, rather than per cpu per irq.
82-
*/
83-
void enable_percpu_irq(unsigned int irq);
84-
void disable_percpu_irq(unsigned int irq);
85-
86-
8777
void setup_irq_regs(void);
8878

8979
#endif /* _ASM_TILE_IRQ_H */

arch/tile/kernel/irq.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -152,28 +152,26 @@ void tile_dev_intr(struct pt_regs *regs, int intnum)
152152
* Remove an irq from the disabled mask. If we're in an interrupt
153153
* context, defer enabling the HW interrupt until we leave.
154154
*/
155-
void enable_percpu_irq(unsigned int irq)
155+
static void tile_irq_chip_enable(struct irq_data *d)
156156
{
157-
get_cpu_var(irq_disable_mask) &= ~(1UL << irq);
157+
get_cpu_var(irq_disable_mask) &= ~(1UL << d->irq);
158158
if (__get_cpu_var(irq_depth) == 0)
159-
unmask_irqs(1UL << irq);
159+
unmask_irqs(1UL << d->irq);
160160
put_cpu_var(irq_disable_mask);
161161
}
162-
EXPORT_SYMBOL(enable_percpu_irq);
163162

164163
/*
165164
* Add an irq to the disabled mask. We disable the HW interrupt
166165
* immediately so that there's no possibility of it firing. If we're
167166
* in an interrupt context, the return path is careful to avoid
168167
* unmasking a newly disabled interrupt.
169168
*/
170-
void disable_percpu_irq(unsigned int irq)
169+
static void tile_irq_chip_disable(struct irq_data *d)
171170
{
172-
get_cpu_var(irq_disable_mask) |= (1UL << irq);
173-
mask_irqs(1UL << irq);
171+
get_cpu_var(irq_disable_mask) |= (1UL << d->irq);
172+
mask_irqs(1UL << d->irq);
174173
put_cpu_var(irq_disable_mask);
175174
}
176-
EXPORT_SYMBOL(disable_percpu_irq);
177175

178176
/* Mask an interrupt. */
179177
static void tile_irq_chip_mask(struct irq_data *d)
@@ -209,6 +207,8 @@ static void tile_irq_chip_eoi(struct irq_data *d)
209207

210208
static struct irq_chip tile_irq_chip = {
211209
.name = "tile_irq_chip",
210+
.irq_enable = tile_irq_chip_enable,
211+
.irq_disable = tile_irq_chip_disable,
212212
.irq_ack = tile_irq_chip_ack,
213213
.irq_eoi = tile_irq_chip_eoi,
214214
.irq_mask = tile_irq_chip_mask,

arch/tile/kernel/pci-dma.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/mm.h>
1616
#include <linux/dma-mapping.h>
1717
#include <linux/vmalloc.h>
18+
#include <linux/export.h>
1819
#include <asm/tlbflush.h>
1920
#include <asm/homecache.h>
2021

arch/tile/kernel/pci.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#include <linux/irq.h>
2525
#include <linux/io.h>
2626
#include <linux/uaccess.h>
27+
#include <linux/export.h>
2728

2829
#include <asm/processor.h>
2930
#include <asm/sections.h>

arch/tile/kernel/sysfs.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/cpu.h>
1919
#include <linux/slab.h>
2020
#include <linux/smp.h>
21+
#include <linux/stat.h>
2122
#include <hv/hypervisor.h>
2223

2324
/* Return a string queried from the hypervisor, truncated to page size. */

arch/tile/lib/exports.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,9 @@ EXPORT_SYMBOL(finv_user_asm);
3939
EXPORT_SYMBOL(current_text_addr);
4040
EXPORT_SYMBOL(dump_stack);
4141

42+
/* arch/tile/kernel/head.S */
43+
EXPORT_SYMBOL(empty_zero_page);
44+
4245
/* arch/tile/lib/, various memcpy files */
4346
EXPORT_SYMBOL(memcpy);
4447
EXPORT_SYMBOL(__copy_to_user_inatomic);

arch/tile/mm/homecache.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -449,9 +449,12 @@ void homecache_free_pages(unsigned long addr, unsigned int order)
449449
VM_BUG_ON(!virt_addr_valid((void *)addr));
450450
page = virt_to_page((void *)addr);
451451
if (put_page_testzero(page)) {
452-
int pages = (1 << order);
453452
homecache_change_page_home(page, order, initial_page_home());
454-
while (pages--)
455-
__free_page(page++);
453+
if (order == 0) {
454+
free_hot_cold_page(page, 0);
455+
} else {
456+
init_page_count(page);
457+
__free_pages(page, order);
458+
}
456459
}
457460
}

drivers/net/ethernet/tile/tilepro.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -926,7 +926,7 @@ static int tile_net_poll(struct napi_struct *napi, int budget)
926926
goto done;
927927

928928
/* Re-enable the ingress interrupt. */
929-
enable_percpu_irq(priv->intr_id);
929+
enable_percpu_irq(priv->intr_id, 0);
930930

931931
/* HACK: Avoid the "rotting packet" problem (see above). */
932932
if (qup->__packet_receive_read !=
@@ -1296,7 +1296,7 @@ static void tile_net_open_enable(void *dev_ptr)
12961296
info->napi_enabled = true;
12971297

12981298
/* Enable the ingress interrupt. */
1299-
enable_percpu_irq(priv->intr_id);
1299+
enable_percpu_irq(priv->intr_id, 0);
13001300
}
13011301

13021302

@@ -1697,7 +1697,7 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags,
16971697
for (i = 0; i < sh->nr_frags; i++) {
16981698

16991699
skb_frag_t *f = &sh->frags[i];
1700-
unsigned long pfn = page_to_pfn(f->page);
1700+
unsigned long pfn = page_to_pfn(skb_frag_page(f));
17011701

17021702
/* FIXME: Compute "hash_for_home" properly. */
17031703
/* ISSUE: The hypervisor checks CHIP_HAS_REV1_DMA_PACKETS(). */
@@ -1706,7 +1706,7 @@ static unsigned int tile_net_tx_frags(lepp_frag_t *frags,
17061706
/* FIXME: Hmmm. */
17071707
if (!hash_default) {
17081708
void *va = pfn_to_kaddr(pfn) + f->page_offset;
1709-
BUG_ON(PageHighMem(f->page));
1709+
BUG_ON(PageHighMem(skb_frag_page(f)));
17101710
finv_buffer_remote(va, f->size, 0);
17111711
}
17121712

include/asm-generic/unistd.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -685,9 +685,15 @@ __SYSCALL(__NR_syncfs, sys_syncfs)
685685
__SYSCALL(__NR_setns, sys_setns)
686686
#define __NR_sendmmsg 269
687687
__SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg)
688+
#define __NR_process_vm_readv 270
689+
__SC_COMP(__NR_process_vm_readv, sys_process_vm_readv, \
690+
compat_sys_process_vm_readv)
691+
#define __NR_process_vm_writev 271
692+
__SC_COMP(__NR_process_vm_writev, sys_process_vm_writev, \
693+
compat_sys_process_vm_writev)
688694

689695
#undef __NR_syscalls
690-
#define __NR_syscalls 270
696+
#define __NR_syscalls 272
691697

692698
/*
693699
* All syscalls below here should go away really,

include/linux/compat.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -552,5 +552,14 @@ extern ssize_t compat_rw_copy_check_uvector(int type,
552552

553553
extern void __user *compat_alloc_user_space(unsigned long len);
554554

555+
asmlinkage ssize_t compat_sys_process_vm_readv(compat_pid_t pid,
556+
const struct compat_iovec __user *lvec,
557+
unsigned long liovcnt, const struct compat_iovec __user *rvec,
558+
unsigned long riovcnt, unsigned long flags);
559+
asmlinkage ssize_t compat_sys_process_vm_writev(compat_pid_t pid,
560+
const struct compat_iovec __user *lvec,
561+
unsigned long liovcnt, const struct compat_iovec __user *rvec,
562+
unsigned long riovcnt, unsigned long flags);
563+
555564
#endif /* CONFIG_COMPAT */
556565
#endif /* _LINUX_COMPAT_H */

0 commit comments

Comments
 (0)