LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH] Fix ptrace compat wrapper for fpu register access
From: Michael Neuling @ 2009-03-29 23:57 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linuxppc-dev
In-Reply-To: <m2k568xlfg.fsf@igel.home>

> The ptrace compat wrapper mishandles access to the fpu registers.  The
> PTRACE_PEEKUSR and PTRACE_POKEUSR requests miscalculate the index into
> the fpr array due to the broken FPINDEX macro.  The
> PPC_PTRACE_PEEKUSR_3264 request needs to use the same formula that the
> native ptrace interface uses when operating on the register number (as
> opposed to the 4-byte offset).  The PPC_PTRACE_POKEUSR_3264 request
> didn't take TS_FPRWIDTH into account.
> 
> This was tested with the gdb testsuite on a G5.

So if you're looking fixing 32 bit apps ptracing 64 bit apps, does that
mean we can get a single 32 bit GDB that'll ptrace both 64 and 32 bit
apps?

I'd been looking for a ptrace test suite... thanks!

> Signed-off-by: Andreas Schwab <schwab@linux-m68k.org>
> 
> ---
> diff --git a/arch/powerpc/kernel/ptrace32.c b/arch/powerpc/kernel/ptrace32.c
> index 197d49c..f992eaf 100644
> --- a/arch/powerpc/kernel/ptrace32.c
> +++ b/arch/powerpc/kernel/ptrace32.c
> @@ -67,7 +67,7 @@ static long compat_ptrace_old(struct task_struct *child, lo
ng request,
>  /* Macros to workout the correct index for the FPR in the thread struct */
>  #define FPRNUMBER(i) (((i) - PT_FPR0) >> 1)
>  #define FPRHALF(i) (((i) - PT_FPR0) & 1)
> -#define FPRINDEX(i) TS_FPRWIDTH * FPRNUMBER(i) + FPRHALF(i)
> +#define FPRINDEX(i) TS_FPRWIDTH * FPRNUMBER(i) * 2 + FPRHALF(i)

ACK, I have the same patch here:
http://patchwork.ozlabs.org/patch/24940/

>  
>  long compat_arch_ptrace(struct task_struct *child, compat_long_t request,
>  			compat_ulong_t caddr, compat_ulong_t cdata)
> @@ -169,7 +169,7 @@ long compat_arch_ptrace(struct task_struct *child, compat
_long_t request,
>  		if (numReg >= PT_FPR0) {
>  			flush_fp_to_thread(child);
>  			tmp = ((unsigned long int *)child->thread.fpr)
> -				[FPRINDEX(numReg)];
> +				[TS_FPRWIDTH * (numReg - PT_FPR0)];
>  		} else { /* register within PT_REGS struct */
>  			tmp = ptrace_get_reg(child, numReg);
>  		} 
> @@ -263,7 +263,8 @@ long compat_arch_ptrace(struct task_struct *child, compat
_long_t request,
>  			ret = ptrace_put_reg(child, numReg, freg);
>  		} else {
>  			flush_fp_to_thread(child);
> -			((unsigned int *)child->thread.regs)[index] = data;
> +			((unsigned int *)child->thread.regs)
> +				[FPRINDEX(index)] = data;

This index is into the ptregs structure not the fpr.  I'm not sure the
FPRINDEX macro is applicable here.

Mikey

>  			ret = 0;
>  		}
>  		break;
> 
> -- 
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-dev
> 

^ permalink raw reply

* Build error
From: Benjamin Herrenschmidt @ 2009-03-30  3:25 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev list

My next branch (after merging from you):

ERROR: "fsl_pq_mdio_bus_name" [drivers/net/gianfar_driver.ko] undefined!

I'll ask Linus to pull anyway though.

Cheers,
Ben.

^ permalink raw reply

* [git pull] Please pull powerpc.git merge branch
From: Benjamin Herrenschmidt @ 2009-03-30  4:26 UTC (permalink / raw)
  To: Linus Torvalds; +Cc: linuxppc-dev list, Andrew Morton, Linux Kernel list

Hi Linus !

So here's is the powerpc main batch for this merge window. 

You'll notice some x86 and ftrace changes in there, they come from a
commit I pulled from Steven Rostedt that was a pre-req for some other
powerpc work in that area. The commit was pulled from a tree that Ingo
should have pulled too, at least that's how we decided to do things
back then, so there should be no problem.

Cheers,
Ben.

The following changes since commit 0d34fb8e93ceba7b6dad0062dbb4a0813bacd75b:
  Linus Torvalds (1):
        Merge branch 'bzip2-lzma-for-linus' of git://git.kernel.org/.../x86/linux-2.6-tip

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git next

Andrew Klossner (1):
      powerpc/udbg: Fix lost byte during console handover; change LFCR to CRLF

Anton Blanchard (11):
      powerpc/mm: Move 64-bit unmapped_area to top of address space
      powerpc/mm: Reduce hashtable size when using 64kB pages
      powerpc: Move is_32bit_task
      powerpc: Rearrange mmap.c
      powerpc: Randomise mmap start address
      powerpc: More stack randomisation for 64bit binaries
      powerpc: Randomise lower bits of stack address
      powerpc: Randomise the brk region
      powerpc: Ensure random space between stack and mmaps
      powerpc: Increase stack gap on 64bit binaries
      powerpc: Randomise PIEs

Anton Vorontsov (10):
      powerpc/fsl_pci: Add MPC83xx PCI-E controller RC mode support
      powerpc/83xx: Add PCI-E support for all MPC83xx boards with PCI-E
      powerpc: Document FSL eSDHC bindings
      powerpc/83xx: Convert existing sdhc nodes to new bindings
      powerpc/83xx: Add FSL eSDHC support for MPC837x-RDB boards
      powerpc/83xx: Do not configure or probe disabled FSL DR USB controllers
      powerpc/83xx: Add power management support for MPC837x boards
      powerpc/83xx: Move gianfar mdio nodes under the ethernet nodes
      powerpc/85xx: Move gianfar mdio nodes under the ethernet nodes
      powerpc/86xx: Move gianfar mdio nodes under the ethernet nodes

Arnd Bergmann (2):
      powerpc/cell: Fix dependency in cpufreq
      powerpc/spufs: Initialize ctx->stats.tstamp correctly

Benjamin Herrenschmidt (29):
      Merge commit 'kumar/next' into next
      Merge commit 'gcl/next' into next
      powerpc/mm: Rework I$/D$ coherency (v3)
      powerpc/4xx: Add missing USB and i2c devices to Canyonlands
      powerpc/4xx: Enable PCI domains on 4xx
      Merge commit 'origin/master' into next
      Merge commit 'kumar/next' into next
      Merge commit 'ftrace/function-graph' into next
      Merge commit 'jwb/next' into next
      Merge commit 'gcl/next' into next
      Merge commit 'origin/master' into next
      powerpc: Wire up /proc/vmallocinfo to our ioremap()
      powerpc/mm: Properly wire up get_user_pages_fast() on 32-bit
      powerpc/kconfig: Kill PPC_MULTIPLATFORM
      powerpc/mm: Split the various pgtable-* headers based on MMU type
      powerpc/mm: Unify PTE_RPN_SHIFT and _PAGE_CHG_MASK definitions
      Merge commit 'kumar/next' into next
      Merge commit 'gcl/next' into next
      Merge commit 'origin/master' into next
      powerpc: Fix prom_init on 32-bit OF machines
      powerpc/mm: Tweak PTE bit combination definitions
      powerpc/mm: Merge various PTE bits and accessors definitions
      powerpc/mm: Rename arch/powerpc/kernel/mmap.c to mmap_64.c
      powerpc/mm: Fix printk type warning in mmu_context_nohash
      powerpc/mm: Add option for non-atomic PTE updates to ppc64
      powerpc/mm: Introduce early_init_mmu() on 64-bit
      powerpc: Fix bugs introduced by sysfs changes
      Merge commit 'kumar/next' into next
      Merge commit 'origin/master' into next

Benjamin Krill (1):
      powerpc/cell: Add rtas rtc calls for the QPACE platform

Brian King (1):
      powerpc/pseries: Fix partition migration hang under load

Gabriel Paubert (1):
      powerpc: Disable mv643xx Ethernet port 0 on Pegasos

Geoff Levand (2):
      powerpc: Add missing DABR flags
      powerpc/ps3: Print memory hotplug errors

Gerhard Pircher (4):
      powerpc/amigaone: Add platform support for AmigaOne
      powerpc/amigaone: Generic device tree for all AmigaOne boards
      powerpc/amigaone: Bootwrapper and serial console support for AmigaOne
      powerpc/amigaone: Default config for AmigaOne boards

Giuliano Pochini (1):
      powerpc/powermac: Hotplug /sys entries are missing

Grant Likely (12):
      powerpc/5200: Stop using device_type and port-number properties
      powerpc/5200: Trim cruft from device trees
      powerpc/5200: Don't specify IRQF_SHARED in PSC UART driver
      powerpc/5200: Remove pr_debug() from hot paths in irq driver
      powerpc/5200: Refactor mpc5200 interrupt controller driver
      powerpc/5200: Rework GPT driver to also be an IRQ controller
      powerpc/5200: Add support for the Media5200 board from Freescale
      powerpc/5200: Add 'simple-bus' to the of_platform probe list.
      powerpc/4xx: update ml507 .dts file to release reference design
      powerpc/5200: remove sysfs debug file from GPT driver
      powerpc/bootwrapper: add fixed-head.o to simpleimage wrappers
      powerpc/cpm2: fix building fs_enet driver as a module.

Grzegorz Bernacki (3):
      powerpc/5200: Add support for the digsy MTC board.
      powerpc/5200: Add digsy-mtc support to mpc5200_defconfig
      powerpc/5200: On the digsy-mtc, configure PSC4 and PSC5 as UARTs

Ilya Yanok (1):
      powerpc: Rework dma-noncoherent to use generic vmalloc layer

Jeremy Kerr (10):
      powerpc/spufs: Use correct return value for spu_handle_mm_fault
      powerpc/spufs: Clear purge status before setting up isolated mode
      powerpc/spufs: Constify context contents and coredump callback constants
      powerpc/spufs: Check file offset before calculating write size in fixed-sized files
      powerpc/spufs: Fix incorrect buffer offset in regs write
      powerpc: Fix page_ins details in lppaca comments
      powerpc: Add dispatch trace log fields to lppaca
      powerpc: Add virtual processor dispatch trace log
      powerpc/cell: Fix iommu exception reporting
      powerpc: Add write barrier before enabling DTL flags

John Linn (1):
      powerpc/virtex/spi: Xilinx SPI driver not releasing memory

Josh Boyer (1):
      powerpc: Sanitize stack pointer in signal handling code

Kumar Gala (19):
      powerpc/fsl-booke: Cleanup init/exception setup to be runtime
      powerpc/fsl: Ensure PCI_QUIRKS are enabled for FSL_PCI
      powerpc/85xx: Fixed PCI IO region sizes in mpc8572ds*.dts
      powerpc/85xx: Added 36-bit physical device tree for mpc8572ds board
      powerpc/fsl-booke: Add new ISA 2.06 page sizes and MAS defines
      powerpc/book-3e: Introduce concept of Book-3e MMU
      powerpc/fsl-booke: Fix compile warning
      powerpc: Unify opcode definitions and support
      powerpc: Fix warnings from make headers_check
      powerpc: Add support for using doorbells for SMP IPI
      powerpc/fsl-booke: Add support for tlbilx instructions
      powerpc/85xx: Update smp support to handle doorbells and non-mpic init
      powerpc/pci: Default to dma_direct_ops for pci dma_ops
      powerpc: setup default archdata for {of_}platform via bus_register_notifier
      powerpc: expect all devices calling dma ops to have archdata set
      powerpc/mm: Remove unused register usage in SW TLB miss handling
      powerpc/mm: Used free register to save a few cycles in SW TLB miss handling
      powerpc/mm: e300c2/c3/c4 TLB errata workaround
      powerpc/83xx: Update ranges in gianfar node to match other dts

Laurent Pinchart (1):
      cpm2: Round the baud-rate clock divider to the nearest integer.

Liu Yu (1):
      powerpc/math-emu: Fix efp dependence

Madhulika Madishetty (1):
      AMCC PPC 460SX redwood SoC platform initial framework

Martyn Welch (7):
      powerpc/86xx: Board support for GE Fanuc SBC310
      powerpc/86xx: Default configutation for GE Fanuc's SBC310
      powerpc/86xx: Extend GE Fanuc GPIO driver for the SBC310
      powerpc/86xx: Correct local bus registers in GE Fanuc SBC610 dts file
      powerpc/86xx: Run sbc310 USB fixup code only on the appropriate platform.
      powerpc/86xx: Board support for GE Fanuc's PPC9A
      powerpc/86xx: Default configuration for GE Fanuc's PPC9A

Michael Ellerman (20):
      powerpc: Remove unused ppc64_terminate_msg()
      powerpc: Allow debugging of LMBs with lmb=debug
      lmb: Rework lmb_dump_all() output
      powerpc/pseries: Fix MSI-X interrupt querying
      powerpc/pseries: Add support for ibm,req#msi-x
      powerpc/pseries: Check for MSI-X also in rtas_msi_pci_irq_fixup()
      powerpc/pseries: Return the number of MSIs we could allocate
      powerpc/pseries: Return req#msi(-x) if request is larger
      powerpc/pseries: Implement a quota system for MSIs
      powerpc: Deindentify identify_cpu()
      powerpc: Make sure we copy all cpu_spec features except PMC related ones
      powerpc: Remove unused asm-offsets entries for cpu_spec
      powerpc: Print linux_banner in prom_init
      powerpc/pseries: Reject discontiguous/non-zero based MSI-X requests
      powerpc/pseries: The pseries MSI code depends on EEH
      powerpc/cell: Fix Axon MSI driver dependencies
      powerpc/pseries: The RPA PCI hotplug driver depends on EEH
      powerpc/cell: Make axonram depends on BLOCK
      powerpc/msi: Mark the MSI bitmap selftest code as __init
      powerpc: Turn on self-tests in ppc64_defconfig

Michael Neuling (2):
      powerpc: Add alignment handler for new lfiwzx instruction
      powerpc: Fix load/store float double alignment handler

Mike Mason (1):
      powerpc/eeh: Only disable/enable LSI interrupts in EEH

Milton Miller (4):
      powerpc/numa: Avoid possible reference beyond prop. length in find_min_common_depth()
      powerpc/numa: Remove redundant find_cpu_node()
      powerpc/pseries: Remove write only variable in PCI DLPAR
      powerpc/pci: Move hose_list and pci_address_to_pio to pci-common

Nathan Fontenot (2):
      powerpc/numa: Cleanup hot_add_scn_to_nid
      powerpc/pseries: Failed reconfig notifier chain call cleanup

Nick Piggin (1):
      powerpc: Estimate G5 cpufreq transition latency

Octavian Purdila (2):
      powerpc/oprofile: G4 oprofile has variable number of counters
      powerpc/oprofile: Enable support for ppc750 processors

Peter Korsgaard (1):
      powerpc: convert dts-bindings/fsl/dma.txt to dts-v1 syntax

Reynes Philippe (3):
      powerpc/83xx: Add i2c eeprom to dts for MPC837x RDB
      powerpc/83xx: Add gpio to MPC837x RDB
      powerpc/83xx: Add lm75 to MPC837x RDB dts

Rusty Russell (2):
      powerpc: Make sysfs code use smp_call_function_single
      cpumask: Use mm_cpumask() wrapper instead of cpu_vm_mask

Stephen Rothwell (1):
      powerpc/pmi: Irq handlers return irqreturn_t

Steven Rostedt (11):
      tracing/function-graph-tracer: make arch generic push pop functions
      ftrace, powerpc: replace debug macro with proper pr_deug
      powerpc, ftrace: fix compile error when modules not configured
      powerpc64: port of the function graph tracer
      powerpc64, tracing: add function graph tracer with dynamic tracing
      powerpc64, ftrace: save toc only on modules for function graph
      powerpc32, ftrace: save and restore mcount regs with macro
      powerpc32, ftrace: port function graph tracer to ppc32, static only
      powerpc32, ftrace: dynamic function graph tracer
      powerpc, ftrace: use unsigned int for instruction manipulation
      powerpc, ftrace: use create_branch lib function

Ted Peters (1):
      powerpc/85xx: Fix MPC8572DS PCI protected interrupt sources

Thomas Gleixner (3):
      powerpc/irq: Convert obsolete irq_desc_t to struct irq_desc
      powerpc/irq: Convert obsolete hw_interrupt_type to struct irq_chip
      powerpc/85xx: remove setup_irq(NULL action) in ksi8560

Timur Tabi (4):
      i2c-mpc: do not allow interruptions when waiting for I2C to complete
      powerpc: add fsl,fifo-depth property to Freescale SSI device nodes
      powerpc: Add defintion for MSR[GS] to list of MSR bits
      powerpc: clean up ssi.txt, add definition for fsl,ssi-asynchronous

Tom Arbuckle (1):
      powerpc/pci: Fix PCI<->OF matching of old style multifunc devices

Trent Piepho (3):
      powerpc/fsl-booke: Remove code duplication in lowmem mapping
      powerpc/fsl-booke: Allow larger CAM sizes than 256 MB
      powerpc/fsl-booke: Make CAM entries used for lowmem configurable

Wolfgang Grandegger (4):
      powerpc/85xx: TQM85xx - fix sensitivity of CAN interrupts
      powerpc/85xx: TQM85xx - add i2c device nodes for LM75
      powerpc/5200: add function to return external clock frequency
      powerpc/85xx: Add support for the "socrates" board (MPC8544).

Wolfram Sang (2):
      powerpc/pci: Fix typo: s/resouces/resources/ in a pr_debug
      powerpc/5200: add Phytec phyCORE-MPC5200B-IO board (pcm032)

Xiaotian Feng (1):
      cpm_uart: fix non-console port startup bug

Yuri Tikhonov (1):
      powerpc/44x: Support for 256KB PAGE_SIZE

dayu@datangmobile.cn (1):
      powerpc/83xx: Fix the interrupt loss problem on ipic

roel kluin (2):
      therm_adt746x: Fix signed/unsigned confusion
      powerpc/ps3: Make ps3av_set_video_mode mode ID signed

 Documentation/powerpc/dts-bindings/fsl/dma.txt     |   34 +-
 Documentation/powerpc/dts-bindings/fsl/esdhc.txt   |   24 +
 Documentation/powerpc/dts-bindings/fsl/ssi.txt     |   68 +-
 arch/powerpc/Kconfig                               |   74 +-
 arch/powerpc/Kconfig.debug                         |    2 +-
 arch/powerpc/Makefile                              |    4 +-
 arch/powerpc/boot/Makefile                         |    9 +-
 arch/powerpc/boot/cuboot-amigaone.c                |   35 +
 arch/powerpc/boot/dts/amigaone.dts                 |  173 ++
 arch/powerpc/boot/dts/asp834x-redboot.dts          |   82 +-
 arch/powerpc/boot/dts/canyonlands.dts              |   28 +
 arch/powerpc/boot/dts/cm5200.dts                   |   49 +-
 arch/powerpc/boot/dts/digsy_mtc.dts                |  254 +++
 arch/powerpc/boot/dts/gef_ppc9a.dts                |  367 ++++
 arch/powerpc/boot/dts/gef_sbc310.dts               |  367 ++++
 arch/powerpc/boot/dts/gef_sbc610.dts               |   41 +-
 arch/powerpc/boot/dts/ksi8560.dts                  |   79 +-
 arch/powerpc/boot/dts/lite5200.dts                 |   52 +-
 arch/powerpc/boot/dts/lite5200b.dts                |   63 +-
 arch/powerpc/boot/dts/media5200.dts                |  318 ++++
 arch/powerpc/boot/dts/motionpro.dts                |   42 +-
 arch/powerpc/boot/dts/mpc8313erdb.dts              |   11 +-
 arch/powerpc/boot/dts/mpc8315erdb.dts              |  144 ++-
 arch/powerpc/boot/dts/mpc8349emitx.dts             |   69 +-
 arch/powerpc/boot/dts/mpc8349emitxgp.dts           |   42 +-
 arch/powerpc/boot/dts/mpc834x_mds.dts              |   81 +-
 arch/powerpc/boot/dts/mpc8377_mds.dts              |  211 ++-
 arch/powerpc/boot/dts/mpc8377_rdb.dts              |  229 ++-
 arch/powerpc/boot/dts/mpc8378_mds.dts              |  209 ++-
 arch/powerpc/boot/dts/mpc8378_rdb.dts              |  229 ++-
 arch/powerpc/boot/dts/mpc8379_mds.dts              |  146 +-
 arch/powerpc/boot/dts/mpc8379_rdb.dts              |  164 ++-
 arch/powerpc/boot/dts/mpc8536ds.dts                |   78 +-
 arch/powerpc/boot/dts/mpc8540ads.dts               |  117 +-
 arch/powerpc/boot/dts/mpc8541cds.dts               |   78 +-
 arch/powerpc/boot/dts/mpc8544ds.dts                |   81 +-
 arch/powerpc/boot/dts/mpc8548cds.dts               |  156 +-
 arch/powerpc/boot/dts/mpc8555cds.dts               |   78 +-
 arch/powerpc/boot/dts/mpc8560ads.dts               |  102 +-
 arch/powerpc/boot/dts/mpc8568mds.dts               |  102 +-
 arch/powerpc/boot/dts/mpc8572ds.dts                |  160 +-
 arch/powerpc/boot/dts/mpc8572ds_36b.dts            |  799 +++++++++
 arch/powerpc/boot/dts/mpc8572ds_camp_core0.dts     |   49 +-
 arch/powerpc/boot/dts/mpc8572ds_camp_core1.dts     |    6 +-
 arch/powerpc/boot/dts/mpc8610_hpcd.dts             |    2 +
 arch/powerpc/boot/dts/mpc8641_hpcn.dts             |  157 +-
 arch/powerpc/boot/dts/pcm030.dts                   |  182 +--
 arch/powerpc/boot/dts/pcm032.dts                   |  392 ++++
 arch/powerpc/boot/dts/redwood.dts                  |  244 +++
 arch/powerpc/boot/dts/sbc8349.dts                  |   80 +-
 arch/powerpc/boot/dts/sbc8548.dts                  |   78 +-
 arch/powerpc/boot/dts/sbc8560.dts                  |  100 +-
 arch/powerpc/boot/dts/sbc8641d.dts                 |  156 +-
 arch/powerpc/boot/dts/socrates.dts                 |  338 ++++
 arch/powerpc/boot/dts/stx_gp3_8560.dts             |   78 +-
 arch/powerpc/boot/dts/tqm5200.dts                  |   32 +-
 arch/powerpc/boot/dts/tqm8540.dts                  |  122 +-
 arch/powerpc/boot/dts/tqm8541.dts                  |   95 +-
 arch/powerpc/boot/dts/tqm8548-bigflash.dts         |  177 +-
 arch/powerpc/boot/dts/tqm8548.dts                  |  177 +-
 arch/powerpc/boot/dts/tqm8555.dts                  |   95 +-
 arch/powerpc/boot/dts/tqm8560.dts                  |   99 +-
 arch/powerpc/boot/dts/virtex440-ml507.dts          |  124 ++-
 arch/powerpc/boot/serial.c                         |    3 +-
 arch/powerpc/boot/wrapper                          |    7 +-
 arch/powerpc/configs/44x/canyonlands_defconfig     |  266 +++-
 arch/powerpc/configs/44x/redwood_defconfig         | 1176 ++++++++++++
 arch/powerpc/configs/85xx/socrates_defconfig       | 1410 +++++++++++++++
 arch/powerpc/configs/86xx/gef_ppc9a_defconfig      | 1889 ++++++++++++++++++++
 arch/powerpc/configs/86xx/gef_sbc310_defconfig     | 1613 +++++++++++++++++
 arch/powerpc/configs/amigaone_defconfig            | 1636 +++++++++++++++++
 arch/powerpc/configs/mpc5200_defconfig             |   71 +-
 arch/powerpc/configs/ppc64_defconfig               |    6 +-
 arch/powerpc/include/asm/code-patching.h           |    4 +-
 arch/powerpc/include/asm/cputable.h                |    4 +-
 arch/powerpc/include/asm/dbell.h                   |   43 +
 arch/powerpc/include/asm/dma-mapping.h             |   12 +-
 arch/powerpc/include/asm/elf.h                     |   12 +-
 arch/powerpc/include/asm/fixmap.h                  |    2 +-
 arch/powerpc/include/asm/ftrace.h                  |   39 +-
 arch/powerpc/include/asm/highmem.h                 |   12 +-
 arch/powerpc/include/asm/hw_irq.h                  |    2 +-
 arch/powerpc/include/asm/io.h                      |    6 +
 arch/powerpc/include/asm/lppaca.h                  |    8 +-
 arch/powerpc/include/asm/machdep.h                 |    4 +-
 arch/powerpc/include/asm/mmu-44x.h                 |    2 +
 .../include/asm/{mmu-fsl-booke.h => mmu-book3e.h}  |   66 +-
 arch/powerpc/include/asm/mmu-hash64.h              |    2 -
 arch/powerpc/include/asm/mmu.h                     |   20 +-
 arch/powerpc/include/asm/mmu_context.h             |    2 +-
 arch/powerpc/include/asm/mpc52xx.h                 |    1 +
 arch/powerpc/include/asm/page.h                    |    6 +-
 arch/powerpc/include/asm/page_32.h                 |    4 +
 arch/powerpc/include/asm/pgtable-4k.h              |  117 --
 arch/powerpc/include/asm/pgtable-ppc32.h           |  557 +------
 arch/powerpc/include/asm/pgtable-ppc64-4k.h        |   74 +
 arch/powerpc/include/asm/pgtable-ppc64-64k.h       |   42 +
 arch/powerpc/include/asm/pgtable-ppc64.h           |  196 +--
 arch/powerpc/include/asm/pgtable.h                 |  134 ++
 arch/powerpc/include/asm/ppc-opcode.h              |   73 +
 arch/powerpc/include/asm/ppc_asm.h                 |    6 +-
 arch/powerpc/include/asm/processor.h               |   19 +
 arch/powerpc/include/asm/ps3av.h                   |    2 +-
 arch/powerpc/include/asm/ps3fb.h                   |    1 +
 arch/powerpc/include/asm/pte-40x.h                 |   64 +
 arch/powerpc/include/asm/pte-44x.h                 |  102 ++
 arch/powerpc/include/asm/pte-8xx.h                 |   67 +
 arch/powerpc/include/asm/pte-common.h              |  180 ++
 arch/powerpc/include/asm/pte-fsl-booke.h           |   48 +
 arch/powerpc/include/asm/pte-hash32.h              |   48 +
 arch/powerpc/include/asm/pte-hash64-4k.h           |   17 +
 .../asm/{pgtable-64k.h => pte-hash64-64k.h}        |  132 +-
 arch/powerpc/include/asm/pte-hash64.h              |   54 +
 arch/powerpc/include/asm/reg.h                     |    2 +
 arch/powerpc/include/asm/reg_booke.h               |    2 +
 arch/powerpc/include/asm/system.h                  |    2 +-
 arch/powerpc/include/asm/thread_info.h             |   11 +-
 arch/powerpc/include/asm/udbg.h                    |    1 +
 arch/powerpc/kernel/Makefile                       |   12 +-
 arch/powerpc/kernel/align.c                        |    2 +-
 arch/powerpc/kernel/asm-offsets.c                  |    3 -
 arch/powerpc/kernel/cpu_setup_44x.S                |    1 +
 arch/powerpc/kernel/cpu_setup_6xx.S                |    5 +
 arch/powerpc/kernel/cpu_setup_fsl_booke.S          |   31 +
 arch/powerpc/kernel/cputable.c                     |  166 ++-
 arch/powerpc/kernel/crash_dump.c                   |    2 +-
 arch/powerpc/kernel/dbell.c                        |   44 +
 arch/powerpc/kernel/entry_32.S                     |  129 +-
 arch/powerpc/kernel/entry_64.S                     |   89 +-
 arch/powerpc/kernel/ftrace.c                       |  222 ++-
 arch/powerpc/kernel/head_32.S                      |  101 +-
 arch/powerpc/kernel/head_64.S                      |    6 +-
 arch/powerpc/kernel/head_booke.h                   |   19 +-
 arch/powerpc/kernel/head_fsl_booke.S               |  101 +-
 arch/powerpc/kernel/irq.c                          |    4 +-
 arch/powerpc/kernel/module_64.c                    |    2 +-
 arch/powerpc/kernel/pci-common.c                   |   45 +-
 arch/powerpc/kernel/pci_32.c                       |   36 +-
 arch/powerpc/kernel/pci_64.c                       |   19 -
 arch/powerpc/kernel/process.c                      |   58 +
 arch/powerpc/kernel/prom.c                         |    6 +-
 arch/powerpc/kernel/prom_init.c                    |    2 +
 arch/powerpc/kernel/prom_init_check.sh             |    2 +-
 arch/powerpc/kernel/rtas.c                         |   10 +-
 arch/powerpc/kernel/setup-common.c                 |   36 +
 arch/powerpc/kernel/setup_64.c                     |   42 +-
 arch/powerpc/kernel/signal.c                       |    4 +-
 arch/powerpc/kernel/signal.h                       |   12 +-
 arch/powerpc/kernel/signal_32.c                    |    4 +-
 arch/powerpc/kernel/signal_64.c                    |    2 +-
 arch/powerpc/kernel/sysfs.c                        |   35 +-
 arch/powerpc/kernel/traps.c                        |   79 +-
 arch/powerpc/kernel/udbg.c                         |    7 +
 arch/powerpc/kernel/udbg_16550.c                   |   60 +-
 arch/powerpc/kernel/vmlinux.lds.S                  |    1 +
 arch/powerpc/lib/dma-noncoherent.c                 |  303 +---
 arch/powerpc/lib/feature-fixups.c                  |    4 +-
 arch/powerpc/math-emu/Makefile                     |    5 +-
 arch/powerpc/mm/Makefile                           |    4 +-
 arch/powerpc/mm/fault.c                            |   46 +-
 arch/powerpc/mm/fsl_booke_mmu.c                    |   95 +-
 arch/powerpc/mm/gup.c                              |   16 +-
 arch/powerpc/mm/hash_utils_64.c                    |   51 +-
 arch/powerpc/mm/mem.c                              |   33 -
 arch/powerpc/mm/{mmap.c => mmap_64.c}              |   64 +-
 arch/powerpc/mm/mmu_context_nohash.c               |    4 +-
 arch/powerpc/mm/numa.c                             |  174 +-
 arch/powerpc/mm/pgtable.c                          |  134 ++-
 arch/powerpc/mm/pgtable_32.c                       |   18 +-
 arch/powerpc/mm/pgtable_64.c                       |   25 +-
 arch/powerpc/mm/ppc_mmu_32.c                       |   10 +-
 arch/powerpc/mm/tlb_hash64.c                       |    6 +-
 arch/powerpc/mm/tlb_nohash.c                       |   18 +-
 arch/powerpc/mm/tlb_nohash_low.S                   |   44 +-
 arch/powerpc/oprofile/op_model_7450.c              |   21 +-
 arch/powerpc/platforms/44x/Kconfig                 |   19 +
 arch/powerpc/platforms/44x/ppc44x_simple.c         |    1 +
 arch/powerpc/platforms/512x/Kconfig                |    4 +-
 arch/powerpc/platforms/52xx/Kconfig                |   15 +-
 arch/powerpc/platforms/52xx/Makefile               |    3 +-
 arch/powerpc/platforms/52xx/media5200.c            |  273 +++
 arch/powerpc/platforms/52xx/mpc5200_simple.c       |    4 +-
 arch/powerpc/platforms/52xx/mpc52xx_common.c       |   40 +-
 arch/powerpc/platforms/52xx/mpc52xx_gpio.c         |   85 -
 arch/powerpc/platforms/52xx/mpc52xx_gpt.c          |  396 ++++
 arch/powerpc/platforms/52xx/mpc52xx_pic.c          |  170 +--
 arch/powerpc/platforms/82xx/Kconfig                |    2 +-
 arch/powerpc/platforms/83xx/Kconfig                |    2 +-
 arch/powerpc/platforms/83xx/asp834x.c              |    1 +
 arch/powerpc/platforms/83xx/mpc831x_rdb.c          |    2 +
 arch/powerpc/platforms/83xx/mpc834x_itx.c          |    1 +
 arch/powerpc/platforms/83xx/mpc834x_mds.c          |    1 +
 arch/powerpc/platforms/83xx/mpc837x_mds.c          |   11 +-
 arch/powerpc/platforms/83xx/mpc837x_rdb.c          |    3 +
 arch/powerpc/platforms/83xx/sbc834x.c              |    1 +
 arch/powerpc/platforms/83xx/usb.c                  |    3 +-
 arch/powerpc/platforms/85xx/Kconfig                |    6 +
 arch/powerpc/platforms/85xx/Makefile               |    1 +
 arch/powerpc/platforms/85xx/ksi8560.c              |    3 +-
 arch/powerpc/platforms/85xx/mpc8536_ds.c           |    1 +
 arch/powerpc/platforms/85xx/mpc85xx_ads.c          |    1 +
 arch/powerpc/platforms/85xx/mpc85xx_cds.c          |    1 +
 arch/powerpc/platforms/85xx/mpc85xx_ds.c           |    1 +
 arch/powerpc/platforms/85xx/mpc85xx_mds.c          |    1 +
 arch/powerpc/platforms/85xx/sbc8548.c              |    1 +
 arch/powerpc/platforms/85xx/sbc8560.c              |    1 +
 arch/powerpc/platforms/85xx/smp.c                  |   43 +-
 arch/powerpc/platforms/85xx/socrates.c             |  133 ++
 arch/powerpc/platforms/85xx/socrates_fpga_pic.c    |  327 ++++
 arch/powerpc/platforms/85xx/socrates_fpga_pic.h    |   16 +
 arch/powerpc/platforms/85xx/stx_gp3.c              |    1 +
 arch/powerpc/platforms/85xx/tqm85xx.c              |    1 +
 arch/powerpc/platforms/86xx/Kconfig                |   20 +-
 arch/powerpc/platforms/86xx/Makefile               |    2 +
 arch/powerpc/platforms/86xx/gef_gpio.c             |   36 +-
 arch/powerpc/platforms/86xx/gef_ppc9a.c            |  224 +++
 arch/powerpc/platforms/86xx/gef_sbc310.c           |  235 +++
 arch/powerpc/platforms/86xx/gef_sbc610.c           |    1 +
 arch/powerpc/platforms/86xx/mpc8610_hpcd.c         |    1 +
 arch/powerpc/platforms/86xx/mpc86xx_hpcn.c         |    1 +
 arch/powerpc/platforms/86xx/sbc8641d.c             |    1 +
 arch/powerpc/platforms/Kconfig                     |   39 +-
 arch/powerpc/platforms/Kconfig.cputype             |   22 +-
 arch/powerpc/platforms/Makefile                    |    1 +
 arch/powerpc/platforms/amigaone/Kconfig            |   18 +
 arch/powerpc/platforms/amigaone/Makefile           |    1 +
 arch/powerpc/platforms/amigaone/setup.c            |  170 ++
 arch/powerpc/platforms/cell/Kconfig                |   33 +-
 arch/powerpc/platforms/cell/Makefile               |    2 +-
 arch/powerpc/platforms/cell/io-workarounds.c       |    4 +-
 arch/powerpc/platforms/cell/iommu.c                |    9 +-
 arch/powerpc/platforms/cell/qpace_setup.c          |   15 +-
 arch/powerpc/platforms/cell/spu_base.c             |    2 +-
 arch/powerpc/platforms/cell/spu_fault.c            |   48 +-
 arch/powerpc/platforms/cell/spufs/context.c        |    4 +
 arch/powerpc/platforms/cell/spufs/file.c           |   20 +-
 arch/powerpc/platforms/cell/spufs/inode.c          |    5 +-
 arch/powerpc/platforms/cell/spufs/run.c            |    3 +
 arch/powerpc/platforms/cell/spufs/spufs.h          |    8 +-
 arch/powerpc/platforms/chrp/Kconfig                |    2 +-
 arch/powerpc/platforms/chrp/pegasos_eth.c          |   72 +-
 arch/powerpc/platforms/embedded6xx/Kconfig         |    2 +-
 arch/powerpc/platforms/iseries/Kconfig             |    2 +-
 arch/powerpc/platforms/iseries/irq.c               |    2 +-
 arch/powerpc/platforms/iseries/setup.c             |    2 +-
 arch/powerpc/platforms/maple/Kconfig               |    2 +-
 arch/powerpc/platforms/pasemi/Kconfig              |    2 +-
 arch/powerpc/platforms/powermac/Kconfig            |    2 +-
 arch/powerpc/platforms/powermac/cpufreq_64.c       |    5 +-
 arch/powerpc/platforms/powermac/pic.h              |    2 +-
 arch/powerpc/platforms/powermac/setup.c            |    3 +
 arch/powerpc/platforms/prep/Kconfig                |    2 +-
 arch/powerpc/platforms/ps3/Kconfig                 |    2 +-
 arch/powerpc/platforms/ps3/mm.c                    |    4 +-
 arch/powerpc/platforms/pseries/Kconfig             |   17 +-
 arch/powerpc/platforms/pseries/Makefile            |    3 +-
 arch/powerpc/platforms/pseries/dtl.c               |  278 +++
 arch/powerpc/platforms/pseries/eeh_driver.c        |   68 +-
 arch/powerpc/platforms/pseries/msi.c               |  248 +++-
 arch/powerpc/platforms/pseries/pci_dlpar.c         |    2 -
 arch/powerpc/platforms/pseries/plpar_wrappers.h    |   10 +
 arch/powerpc/platforms/pseries/reconfig.c          |    6 +-
 arch/powerpc/sysdev/cpm2.c                         |    4 +-
 arch/powerpc/sysdev/cpm_common.c                   |    2 +-
 arch/powerpc/sysdev/fsl_pci.c                      |  244 +++-
 arch/powerpc/sysdev/fsl_soc.c                      |    4 +
 arch/powerpc/sysdev/ipic.c                         |    6 +-
 arch/powerpc/sysdev/msi_bitmap.c                   |    6 +-
 arch/powerpc/sysdev/pmi.c                          |    2 +-
 arch/powerpc/sysdev/ppc4xx_pci.c                   |    2 +
 arch/x86/include/asm/ftrace.h                      |   25 -
 arch/x86/kernel/dumpstack.c                        |    1 +
 arch/x86/kernel/ftrace.c                           |   75 +-
 drivers/i2c/busses/i2c-mpc.c                       |    9 +-
 drivers/macintosh/therm_adt746x.c                  |    4 +-
 drivers/net/fec_mpc52xx.c                          |    6 +-
 drivers/ps3/ps3av.c                                |   16 +-
 drivers/serial/cpm_uart/cpm_uart_core.c            |   14 +-
 drivers/serial/mpc52xx_uart.c                      |   40 +-
 drivers/spi/xilinx_spi.c                           |    9 +-
 drivers/watchdog/Kconfig                           |    2 +-
 include/linux/ftrace.h                             |   24 +
 include/linux/pci_ids.h                            |    8 +
 kernel/trace/trace_functions_graph.c               |   75 +
 lib/lmb.c                                          |   42 +-
 285 files changed, 20157 insertions(+), 4688 deletions(-)
 create mode 100644 Documentation/powerpc/dts-bindings/fsl/esdhc.txt
 create mode 100644 arch/powerpc/boot/cuboot-amigaone.c
 create mode 100644 arch/powerpc/boot/dts/amigaone.dts
 create mode 100644 arch/powerpc/boot/dts/digsy_mtc.dts
 create mode 100644 arch/powerpc/boot/dts/gef_ppc9a.dts
 create mode 100644 arch/powerpc/boot/dts/gef_sbc310.dts
 create mode 100644 arch/powerpc/boot/dts/media5200.dts
 create mode 100644 arch/powerpc/boot/dts/mpc8572ds_36b.dts
 create mode 100644 arch/powerpc/boot/dts/pcm032.dts
 create mode 100644 arch/powerpc/boot/dts/redwood.dts
 create mode 100644 arch/powerpc/boot/dts/socrates.dts
 create mode 100644 arch/powerpc/configs/44x/redwood_defconfig
 create mode 100644 arch/powerpc/configs/85xx/socrates_defconfig
 create mode 100644 arch/powerpc/configs/86xx/gef_ppc9a_defconfig
 create mode 100644 arch/powerpc/configs/86xx/gef_sbc310_defconfig
 create mode 100644 arch/powerpc/configs/amigaone_defconfig
 create mode 100644 arch/powerpc/include/asm/dbell.h
 rename arch/powerpc/include/asm/{mmu-fsl-booke.h => mmu-book3e.h} (53%)
 delete mode 100644 arch/powerpc/include/asm/pgtable-4k.h
 create mode 100644 arch/powerpc/include/asm/pgtable-ppc64-4k.h
 create mode 100644 arch/powerpc/include/asm/pgtable-ppc64-64k.h
 create mode 100644 arch/powerpc/include/asm/ppc-opcode.h
 create mode 100644 arch/powerpc/include/asm/pte-40x.h
 create mode 100644 arch/powerpc/include/asm/pte-44x.h
 create mode 100644 arch/powerpc/include/asm/pte-8xx.h
 create mode 100644 arch/powerpc/include/asm/pte-common.h
 create mode 100644 arch/powerpc/include/asm/pte-fsl-booke.h
 create mode 100644 arch/powerpc/include/asm/pte-hash32.h
 create mode 100644 arch/powerpc/include/asm/pte-hash64-4k.h
 rename arch/powerpc/include/asm/{pgtable-64k.h => pte-hash64-64k.h} (73%)
 create mode 100644 arch/powerpc/include/asm/pte-hash64.h
 create mode 100644 arch/powerpc/kernel/cpu_setup_fsl_booke.S
 create mode 100644 arch/powerpc/kernel/dbell.c
 rename arch/powerpc/mm/{mmap.c => mmap_64.c} (65%)
 create mode 100644 arch/powerpc/platforms/52xx/media5200.c
 create mode 100644 arch/powerpc/platforms/52xx/mpc52xx_gpt.c
 create mode 100644 arch/powerpc/platforms/85xx/socrates.c
 create mode 100644 arch/powerpc/platforms/85xx/socrates_fpga_pic.c
 create mode 100644 arch/powerpc/platforms/85xx/socrates_fpga_pic.h
 create mode 100644 arch/powerpc/platforms/86xx/gef_ppc9a.c
 create mode 100644 arch/powerpc/platforms/86xx/gef_sbc310.c
 create mode 100644 arch/powerpc/platforms/amigaone/Kconfig
 create mode 100644 arch/powerpc/platforms/amigaone/Makefile
 create mode 100644 arch/powerpc/platforms/amigaone/setup.c
 create mode 100644 arch/powerpc/platforms/pseries/dtl.c

^ permalink raw reply

* Re: [PATCH 1/3] powerpc, Makefile: Make it possible to safely select CONFIG_FRAME_POINTER
From: Sam Ravnborg @ 2009-03-30  4:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt
  Cc: linux-kernel, linuxppc-dev, Steven Rostedt, Paul Mackerras,
	Ingo Molnar
In-Reply-To: <1238367290.20197.113.camel@pasglop>

On Mon, Mar 30, 2009 at 09:54:50AM +1100, Benjamin Herrenschmidt wrote:
> On Sat, 2009-03-28 at 13:48 +0300, Anton Vorontsov wrote:
> > On Fri, Mar 20, 2009 at 11:49:29PM -0400, Steven Rostedt wrote:
> > > Ben,
> > > 
> > > Can you ACK this patch? Or even take it in your tree?
> > 
> > Benjamin, have you had a chance to look into this? Sam, could
> > you also take a look?
> 
> Those patches look ok. I'm a little bit surprised that -mno-sched-epilog
> isn't needed, gcc weirdness never ceases to amaze me, but the
> Makefile/Kconfig churning isn't for me to judge. If Sam is happy, then
> let's merge it.

I will take a closer look tonight or tomorrow - as day-time job permits.

	Sam

^ permalink raw reply

* Re: [PATCH 1/2] ucc_geth: Move freeing of TX packets to NAPI context.
From: Li Yang @ 2009-03-30  7:36 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev, netdev
In-Reply-To: <OF073D5C49.F0D791DE-ONC1257586.0040163D-C1257586.00413F47@transmode.se>

On Fri, Mar 27, 2009 at 7:52 PM, Joakim Tjernlund
<Joakim.Tjernlund@transmode.se> wrote:
> pku.leo@gmail.com wrote on 27/03/2009 11:50:09:
>>
>> On Thu, Mar 26, 2009 at 8:54 PM, Joakim Tjernlund
>> <Joakim.Tjernlund@transmode.se> wrote:
>> > Also set NAPI weight to 64 as this is a common value.
>> > This will make the system alot more responsive while
>> > ping flooding the ucc_geth ethernet interaface.
>> >
>> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
>> > ---
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Errors and other events */
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ucce & UCCE_OTHER) {
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ucce & UCC_=
GETH_UCCE_BSY)
>> > @@ -3733,7 +3725,7 @@ static int ucc_geth_probe(struct of_device*
> ofdev, const struct of_device_id *ma
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0dev->netdev_ops =3D &ucc_geth_netdev_ops;
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0dev->watchdog_timeo =3D TX_TIMEOUT;
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0INIT_WORK(&ugeth->timeout_work, ucc_geth_ti=
meout_work);
>> > - =C2=A0 =C2=A0 =C2=A0 netif_napi_add(dev, &ugeth->napi, ucc_geth_poll=
,
> UCC_GETH_DEV_WEIGHT);
>> > + =C2=A0 =C2=A0 =C2=A0 netif_napi_add(dev, &ugeth->napi, ucc_geth_poll=
, 64);
>>
>> It doesn't make sense to have larger napi budget than the size of RX
>> BD ring. =C2=A0You can't have more BDs than RX_BD_RING_LEN in backlog fo=
r
>> napi_poll to process. =C2=A0Increase the RX_BD_RING_LEN if you want to
>> increase UCC_GETH_DEV_WEIGHT. =C2=A0However please also provide the
>> performance comparison for this kind of change. =C2=A0Thanks
>
> Bring it up with David Miller. After my initial attempt to just increase
> weight somewhat, he requested that I hardcoded it to 64. Just read the
> whole thread.
> If I don't increase weight somewhat, ping -f -l 3 almost halts the board.
> Logging
> in takes forever. These are my "performance numbers".

Faster response time is surely good.  But it might also mean CPU is
not fully loaded.  IMHO, throughput is a more important factor for
network devices.  When you try to optimize the driver, please also
consider the throughput change.  Thanks.

- Leo

^ permalink raw reply

* Re: [PATCH 1/2] ucc_geth: Move freeing of TX packets to NAPI context.
From: Joakim Tjernlund @ 2009-03-30  7:48 UTC (permalink / raw)
  To: Li Yang; +Cc: linuxppc-dev, pku.leo, netdev
In-Reply-To: <2a27d3730903300036x1dc265a3o76ea36ca6a16fb5b@mail.gmail.com>

pku.leo@gmail.com wrote on 30/03/2009 09:36:21:
> 
> On Fri, Mar 27, 2009 at 7:52 PM, Joakim Tjernlund
> <Joakim.Tjernlund@transmode.se> wrote:
> > pku.leo@gmail.com wrote on 27/03/2009 11:50:09:
> >>
> >> On Thu, Mar 26, 2009 at 8:54 PM, Joakim Tjernlund
> >> <Joakim.Tjernlund@transmode.se> wrote:
> >> > Also set NAPI weight to 64 as this is a common value.
> >> > This will make the system alot more responsive while
> >> > ping flooding the ucc_geth ethernet interaface.
> >> >
> >> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> >> > ---
> >> >        /* Errors and other events */
> >> >        if (ucce & UCCE_OTHER) {
> >> >                if (ucce & UCC_GETH_UCCE_BSY)
> >> > @@ -3733,7 +3725,7 @@ static int ucc_geth_probe(struct of_device*
> > ofdev, const struct of_device_id *ma
> >> >        dev->netdev_ops = &ucc_geth_netdev_ops;
> >> >        dev->watchdog_timeo = TX_TIMEOUT;
> >> >        INIT_WORK(&ugeth->timeout_work, ucc_geth_timeout_work);
> >> > -       netif_napi_add(dev, &ugeth->napi, ucc_geth_poll,
> > UCC_GETH_DEV_WEIGHT);
> >> > +       netif_napi_add(dev, &ugeth->napi, ucc_geth_poll, 64);
> >>
> >> It doesn't make sense to have larger napi budget than the size of RX
> >> BD ring.  You can't have more BDs than RX_BD_RING_LEN in backlog for
> >> napi_poll to process.  Increase the RX_BD_RING_LEN if you want to
> >> increase UCC_GETH_DEV_WEIGHT.  However please also provide the
> >> performance comparison for this kind of change.  Thanks
> >
> > Bring it up with David Miller. After my initial attempt to just 
increase
> > weight somewhat, he requested that I hardcoded it to 64. Just read the
> > whole thread.
> > If I don't increase weight somewhat, ping -f -l 3 almost halts the 
board.
> > Logging
> > in takes forever. These are my "performance numbers".
> 
> Faster response time is surely good.  But it might also mean CPU is
> not fully loaded.  IMHO, throughput is a more important factor for
> network devices.  When you try to optimize the driver, please also
> consider the throughput change.  Thanks.

This particular change isn't about performance, it is about not
"bricking" the board during heavy traffic. Next step is to optimize
the driver.

 Jocke

^ permalink raw reply

* Re: [PATCH 1/2] ucc_geth: Move freeing of TX packets to NAPI context.
From: Li Yang @ 2009-03-30  7:57 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev, netdev
In-Reply-To: <OF8F2A374C.8C3B68EA-ONC1257589.002A7868-C1257589.002AD913@transmode.se>

On Mon, Mar 30, 2009 at 3:48 PM, Joakim Tjernlund
<Joakim.Tjernlund@transmode.se> wrote:
> pku.leo@gmail.com wrote on 30/03/2009 09:36:21:
>>
>> On Fri, Mar 27, 2009 at 7:52 PM, Joakim Tjernlund
>> <Joakim.Tjernlund@transmode.se> wrote:
>> > pku.leo@gmail.com wrote on 27/03/2009 11:50:09:
>> >>
>> >> On Thu, Mar 26, 2009 at 8:54 PM, Joakim Tjernlund
>> >> <Joakim.Tjernlund@transmode.se> wrote:
>> >> > Also set NAPI weight to 64 as this is a common value.
>> >> > This will make the system alot more responsive while
>> >> > ping flooding the ucc_geth ethernet interaface.
>> >> >
>> >> > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
>> >> > ---
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0/* Errors and other events */
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ucce & UCCE_OTHER) {
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0if (ucce & U=
CC_GETH_UCCE_BSY)
>> >> > @@ -3733,7 +3725,7 @@ static int ucc_geth_probe(struct of_device*
>> > ofdev, const struct of_device_id *ma
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0dev->netdev_ops =3D &ucc_geth_netdev_ops=
;
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0dev->watchdog_timeo =3D TX_TIMEOUT;
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0INIT_WORK(&ugeth->timeout_work, ucc_geth=
_timeout_work);
>> >> > - =C2=A0 =C2=A0 =C2=A0 netif_napi_add(dev, &ugeth->napi, ucc_geth_p=
oll,
>> > UCC_GETH_DEV_WEIGHT);
>> >> > + =C2=A0 =C2=A0 =C2=A0 netif_napi_add(dev, &ugeth->napi, ucc_geth_p=
oll, 64);
>> >>
>> >> It doesn't make sense to have larger napi budget than the size of RX
>> >> BD ring. =C2=A0You can't have more BDs than RX_BD_RING_LEN in backlog=
 for
>> >> napi_poll to process. =C2=A0Increase the RX_BD_RING_LEN if you want t=
o
>> >> increase UCC_GETH_DEV_WEIGHT. =C2=A0However please also provide the
>> >> performance comparison for this kind of change. =C2=A0Thanks
>> >
>> > Bring it up with David Miller. After my initial attempt to just
> increase
>> > weight somewhat, he requested that I hardcoded it to 64. Just read the
>> > whole thread.
>> > If I don't increase weight somewhat, ping -f -l 3 almost halts the
> board.
>> > Logging
>> > in takes forever. These are my "performance numbers".
>>
>> Faster response time is surely good. =C2=A0But it might also mean CPU is
>> not fully loaded. =C2=A0IMHO, throughput is a more important factor for
>> network devices. =C2=A0When you try to optimize the driver, please also
>> consider the throughput change. =C2=A0Thanks.
>
> This particular change isn't about performance, it is about not
> "bricking" the board during heavy traffic. Next step is to optimize
> the driver.

Sure.  I mean for other changes like tx NAPI, ring size tweak and tx logic.

- Leo

^ permalink raw reply

* Re: [PATCH] ucc_geth: Move freeing of TX packets to NAPI context.
From: Li Yang @ 2009-03-30  8:34 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev Development, Netdev
In-Reply-To: <OF3C4E8131.4223FD1A-ONC1257584.0061D2E6-C1257584.0062233E@transmode.se>

On Thu, Mar 26, 2009 at 1:51 AM, Joakim Tjernlund
<Joakim.Tjernlund@transmode.se> wrote:
> Anton Vorontsov <avorontsov@ru.mvista.com> wrote on 25/03/2009 15:25:40:
>> On Wed, Mar 25, 2009 at 02:30:49PM +0100, Joakim Tjernlund wrote:
>> > >>From 1c2f23b1f37f4818c0fd0217b93eb38ab6564840 Mon Sep 17 00:00:00
> 2001
>> > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
>> > Date: Tue, 24 Mar 2009 10:19:27 +0100
>> > Subject: [PATCH] ucc_geth: Move freeing of TX packets to NAPI context.
>> > =C2=A0Also increase NAPI weight somewhat.
>> > =C2=A0This will make the system alot more responsive while
>> > =C2=A0ping flooding the ucc_geth ethernet interaface.
>>
>> Some time ago I've tried a similar thing for this driver, but during
>> tcp (or udp I don't quite remember) netperf tests I was getting tx
>> watchdog timeouts after ~2-5 minutes of work. I was testing with a
>> gigabit and 100 Mbit link, with 100 Mbit link the issue was not
>> reproducible.
>>
>> Though, I recalling I was doing a bit more than your patch: I was
>> also clearing the TX events in the ucce register before calling
>> ucc_geth_tx, that way I was trying to avoid stale interrupts. That
>> helped to increase an overall performance (not only responsiveness),
>> but as I said my approach didn't pass the tests.
>>
>> I don't really think that your patch may cause this, but can you
>> try netperf w/ this patch applied anyway? And see if it really
>> doesn't cause any issues under stress?
>
> Does the line(in ucc_geth_tx()) look OK to you:
> =C2=A0 =C2=A0 =C2=A0 =C2=A0if ((bd =3D=3D ugeth->txBd[txQ]) && (netif_que=
ue_stopped(dev) =3D=3D 0))
> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0break;
>
> Sure does look fishy to me.

There are two cases when txBd=3DConfBd: the BD ring is full or empty.
The condition used here ensures that it is the empty case.  Because in
hard_start_xmit, the queue will be stopped when the BD ring is full.
Maybe some comment is needed here.

- Leo

^ permalink raw reply

* Re: [PATCH] Fix ptrace compat wrapper for fpu register access
From: Andreas Schwab @ 2009-03-30  9:17 UTC (permalink / raw)
  To: Michael Neuling; +Cc: linuxppc-dev
In-Reply-To: <13580.1238371079@neuling.org>

Michael Neuling <mikey@neuling.org> writes:

> So if you're looking fixing 32 bit apps ptracing 64 bit apps, does that
> mean we can get a single 32 bit GDB that'll ptrace both 64 and 32 bit
> apps?

Currently gdb only supports 32x64 debugging for the SPU.

>> @@ -263,7 +263,8 @@ long compat_arch_ptrace(struct task_struct *child, compat
> _long_t request,
>>  			ret = ptrace_put_reg(child, numReg, freg);
>>  		} else {
>>  			flush_fp_to_thread(child);
>> -			((unsigned int *)child->thread.regs)[index] = data;
>> +			((unsigned int *)child->thread.regs)
>> +				[FPRINDEX(index)] = data;
>
> This index is into the ptregs structure not the fpr.  I'm not sure the
> FPRINDEX macro is applicable here.

You're right, this hunk is bogus.  But indexing off thread.regs is
totally bogus as well.  I think what was intented is this:

@@ -263,7 +263,9 @@ long compat_arch_ptrace(struct task_stru
 			ret = ptrace_put_reg(child, numReg, freg);
 		} else {
 			flush_fp_to_thread(child);
-			((unsigned int *)child->thread.regs)[index] = data;
+			((unsigned int *)child->thread.fpr)
+				[TS_FPRWIDTH * (numReg - PT_FPR0) * 2 +
+				 index % 2] = data;
 			ret = 0;
 		}
 		break;

But gdb does not actually use PPC_PTRACE_POKEUSR_3264.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* Re: [PATCH] ucc_geth: Move freeing of TX packets to NAPI context.
From: Joakim Tjernlund @ 2009-03-30  9:21 UTC (permalink / raw)
  To: Li Yang; +Cc: linuxppc-dev Development, pku.leo, Netdev
In-Reply-To: <2a27d3730903300134q673de9cbg6c92e981efc12695@mail.gmail.com>

pku.leo@gmail.com wrote on 30/03/2009 10:34:47:
> 
> On Thu, Mar 26, 2009 at 1:51 AM, Joakim Tjernlund
> <Joakim.Tjernlund@transmode.se> wrote:
> > Anton Vorontsov <avorontsov@ru.mvista.com> wrote on 25/03/2009 
15:25:40:
> >> On Wed, Mar 25, 2009 at 02:30:49PM +0100, Joakim Tjernlund wrote:
> >> > >>From 1c2f23b1f37f4818c0fd0217b93eb38ab6564840 Mon Sep 17 00:00:00
> > 2001
> >> > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> >> > Date: Tue, 24 Mar 2009 10:19:27 +0100
> >> > Subject: [PATCH] ucc_geth: Move freeing of TX packets to NAPI 
context.
> >> >  Also increase NAPI weight somewhat.
> >> >  This will make the system alot more responsive while
> >> >  ping flooding the ucc_geth ethernet interaface.
> >>
> >> Some time ago I've tried a similar thing for this driver, but during
> >> tcp (or udp I don't quite remember) netperf tests I was getting tx
> >> watchdog timeouts after ~2-5 minutes of work. I was testing with a
> >> gigabit and 100 Mbit link, with 100 Mbit link the issue was not
> >> reproducible.
> >>
> >> Though, I recalling I was doing a bit more than your patch: I was
> >> also clearing the TX events in the ucce register before calling
> >> ucc_geth_tx, that way I was trying to avoid stale interrupts. That
> >> helped to increase an overall performance (not only responsiveness),
> >> but as I said my approach didn't pass the tests.
> >>
> >> I don't really think that your patch may cause this, but can you
> >> try netperf w/ this patch applied anyway? And see if it really
> >> doesn't cause any issues under stress?
> >
> > Does the line(in ucc_geth_tx()) look OK to you:
> >        if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) == 
0))
> >                        break;
> >
> > Sure does look fishy to me.
> 
> There are two cases when txBd=ConfBd: the BD ring is full or empty.
> The condition used here ensures that it is the empty case.  Because in
> hard_start_xmit, the queue will be stopped when the BD ring is full.
> Maybe some comment is needed here.

But how do you know that the queue hasn't been stopped by someone else 
than
the driver? 
If it is stopped by higher layers, the if stmt will fail.

 Jocke

^ permalink raw reply

* Re: [PATCH] ucc_geth: Move freeing of TX packets to NAPI context.
From: Li Yang @ 2009-03-30  9:36 UTC (permalink / raw)
  To: Joakim Tjernlund; +Cc: linuxppc-dev Development, Netdev
In-Reply-To: <OF6D5FFE1D.1843C7FE-ONC1257589.00328D91-C1257589.00336B8B@transmode.se>

On Mon, Mar 30, 2009 at 5:21 PM, Joakim Tjernlund
<Joakim.Tjernlund@transmode.se> wrote:
> pku.leo@gmail.com wrote on 30/03/2009 10:34:47:
>>
>> On Thu, Mar 26, 2009 at 1:51 AM, Joakim Tjernlund
>> <Joakim.Tjernlund@transmode.se> wrote:
>> > Anton Vorontsov <avorontsov@ru.mvista.com> wrote on 25/03/2009
> 15:25:40:
>> >> On Wed, Mar 25, 2009 at 02:30:49PM +0100, Joakim Tjernlund wrote:
>> >> > >>From 1c2f23b1f37f4818c0fd0217b93eb38ab6564840 Mon Sep 17 00:00:00
>> > 2001
>> >> > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
>> >> > Date: Tue, 24 Mar 2009 10:19:27 +0100
>> >> > Subject: [PATCH] ucc_geth: Move freeing of TX packets to NAPI
> context.
>> >> > =C2=A0Also increase NAPI weight somewhat.
>> >> > =C2=A0This will make the system alot more responsive while
>> >> > =C2=A0ping flooding the ucc_geth ethernet interaface.
>> >>
>> >> Some time ago I've tried a similar thing for this driver, but during
>> >> tcp (or udp I don't quite remember) netperf tests I was getting tx
>> >> watchdog timeouts after ~2-5 minutes of work. I was testing with a
>> >> gigabit and 100 Mbit link, with 100 Mbit link the issue was not
>> >> reproducible.
>> >>
>> >> Though, I recalling I was doing a bit more than your patch: I was
>> >> also clearing the TX events in the ucce register before calling
>> >> ucc_geth_tx, that way I was trying to avoid stale interrupts. That
>> >> helped to increase an overall performance (not only responsiveness),
>> >> but as I said my approach didn't pass the tests.
>> >>
>> >> I don't really think that your patch may cause this, but can you
>> >> try netperf w/ this patch applied anyway? And see if it really
>> >> doesn't cause any issues under stress?
>> >
>> > Does the line(in ucc_geth_tx()) look OK to you:
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if ((bd =3D=3D ugeth->txBd[txQ]) && (netif_=
queue_stopped(dev) =3D=3D
> 0))
>> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =
=C2=A0 =C2=A0break;
>> >
>> > Sure does look fishy to me.
>>
>> There are two cases when txBd=3DConfBd: the BD ring is full or empty.
>> The condition used here ensures that it is the empty case. =C2=A0Because=
 in
>> hard_start_xmit, the queue will be stopped when the BD ring is full.
>> Maybe some comment is needed here.
>
> But how do you know that the queue hasn't been stopped by someone else
> than
> the driver?
> If it is stopped by higher layers, the if stmt will fail.

It looks like from existing code that only the driver can legally stop
the queue.  I'm not 100% sure though.  Correct me if I'm wrong.

- Leo

^ permalink raw reply

* Re: [PATCH] Fix ptrace compat wrapper for fpu register access
From: Michael Neuling @ 2009-03-30  9:52 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: linuxppc-dev
In-Reply-To: <m2vdpr2wv4.fsf@igel.home>

> > So if you're looking fixing 32 bit apps ptracing 64 bit apps, does that
> > mean we can get a single 32 bit GDB that'll ptrace both 64 and 32 bit
> > apps?
> 
> Currently gdb only supports 32x64 debugging for the SPU.

Ok, thanks.

> >> @@ -263,7 +263,8 @@ long compat_arch_ptrace(struct task_struct *child, com
pat
> > _long_t request,
> >>  			ret = ptrace_put_reg(child, numReg, freg);
> >>  		} else {
> >>  			flush_fp_to_thread(child);
> >> -			((unsigned int *)child->thread.regs)[index] = data;
> >> +			((unsigned int *)child->thread.regs)
> >> +				[FPRINDEX(index)] = data;
> >
> > This index is into the ptregs structure not the fpr.  I'm not sure the
> > FPRINDEX macro is applicable here.
> 
> You're right, this hunk is bogus.  But indexing off thread.regs is
> totally bogus as well.  I think what was intented is this:
> 
> @@ -263,7 +263,9 @@ long compat_arch_ptrace(struct task_stru
>  			ret = ptrace_put_reg(child, numReg, freg);
>  		} else {
>  			flush_fp_to_thread(child);
> -			((unsigned int *)child->thread.regs)[index] = data;
> +			((unsigned int *)child->thread.fpr)
> +				[TS_FPRWIDTH * (numReg - PT_FPR0) * 2 +
> +				 index % 2] = data;

I think the indexing here should be the same as PEEKUSR_3264.  This
looks better but all this magic indexing makes me want to vomit.

I'd like to fix this stuff but I've been avoiding it since we don't have
a decent test case/suite to make sure it's not bust.

Mikey

>  			ret = 0;
>  		}
>  		break;
> 
> But gdb does not actually use PPC_PTRACE_POKEUSR_3264.
> 
> Andreas.
> 
> -- 
> Andreas Schwab, schwab@linux-m68k.org
> GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
> "And now for something completely different."
> 

^ permalink raw reply

* Re: [PATCH] ucc_geth: Move freeing of TX packets to NAPI context.
From: Joakim Tjernlund @ 2009-03-30 10:01 UTC (permalink / raw)
  To: Li Yang; +Cc: linuxppc-dev Development, pku.leo, Netdev
In-Reply-To: <2a27d3730903300236j79cc3035raef2bf5e895fe429@mail.gmail.com>

pku.leo@gmail.com wrote on 30/03/2009 11:36:36:
> 
> On Mon, Mar 30, 2009 at 5:21 PM, Joakim Tjernlund
> <Joakim.Tjernlund@transmode.se> wrote:
> > pku.leo@gmail.com wrote on 30/03/2009 10:34:47:
> >>
> >> On Thu, Mar 26, 2009 at 1:51 AM, Joakim Tjernlund
> >> <Joakim.Tjernlund@transmode.se> wrote:
> >> > Anton Vorontsov <avorontsov@ru.mvista.com> wrote on 25/03/2009
> > 15:25:40:
> >> >> On Wed, Mar 25, 2009 at 02:30:49PM +0100, Joakim Tjernlund wrote:
> >> >> > >>From 1c2f23b1f37f4818c0fd0217b93eb38ab6564840 Mon Sep 17 
00:00:00
> >> > 2001
> >> >> > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
> >> >> > Date: Tue, 24 Mar 2009 10:19:27 +0100
> >> >> > Subject: [PATCH] ucc_geth: Move freeing of TX packets to NAPI
> > context.
> >> >> >  Also increase NAPI weight somewhat.
> >> >> >  This will make the system alot more responsive while
> >> >> >  ping flooding the ucc_geth ethernet interaface.
> >> >>
> >> >> Some time ago I've tried a similar thing for this driver, but 
during
> >> >> tcp (or udp I don't quite remember) netperf tests I was getting tx
> >> >> watchdog timeouts after ~2-5 minutes of work. I was testing with a
> >> >> gigabit and 100 Mbit link, with 100 Mbit link the issue was not
> >> >> reproducible.
> >> >>
> >> >> Though, I recalling I was doing a bit more than your patch: I was
> >> >> also clearing the TX events in the ucce register before calling
> >> >> ucc_geth_tx, that way I was trying to avoid stale interrupts. That
> >> >> helped to increase an overall performance (not only 
responsiveness),
> >> >> but as I said my approach didn't pass the tests.
> >> >>
> >> >> I don't really think that your patch may cause this, but can you
> >> >> try netperf w/ this patch applied anyway? And see if it really
> >> >> doesn't cause any issues under stress?
> >> >
> >> > Does the line(in ucc_geth_tx()) look OK to you:
> >> >        if ((bd == ugeth->txBd[txQ]) && (netif_queue_stopped(dev) ==
> > 0))
> >> >                        break;
> >> >
> >> > Sure does look fishy to me.
> >>
> >> There are two cases when txBd=ConfBd: the BD ring is full or empty.
> >> The condition used here ensures that it is the empty case.  Because 
in
> >> hard_start_xmit, the queue will be stopped when the BD ring is full.
> >> Maybe some comment is needed here.
> >
> > But how do you know that the queue hasn't been stopped by someone else
> > than
> > the driver?
> > If it is stopped by higher layers, the if stmt will fail.
> 
> It looks like from existing code that only the driver can legally stop
> the queue.  I'm not 100% sure though.  Correct me if I'm wrong.

I don't know. But the question you should ask is: Does the networking
code promise this now and for the future? If not, you should
fix the driver not to relay on netif_queue_stopped() here.

 Jocke

^ permalink raw reply

* [PATCH v4 0/4] NAND: Multi-chip support for FSL-UPM for TQM8548 modules
From: Wolfgang Grandegger @ 2009-03-30 10:02 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev; +Cc: devicetree-discuss

This is my forth version of the patch series adding generic support
for multi-chip NAND devices to the FSL-UPM driver and support for
the Micron MT29F8G08FAB NAND flash memory on the TQM8548 modules.
It addresses the issues reported on the mailing list, e.g. the new
bindings are now documented as well:

 NAND: FSL-UPM: add multi chip support
 NAND: FSL-UPM: Add wait flags to support board/chip specific delays
 powerpc: NAND: FSL UPM: document new bindings
 powerpc/85xx: TQM8548: Update DTS file for multi-chip support

Changes since v3:
  - As Grant suggested, the property "fsl,upm-addr-line-cs-offsets"
    is now used to define multi-chip support using dedicated address
    lines for chip selection. This make the properties "num-chips"
    and "chip-offset" obsolte.

  - As Grant suggested, I added the string "tqc,tqm8548-upm-nand" to
    the list of compatible devices for the TQM8548 modules in case it
    turns out in the future that the "fsl,upm-addr-line-cs-offsets"
    method is not generic enough.

  - For multi-chip chip devices, the name "mchip" is now used in the
    code to avoid confusion with the normal NAND "chip".

  - Coding style fixes as pointed out by Anton.

Patch 3 and 4 should go through the powerpc maintainer(s).

Hope this patch series is fine now for inclusion into 2.6.30.

Thanks,

Wolfgang.

^ permalink raw reply

* [PATCH v4 2/4] NAND: FSL-UPM: Add wait flags to support board/chip specific delays
From: Wolfgang Grandegger @ 2009-03-30 10:02 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev; +Cc: devicetree-discuss
In-Reply-To: <20090330100241.346785618@denx.de>

The NAND flash on the TQM8548_BE modules requires a short delay after
running the UPM pattern. The TQM8548_BE requires a further short delay
after writing out a buffer. Normally the R/B pin should be checked, but
it's not connected on the TQM8548_BE. The existing driver uses similar
fixed delay points. To manage these extra delays in a more general way,
I introduced the "fsl,ump-wait-flags" property allowing the board-
specific driver to specify various types of extra delay.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 drivers/mtd/nand/fsl_upm.c |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

Index: linux-2.6/drivers/mtd/nand/fsl_upm.c
===================================================================
--- linux-2.6.orig/drivers/mtd/nand/fsl_upm.c	2009-03-30 12:01:35.634720440 +0200
+++ linux-2.6/drivers/mtd/nand/fsl_upm.c	2009-03-30 12:01:38.918718552 +0200
@@ -23,6 +23,10 @@
 #include <linux/io.h>
 #include <asm/fsl_lbc.h>
 
+#define FSL_UPM_WAIT_RUN_PATTERN  0x1
+#define FSL_UPM_WAIT_WRITE_BYTE   0x2
+#define FSL_UPM_WAIT_WRITE_BUFFER 0x4
+
 struct fsl_upm_nand {
 	struct device *dev;
 	struct mtd_info mtd;
@@ -41,6 +45,7 @@
 	uint32_t mchip_count;
 	uint32_t mchip_number;
 	int chip_delay;
+	uint32_t wait_flags;
 };
 
 #define to_fsl_upm_nand(mtd) container_of(mtd, struct fsl_upm_nand, mtd)
@@ -96,7 +101,8 @@
 		fun->mchip_offsets[fun->mchip_number];
 	fsl_upm_run_pattern(&fun->upm, chip->IO_ADDR_R, mar);
 
-	fun_wait_rnb(fun);
+	if (fun->wait_flags & FSL_UPM_WAIT_RUN_PATTERN)
+		fun_wait_rnb(fun);
 }
 
 static void fun_select_chip(struct mtd_info *mtd, int mchip_nr)
@@ -138,8 +144,11 @@
 
 	for (i = 0; i < len; i++) {
 		out_8(fun->chip.IO_ADDR_W, buf[i]);
-		fun_wait_rnb(fun);
+		if (fun->wait_flags & FSL_UPM_WAIT_WRITE_BYTE)
+			fun_wait_rnb(fun);
 	}
+	if (fun->wait_flags & FSL_UPM_WAIT_WRITE_BUFFER)
+		fun_wait_rnb(fun);
 }
 
 static int __devinit fun_chip_init(struct fsl_upm_nand *fun,
@@ -285,6 +294,13 @@
 	else
 		fun->chip_delay = 50;
 
+	prop = of_get_property(ofdev->node, "fsl,upm-wait-flags", &size);
+	if (prop && size == sizeof(uint32_t))
+		fun->wait_flags = *prop;
+	else
+		fun->wait_flags = FSL_UPM_WAIT_RUN_PATTERN |
+				  FSL_UPM_WAIT_WRITE_BYTE;
+
 	fun->io_base = devm_ioremap_nocache(&ofdev->dev, io_res.start,
 					    io_res.end - io_res.start + 1);
 	if (!fun->io_base) {

^ permalink raw reply

* [PATCH v4 3/4] powerpc: NAND: FSL UPM: document new bindings
From: Wolfgang Grandegger @ 2009-03-30 10:02 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev; +Cc: devicetree-discuss
In-Reply-To: <20090330100241.346785618@denx.de>

This patch adds documentation for the new NAND FSL UPM bindings for:

 NAND: FSL-UPM: add multi chip support
 NAND: FSL-UPM: Add wait flags to support board/chip specific delays

It also documents the old binding for "chip-delay".

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 Documentation/powerpc/dts-bindings/fsl/upm-nand.txt |   39 ++++++++++++++++++--
 1 file changed, 37 insertions(+), 2 deletions(-)

Index: linux-2.6/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt
===================================================================
--- linux-2.6.orig/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt	2009-03-30 12:01:26.799721086 +0200
+++ linux-2.6/Documentation/powerpc/dts-bindings/fsl/upm-nand.txt	2009-03-30 12:01:41.496969771 +0200
@@ -5,9 +5,21 @@
 - reg : should specify localbus chip select and size used for the chip.
 - fsl,upm-addr-offset : UPM pattern offset for the address latch.
 - fsl,upm-cmd-offset : UPM pattern offset for the command latch.
-- gpios : may specify optional GPIO connected to the Ready-Not-Busy pin.
 
-Example:
+Optional properties:
+- fsl,upm-wait-flags : add chip-dependent short delays after running the
+	UPM pattern (0x1), after writing a data byte (0x2) or after
+	writing out a buffer (0x4).
+- fsl,upm-addr-line-cs-offsets : address offsets for multi-chip support.
+	The corresponding address lines are used to select the chip.
+- gpios : may specify optional GPIOs connected to the Ready-Not-Busy pins
+	(R/B#). For multi-chip devices, "n" GPIO definitions are required
+	according to the number of chips.
+- chip-delay : chip dependent delay for transfering data from array to
+	read registers (tR). Required if property "gpios" is not used
+	(R/B# pins not connected).
+
+Examples:
 
 upm@1,0 {
 	compatible = "fsl,upm-nand";
@@ -26,3 +38,26 @@
 		};
 	};
 };
+
+upm@3,0 {
+	#address-cells = <0>;
+	#size-cells = <0>;
+	compatible = "tqc,tqm8548-upm-nand", "fsl,upm-nand";
+	reg = <3 0x0 0x800>;
+	fsl,upm-addr-offset = <0x10>;
+	fsl,upm-cmd-offset = <0x08>;
+	/* Multi-chip NAND device */
+	fsl,upm-addr-line-cs-offsets = <0x0 0x200>;
+	fsl,upm-wait-flags = <0x5>;
+	chip-delay = <25>; // in micro-seconds
+
+	nand@0 {
+		#address-cells = <1>;
+		#size-cells = <1>;
+
+		partition@0 {
+			    label = "fs";
+			    reg = <0x00000000 0x10000000>;
+		};
+	};
+};

^ permalink raw reply

* [PATCH v4 1/4] NAND: FSL-UPM: add multi chip support
From: Wolfgang Grandegger @ 2009-03-30 10:02 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev; +Cc: devicetree-discuss
In-Reply-To: <20090330100241.346785618@denx.de>

This patch adds support for multi-chip NAND devices to the FSL-UPM
driver. This requires support for multiple GPIOs for the RNB pins.
The NAND chips are selected through address lines defined by the
FDT property "fsl,upm-addr-line-cs-offsets".

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 arch/powerpc/sysdev/fsl_lbc.c |    2 
 drivers/mtd/nand/fsl_upm.c    |   99 ++++++++++++++++++++++++++++++++----------
 2 files changed, 77 insertions(+), 24 deletions(-)

Index: linux-2.6/arch/powerpc/sysdev/fsl_lbc.c
===================================================================
--- linux-2.6.orig/arch/powerpc/sysdev/fsl_lbc.c	2009-03-30 12:01:32.088969299 +0200
+++ linux-2.6/arch/powerpc/sysdev/fsl_lbc.c	2009-03-30 12:01:35.633720577 +0200
@@ -150,7 +150,7 @@
 
 	spin_lock_irqsave(&fsl_lbc_lock, flags);
 
-	out_be32(&fsl_lbc_regs->mar, mar << (32 - upm->width));
+	out_be32(&fsl_lbc_regs->mar, mar);
 
 	switch (upm->width) {
 	case 8:
Index: linux-2.6/drivers/mtd/nand/fsl_upm.c
===================================================================
--- linux-2.6.orig/drivers/mtd/nand/fsl_upm.c	2009-03-30 12:01:32.089969721 +0200
+++ linux-2.6/drivers/mtd/nand/fsl_upm.c	2009-03-30 12:01:35.634720440 +0200
@@ -36,7 +36,10 @@
 	uint8_t upm_addr_offset;
 	uint8_t upm_cmd_offset;
 	void __iomem *io_base;
-	int rnb_gpio;
+	int rnb_gpio[NAND_MAX_CHIPS];
+	uint32_t mchip_offsets[NAND_MAX_CHIPS];
+	uint32_t mchip_count;
+	uint32_t mchip_number;
 	int chip_delay;
 };
 
@@ -46,7 +49,7 @@
 {
 	struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd);
 
-	if (gpio_get_value(fun->rnb_gpio))
+	if (gpio_get_value(fun->rnb_gpio[fun->mchip_number]))
 		return 1;
 
 	dev_vdbg(fun->dev, "busy\n");
@@ -55,9 +58,9 @@
 
 static void fun_wait_rnb(struct fsl_upm_nand *fun)
 {
-	int cnt = 1000000;
+	if (fun->rnb_gpio[fun->mchip_number] >= 0) {
+		int cnt = 1000000;
 
-	if (fun->rnb_gpio >= 0) {
 		while (--cnt && !fun_chip_ready(&fun->mtd))
 			cpu_relax();
 		if (!cnt)
@@ -69,7 +72,9 @@
 
 static void fun_cmd_ctrl(struct mtd_info *mtd, int cmd, unsigned int ctrl)
 {
+	struct nand_chip *chip = mtd->priv;
 	struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd);
+	u32 mar;
 
 	if (!(ctrl & fun->last_ctrl)) {
 		fsl_upm_end_pattern(&fun->upm);
@@ -87,11 +92,29 @@
 			fsl_upm_start_pattern(&fun->upm, fun->upm_cmd_offset);
 	}
 
-	fsl_upm_run_pattern(&fun->upm, fun->io_base, cmd);
+	mar = (cmd << (32 - fun->upm.width)) |
+		fun->mchip_offsets[fun->mchip_number];
+	fsl_upm_run_pattern(&fun->upm, chip->IO_ADDR_R, mar);
 
 	fun_wait_rnb(fun);
 }
 
+static void fun_select_chip(struct mtd_info *mtd, int mchip_nr)
+{
+	struct nand_chip *chip = mtd->priv;
+	struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd);
+
+	if (mchip_nr == -1) {
+		chip->cmd_ctrl(mtd, NAND_CMD_NONE, 0 | NAND_CTRL_CHANGE);
+	} else if (mchip_nr >= 0) {
+		fun->mchip_number = mchip_nr;
+		chip->IO_ADDR_R = fun->io_base + fun->mchip_offsets[mchip_nr];
+		chip->IO_ADDR_W = chip->IO_ADDR_R;
+	} else {
+		BUG();
+	}
+}
+
 static uint8_t fun_read_byte(struct mtd_info *mtd)
 {
 	struct fsl_upm_nand *fun = to_fsl_upm_nand(mtd);
@@ -137,8 +160,10 @@
 	fun->chip.read_buf = fun_read_buf;
 	fun->chip.write_buf = fun_write_buf;
 	fun->chip.ecc.mode = NAND_ECC_SOFT;
+	if (fun->mchip_count > 1)
+		fun->chip.select_chip = fun_select_chip;
 
-	if (fun->rnb_gpio >= 0)
+	if (fun->rnb_gpio[0] >= 0)
 		fun->chip.dev_ready = fun_chip_ready;
 
 	fun->mtd.priv = &fun->chip;
@@ -155,7 +180,7 @@
 		goto err;
 	}
 
-	ret = nand_scan(&fun->mtd, 1);
+	ret = nand_scan(&fun->mtd, fun->mchip_count);
 	if (ret)
 		goto err;
 
@@ -185,8 +210,10 @@
 	struct fsl_upm_nand *fun;
 	struct resource io_res;
 	const uint32_t *prop;
+	int rnb_gpio;
 	int ret;
 	int size;
+	int i;
 
 	fun = kzalloc(sizeof(*fun), GFP_KERNEL);
 	if (!fun)
@@ -208,7 +235,7 @@
 	if (!prop || size != sizeof(uint32_t)) {
 		dev_err(&ofdev->dev, "can't get UPM address offset\n");
 		ret = -EINVAL;
-		goto err2;
+		goto err1;
 	}
 	fun->upm_addr_offset = *prop;
 
@@ -216,21 +243,40 @@
 	if (!prop || size != sizeof(uint32_t)) {
 		dev_err(&ofdev->dev, "can't get UPM command offset\n");
 		ret = -EINVAL;
-		goto err2;
+		goto err1;
 	}
 	fun->upm_cmd_offset = *prop;
 
-	fun->rnb_gpio = of_get_gpio(ofdev->node, 0);
-	if (fun->rnb_gpio >= 0) {
-		ret = gpio_request(fun->rnb_gpio, dev_name(&ofdev->dev));
-		if (ret) {
-			dev_err(&ofdev->dev, "can't request RNB gpio\n");
+	prop = of_get_property(ofdev->node,
+			       "fsl,upm-addr-line-cs-offsets", &size);
+	if (prop && (size / sizeof(uint32_t)) > 0) {
+		fun->mchip_count = size / sizeof(uint32_t);
+		if (fun->mchip_count >= NAND_MAX_CHIPS) {
+			dev_err(&ofdev->dev, "too much multiple chips\n");
+			goto err1;
+		}
+		for (i = 0; i < fun->mchip_count; i++)
+			fun->mchip_offsets[i] = prop[i];
+	} else {
+		fun->mchip_count = 1;
+	}
+
+	for (i = 0; i < fun->mchip_count; i++) {
+		fun->rnb_gpio[i] = -1;
+		rnb_gpio = of_get_gpio(ofdev->node, i);
+		if (rnb_gpio >= 0) {
+			ret = gpio_request(rnb_gpio, dev_name(&ofdev->dev));
+			if (ret) {
+				dev_err(&ofdev->dev,
+					"can't request RNB gpio #%d\n", i);
+				goto err2;
+			}
+			gpio_direction_input(rnb_gpio);
+			fun->rnb_gpio[i] = rnb_gpio;
+		} else if (rnb_gpio == -EINVAL) {
+			dev_err(&ofdev->dev, "RNB gpio #%d is invalid\n", i);
 			goto err2;
 		}
-		gpio_direction_input(fun->rnb_gpio);
-	} else if (fun->rnb_gpio == -EINVAL) {
-		dev_err(&ofdev->dev, "specified RNB gpio is invalid\n");
-		goto err2;
 	}
 
 	prop = of_get_property(ofdev->node, "chip-delay", NULL);
@@ -240,7 +286,7 @@
 		fun->chip_delay = 50;
 
 	fun->io_base = devm_ioremap_nocache(&ofdev->dev, io_res.start,
-					  io_res.end - io_res.start + 1);
+					    io_res.end - io_res.start + 1);
 	if (!fun->io_base) {
 		ret = -ENOMEM;
 		goto err2;
@@ -257,8 +303,11 @@
 
 	return 0;
 err2:
-	if (fun->rnb_gpio >= 0)
-		gpio_free(fun->rnb_gpio);
+	for (i = 0; i < fun->mchip_count; i++) {
+		if (fun->rnb_gpio[i] < 0)
+			break;
+		gpio_free(fun->rnb_gpio[i]);
+	}
 err1:
 	kfree(fun);
 
@@ -268,12 +317,16 @@
 static int __devexit fun_remove(struct of_device *ofdev)
 {
 	struct fsl_upm_nand *fun = dev_get_drvdata(&ofdev->dev);
+	int i;
 
 	nand_release(&fun->mtd);
 	kfree(fun->mtd.name);
 
-	if (fun->rnb_gpio >= 0)
-		gpio_free(fun->rnb_gpio);
+	for (i = 0; i < fun->mchip_count; i++) {
+		if (fun->rnb_gpio[i] < 0)
+			break;
+		gpio_free(fun->rnb_gpio[i]);
+	}
 
 	kfree(fun);
 

^ permalink raw reply

* [PATCH v4 4/4] powerpc/85xx: TQM8548: Update DTS file for multi-chip support
From: Wolfgang Grandegger @ 2009-03-30 10:02 UTC (permalink / raw)
  To: linux-mtd, linuxppc-dev; +Cc: devicetree-discuss
In-Reply-To: <20090330100241.346785618@denx.de>

This patch adds multi-chip support for the Micron MT29F8G08FAB NAND
flash memory on the TQM8548 modules.

Signed-off-by: Wolfgang Grandegger <wg@grandegger.com>
---
 arch/powerpc/boot/dts/tqm8548-bigflash.dts |    7 +++++--
 arch/powerpc/boot/dts/tqm8548.dts          |    7 +++++--
 2 files changed, 10 insertions(+), 4 deletions(-)

Index: linux-2.6/arch/powerpc/boot/dts/tqm8548-bigflash.dts
===================================================================
--- linux-2.6.orig/arch/powerpc/boot/dts/tqm8548-bigflash.dts	2009-03-30 12:01:22.015719619 +0200
+++ linux-2.6/arch/powerpc/boot/dts/tqm8548-bigflash.dts	2009-03-30 12:01:45.007720662 +0200
@@ -380,10 +380,13 @@
 		upm@3,0 {
 			#address-cells = <0>;
 			#size-cells = <0>;
-			compatible = "fsl,upm-nand";
+			compatible = "tqc,tqm8548-upm-nand", "fsl,upm-nand";
 			reg = <3 0x0 0x800>;
 			fsl,upm-addr-offset = <0x10>;
 			fsl,upm-cmd-offset = <0x08>;
+			/* Micron MT29F8G08FAB multi-chip device */
+			fsl,upm-addr-line-cs-offsets = <0x0 0x200>;
+			fsl,upm-wait-flags = <0x5>;
 			chip-delay = <25>; // in micro-seconds
 
 			nand@0 {
@@ -392,7 +395,7 @@
 
 				partition@0 {
 					    label = "fs";
-					    reg = <0x00000000 0x01000000>;
+					    reg = <0x00000000 0x10000000>;
 				};
 			};
 		};
Index: linux-2.6/arch/powerpc/boot/dts/tqm8548.dts
===================================================================
--- linux-2.6.orig/arch/powerpc/boot/dts/tqm8548.dts	2009-03-30 12:01:22.015719619 +0200
+++ linux-2.6/arch/powerpc/boot/dts/tqm8548.dts	2009-03-30 12:01:45.008720246 +0200
@@ -380,10 +380,13 @@
 		upm@3,0 {
 			#address-cells = <0>;
 			#size-cells = <0>;
-			compatible = "fsl,upm-nand";
+			compatible = "tqc,tqm8548-upm-nand", "fsl,upm-nand";
 			reg = <3 0x0 0x800>;
 			fsl,upm-addr-offset = <0x10>;
 			fsl,upm-cmd-offset = <0x08>;
+			/* Micron MT29F8G08FAB multi-chip device */
+			fsl,upm-addr-line-cs-offsets = <0x0 0x200>;
+			fsl,upm-wait-flags = <0x5>;
 			chip-delay = <25>; // in micro-seconds
 
 			nand@0 {
@@ -392,7 +395,7 @@
 
 				partition@0 {
 					    label = "fs";
-					    reg = <0x00000000 0x01000000>;
+					    reg = <0x00000000 0x10000000>;
 				};
 			};
 		};

^ permalink raw reply

* Re: [PATCH] ucc_geth: Move freeing of TX packets to NAPI context.
From: Li Yang @ 2009-03-30 10:24 UTC (permalink / raw)
  To: Joakim Tjernlund, David Miller; +Cc: linuxppc-dev Development, Netdev
In-Reply-To: <OF42785A57.F2F3AFE4-ONC1257589.0035B462-C1257589.003712D0@transmode.se>

On Mon, Mar 30, 2009 at 6:01 PM, Joakim Tjernlund
<Joakim.Tjernlund@transmode.se> wrote:
> pku.leo@gmail.com wrote on 30/03/2009 11:36:36:
>>
>> On Mon, Mar 30, 2009 at 5:21 PM, Joakim Tjernlund
>> <Joakim.Tjernlund@transmode.se> wrote:
>> > pku.leo@gmail.com wrote on 30/03/2009 10:34:47:
>> >>
>> >> On Thu, Mar 26, 2009 at 1:51 AM, Joakim Tjernlund
>> >> <Joakim.Tjernlund@transmode.se> wrote:
>> >> > Anton Vorontsov <avorontsov@ru.mvista.com> wrote on 25/03/2009
>> > 15:25:40:
>> >> >> On Wed, Mar 25, 2009 at 02:30:49PM +0100, Joakim Tjernlund wrote:
>> >> >> > >>From 1c2f23b1f37f4818c0fd0217b93eb38ab6564840 Mon Sep 17
> 00:00:00
>> >> > 2001
>> >> >> > From: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
>> >> >> > Date: Tue, 24 Mar 2009 10:19:27 +0100
>> >> >> > Subject: [PATCH] ucc_geth: Move freeing of TX packets to NAPI
>> > context.
>> >> >> > =C2=A0Also increase NAPI weight somewhat.
>> >> >> > =C2=A0This will make the system alot more responsive while
>> >> >> > =C2=A0ping flooding the ucc_geth ethernet interaface.
>> >> >>
>> >> >> Some time ago I've tried a similar thing for this driver, but
> during
>> >> >> tcp (or udp I don't quite remember) netperf tests I was getting tx
>> >> >> watchdog timeouts after ~2-5 minutes of work. I was testing with a
>> >> >> gigabit and 100 Mbit link, with 100 Mbit link the issue was not
>> >> >> reproducible.
>> >> >>
>> >> >> Though, I recalling I was doing a bit more than your patch: I was
>> >> >> also clearing the TX events in the ucce register before calling
>> >> >> ucc_geth_tx, that way I was trying to avoid stale interrupts. That
>> >> >> helped to increase an overall performance (not only
> responsiveness),
>> >> >> but as I said my approach didn't pass the tests.
>> >> >>
>> >> >> I don't really think that your patch may cause this, but can you
>> >> >> try netperf w/ this patch applied anyway? And see if it really
>> >> >> doesn't cause any issues under stress?
>> >> >
>> >> > Does the line(in ucc_geth_tx()) look OK to you:
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0if ((bd =3D=3D ugeth->txBd[txQ]) && (net=
if_queue_stopped(dev) =3D=3D
>> > 0))
>> >> > =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 =C2=A0 =C2=A0break;
>> >> >
>> >> > Sure does look fishy to me.
>> >>
>> >> There are two cases when txBd=3DConfBd: the BD ring is full or empty.
>> >> The condition used here ensures that it is the empty case. =C2=A0Beca=
use
> in
>> >> hard_start_xmit, the queue will be stopped when the BD ring is full.
>> >> Maybe some comment is needed here.
>> >
>> > But how do you know that the queue hasn't been stopped by someone else
>> > than
>> > the driver?
>> > If it is stopped by higher layers, the if stmt will fail.
>>
>> It looks like from existing code that only the driver can legally stop
>> the queue. =C2=A0I'm not 100% sure though. =C2=A0Correct me if I'm wrong=
.
>
> I don't know. But the question you should ask is: Does the networking
> code promise this now and for the future?

Right.  But it's beyond my knowledge to answer this question.  If not,
adding a device specific flag is not very costing.

Hi Dave,

Can we assume that the netif_stop_queue() and netif_wake_queue() are
only used by the netdev driver?  And the queue state will not be
changed by other part of the networking subsystem?

- Leo

^ permalink raw reply

* Re: [PATCH] Fix ptrace compat wrapper for fpu register access
From: Andreas Schwab @ 2009-03-30 11:11 UTC (permalink / raw)
  To: Michael Neuling; +Cc: linuxppc-dev
In-Reply-To: <29891.1238406751@neuling.org>

Michael Neuling <mikey@neuling.org> writes:

>> @@ -263,7 +263,9 @@ long compat_arch_ptrace(struct task_stru
>>  			ret = ptrace_put_reg(child, numReg, freg);
>>  		} else {
>>  			flush_fp_to_thread(child);
>> -			((unsigned int *)child->thread.regs)[index] = data;
>> +			((unsigned int *)child->thread.fpr)
>> +				[TS_FPRWIDTH * (numReg - PT_FPR0) * 2 +
>> +				 index % 2] = data;
>
> I think the indexing here should be the same as PEEKUSR_3264.  This
> looks better but all this magic indexing makes me want to vomit.

How about this instead:

@@ -241,6 +241,7 @@ long compat_arch_ptrace(struct task_stru
 	case PPC_PTRACE_POKEUSR_3264: {
 		u32 index;
 		u32 numReg;
+		u32 *tmp;
 
 		ret = -EIO;
 		/* Determine which register the user wants */
@@ -263,7 +264,8 @@ long compat_arch_ptrace(struct task_stru
 			ret = ptrace_put_reg(child, numReg, freg);
 		} else {
 			flush_fp_to_thread(child);
-			((unsigned int *)child->thread.regs)[index] = data;
+			tmp = (u32 *)child->thread.fpr[numReg - PT_FPR0];
+			tmp[index % 2] = data;
 			ret = 0;
 		}
 		break;

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply

* Re: Build error
From: Kumar Gala @ 2009-03-30 13:51 UTC (permalink / raw)
  To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list
In-Reply-To: <1238383506.17330.0.camel@pasglop>


On Mar 29, 2009, at 10:25 PM, Benjamin Herrenschmidt wrote:

> My next branch (after merging from you):
>
> ERROR: "fsl_pq_mdio_bus_name" [drivers/net/gianfar_driver.ko]  
> undefined!
>
> I'll ask Linus to pull anyway though.
>
> Cheers,
> Ben.

I believe this is fixed in net-next (and possible linus has already  
pulled that in.)

- k

^ permalink raw reply

* Re: Build error
From: Anton Vorontsov @ 2009-03-30 13:59 UTC (permalink / raw)
  To: Kumar Gala; +Cc: linuxppc-dev list
In-Reply-To: <7E26E694-85F8-445F-9113-88DCD61BC32C@kernel.crashing.org>

On Mon, Mar 30, 2009 at 08:51:38AM -0500, Kumar Gala wrote:
>
> On Mar 29, 2009, at 10:25 PM, Benjamin Herrenschmidt wrote:
>
>> My next branch (after merging from you):
>>
>> ERROR: "fsl_pq_mdio_bus_name" [drivers/net/gianfar_driver.ko]  
>> undefined!
>>
>> I'll ask Linus to pull anyway though.
>>
>> Cheers,
>> Ben.
>
> I believe this is fixed in net-next (and possible linus has already  
> pulled that in.)

FWIW, I can't reproduce the issue neither in benh/powerpc.git `next'
branch nor in `merge' branch...

-- 
Anton Vorontsov
email: cbouatmailru@gmail.com
irc://irc.freenode.net/bd2

^ permalink raw reply

* using IRQ1 in mpc5121ads
From: sylvain louchez @ 2009-03-30 14:33 UTC (permalink / raw)
  To: linuxppc-dev

[-- Attachment #1: Type: text/plain, Size: 1649 bytes --]

Hello, I'm a newbie looking for where the documentation and implementation
model can be found.

 

My custom driver is looking for an interrupt notification from the kernel -
and it registers in the /proc/interrupts file as expected when installed,
i.e.

$insmod custom_driver.ko gps_irq=<n>

**Note - this part's OK, I see the instance in /proc/interrupts after I load
it**

 

On the hardware side the actual signal is a 1 Hz pulse (from GPS) routed to
IRQ1 through the board's CPLD. This is the only interrupt on IRQ_1 so we can
keep the logic simple i.e. on IRQ1 we can just jump to the service routine
in a custom driver.

 

I understand 2 things have to be done:

 

1. create an entry in the dts file; I think we've got this understood
through advice already received - for example the new interrupt entry can be
created in the dts file - something like:

 

gps@0 {      // there is no address so just make it 0

    compatible = "gps_interrupt";

    interrupts = <17 0x8>;         // 17 is irq1, 8 is level low, see
include/linux/irq.h for others

    interrupt-parent = < &ipic >;

};

 

2. but now we need to relate the actual interrupt to the virtual interrupt
called in the driver... by invoking the function irq_of_parse_and_map - but
we don't know how to do it - nor have we found how to do it in browsing
through the open source documentation

A secondary question: where to properly add this function call in the file
system?

 

Are we on the right track here? Is there sample/ tutorial code you could
point us to?

 

Thanks in advance for any pointers - documentation on these mechanisms,
sample code.

 

Sylvain Louchez

 


[-- Attachment #2: Type: text/html, Size: 6213 bytes --]

^ permalink raw reply

* Interrupts on GPIO
From: Yann Pelletier @ 2009-03-30 15:57 UTC (permalink / raw)
  To: linuxppc-dev@ozlabs.org


Hi,=20
I'd like to add supports for interrupts handling from GPIO controller.  Som=
e of these interrupts are from I2C devices and some others are from SPI dev=
ices.

What is the best approach to enable interrupts handling for those devices t=
hrough GPIO.

Note that I'm developing on a custom board based on mpc8313_rdb using linux=
 2.6.28.5


Also,=20

# cat /proc/interrupts
           CPU0      =20
 16:         60   IPIC   Level     serial
 17:          0   IPIC   Level     fpga
 18:          4   IPIC   Level     mpc83xx_spi
 21:          0   IPIC   Level     i2c-mpc
 22:          7   IPIC   Level     i2c-mpc

According to my platform device tree, serial irq should be on int9, SPI on =
int16 and i2c on int14,15.  This causes me some problems as I need int18 to=
 map to external IRQ2.

Thanks for support.

Yann

^ permalink raw reply

* Re: Interrupts on GPIO
From: Grant Likely @ 2009-03-30 16:32 UTC (permalink / raw)
  To: Yann Pelletier; +Cc: linuxppc-dev@ozlabs.org
In-Reply-To: <9A8B45DD4DE17F4783430D784DA0B68811C41F9D9F@HEXMBVS12.hostedmsx.local>

On Mon, Mar 30, 2009 at 9:57 AM, Yann Pelletier
<ypelletier@haivision.com> wrote:
>
> Hi,
> I'd like to add supports for interrupts handling from GPIO controller. =
=A0Some of these interrupts are from I2C devices and some others are from S=
PI devices.
>
> What is the best approach to enable interrupts handling for those devices=
 through GPIO.

Modify the GPIO driver to also be a cascaded IRQ driver (see
http://patchwork.ozlabs.org/patch/21914/ for an example).

> Also,
>
> # cat /proc/interrupts
> =A0 =A0 =A0 =A0 =A0 CPU0
> =A016: =A0 =A0 =A0 =A0 60 =A0 IPIC =A0 Level =A0 =A0 serial
> =A017: =A0 =A0 =A0 =A0 =A00 =A0 IPIC =A0 Level =A0 =A0 fpga
> =A018: =A0 =A0 =A0 =A0 =A04 =A0 IPIC =A0 Level =A0 =A0 mpc83xx_spi
> =A021: =A0 =A0 =A0 =A0 =A00 =A0 IPIC =A0 Level =A0 =A0 i2c-mpc
> =A022: =A0 =A0 =A0 =A0 =A07 =A0 IPIC =A0 Level =A0 =A0 i2c-mpc
>
> According to my platform device tree, serial irq should be on int9, SPI o=
n int16 and i2c on int14,15. =A0This causes me some problems as I need int1=
8 to map to external IRQ2.

These numbers are *Linux internal* virtual irq numbers.  They have no
relation to the physical IRQ number for each interrupt controller.
Just make sure your Device Tree maps the IRQs correctly and you'll be
okay.

g.

--=20
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox