diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /arch/powerpc/platforms/cell | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'arch/powerpc/platforms/cell')
-rw-r--r-- | arch/powerpc/platforms/cell/celleb_scc_pciex.c | 6 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/celleb_scc_sio.c | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spider-pic.c | 7 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_manage.c | 13 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_syscalls.c | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/coredump.c | 89 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/spufs.h | 3 |
7 files changed, 87 insertions, 43 deletions
diff --git a/arch/powerpc/platforms/cell/celleb_scc_pciex.c b/arch/powerpc/platforms/cell/celleb_scc_pciex.c index 4278acf..14be2bd 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_pciex.c +++ b/arch/powerpc/platforms/cell/celleb_scc_pciex.c @@ -486,6 +486,7 @@ static __init int celleb_setup_pciex(struct device_node *node, struct pci_controller *phb) { struct resource r; + struct of_irq oirq; int virq; /* SMMIO registers; used inside this file */ @@ -506,11 +507,12 @@ static __init int celleb_setup_pciex(struct device_node *node, phb->ops = &scc_pciex_pci_ops; /* internal interrupt handler */ - virq = irq_of_parse_and_map(node, 1); - if (!virq) { + if (of_irq_map_one(node, 1, &oirq)) { pr_err("PCIEXC:Failed to map irq\n"); goto error; } + virq = irq_create_of_mapping(oirq.controller, oirq.specifier, + oirq.size); if (request_irq(virq, pciex_handle_internal_irq, 0, "pciex", (void *)phb)) { pr_err("PCIEXC:Failed to request irq\n"); diff --git a/arch/powerpc/platforms/cell/celleb_scc_sio.c b/arch/powerpc/platforms/cell/celleb_scc_sio.c index c8eb571..9c339ec 100644 --- a/arch/powerpc/platforms/cell/celleb_scc_sio.c +++ b/arch/powerpc/platforms/cell/celleb_scc_sio.c @@ -45,7 +45,7 @@ static int __init txx9_serial_init(void) struct device_node *node; int i; struct uart_port req; - struct of_phandle_args irq; + struct of_irq irq; struct resource res; for_each_compatible_node(node, "serial", "toshiba,sio-scc") { @@ -53,7 +53,7 @@ static int __init txx9_serial_init(void) if (!(txx9_serial_bitmap & (1<<i))) continue; - if (of_irq_parse_one(node, i, &irq)) + if (of_irq_map_one(node, i, &irq)) continue; if (of_address_to_resource(node, txx9_scc_tab[i].index, &res)) @@ -66,7 +66,8 @@ static int __init txx9_serial_init(void) #ifdef CONFIG_SERIAL_TXX9_CONSOLE req.membase = ioremap(req.mapbase, 0x24); #endif - req.irq = irq_create_of_mapping(&irq); + req.irq = irq_create_of_mapping(irq.controller, + irq.specifier, irq.size); req.flags |= UPF_IOREMAP | UPF_BUGGY_UART /*HAVE_CTS_LINE*/; req.uartclk = 83300000; diff --git a/arch/powerpc/platforms/cell/spider-pic.c b/arch/powerpc/platforms/cell/spider-pic.c index 1f72f4a..8e29944 100644 --- a/arch/powerpc/platforms/cell/spider-pic.c +++ b/arch/powerpc/platforms/cell/spider-pic.c @@ -235,9 +235,12 @@ static unsigned int __init spider_find_cascade_and_node(struct spider_pic *pic) /* First, we check whether we have a real "interrupts" in the device * tree in case the device-tree is ever fixed */ - virq = irq_of_parse_and_map(pic->host->of_node, 0); - if (virq) + struct of_irq oirq; + if (of_irq_map_one(pic->host->of_node, 0, &oirq) == 0) { + virq = irq_create_of_mapping(oirq.controller, oirq.specifier, + oirq.size); return virq; + } /* Now do the horrible hacks */ tmp = of_get_property(pic->host->of_node, "#interrupt-cells", NULL); diff --git a/arch/powerpc/platforms/cell/spu_manage.c b/arch/powerpc/platforms/cell/spu_manage.c index c3327f3..2bb6977 100644 --- a/arch/powerpc/platforms/cell/spu_manage.c +++ b/arch/powerpc/platforms/cell/spu_manage.c @@ -177,20 +177,21 @@ out: static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) { - struct of_phandle_args oirq; + struct of_irq oirq; int ret; int i; for (i=0; i < 3; i++) { - ret = of_irq_parse_one(np, i, &oirq); + ret = of_irq_map_one(np, i, &oirq); if (ret) { pr_debug("spu_new: failed to get irq %d\n", i); goto err; } ret = -EINVAL; - pr_debug(" irq %d no 0x%x on %s\n", i, oirq.args[0], - oirq.np->full_name); - spu->irqs[i] = irq_create_of_mapping(&oirq); + pr_debug(" irq %d no 0x%x on %s\n", i, oirq.specifier[0], + oirq.controller->full_name); + spu->irqs[i] = irq_create_of_mapping(oirq.controller, + oirq.specifier, oirq.size); if (spu->irqs[i] == NO_IRQ) { pr_debug("spu_new: failed to map it !\n"); goto err; @@ -199,7 +200,7 @@ static int __init spu_map_interrupts(struct spu *spu, struct device_node *np) return 0; err: - pr_debug("failed to map irq %x for spu %s\n", *oirq.args, + pr_debug("failed to map irq %x for spu %s\n", *oirq.specifier, spu->name); for (; i >= 0; i--) { if (spu->irqs[i] != NO_IRQ) diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c index 3844f13..db4e638 100644 --- a/arch/powerpc/platforms/cell/spu_syscalls.c +++ b/arch/powerpc/platforms/cell/spu_syscalls.c @@ -25,7 +25,6 @@ #include <linux/module.h> #include <linux/syscalls.h> #include <linux/rcupdate.h> -#include <linux/binfmts.h> #include <asm/spu.h> @@ -127,7 +126,7 @@ int elf_coredump_extra_notes_size(void) return ret; } -int elf_coredump_extra_notes_write(struct coredump_params *cprm) +int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset) { struct spufs_calls *calls; int ret; @@ -136,7 +135,7 @@ int elf_coredump_extra_notes_write(struct coredump_params *cprm) if (!calls) return 0; - ret = calls->coredump_extra_notes_write(cprm); + ret = calls->coredump_extra_notes_write(file, foffset); spufs_calls_put(calls); diff --git a/arch/powerpc/platforms/cell/spufs/coredump.c b/arch/powerpc/platforms/cell/spufs/coredump.c index be6212d..c9500ea 100644 --- a/arch/powerpc/platforms/cell/spufs/coredump.c +++ b/arch/powerpc/platforms/cell/spufs/coredump.c @@ -27,8 +27,6 @@ #include <linux/gfp.h> #include <linux/list.h> #include <linux/syscalls.h> -#include <linux/coredump.h> -#include <linux/binfmts.h> #include <asm/uaccess.h> @@ -50,6 +48,44 @@ static ssize_t do_coredump_read(int num, struct spu_context *ctx, void *buffer, return ++ret; /* count trailing NULL */ } +/* + * These are the only things you should do on a core-file: use only these + * functions to write out all the necessary info. + */ +static int spufs_dump_write(struct file *file, const void *addr, int nr, loff_t *foffset) +{ + unsigned long limit = rlimit(RLIMIT_CORE); + ssize_t written; + + if (*foffset + nr > limit) + return -EIO; + + written = file->f_op->write(file, addr, nr, &file->f_pos); + *foffset += written; + + if (written != nr) + return -EIO; + + return 0; +} + +static int spufs_dump_align(struct file *file, char *buf, loff_t new_off, + loff_t *foffset) +{ + int rc, size; + + size = min((loff_t)PAGE_SIZE, new_off - *foffset); + memset(buf, 0, size); + + rc = 0; + while (rc == 0 && new_off > *foffset) { + size = min((loff_t)PAGE_SIZE, new_off - *foffset); + rc = spufs_dump_write(file, buf, size, foffset); + } + + return rc; +} + static int spufs_ctx_note_size(struct spu_context *ctx, int dfd) { int i, sz, total = 0; @@ -129,10 +165,10 @@ int spufs_coredump_extra_notes_size(void) } static int spufs_arch_write_note(struct spu_context *ctx, int i, - struct coredump_params *cprm, int dfd) + struct file *file, int dfd, loff_t *foffset) { loff_t pos = 0; - int sz, rc, total = 0; + int sz, rc, nread, total = 0; const int bufsz = PAGE_SIZE; char *name; char fullname[80], *buf; @@ -150,39 +186,42 @@ static int spufs_arch_write_note(struct spu_context *ctx, int i, en.n_descsz = sz; en.n_type = NT_SPU; - if (!dump_emit(cprm, &en, sizeof(en))) - goto Eio; + rc = spufs_dump_write(file, &en, sizeof(en), foffset); + if (rc) + goto out; - if (!dump_emit(cprm, fullname, en.n_namesz)) - goto Eio; + rc = spufs_dump_write(file, fullname, en.n_namesz, foffset); + if (rc) + goto out; - if (!dump_align(cprm, 4)) - goto Eio; + rc = spufs_dump_align(file, buf, roundup(*foffset, 4), foffset); + if (rc) + goto out; do { - rc = do_coredump_read(i, ctx, buf, bufsz, &pos); - if (rc > 0) { - if (!dump_emit(cprm, buf, rc)) - goto Eio; - total += rc; + nread = do_coredump_read(i, ctx, buf, bufsz, &pos); + if (nread > 0) { + rc = spufs_dump_write(file, buf, nread, foffset); + if (rc) + goto out; + total += nread; } - } while (rc == bufsz && total < sz); + } while (nread == bufsz && total < sz); - if (rc < 0) + if (nread < 0) { + rc = nread; goto out; + } + + rc = spufs_dump_align(file, buf, roundup(*foffset - total + sz, 4), + foffset); - if (!dump_skip(cprm, - roundup(cprm->written - total + sz, 4) - cprm->written)) - goto Eio; out: free_page((unsigned long)buf); return rc; -Eio: - free_page((unsigned long)buf); - return -EIO; } -int spufs_coredump_extra_notes_write(struct coredump_params *cprm) +int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset) { struct spu_context *ctx; int fd, j, rc; @@ -194,7 +233,7 @@ int spufs_coredump_extra_notes_write(struct coredump_params *cprm) return rc; for (j = 0; spufs_coredump_read[j].name != NULL; j++) { - rc = spufs_arch_write_note(ctx, j, cprm, fd); + rc = spufs_arch_write_note(ctx, j, file, fd, foffset); if (rc) { spu_release_saved(ctx); return rc; diff --git a/arch/powerpc/platforms/cell/spufs/spufs.h b/arch/powerpc/platforms/cell/spufs/spufs.h index 0ba3c95..67852ad 100644 --- a/arch/powerpc/platforms/cell/spufs/spufs.h +++ b/arch/powerpc/platforms/cell/spufs/spufs.h @@ -247,13 +247,12 @@ extern const struct spufs_tree_descr spufs_dir_debug_contents[]; /* system call implementation */ extern struct spufs_calls spufs_calls; -struct coredump_params; long spufs_run_spu(struct spu_context *ctx, u32 *npc, u32 *status); long spufs_create(struct path *nd, struct dentry *dentry, unsigned int flags, umode_t mode, struct file *filp); /* ELF coredump callbacks for writing SPU ELF notes */ extern int spufs_coredump_extra_notes_size(void); -extern int spufs_coredump_extra_notes_write(struct coredump_params *cprm); +extern int spufs_coredump_extra_notes_write(struct file *file, loff_t *foffset); extern const struct file_operations spufs_context_fops; |