29 Nov, 2012

16 commits


27 Nov, 2012

2 commits


16 Nov, 2012

1 commit


15 Nov, 2012

6 commits

  • This patch documents the firmware cache mechanism so that
    users of request_firmware() know that it can be called
    safely inside device's suspend and resume callback, and
    the device's firmware needn't be cached any more by individual
    driver itself to deal with firmware loss during system resume.

    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • This patch introduces one module parameter of 'path' in firmware_class
    to support customizing firmware image search path, so that people can
    use its own firmware path if the default built-in paths can't meet their
    demand[1], and the typical usage is passing the below from kernel command
    parameter when 'firmware_class' is built in kernel:

    firmware_class.path=$CUSTOMIZED_PATH

    [1], https://lkml.org/lkml/2012/10/11/337

    Cc: Linus Torvalds
    Signed-off-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Ming Lei
     
  • The comment above fw_file_size() suggests it is noinline for stack size
    reasons. Use noinline_for_stack to make this more clear.

    Signed-off-by: Cesar Eduardo Barros
    Acked-by: Ming Lei
    Signed-off-by: Greg Kroah-Hartman

    Cesar Eduardo Barros
     
  • There is one race that both request_firmware() with the same
    firmware name.

    The race scenerio is as below:
    CPU1 CPU2
    request_firmware() -->
    _request_firmware_load() return err another request_firmware() is coming -->
    _request_firmware_cleanup is called --> _request_firmware_prepare -->
    release_firmware ---> fw_lookup_and_allocate_buf -->
    spin_lock(&fwc->lock)
    ... __fw_lookup_buf() return true
    fw_free_buf() will be called --> ...
    kref_put -->
    decrease the refcount to 0
    kref_get(&tmp->ref) ==> it will trigger warning
    due to refcount == 0
    __fw_free_buf() -->
    ... spin_unlock(&fwc->lock)
    spin_lock(&fwc->lock)
    list_del(&buf->list)
    spin_unlock(&fwc->lock)
    kfree(buf)
    After that, the freed buf will be used.

    The key race is decreasing refcount to 0 and list_del is not protected together by
    fwc->lock, and it is possible another thread try to get it between refcount==0
    and list_del.

    Fix it here to protect it together.

    Acked-by: Ming Lei
    Signed-off-by: liu chuansheng
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Chuansheng Liu
     
  • There is a race as below when calling request_firmware():
    CPU1 CPU2
    write 0 > loading
    mutex_lock(&fw_lock)
    ...
    set_bit FW_STATUS_DONE class_timeout is coming
    set_bit FW_STATUS_ABORT
    complete_all &completion
    ...
    mutex_unlock(&fw_lock)

    In this time, the bit FW_STATUS_DONE and FW_STATUS_ABORT are set,
    and request_firmware() will return failure due to condition in
    _request_firmware_load():
    if (!buf->size || test_bit(FW_STATUS_ABORT, &buf->status))
    retval = -ENOENT;

    But from the above scenerio, it should be a successful requesting.
    So we need judge if the bit FW_STATUS_DONE is already set before
    calling fw_load_abort() in timeout function.

    As Ming's proposal, we need change the timer into sched_work to
    benefit from using &fw_lock mutex also.

    Signed-off-by: liu chuansheng
    Acked-by: Ming Lei
    Cc: stable
    Signed-off-by: Greg Kroah-Hartman

    Chuansheng Liu
     
  • Greg Kroah-Hartman
     

11 Nov, 2012

