24 Mar, 2012

2 commits

  • Pull #3 ARM updates from Russell King:
    "This adds gpio support to soc_common, allowing an amount of code to be
    deleted from each PCMCIA socket driver for the PXA/SA11x0 SoCs."

    * 'pcmcia' of git://git.linaro.org/people/rmk/linux-arm:
    PCMCIA: sa1111: rename sa1111 socket drivers to have sa1111_ prefix.
    PCMCIA: make lubbock socket driver part of sa1111_cs
    PCMCIA: add Kconfig control for building sa11xx_base.c
    PCMCIA: sa1111: jornada720: no need to disable IRQs around sa1111_set_io
    PCMCIA: sa1111: pass along sa1111_pcmcia_configure_socket() failure code
    PCMCIA: soc_common: remove explicit wrprot initialization in socket drivers
    PCMCIA: soc_common: remove soc_pcmcia_*_irqs functions
    PCMCIA: sa11x0: h3600: convert to use new irq/gpio management
    PCMCIA: sa11x0: simpad: convert to use new irq/gpio management
    PCMCIA: sa11x0: shannon: convert to use new irq/gpio management
    PCMCIA: sa11x0: nanoengine: convert reset handling to use GPIO subsystem
    PCMCIA: sa11x0: nanoengine: convert to use new irq/gpio management
    PCMCIA: sa11x0: cerf: convert reset handling to use GPIO subsystem
    PCMCIA: sa11x0: cerf: convert to use new irq/gpio management
    PCMCIA: sa11x0: assabet: convert to use new irq/gpio management
    PCMCIA: sa1111: use new per-socket irq/gpio infrastructure
    PCMCIA: pxa: convert PXA socket drivers to use new irq/gpio management
    PCMCIA: soc_common: add GPIO support for card status signals
    PCMCIA: soc_common: move common initialization into soc_common

    Linus Torvalds
     
  • Pull PCI changes (including maintainer change) from Jesse Barnes:
    "This pull has some good cleanups from Bjorn and Yinghai, as well as
    some more code from Yinghai to better handle resource re-allocation
    when enabled.

    There's also a new initcall_debug feature from Arjan which will print
    out quirk timing information to help identify slow quirks for fixing
    or refinement (Yinghai sent in a few patches to do just that once the
    new debug code landed).

    Beyond that, I'm handing off PCI maintainership to Bjorn Helgaas.
    He's been a core PCI and Linux contributor for some time now, and has
    kindly volunteered to take over. I just don't feel I have the time
    for PCI review and work that it deserves lately (I've taken on some
    other projects), and haven't been as responsive lately as I'd like, so
    I approached Bjorn asking if he'd like to manage things. He's going
    to give it a try, and I'm confident he'll do at least as well as I
    have in keeping the tree managed, patches flowing, and keeping things
    stable."

    Fix up some fairly trivial conflicts due to other cleanups (mips device
    resource fixup cleanups clashing with list handling cleanup, ppc iseries
    removal clashing with pci_probe_only cleanup etc)

    * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci: (112 commits)
    PCI: Bjorn gets PCI hotplug too
    PCI: hand PCI maintenance over to Bjorn Helgaas
    unicore32/PCI: move include to asm/pci.h
    sparc/PCI: convert devtree and arch-probed bus addresses to resource
    powerpc/PCI: allow reallocation on PA Semi
    powerpc/PCI: convert devtree bus addresses to resource
    powerpc/PCI: compute I/O space bus-to-resource offset consistently
    arm/PCI: don't export pci_flags
    PCI: fix bridge I/O window bus-to-resource conversion
    x86/PCI: add spinlock held check to 'pcibios_fwaddrmap_lookup()'
    PCI / PCIe: Introduce command line option to disable ARI
    PCI: make acpihp use __pci_remove_bus_device instead
    PCI: export __pci_remove_bus_device
    PCI: Rename pci_remove_behind_bridge to pci_stop_and_remove_behind_bridge
    PCI: Rename pci_remove_bus_device to pci_stop_and_remove_bus_device
    PCI: print out PCI device info along with duration
    PCI: Move "pci reassigndev resource alignment" out of quirks.c
    PCI: Use class for quirk for usb host controller fixup
    PCI: Use class for quirk for ti816x class fixup
    PCI: Use class for quirk for intel e100 interrupt fixup
    ...

    Linus Torvalds
     

