24 Sep, 2009

1 commit

  • Sometimes this is used to hold a simple offset, and sometimes
    it is used to hold a pointer. This patch changes it to a union containing
    void * and dma_addr_t. get/set accessors are also provided, because it was
    getting a bit ugly to get to the actual data.

    Signed-off-by: Becky Bruce
    Signed-off-by: Benjamin Herrenschmidt

    Becky Bruce
     

22 Sep, 2009

1 commit


16 Sep, 2009

1 commit

  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc: (134 commits)
    powerpc/nvram: Enable use Generic NVRAM driver for different size chips
    powerpc/iseries: Fix oops reading from /proc/iSeries/mf/*/cmdline
    powerpc/ps3: Workaround for flash memory I/O error
    powerpc/booke: Don't set DABR on 64-bit BookE, use DAC1 instead
    powerpc/perf_counters: Reduce stack usage of power_check_constraints
    powerpc: Fix bug where perf_counters breaks oprofile
    powerpc/85xx: Fix SMP compile error and allow NULL for smp_ops
    powerpc/irq: Improve nanodoc
    powerpc: Fix some late PowerMac G5 with PCIe ATI graphics
    powerpc/fsl-booke: Use HW PTE format if CONFIG_PTE_64BIT
    powerpc/book3e: Add missing page sizes
    powerpc/pseries: Fix to handle slb resize across migration
    powerpc/powermac: Thermal control turns system off too eagerly
    powerpc/pci: Merge ppc32 and ppc64 versions of phb_scan()
    powerpc/405ex: support cuImage via included dtb
    powerpc/405ex: provide necessary fixup function to support cuImage
    powerpc/40x: Add support for the ESTeem 195E (PPC405EP) SBC
    powerpc/44x: Add Eiger AMCC (AppliedMicro) PPC460SX evaluation board support.
    powerpc/44x: Update Arches defconfig
    powerpc/44x: Update Arches dts
    ...

    Fix up conflicts in drivers/char/agp/uninorth-agp.c

    Linus Torvalds
     

15 Sep, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1623 commits)
    netxen: update copyright
    netxen: fix tx timeout recovery
    netxen: fix file firmware leak
    netxen: improve pci memory access
    netxen: change firmware write size
    tg3: Fix return ring size breakage
    netxen: build fix for INET=n
    cdc-phonet: autoconfigure Phonet address
    Phonet: back-end for autoconfigured addresses
    Phonet: fix netlink address dump error handling
    ipv6: Add IFA_F_DADFAILED flag
    net: Add DEVTYPE support for Ethernet based devices
    mv643xx_eth.c: remove unused txq_set_wrr()
    ucc_geth: Fix hangs after switching from full to half duplex
    ucc_geth: Rearrange some code to avoid forward declarations
    phy/marvell: Make non-aneg speed/duplex forcing work for 88E1111 PHYs
    drivers/net/phy: introduce missing kfree
    drivers/net/wan: introduce missing kfree
    net: force bridge module(s) to be GPL
    Subject: [PATCH] appletalk: Fix skb leak when ipddp interface is not loaded
    ...

    Fixed up trivial conflicts:

    - arch/x86/include/asm/socket.h

    converted to in the x86 tree. The generic
    header has the same new #define's, so that works out fine.

    - drivers/net/tun.c

    fix conflict between 89f56d1e9 ("tun: reuse struct sock fields") that
    switched over to using 'tun->socket.sk' instead of the redundantly
    available (and thus removed) 'tun->sk', and 2b980dbd ("lsm: Add hooks
    to the TUN driver") which added a new 'tun->sk' use.

    Noted in 'next' by Stephen Rothwell.

    Linus Torvalds
     

06 Sep, 2009

1 commit


31 Aug, 2009

1 commit

  • In some CPUs (i.e. MPC8569) QE shuts down completely during sleep,
    drivers may want to know that to reinitialize registers and buffer
    descriptors.

    This patch implements qe_alive_during_sleep() helper function, so far
    it just checks if MPC8569-compatible power management controller is
    present, which is a sign that QE turns off during sleep.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: David S. Miller

    Anton Vorontsov
     

26 Aug, 2009

1 commit


25 Aug, 2009

1 commit


20 Aug, 2009

6 commits

  • Add a byte length read and write interface compatible with the
    nvram_generic driver interface to the mmio driver.

    Signed-off-by: Martyn Welch
    Signed-off-by: Benjamin Herrenschmidt

    Martyn Welch
     
  • Error handling code following a kzalloc should free the allocated data.

    The semantic match that finds the problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r exists@
    local idexpression x;
    statement S;
    expression E;
    identifier f,f1,l;
    position p1,p2;
    expression *ptr != NULL;
    @@

    x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
    ...
    if (x == NULL) S
    }
    (
    x->f1 = E
    |
    (x->f1 == NULL || ...)
    |
    f(...,x->f1,...)
    )
    ...>
    (
    return \(0\|\|ptr\);
    |
    return@p2 ...;
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
    //

    Signed-off-by: Julia Lawall
    Acked-by: Timur Tabi
    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Julia Lawall
     
  • Error handling code following a kzalloc should free the allocated data.

    The semantic match that finds the problem is as follows:
    (http://www.emn.fr/x-info/coccinelle/)

    //
    @r exists@
    local idexpression x;
    statement S;
    expression E;
    identifier f,f1,l;
    position p1,p2;
    expression *ptr != NULL;
    @@

    x@p1 = \(kmalloc\|kzalloc\|kcalloc\)(...);
    ...
    if (x == NULL) S
    }
    (
    x->f1 = E
    |
    (x->f1 == NULL || ...)
    |
    f(...,x->f1,...)
    )
    ...>
    (
    return \(0\|\|ptr\);
    |
    return@p2 ...;
    )

    @script:python@
    p1 << r.p1;
    p2 << r.p2;
    @@

    print "* file: %s kmalloc %s return %s" % (p1[0].file,p1[0].line,p2[0].line)
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Julia Lawall
     
  • in case the interrupt controller was used in an earlier life then it is
    possible it is that some of its sources were used and are still unmask.
    If the (unmasked) device is active and is creating interrupts (or one
    interrupts was pending since the interrupts were disabled) then the boot
    process "ends" very soon. Once external interrupts are enabled, we land in
    -> do_IRQ
    -> call ppc_md.get_irq()
    -> ipic_read() gets the source number
    -> irq_linear_revmap(source)
    -> revmap[source] == NO_IRQ
    -> irq_find_mapping(source) returns NO_IRQ because no source
    is registered
    -> source is NO_IRQ, ppc_spurious_interrupts gets incremented, no
    further action.

    Signed-off-by: Sebastian Andrzej Siewior
    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Sebastian Andrzej Siewior
     
  • Check that the result of kmalloc/kzalloc is not NULL before dereferencing it.

    The semantic match that finds this problem is as follows:
    (http://coccinelle.lip6.fr/)

    //
    @@
    expression *x;
    identifier f;
    constant char *C;
    @@

    x = \(kmalloc\|kcalloc\|kzalloc\)(...);
    ... when != x == NULL
    when != x != NULL
    when != (x || ...)
    (
    kfree(x)
    |
    f(...,C,...,x,...)
    |
    *f(...,x,...)
    |
    *x->f
    )
    //

    Signed-off-by: Julia Lawall
    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Julia Lawall
     
  • The workaround enabled by CONFIG_MPIC_BROKEN_REGREAD does not work
    on non-broken MPICs. The symptom is no interrupts being received.

    The fix is twofold. Firstly the code was broken for multiple isus,
    we need to index into the shadow array with the src_no, not the idx.
    Secondly, we always do the read, but only use the VECPRI_MASK and
    VECPRI_ACTIVITY bits from the hardware, the rest of "val" comes
    from the shadow.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Olof Johansson
    Signed-off-by: Benjamin Herrenschmidt

    Michael Ellerman
     

08 Jul, 2009

2 commits

  • This patch fixes various badnesses like this for all interrupt
    controllers:

    ------------[ cut here ]------------
    Badness at c04db9dc [verbose debug info unavailable]
    NIP: c04db9dc LR: c04db9ac CTR: 00000000
    REGS: c053de30 TRAP: 0700 Not tainted (2.6.31-rc1-00432-ge69b2b5-dirty)
    MSR: 00021000 CR: 22020084 XER: 00000000
    TASK = c0500480[0] 'swapper' THREAD: c053c000
    GPR00: 00000001 c053dee0 c0500480 00000000 00000050 00000020 3fffffff 00000000
    GPR08: 00000001 c0540000 e0080080 00000000 22000084 64183600 3ff8f800 00000000
    GPR16: 841b0240 449a0303 00000000 00000000 00000000 00000000 00000000 c04f5bf4
    GPR24: 00000000 00000000 00000000 00000050 00000020 00000000 3fffffff 00000050
    NIP [c04db9dc] alloc_arch_preferred_bootmem+0x48/0x74
    LR [c04db9ac] alloc_arch_preferred_bootmem+0x18/0x74
    Call Trace:
    [c053dee0] [c000a5a4] __of_address_to_resource+0x44/0xd0 (unreliable)
    [c053def0] [c04dba58] ___alloc_bootmem_nopanic+0x50/0x108
    [c053df20] [c04dbb28] ___alloc_bootmem+0x18/0x50
    [c053df30] [c04d5de0] qe_ic_init+0x5c/0x1b0
    [c053df70] [c04d77b0] mpc85xx_mds_pic_init+0xb8/0x10c
    [c053dfb0] [c04cf374] init_IRQ+0x28/0x3c

    p.s. commit 85355bb272db31a3f2dd99d547eef794805e1319 ("powerpc: Fix
    mpic alloc warning") missed some alloc_bootmem() instances, this is
    now fixed.

    Signed-off-by: Anton Vorontsov
    Acked-by: Timur Tabi
    Signed-off-by: Benjamin Herrenschmidt

    Anton Vorontsov
     
  • Signed-off-by: Joe Perches
    Acked-by: Geoff Levand
    Signed-off-by: Benjamin Herrenschmidt

    Joe Perches
     

26 Jun, 2009

3 commits

  • Benjamin Herrenschmidt
     
  • Since we can use kmalloc earlier we are getting the following since the
    mpic_alloc() code calls alloc_bootmem(). Move to using kzalloc() to
    remove the warning.

    ------------[ cut here ]------------
    Badness at c0583248 [verbose debug info unavailable]
    NIP: c0583248 LR: c0583210 CTR: 00000004
    REGS: c0741de0 TRAP: 0700 Not tainted (2.6.30-06736-g12a31df)
    MSR: 00021000 CR: 22024024 XER: 00000000
    TASK = c070d3b8[0] 'swapper' THREAD: c0740000 CPU: 0
    GPR00: 00000001 c0741e90 c070d3b8 00000001 00000210 00000020 3fffffff 00000000
    GPR08: 00000000 c0c85700 c04f8c40 0000002d 22044022 1004a388 7ffd9400 00000000
    GPR16: 00000000 7ffcd100 7ffcd100 7ffcd100 c04f8c40 00000000 c059f62c c075a0c0
    GPR24: c059f648 00000000 0000000f 00000210 00000020 00000000 3fffffff 00000210
    NIP [c0583248] alloc_arch_preferred_bootmem+0x50/0x80
    LR [c0583210] alloc_arch_preferred_bootmem+0x18/0x80
    Call Trace:
    [c0741e90] [c07343b0] devtree_lock+0x0/0x24 (unreliable)
    [c0741ea0] [c0583b14] ___alloc_bootmem_nopanic+0x54/0x108
    [c0741ee0] [c0583e18] ___alloc_bootmem+0x18/0x50
    [c0741ef0] [c057b9cc] mpic_alloc+0x48/0x710
    [c0741f40] [c057ecf4] mpc85xx_ds_pic_init+0x190/0x1b8
    [c0741f90] [c057633c] init_IRQ+0x24/0x34
    [c0741fa0] [c05738b8] start_kernel+0x260/0x3dc
    [c0741ff0] [c00003c8] skpinv+0x2e0/0x31c
    Instruction dump:
    409e001c 7c030378 80010014 83e1000c 38210010 7c0803a6 4e800020 3d20c0c8
    39295700 80090004 7c000034 5400d97e 2f800000 409e001c 38800000

    BenH: Changed to use GFP_KERNEL, the allocator will do the right thing

    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     
  • Commit 31207dab7d2e63795eb15823947bd2f7025b08e2
    "Fix incorrect allocation of interrupt rev-map"
    introduced a regression crashing on boot on machines using
    a "DCR" based MPIC, such as the Cell blades.

    The reason is that the irq host data structure is initialized
    much later as a result of that patch, causing our calls to
    mpic_map() do be done before we have a host setup.

    Unfortunately, this breaks _mpic_map_dcr() which uses the
    mpic->irqhost to get to the device node.

    This fixes it by, instead, passing the device node explicitely
    to mpic_map().

    Signed-off-by: Benjamin Herrenschmidt
    Acked-by: Akira Tsukamoto

    Benjamin Herrenschmidt
     

23 Jun, 2009

1 commit

  • The qe_issue_cmd() function (Freescale PowerPC QUICC Engine library) polls
    on a register until a status bit changes, but does not include a timeout
    to handle the situation if the bit never changes. Change the code to use
    the new spin_event_timeout() macro, which simplifies polling on a register
    without a timeout.

    Signed-off-by: Timur Tabi
    Signed-off-by: Kumar Gala

    Timur Tabi
     

17 Jun, 2009

1 commit


16 Jun, 2009

1 commit

  • Add the option to build the code under arch/powerpc with -Werror.

    The intention is to make it harder for people to inadvertantly introduce
    warnings in the arch/powerpc code. It needs to be configurable so that
    if a warning is introduced, people can easily work around it while it's
    being fixed.

    The option is a negative, ie. don't enable -Werror, so that it will be
    turned on for allyes and allmodconfig builds.

    The default is n, in the hope that developers will build with -Werror,
    that will probably lead to some build breaks, I am prepared to be flamed.

    It's not enabled for math-emu, which is a steaming pile of warnings.

    Signed-off-by: Michael Ellerman
    Signed-off-by: Benjamin Herrenschmidt

    Michael Ellerman
     

12 Jun, 2009

2 commits

  • Manual merge of:
    arch/powerpc/kernel/asm-offsets.c

    Benjamin Herrenschmidt
     
  • * 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block: (153 commits)
    block: add request clone interface (v2)
    floppy: fix hibernation
    ramdisk: remove long-deprecated "ramdisk=" boot-time parameter
    fs/bio.c: add missing __user annotation
    block: prevent possible io_context->refcount overflow
    Add serial number support for virtio_blk, V4a
    block: Add missing bounce_pfn stacking and fix comments
    Revert "block: Fix bounce limit setting in DM"
    cciss: decode unit attention in SCSI error handling code
    cciss: Remove no longer needed sendcmd reject processing code
    cciss: change SCSI error handling routines to work with interrupts enabled.
    cciss: separate error processing and command retrying code in sendcmd_withirq_core()
    cciss: factor out fix target status processing code from sendcmd functions
    cciss: simplify interface of sendcmd() and sendcmd_withirq()
    cciss: factor out core of sendcmd_withirq() for use by SCSI error handling code
    cciss: Use schedule_timeout_uninterruptible in SCSI error handling code
    block: needs to set the residual length of a bidi request
    Revert "block: implement blkdev_readpages"
    block: Fix bounce limit setting in DM
    Removed reference to non-existing file Documentation/PCI/PCI-DMA-mapping.txt
    ...

    Manually fix conflicts with tracing updates in:
    block/blk-sysfs.c
    drivers/ide/ide-atapi.c
    drivers/ide/ide-cd.c
    drivers/ide/ide-floppy.c
    drivers/ide/ide-tape.c
    include/trace/events/block.h
    kernel/trace/blktrace.c

    Linus Torvalds
     

07 Jun, 2009

3 commits


02 Jun, 2009

1 commit


23 May, 2009

1 commit

  • Until now we have had a 1:1 mapping between storage device physical
    block size and the logical block sized used when addressing the device.
    With SATA 4KB drives coming out that will no longer be the case. The
    sector size will be 4KB but the logical block size will remain
    512-bytes. Hence we need to distinguish between the physical block size
    and the logical ditto.

    This patch renames hardsect_size to logical_block_size.

    Signed-off-by: Martin K. Petersen
    Signed-off-by: Jens Axboe

    Martin K. Petersen
     

21 May, 2009

5 commits

  • We shouldn't directly access sysdata to get the pci_controller. Instead
    use pci_bus_to_host() for this purpose. In the future we might have
    sysdata be a device_node to match ppc64 and unify the code between ppc32
    & ppc64.

    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     
  • We shouldn't directly access sysdata to get the pci_controller. Instead
    use pci_bus_to_host() for this purpose. In the future we might have
    sysdata be a device_node to match ppc64 and unify the code between ppc32
    & ppc64.

    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     
  • We shouldn't directly access sysdata to get the pci_controller. Instead
    use pci_bus_to_host() for this purpose. In the future we might have
    sysdata be a device_node to match ppc64 and unify the code between ppc32
    & ppc64.

    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     
  • We shouldn't directly access sysdata to get the pci_controller. Instead
    use pci_bus_to_host() for this purpose. In the future we might have
    sysdata be a device_node to match ppc64 and unify the code between ppc32
    & ppc64.

    Signed-off-by: Kumar Gala
    Signed-off-by: Benjamin Herrenschmidt

    Kumar Gala
     
  • mpic_find() was overloaded to do two things, finding the mpic instance
    for a given interrupt and returning if it's an IPI. Instead we introduce
    mpic_is_ipi() and simplify mpic_find() to just return the mpic instance

    Also silences the warning:
    arch/powerpc/sysdev/mpic.c: In function 'mpic_irq_set_priority':
    arch/powerpc/sysdev/mpic.c:1382: warning: 'is_ipi' may be used uninitialized in this function

    Signed-off-by: Tony Breeds
    Acked-by: Michael Ellerman
    Signed-off-by: Benjamin Herrenschmidt

    Tony Breeds
     

19 May, 2009

6 commits

  • Previouslly we just always set the inbound window to 2G. This was
    broken for systems with >2G. If a system has >=4G we will need
    SWIOTLB support to handle that case.

    We now allocate PCICSRBAR/PEXCSRBAR right below the lowest PCI outbound
    address for MMIO or the 4G boundary (if the lowest PCI address is above
    4G).

    Signed-off-by: Kumar Gala

    Kumar Gala
     
  • The P2020 is a dual e500v2 core based SOC with:
    * 3 PCIe controllers
    * 2 General purpose DMA controllers
    * 2 sRIO controllers
    * 3 eTSECS
    * USB 2.0
    * SDHC
    * SPI, I2C, DUART
    * enhanced localbus
    * and optional Security (P2020E) security w/XOR acceleration

    The p2020 DS reference board is pretty similar to the existing MPC85xx
    DS boards and has a ULI 1575 connected on one of the PCIe controllers.

    Signed-off-by: Ted Peters
    Signed-off-by: Kumar Gala

    Kumar Gala
     
  • Instead of fixed address in old code.

    Signed-off-by: Li Yang
    Signed-off-by: Kumar Gala

    Li Yang
     
  • We we build with resource_size_t as a 64-bit quantity we get:

    arch/powerpc/sysdev/fsl_rio.c: In function 'fsl_rio_setup':
    arch/powerpc/sysdev/fsl_rio.c:1029: warning: format '%08x' expects type 'unsigned int', but argument 4 has type 'resource_size_t'
    arch/powerpc/sysdev/fsl_rio.c:1029: warning: format '%08x' expects type 'unsigned int', but argument 5 has type 'resource_size_t'

    Signed-off-by: Kumar Gala

    Kumar Gala
     
  • Its feasible based on how the PCI address map is setup that the region
    of PCI address space used for MSIs differs for each PHB on the same SoC.

    Instead of assuming that the address mappes to CCSRBAR 1:1 we read
    PEXCSRBAR (BAR0) for the PHB that the given pci_dev is on.

    Signed-off-by: Kumar Gala

    Kumar Gala
     
  • This patch adds PCI IDs for MPC8569 and MPC8569E processors,
    plus adds appropriate quirks for these IDs, and thus makes
    PCI-E actually work on MPC8569E-MDS boards.

    Signed-off-by: Anton Vorontsov
    Signed-off-by: Kumar Gala

    Anton Vorontsov