2 commits

  • Pull networking fixes from David Miller:
    "Bug fixes galore, mostly in drivers as is often the case:

    1) USB gadget and cdc_eem drivers need adjustments to their frame size
    lengths in order to handle VLANs correctly. From Ian Coolidge.

    2) TIPC and several network drivers erroneously call tasklet_disable
    before tasklet_kill, fix from Xiaotian Feng.

    3) r8169 driver needs to apply the WOL suspend quirk to more chipsets,
    fix from Cyril Brulebois.

    4) Fix multicast filters on RTL_GIGA_MAC_VER_35 r8169 chips, from
    Nathan Walp.

    5) FDB netlink dumps should use RTM_NEWNEIGH as the message type, not
    zero. From John Fastabend.

    6) Fix smsc95xx tx checksum offload on big-endian, from Steve
    Glendinning.

    7) __inet_diag_dump() needs to repsect and report the error value
    returned from inet_diag_lock_handler() rather than ignore it.
    Otherwise if an inet diag handler is not available for a particular
    protocol, we essentially report success instead of giving an error
    indication. Fix from Cyrill Gorcunov.

    8) When the QFQ packet scheduler sees TSO/GSO packets it does not
    handle things properly, and in fact ends up corrupting it's
    datastructures as well as mis-schedule packets. Fix from Paolo
    Valente.

    9) Fix oopser in skb_loop_sk(), from Eric Leblond.

    10) CXGB4 passes partially uninitialized datastructures in to FW
    commands, fix from Vipul Pandya.

    11) When we send unsolicited ipv6 neighbour advertisements, we should
    send them to the link-local allnodes multicast address, as per
    RFC4861. Fix from Hannes Frederic Sowa.

    12) There is some kind of bug in the usbnet's kevent deferral
    mechanism, but more immediately when it triggers an uncontrolled
    stream of kernel messages spam the log. Rate limit the error log
    message triggered when this problem occurs, as sending thousands
    of error messages into the kernel log doesn't help matters at all,
    and in fact makes further diagnosis more difficult.

    From Steve Glendinning.

    13) Fix gianfar restore from hibernation, from Wang Dongsheng.

    14) The netlink message attribute sizes are wrong in the ipv6 GRE
    driver, it was using the size of ipv4 addresses instead of ipv6
    ones :-) Fix from Nicolas Dichtel."

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
    gre6: fix rtnl dump messages
    gianfar: ethernet vanishes after restoring from hibernation
    usbnet: ratelimit kevent may have been dropped warnings
    ipv6: send unsolicited neighbour advertisements to all-nodes
    net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs
    usb: gadget: g_ether: fix frame size check for 802.1Q
    cxgb4: Fix initialization of SGE_CONTROL register
    isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES
    cxgb4: Initialize data structures before using.
    af-packet: fix oops when socket is not present
    pkt_sched: enable QFQ to support TSO/GSO
    net: inet_diag -- Return error code if protocol handler is missed
    net: bnx2x: Fix typo in bnx2x driver
    smsc95xx: fix tx checksum offload for big endian
    rtnetlink: Use nlmsg type RTM_NEWNEIGH from dflt fdb dump
    ptp: update adjfreq callback description
    r8169: allow multicast packets on sub-8168f chipset.
    r8169: Fix WoL on RTL8168d/8111d.
    drivers/net: use tasklet_kill in device remove/close process
    tipc: do not use tasklet_disable before tasklet_kill

    Linus Torvalds
     
  • Pull sparc fixes from David Miller:
    "Several build/bug fixes for sparc, including:

    1) Configuring a mix of static vs. modular sparc64 crypto modules
    didn't work, remove an ill-conceived attempt to only have to build
    the device match table for these drivers once to fix the problem.

    Reported by Meelis Roos.

    2) Make the montgomery multiple/square and mpmul instructions actually
    usable in 32-bit tasks. Essentially this involves providing 32-bit
    userspace with a way to use a 64-bit stack when it needs to.

    3) Our sparc64 atomic backoffs don't yield cpu strands properly on
    Niagara chips. Use pause instruction when available to achieve
    this, otherwise use a benign instruction we know blocks the strand
    for some time.

    4) Wire up kcmp

    5) Fix the build of various drivers by removing the unnecessary
    blocking of OF_GPIO when SPARC.

    6) Fix unintended regression wherein of_address_to_resource stopped
    being provided. Fix from Andreas Larsson.

    7) Fix NULL dereference in leon_handle_ext_irq(), also from Andreas
    Larsson."

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc64: Fix build with mix of modular vs. non-modular crypto drivers.
    sparc: Support atomic64_dec_if_positive properly.
    of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again
    sparc32, leon: Check for existent irq_map entry in leon_handle_ext_irq
    sparc: Add sparc support for platform_get_irq()
    sparc: Allow OF_GPIO on sparc.
    qlogicpti: Fix build warning.
    sparc: Wire up sys_kcmp.
    sparc64: Improvde documentation and readability of atomic backoff code.
    sparc64: Use pause instruction when available.
    sparc64: Fix cpu strand yielding.
    sparc64: Make montmul/montsqr/mpmul usable in 32-bit threads.

    Linus Torvalds
     

10 Nov, 2012