10 Mar, 2012

1 commit


28 Feb, 2012

1 commit


21 Feb, 2012

10 commits


16 Feb, 2012

1 commit

  • If pxa2xx_drv_pcmcia_add_one fails, it will go to err1 error path.
    Add a missing clk_put in the error path.

    Checking the ret value after the for loop is redundant, it is always false.
    Thus remove the redundant checking.

    Signed-off-by: Axel Lin
    Acked-by: Eric Miao
    Acked-by: Marek Vasut
    Signed-off-by: Haojian Zhuang

    Axel Lin
     

09 Feb, 2012

1 commit

  • This fixes a memory-corrupting bug: not only does it cause the warning,
    but as a result of dropping the refcount to zero, it causes the
    pcmcia_socket0 device structure to be freed while it still has
    references, causing slab caches corruption. A fatal oops quickly
    follows this warning - often even just a 'dmesg' following the warning
    causes the kernel to oops.

    While testing suspend/resume on an ARM device with PCMCIA support, and a
    CF card inserted, I found that after five suspend and resumes, the
    kernel would complain, and shortly die after with slab corruption.

    WARNING: at include/linux/kref.h:41 kobject_get+0x28/0x50()

    As the message doesn't give a clue about which kobject, and the built-in
    debugging in drivers/base/power/main.c happens too late, this was added
    right before each get_device():

    printk("%s: %p [%s] %u\n", __func__, dev, kobject_name(&dev->kobj), atomic_read(&dev->kobj.kref.refcount));

    and on the 3rd s2ram cycle, the following behaviour observed:

    On the 3rd suspend/resume cycle:

    dpm_prepare: c1a0d998 [pcmcia_socket0] 3
    dpm_suspend: c1a0d998 [pcmcia_socket0] 3
    dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 3
    dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 3
    dpm_resume: c1a0d998 [pcmcia_socket0] 3
    dpm_complete: c1a0d998 [pcmcia_socket0] 2

    4th:

    dpm_prepare: c1a0d998 [pcmcia_socket0] 2
    dpm_suspend: c1a0d998 [pcmcia_socket0] 2
    dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 2
    dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 2
    dpm_resume: c1a0d998 [pcmcia_socket0] 2
    dpm_complete: c1a0d998 [pcmcia_socket0] 1

    5th:

    dpm_prepare: c1a0d998 [pcmcia_socket0] 1
    dpm_suspend: c1a0d998 [pcmcia_socket0] 1
    dpm_suspend_noirq: c1a0d998 [pcmcia_socket0] 1
    dpm_resume_noirq: c1a0d998 [pcmcia_socket0] 1
    dpm_resume: c1a0d998 [pcmcia_socket0] 1
    dpm_complete: c1a0d998 [pcmcia_socket0] 0
    ------------[ cut here ]------------
    WARNING: at include/linux/kref.h:41 kobject_get+0x28/0x50()
    Modules linked in: ucb1x00_core
    Backtrace:
    [] (dump_backtrace+0x0/0x110) from [] (dump_stack+0x18/0x1c)
    [] (dump_stack+0x0/0x1c) from [] (warn_slowpath_common+0x50/0x68)
    [] (warn_slowpath_common+0x0/0x68) from [] (warn_slowpath_null+0x24/0x28)
    [] (warn_slowpath_null+0x0/0x28) from [] (kobject_get+0x28/0x50)
    [] (kobject_get+0x0/0x50) from [] (get_device+0x1c/0x24)
    [] (dpm_complete+0x0/0x1a0) from [] (dpm_resume_end+0x1c/0x20)
    ...

    Looking at commit 7b24e7988263 ("pcmcia: split up central event handler"),
    the following change was made to cs.c:

    return 0;
    }
    #endif
    -
    - send_event(skt, CS_EVENT_PM_RESUME, CS_EVENT_PRI_LOW);
    + if (!(skt->state & SOCKET_CARDBUS) && (skt->callback))
    + skt->callback->early_resume(skt);
    return 0;
    }

    And the corresponding change in ds.c is from:

    -static int ds_event(struct pcmcia_socket *skt, event_t event, int priority)
    -{
    - struct pcmcia_socket *s = pcmcia_get_socket(skt);
    ...
    - switch (event) {
    ...
    - case CS_EVENT_PM_RESUME:
    - if (verify_cis_cache(skt) != 0) {
    - dev_dbg(&skt->dev, "cis mismatch - different card\n");
    - /* first, remove the card */
    - ds_event(skt, CS_EVENT_CARD_REMOVAL, CS_EVENT_PRI_HIGH);
    - mutex_lock(&s->ops_mutex);
    - destroy_cis_cache(skt);
    - kfree(skt->fake_cis);
    - skt->fake_cis = NULL;
    - s->functions = 0;
    - mutex_unlock(&s->ops_mutex);
    - /* now, add the new card */
    - ds_event(skt, CS_EVENT_CARD_INSERTION,
    - CS_EVENT_PRI_LOW);
    - }
    - break;
    ...
    - }

    - pcmcia_put_socket(s);

    - return 0;
    -} /* ds_event */

    to:

    +static int pcmcia_bus_early_resume(struct pcmcia_socket *skt)
    +{
    + if (!verify_cis_cache(skt)) {
    + pcmcia_put_socket(skt);
    + return 0;
    + }

    + dev_dbg(&skt->dev, "cis mismatch - different card\n");

    + /* first, remove the card */
    + pcmcia_bus_remove(skt);
    + mutex_lock(&skt->ops_mutex);
    + destroy_cis_cache(skt);
    + kfree(skt->fake_cis);
    + skt->fake_cis = NULL;
    + skt->functions = 0;
    + mutex_unlock(&skt->ops_mutex);

    + /* now, add the new card */
    + pcmcia_bus_add(skt);
    + return 0;
    +}

    As can be seen, the original function called pcmcia_get_socket() and
    pcmcia_put_socket() around the guts, whereas the replacement code
    calls pcmcia_put_socket() only in one path. This creates an imbalance
    in the refcounting.

    Testing with pcmcia_put_socket() put removed shows that the bug is gone:

    dpm_suspend: c1a10998 [pcmcia_socket0] 5
    dpm_suspend_noirq: c1a10998 [pcmcia_socket0] 5
    dpm_resume_noirq: c1a10998 [pcmcia_socket0] 5
    dpm_resume: c1a10998 [pcmcia_socket0] 5
    dpm_complete: c1a10998 [pcmcia_socket0] 5

    Tested-by: Russell King
    Signed-off-by: Russell King
    Cc: Dominik Brodowski
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Russell King
     

