Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'powerpc-4.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux

Pull powerpc fixes from Michael Ellerman:
"A few more powerpc fixes for 4.6:

- cxl: Keep IRQ mappings on context teardown from Michael Neuling

- cxl: Poll for outstanding IRQs when detaching a context from
Michael Neuling

- Wire up preadv2 and pwritev2 syscalls from Rui Salvaterra"

* tag 'powerpc-4.6-4' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
powerpc: wire up preadv2 and pwritev2 syscalls
cxl: Poll for outstanding IRQs when detaching a context
cxl: Keep IRQ mappings on context teardown

+45 -2
+2
arch/powerpc/include/asm/systbl.h
··· 384 384 SYSCALL(ni_syscall) 385 385 SYSCALL(mlock2) 386 386 SYSCALL(copy_file_range) 387 + COMPAT_SYS_SPU(preadv2) 388 + COMPAT_SYS_SPU(pwritev2)
+1 -1
arch/powerpc/include/asm/unistd.h
··· 12 12 #include <uapi/asm/unistd.h> 13 13 14 14 15 - #define NR_syscalls 380 15 + #define NR_syscalls 382 16 16 17 17 #define __NR__exit __NR_exit 18 18
+2
arch/powerpc/include/uapi/asm/unistd.h
··· 390 390 #define __NR_membarrier 365 391 391 #define __NR_mlock2 378 392 392 #define __NR_copy_file_range 379 393 + #define __NR_preadv2 380 394 + #define __NR_pwritev2 381 393 395 394 396 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
+7
drivers/misc/cxl/context.c
··· 223 223 cxl_ops->link_ok(ctx->afu->adapter, ctx->afu)); 224 224 flush_work(&ctx->fault_work); /* Only needed for dedicated process */ 225 225 226 + /* 227 + * Wait until no further interrupts are presented by the PSL 228 + * for this context. 229 + */ 230 + if (cxl_ops->irq_wait) 231 + cxl_ops->irq_wait(ctx); 232 + 226 233 /* release the reference to the group leader and mm handling pid */ 227 234 put_pid(ctx->pid); 228 235 put_pid(ctx->glpid);
+2
drivers/misc/cxl/cxl.h
··· 274 274 #define CXL_PSL_DSISR_An_PE (1ull << (63-4)) /* PSL Error (implementation specific) */ 275 275 #define CXL_PSL_DSISR_An_AE (1ull << (63-5)) /* AFU Error */ 276 276 #define CXL_PSL_DSISR_An_OC (1ull << (63-6)) /* OS Context Warning */ 277 + #define CXL_PSL_DSISR_PENDING (CXL_PSL_DSISR_TRANS | CXL_PSL_DSISR_An_PE | CXL_PSL_DSISR_An_AE | CXL_PSL_DSISR_An_OC) 277 278 /* NOTE: Bits 32:63 are undefined if DSISR[DS] = 1 */ 278 279 #define CXL_PSL_DSISR_An_M DSISR_NOHPTE /* PTE not found */ 279 280 #define CXL_PSL_DSISR_An_P DSISR_PROTFAULT /* Storage protection violation */ ··· 856 855 u64 dsisr, u64 errstat); 857 856 irqreturn_t (*psl_interrupt)(int irq, void *data); 858 857 int (*ack_irq)(struct cxl_context *ctx, u64 tfc, u64 psl_reset_mask); 858 + void (*irq_wait)(struct cxl_context *ctx); 859 859 int (*attach_process)(struct cxl_context *ctx, bool kernel, 860 860 u64 wed, u64 amr); 861 861 int (*detach_process)(struct cxl_context *ctx);
-1
drivers/misc/cxl/irq.c
··· 203 203 void cxl_unmap_irq(unsigned int virq, void *cookie) 204 204 { 205 205 free_irq(virq, cookie); 206 - irq_dispose_mapping(virq); 207 206 } 208 207 209 208 int cxl_register_one_irq(struct cxl *adapter,
+31
drivers/misc/cxl/native.c
··· 14 14 #include <linux/mutex.h> 15 15 #include <linux/mm.h> 16 16 #include <linux/uaccess.h> 17 + #include <linux/delay.h> 17 18 #include <asm/synch.h> 18 19 #include <misc/cxl-base.h> 19 20 ··· 798 797 return fail_psl_irq(afu, &irq_info); 799 798 } 800 799 800 + void native_irq_wait(struct cxl_context *ctx) 801 + { 802 + u64 dsisr; 803 + int timeout = 1000; 804 + int ph; 805 + 806 + /* 807 + * Wait until no further interrupts are presented by the PSL 808 + * for this context. 809 + */ 810 + while (timeout--) { 811 + ph = cxl_p2n_read(ctx->afu, CXL_PSL_PEHandle_An) & 0xffff; 812 + if (ph != ctx->pe) 813 + return; 814 + dsisr = cxl_p2n_read(ctx->afu, CXL_PSL_DSISR_An); 815 + if ((dsisr & CXL_PSL_DSISR_PENDING) == 0) 816 + return; 817 + /* 818 + * We are waiting for the workqueue to process our 819 + * irq, so need to let that run here. 820 + */ 821 + msleep(1); 822 + } 823 + 824 + dev_warn(&ctx->afu->dev, "WARNING: waiting on DSI for PE %i" 825 + " DSISR %016llx!\n", ph, dsisr); 826 + return; 827 + } 828 + 801 829 static irqreturn_t native_slice_irq_err(int irq, void *data) 802 830 { 803 831 struct cxl_afu *afu = data; ··· 1106 1076 .handle_psl_slice_error = native_handle_psl_slice_error, 1107 1077 .psl_interrupt = NULL, 1108 1078 .ack_irq = native_ack_irq, 1079 + .irq_wait = native_irq_wait, 1109 1080 .attach_process = native_attach_process, 1110 1081 .detach_process = native_detach_process, 1111 1082 .support_attributes = native_support_attributes,