7 commits

  • Pull Xen fixes from Konrad Rzeszutek Wilk:
    "There are three ARM compile fixes (we forgot to export certain
    functions and if the drivers are built as an module - we go belly-up).

    There is also an mismatch of irq_enter() / exit_idle() calls sequence
    which were fixed some time ago in other piece of codes, but failed to
    appear in the Xen code.

    Lastly a fix for to help in the field with troubleshooting in case we
    cannot get the appropriate parameter and also fallback code when
    working with very old hypervisors."

    Bug-fixes:
    - Fix compile issues on ARM.
    - Fix hypercall fallback code for old hypervisors.
    - Print out which HVM parameter failed if it fails.
    - Fix idle notifier call after irq_enter.

    * tag 'stable/for-linus-3.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
    xen/arm: Fix compile errors when drivers are compiled as modules (export more).
    xen/arm: Fix compile errors when drivers are compiled as modules.
    xen/generic: Disable fallback build on ARM.
    xen/events: fix RCU warning, or Call idle notifier after irq_enter()
    xen/hvm: If we fail to fetch an HVM parameter print out which flag it is.
    xen/hypercall: fix hypercall fallback code for very old hypervisors

    Linus Torvalds
     
  • This adds sparc support for platform_get_irq that in the normal case use
    platform_get_resource() to get an irq. This standard approach fails for sparc as
    there are no resources of type IORESOURCE_IRQ for irqs for sparc.

    Cross platform drivers can then use this standard platform function and work on
    sparc instead of having to have a special case for sparc.

    Signed-off-by: Andreas Larsson
    Signed-off-by: David S. Miller

    Andreas Larsson
     
  • If a gianfar ethernet device is down prior to hibernating a
    system, it will no longer be present upon system restore.

    For example:

    ~# ifconfig eth0 down
    ~# echo disk > /sys/power/state

    ~# ifconfig eth0 up
    SIOCSIFFLAGS: No such device

    This happens because the restore function bails out early upon
    finding devices that were not up at hibernation. In doing so,
    it never gets to the netif_device_attach call at the end of
    the restore function. Adding the netif_device_attach as done
    here also makes the gfar_restore code consistent with what is
    done in the gfar_resume code.

    Cc: Claudiu Manoil
    Signed-off-by: Wang Dongsheng
    Signed-off-by: Paul Gortmaker
    Acked-by: Claudiu Manoil
    Signed-off-by: David S. Miller

    Wang Dongsheng
     
  • when something goes wrong, a flood of these messages can be
    generated by usbnet (thousands per second). This doesn't
    generally *help* the condition so this patch ratelimits the
    rate of their generation.

    There's an underlying problem in usbnet's kevent deferral
    mechanism which needs fixing, specifically that events *can*
    get dropped and not handled. This patch doesn't address this,
    but just mitigates fallout caused by the current implemention.

    Signed-off-by: Steve Glendinning
    Signed-off-by: David S. Miller

    Steve Glendinning
     
  • Pull drm fixes (again) from Dave Airlie:
    "dropped the ball on a vmware patch, so two more fixes for vmwgfx are
    here, one for hibernate issue, one for a BUG trigger."

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm/vmwgfx: Fix a case where the code would BUG when trying to pin GMR memory
    drm/vmwgfx: Fix hibernation device reset

    Linus Torvalds
     
  • Pull PCI fixes from Bjorn Helgaas:
    "Power management:
    - PCI/PM: Fix proc config reg access for D3cold and bridge
    suspending
    - PCI/PM: Resume device before shutdown
    - PCI/PM: Fix deadlock when unbinding device if parent in D3cold
    Hotplug:
    - PCI/portdrv: Don't create hotplug slots unless port supports
    hotplug"

    * tag '3.7-pci-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci:
    PCI/portdrv: Don't create hotplug slots unless port supports hotplug
    PCI/PM: Fix proc config reg access for D3cold and bridge suspending
    PCI/PM: Resume device before shutdown
    PCI/PM: Fix deadlock when unbinding device if parent in D3cold

    Linus Torvalds
     
  • Pull MMC fixes from Chris Ball:
    - sdhci: fix a NULL dereference at resume-time, seen on OLPC XO-4
    - sdhci: fix against 3.7-rc1 for UHS modes without a vqmmc regulator
    - sdhci-of-esdhc: disable CMD23 on boards where it's broken
    - sdhci-s3c: fix against 3.7-rc1 for card detection with runtime PM
    - dw_mmc, omap_hsmmc: fix potential NULL derefs, compiler warnings

    * tag 'mmc-fixes-for-3.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/cjb/mmc:
    mmc: sdhci-s3c: fix the card detection in runtime-pm
    mmc: sdhci-s3c: use clk_prepare_enable and clk_disable_unprepare
    mmc: dw_mmc: constify dw_mci_idmac_ops in exynos back-end
    mmc: dw_mmc: fix modular build for exynos back-end
    mmc: sdhci: fix NULL dereference in sdhci_request() tuning
    mmc: sdhci: fix IS_ERR() checking of regulator_get()
    mmc: fix sdhci-dove probe/removal
    mmc: sh_mmcif: fix use after free
    mmc: sdhci-pci: fix 'Invalid iomem size' error message condition
    mmc: mxcmmc: Fix MODULE_ALIAS
    mmc: omap_hsmmc: fix NULL pointer dereference for dt boot
    mmc: omap_hsmmc: fix host reference after mmc_free_host
    mmc: dw_mmc: fix multiple drv_data NULL dereferences
    mmc: dw_mmc: enable controller interrupt before calling mmc_start_host
    mmc: sdhci-of-esdhc: disable CMD23 for some Freescale SoCs
    mmc: dw_mmc: remove _dev_info compile warning
    mmc: dw_mmc: convert the variable type of irq

    Linus Torvalds
     