04 Feb, 2012

7 commits


03 Feb, 2012

1 commit


27 Jan, 2012

3 commits

  • This patch (as1514) cleans up some places where new_id and remove_id
    sysfs attributes are created and deleted. Handling both attributes in
    a single routine rather than a pair of routines makes the code
    smaller. It also prevents certain kinds of errors, like one we
    currently have in the USB subsystem: The removeid attribute is often
    created even when newid isn't (because the driver's no_dynamid_id flag
    is set).

    In the case of the PCMCIA subsystem, the newid attribute is created
    but never explicitly deleted. The patch adds a deletion routine.

    Signed-off-by: Alan Stern
    Acked-by: Jesse Barnes
    Acked-by: Dominik Brodowski
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • Add GPIO support for reading the card status (card detect, ready,
    battery voltage detect) signals into soc_common code. As we want
    interrupts from these GPIOs, this takes over the old irq handling
    infrastructure for card status signals, which will now be managed
    entirely by the soc_common code.

    Acked-by: Dominik Brodowski
    Signed-off-by: Russell King

    Russell King
     
  • Move common socket initialization into soc_common.c.

    Acked-by: Dominik Brodowski
    Signed-off-by: Russell King

    Russell King
     

25 Jan, 2012

2 commits

  • As part of the removal of get_driver()/put_driver(), this patch
    (as1511) changes all the places that add dynamic IDs for drivers.
    Since these additions are done by writing to the drivers' sysfs
    attribute files, and the attributes are removed when the drivers are
    unregistered, there is no reason to take an extra reference to the
    drivers.

    The one exception is the pci-stub driver, which calls pci_add_dynid()
    as part of its registration. But again, there's no reason to take an
    extra reference here, because the driver can't be unloaded while it is
    being registered.

    Signed-off-by: Alan Stern
    CC: Dmitry Torokhov
    CC: Jiri Kosina
    CC: Jesse Barnes
    CC: Dominik Brodowski
    Signed-off-by: Greg Kroah-Hartman

    Alan Stern
     
  • The sa1111 socket driver oopses when removed:

    Unable to handle kernel NULL pointer dereference at virtual address 000003b0
    pgd = c1b40000
    [000003b0] *pgd=00000000
    Internal error: Oops: 41b43005 [#1]
    Modules linked in:
    CPU: 0 Not tainted (3.3.0-rc1+ #744)
    PC is at pcmcia_remove+0x3c/0x60
    LR is at pcmcia_remove+0x34/0x60

    This is because we try to dereference a NULL 's' to obtain the next
    pointer. Fix this.

    Signed-off-by: Russell King

    Russell King
     

15 Jan, 2012

1 commit

  • * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: (119 commits)
    MIPS: Delete unused function add_temporary_entry.
    MIPS: Set default pci cache line size.
    MIPS: Flush huge TLB
    MIPS: Octeon: Remove SYS_SUPPORTS_HIGHMEM.
    MIPS: Octeon: Add support for OCTEON II PCIe
    MIPS: Octeon: Update PCI Latency timer and enable more error reporting.
    MIPS: Alchemy: Update cpu-feature-overrides
    MIPS: Alchemy: db1200: Improve PB1200 detection.
    MIPS: Alchemy: merge Au1000 and Au1300-style IRQ controller code.
    MIPS: Alchemy: chain IRQ controllers to MIPS IRQ controller
    MIPS: Alchemy: irq: register pm at irq init time
    MIPS: Alchemy: Touchscreen support on DB1100
    MIPS: Alchemy: Hook up IrDA on DB1000/DB1100
    net/irda: convert au1k_ir to platform driver.
    MIPS: Alchemy: remove unused board headers
    MTD: nand: make au1550nd.c a platform_driver
    MIPS: Netlogic: Mark Netlogic chips as SMT capable
    MIPS: Netlogic: Add support for XLP 3XX cores
    MIPS: Netlogic: Merge some of XLR/XLP wakup code
    MIPS: Netlogic: Add default XLP config.
    ...

    Fix up trivial conflicts in arch/mips/kernel/{perf_event_mipsxx.c,
    traps.c} and drivers/tty/serial/Makefile

    Linus Torvalds
     

13 Jan, 2012

1 commit


28 Dec, 2011

1 commit

  • Since commit 6384fd "ARM: pxa: rename IRQ_GPIO to PXA_GPIO_TO_IRQ",
    I got buid errors due to implicit declaration of function 'IRQ_GPIO'.

    Use common gpio_to_irq() to replace machine dependant macro IRQ_GPIO().

    Cc: Marek Vasut
    Cc: Ian Molton
    Cc: Jonathan Cameron
    Cc: Zhuang
    Cc: Eric Miao
    Cc: Russell King
    Signed-off-by: Axel Lin
    Acked-by: Haojian Zhuang
    Acked-by: Eric Miao
    Acked-by: Marek Vasut
    Signed-off-by: Arnd Bergmann

    Axel Lin
     

08 Dec, 2011

2 commits

  • Signed-off-by: Manuel Lauss
    To: linux-mips@linux-mips.org
    Patchwork: https://patchwork.linux-mips.org/patch/2867/
    Patchwork: https://patchwork.linux-mips.org/patch/2919/
    Patchwork: https://patchwork.linux-mips.org/patch/2928/
    Signed-off-by: Ralf Baechle

    Manuel Lauss
     
  • Noone seems to have test hardware or care anymore. Drop PB1000 support
    and along with it the old Alchemy PCMCIA socket driver.

    Signed-off-by: Manuel Lauss
    To: linux-mips@linux-mips.org
    Cc: netdev@vger.kernel.org
    Cc: linux-pcmcia@lists.infradead.org
    Patchwork: https://patchwork.linux-mips.org/patch/2881/
    Signed-off-by: Ralf Baechle

    Manuel Lauss
     

15 Nov, 2011

1 commit


07 Nov, 2011

1 commit

  • * 'modsplit-Oct31_2011' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (230 commits)
    Revert "tracing: Include module.h in define_trace.h"
    irq: don't put module.h into irq.h for tracking irqgen modules.
    bluetooth: macroize two small inlines to avoid module.h
    ip_vs.h: fix implicit use of module_get/module_put from module.h
    nf_conntrack.h: fix up fallout from implicit moduleparam.h presence
    include: replace linux/module.h with "struct module" wherever possible
    include: convert various register fcns to macros to avoid include chaining
    crypto.h: remove unused crypto_tfm_alg_modname() inline
    uwb.h: fix implicit use of asm/page.h for PAGE_SIZE
    pm_runtime.h: explicitly requires notifier.h
    linux/dmaengine.h: fix implicit use of bitmap.h and asm/page.h
    miscdevice.h: fix up implicit use of lists and types
    stop_machine.h: fix implicit use of smp.h for smp_processor_id
    of: fix implicit use of errno.h in include/linux/of.h
    of_platform.h: delete needless include
    acpi: remove module.h include from platform/aclinux.h
    miscdevice.h: delete unnecessary inclusion of module.h
    device_cgroup.h: delete needless include
    net: sch_generic remove redundant use of
    net: inet_timewait_sock doesnt need
    ...

    Fix up trivial conflicts (other header files, and removal of the ab3550 mfd driver) in
    - drivers/media/dvb/frontends/dibx000_common.c
    - drivers/media/video/{mt9m111.c,ov6650.c}
    - drivers/mfd/ab3550-core.c
    - include/linux/dmaengine.h

    Linus Torvalds
     

06 Nov, 2011

2 commits

  • The includes in the pxa2xx_cm_x2xx PCMCIA driver are rather random;
    the driver doesn't require anything from these headers except the
    cpu_is_xxx() macros which come from another include.

    The concern is that it's getting these definitions via mach/system.h,
    which is supposed to only be included by arch/arm/kernel/process.c.
    As this header is scheduled for cleanup (and elimination) keeping
    the status quo will cause build errors. So lets fix properly and
    independent of the future work.

    Signed-off-by: Russell King

    Russell King
     
  • Fix:

    ERROR: "pxa2xx_configure_sockets" [drivers/pcmcia/pxa2xx_lubbock_cs.ko] undefined!

    by exporting the required function.

    Acked-by: Eric Miao
    Signed-off-by: Russell King

    Russell King
     

02 Nov, 2011

1 commit

  • * 'next/fixes' of git://git.linaro.org/people/arnd/arm-soc: (28 commits)
    ARM: pxa/cm-x300: properly set bt_reset pin
    ARM: mmp: rename SHEEVAD to GPLUGD
    ARM: imx: Fix typo 'MACH_MX31_3DS_MXC_NAND_USE_BBT'
    ARM: i.MX28: shift frac value in _CLK_SET_RATE
    plat-mxc: iomux-v3.h: implicitly enable pull-up/down when that's desired
    ARM: mx5: fix clock usage for suspend
    ARM: pxa: use correct __iomem annotations
    ARM: pxa: sharpsl pm needs SPI
    ARM: pxa: centro and treo680 need palm27x
    ARM: pxa: make pxafb_smart_*() empty when not enabled
    ARM: pxa: select POWER_SUPPLY on raumfeld
    ARM: pxa: pxa95x is incompatible with earlier pxa
    ARM: pxa: CPU_FREQ_TABLE is needed for CPU_FREQ
    ARM: pxa: pxa95x/saarb depends on pxa3xx code
    ARM: pxa: allow selecting just one of TREO680/CENTRO
    ARM: pxa: export symbols from pxa3xx-ulpi
    ARM: pxa: make zylonite_pxa*_init declaration match code
    ARM: pxa/z2: fix building error of pxa27x_cpu_suspend() no longer available
    ARM: at91: add defconfig for at91sam9g45 family
    ARM: at91: remove dependency for Atmel PWM driver selector in Kconfig
    ...

    Linus Torvalds
     

01 Nov, 2011

1 commit