09 Nov, 2012

6 commits

  • Signed-off-by: Thomas Hellstrom
    Reviewed-by: Brian Paul
    Reviewed-by: Dmitry Torokhov
    Cc: stable@vger.kernel.org
    Cc: linux-graphics-maintainer@vmware.com
    Signed-off-by: Dave Airlie

    Thomas Hellstrom
     
  • The device would not reset properly when resuming from hibernation.

    Signed-off-by: Thomas Hellstrom
    Reviewed-by: Brian Paul
    Reviewed-by: Dmitry Torokhov
    Cc: stable@vger.kernel.org
    Cc: linux-graphics-maintainer@vmware.com
    Signed-off-by: Dave Airlie

    Thomas Hellstrom
     
  • …t/linusw/linux-pinctrl

    Pull pinctrl fixes from Linus Walleij:

    - A set of SPEAr pinctrl fixes that recently arrived

    - A fixup for the Samsung/Exynos Kconfig deps

    * tag 'pinctrl-for-v3.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
    pinctrl: samsung and exynos need to depend on OF && GPIOLIB
    pinctrl: SPEAr1340: Add clcd sleep mode pin configuration
    pinctrl: SPEAr1340: Make DDR reset & clock pads as gpio
    pinctrl: SPEAr1310: add register entries for enabling pad direction
    pinctrl: SPEAr1310: Separate out pci pins from pcie_sata pin group
    pinctrl: SPEAr1310: Fix value of PERIP_CFG reigster and MCIF_SEL_SHIFT
    pinctrl: SPEAr1310: fix clcd high resolution pin group name
    pinctrl: SPEAr320: Correct pad mux entries for rmii/smii
    pinctrl: SPEAr3xx: correct register space to configure pwm
    pinctrl: SPEAr: Don't update all non muxreg bits on pinctrl_disable

    Linus Torvalds
     
  • Pull s390 fixes from Martin Schwidefsky:
    "A couple of bug fixes. I keep the fingers crossed that we now got
    transparent huge pages ready for prime time."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
    s390/cio: fix length calculation in idset.c
    s390/sclp: fix addressing mode clobber
    s390: Move css limits from drivers/s390/cio/ to include/asm/.
    s390/thp: respect page protection in pmd_none() and pmd_present()
    s390/mm: use pmd_large() instead of pmd_huge()
    s390/cio: suppress 2nd path verification during resume

    Linus Torvalds
     
  • Pull HID fix from Jiri Kosina:
    "This reverts a patch that causes regression in binding between HID
    devices and drivers during device unplug/replug cycle."

    * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
    HID: hidraw: put old deallocation mechanism in place

    Linus Torvalds
     
  • Pull drm fixes from Dave Airlie:
    "Just radeon and nouveau, mostly regressions fixers, and a couple of
    radeon register checker fixes."

    * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux:
    drm/nouveau: fix acpi edid retrieval
    drm/nvc0/disp: fix regression in vblank semaphore release
    drm/nv40/mpeg: fix context handling
    drm/nv40/graph: fix typo in type names
    drm/nv41/vm: fix typo in type name
    drm/radeon/si: add some missing regs to the VM reg checker
    drm/radeon/cayman: add some missing regs to the VM reg checker
    drm/radeon/dce3: switch back to old pll allocation order for discrete

    Linus Torvalds