13 Jan, 2012

7 commits

  • Cut and paste bug.

    Cc: Mauro Carvalho Chehab
    Cc: devel@driverdev.osuosl.org
    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • For historical reasons, we allow module_param(bool) to take an int (or
    an unsigned int). That's going away.

    A few drivers really want an int: they set it to -1 and a parameter
    will set it to 0 or 1. This sucks: reading them from sysfs will give
    'Y' for both -1 and 1, but if we change it to an int, then the users
    might be broken (if they did "param" instead of "param=1").

    Use a new 'bint' parser for them.

    (ntfs has a different problem: it needs an int for debug_msgs because
    it's also exposed via sysctl.)

    Cc: Steve Glendinning
    Cc: Jean Delvare
    Cc: Guenter Roeck
    Cc: Hoang-Nam Nguyen
    Cc: Christoph Raisch
    Cc: Roland Dreier
    Cc: Sean Hefty
    Cc: Hal Rosenstock
    Cc: linux390@de.ibm.com
    Cc: Anton Altaparmakov
    Cc: Jaroslav Kysela
    Cc: Takashi Iwai
    Cc: lm-sensors@lm-sensors.org
    Cc: linux-rdma@vger.kernel.org
    Cc: linux-s390@vger.kernel.org
    Cc: linux-ntfs-dev@lists.sourceforge.net
    Cc: alsa-devel@alsa-project.org
    Acked-by: Takashi Iwai (For the sound part)
    Acked-by: Guenter Roeck (For the hwmon driver)
    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • module_param_array(), unlike its non-array cousins, didn't check the type
    of the variable. Fixing this found two bugs.

    Cc: Luca Risolia
    Cc: Mauro Carvalho Chehab
    Cc: Eric Piel
    Cc: linux-media@vger.kernel.org
    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: bcm5974 - set BUTTONPAD property
    Input: serio_raw - return proper result when serio_raw_write fails
    Input: serio_raw - really signal HUP upon disconnect
    Input: serio_raw - remove stray semicolon
    Input: revert some over-zealous conversions to module_platform_driver()

    Linus Torvalds
     
  • * tag 'to-linus' of git://github.com/rustyrussell/linux: (24 commits)
    lguest: Make sure interrupt is allocated ok by lguest_setup_irq
    lguest: move the lguest tool to the tools directory
    lguest: switch segment-voodoo-numbers to readable symbols
    virtio: balloon: Add freeze, restore handlers to support S4
    virtio: balloon: Move vq initialization into separate function
    virtio: net: Add freeze, restore handlers to support S4
    virtio: net: Move vq and vq buf removal into separate function
    virtio: net: Move vq initialization into separate function
    virtio: blk: Add freeze, restore handlers to support S4
    virtio: blk: Move vq initialization to separate function
    virtio: console: Disable callbacks for virtqueues at start of S4 freeze
    virtio: console: Add freeze and restore handlers to support S4
    virtio: console: Move vq and vq buf removal into separate functions
    virtio: pci: add PM notification handlers for restore, freeze, thaw, poweroff
    virtio: pci: switch to new PM API
    virtio_blk: fix config handler race
    virtio: add debugging if driver doesn't kick.
    virtio: expose added descriptors immediately.
    virtio: avoid modulus operation.
    virtio: support unlocked queue kick
    ...

    Linus Torvalds
     
  • It appears that you can only read the sprom contents with aligned 16-bit
    reads: anything else causes at least some versions of the broadcom
    chipset to abort the PCI transaction, returning 0xff.

    This apparently doesn't trigger very often, because most setups don't
    use an external srom chip, and the OTP sprom loading doesn't have this
    issue. But at least the current 11" Macbook Air does trigger it, and
    wireless communications were broken as a result.

    Acked-by: Arend van Spriel
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (526 commits)
    ASoC: twl6040 - Add method to query optimum PDM_DL1 gain
    ALSA: hda - Fix the lost power-setup of seconary pins after PM resume
    ALSA: usb-audio: add Yamaha MOX6/MOX8 support
    ALSA: virtuoso: add S/PDIF input support for all Xonars
    ALSA: ice1724 - Support for ooAoo SQ210a
    ALSA: ice1724 - Allow card info based on model only
    ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations
    ALSA: hdspm - Provide unique driver id based on card serial
    ASoC: Dynamically allocate the rtd device for a non-empty release()
    ASoC: Fix recursive dependency due to select ATMEL_SSC in SND_ATMEL_SOC_SSC
    ALSA: hda - Fix the detection of "Loopback Mixing" control for VIA codecs
    ALSA: hda - Return the error from get_wcaps_type() for invalid NIDs
    ALSA: hda - Use auto-parser for HP laptops with cx20459 codec
    ALSA: asihpi - Fix potential Oops in snd_asihpi_cmode_info()
    ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref()
    ALSA: hda/cirrus - support for iMac12,2 model
    ASoC: cx20442: add bias control over a platform provided regulator
    ALSA: usb-audio - Avoid flood of frame-active debug messages
    ALSA: snd-usb-us122l: Delete calls to preempt_disable
    mfd: Put WM8994 into cache only mode when suspending
    ...

    Fix up trivial conflicts in:
    - arch/arm/mach-s3c64xx/mach-crag6410.c:
    renamed speyside_wm8962 to tobermory, added littlemill right
    next to it
    - drivers/base/regmap/{regcache.c,regmap.c}:
    duplicate diff that had already come in with other changes in
    the regmap tree

    Linus Torvalds
     

12 Jan, 2012

33 commits

  • SH/R-Mobile updates for 3.3 merge window.

    * tag 'rmobile-for-linus' of git://github.com/pmundt/linux-sh: (32 commits)
    arm: mach-shmobile: add a resource name for shdma
    ARM: mach-shmobile: r8a7779 SMP support V3
    ARM: mach-shmobile: Add kota2 defconfig.
    ARM: mach-shmobile: Add marzen defconfig.
    ARM: mach-shmobile: r8a7779 power domain support V2
    ARM: mach-shmobile: Fix up marzen build for recent GIC changes.
    ARM: mach-shmobile: r8a7779 PFC function support
    ARM: mach-shmobile: Flush caches in platform_cpu_die()
    ARM: mach-shmobile: Allow SoC specific CPU kill code
    ARM: mach-shmobile: Fix headsmp.S code to use CPUINIT
    ARM: mach-shmobile: clock-r8a7779: clkz/clkzs support
    ARM: mach-shmobile: clock-r8a7779: add DIV4 clock support
    ARM: mach-shmobile: Marzen LAN89218 support
    ARM: mach-shmobile: Marzen SCIF2/SCIF4 support
    ARM: mach-shmobile: r8a7779 PFC GPIO-only support V2
    ARM: mach-shmobile: r8a7779 and Marzen base support V2
    sh: pfc: Unlock register support
    sh: pfc: Variable bitfield width config register support
    sh: pfc: Add config_reg_helper() function
    sh: pfc: Convert index to field and value pair
    ...

    Linus Torvalds
     
  • SuperH updates for 3.3 merge window.

    * tag 'sh-for-linus' of git://github.com/pmundt/linux-sh: (38 commits)
    sh: magicpanelr2: Update for parse_mtd_partitions() fallout.
    sh: mach-rsk: Update for parse_mtd_partitions() fallout.
    sh: sh2a: Improve cache flush/invalidate functions
    sh: also without PM_RUNTIME pm_runtime.o must be built
    sh: add a resource name for shdma
    sh: Remove redundant try_to_freeze() invocations.
    sh: Ensure IRQs are enabled across do_notify_resume().
    sh: Fix up store queue code for subsys_interface changes.
    sh: clkfwk: sh_clk_init_parent() should be called after clk_register()
    sh: add platform_device for renesas_usbhs in board-sh7757lcr
    sh: modify clock-sh7757 for renesas_usbhs
    sh: pfc: ioremap() support
    sh: use ioread32/iowrite32 and mapped_reg for div6
    sh: use ioread32/iowrite32 and mapped_reg for div4
    sh: use ioread32/iowrite32 and mapped_reg for mstp32
    sh: extend clock struct with mapped_reg member
    sh: clkfwk: clock-sh73a0: all div6_clks use SH_CLK_DIV6_EXT()
    sh: clkfwk: clock-sh7724: all div6_clks use SH_CLK_DIV6_EXT()
    sh: clock-sh7723: add CLKDEV_ICK_ID for cleanup
    serial: sh-sci: Handle GPIO function requests.
    ...

    Linus Torvalds
     
  • Make sure the interrupt is allocated correctly by lguest_setup_irq (check the
    return value of irq_alloc_desc_at for -ENOMEM)

    Signed-off-by: Stratos Psomadakis
    Signed-off-by: Rusty Russell (cleanups and commentry)

    Stratos Psomadakis
     
  • This is a better location instead of having it in Documentation.

    Signed-off-by: Davidlohr Bueso
    Signed-off-by: Rusty Russell (fixed compile)

    Davidlohr Bueso
     
  • When studying lguest's x86 segment descriptor code, it is not longer
    necessary to have the Intel x86 architecture manual open on the page
    with the segment descriptor illustration to understand the crazy
    numbers assigned to both descriptor structure halves a/b.
    Now the struct desc_struct's fields, like suggested by
    Glauber de Oliveira Costa in 2008, are used.

    Signed-off-by: Jacek Galowicz
    Signed-off-by: Rusty Russell

    Jacek Galowicz
     
  • Handling balloon hibernate / restore is tricky. If the balloon was
    inflated before going into the hibernation state, upon resume, the host
    will not have any memory of that. Any pages that were passed on to the
    host earlier would most likely be invalid, and the host will have to
    re-balloon to the previous value to get in the pre-hibernate state.

    So the only sane thing for the guest to do here is to discard all the
    pages that were put in the balloon. When to discard the pages is the
    next question.

    One solution is to deflate the balloon just before writing the image to
    the disk (in the freeze() PM callback). However, asking for pages from
    the host just to discard them immediately after seems wasteful of
    resources. Hence, it makes sense to do this by just fudging our
    counters soon after wakeup. This means we don't deflate the balloon
    before sleep, and also don't put unnecessary pressure on the host.

    This also helps in the thaw case: if the freeze fails for whatever
    reason, the balloon should continue to remain in the inflated state.
    This was tested by issuing 'swapoff -a' and trying to go into the S4
    state. That fails, and the balloon stays inflated, as expected. Both
    the host and the guest are happy.

    Finally, in the restore() callback, we empty the list of pages that were
    previously given off to the host, add the appropriate number of pages to
    the totalram_pages counter, reset the num_pages counter to 0, and
    all is fine.

    As a last step, delete the vqs on the freeze callback to prepare for
    hibernation, and re-create them in the restore and thaw callbacks to
    resume normal operation.

    The kthread doesn't race with any operations here, since it's frozen
    before the freeze() call and is thawed after the thaw() and restore()
    callbacks, so we're safe with that.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • The probe and PM restore functions will share this code.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • Remove all the vqs, disable napi and detach from the netdev on
    hibernation.

    Re-create vqs after restoring from a hibernated image, re-enable napi
    and re-attach the netdev. This keeps networking working across
    hibernation.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • The remove and PM freeze functions will share this code.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • The probe and PM restore functions will share this code.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • Delete the vq and flush any pending requests from the block queue on the
    freeze callback to prepare for hibernation.

    Re-create the vq in the restore callback to resume normal function.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • The probe and PM restore functions will share this code.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • To ensure we don't receive any more interrupts from the host after we
    enter the freeze function, disable all vq interrupts.

    There wasn't any problem seen due to this in tests, but applying this
    patch makes the freeze case more robust.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • Remove all vqs and associated buffers in the freeze callback which
    prepares us to go into hibernation state. On restore, re-create all the
    vqs and populate the input vqs with buffers to get to the pre-hibernate
    state.

    Note: Any outstanding unconsumed buffers are discarded; which means
    there's a possibility of data loss in case the host or the guest didn't
    consume any data already present in the vqs. This can be addressed in a
    later patch series, perhaps in virtio common code.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • This common code will be shared with the PM freeze function.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • Handle thaw, restore and freeze notifications from the PM core. Expose
    these to individual virtio drivers that can quiesce and resume vq
    operations. For drivers not implementing the thaw() method, use the
    restore method instead.

    These functions also save device-specific data so that the device can be
    put in pre-suspend state after resume, and disable and enable the PCI
    device in the freeze and resume functions, respectively.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • The older PM API doesn't have a way to get notifications on hibernate
    events. Switch to the newer one that gives us those notifications.

    Signed-off-by: Amit Shah
    Signed-off-by: Rusty Russell

    Amit Shah
     
  • Fix a theoretical race related to config work
    handler: a config interrupt might happen
    after we flush config work but before we
    reset the device. It will then cause the
    config work to run during or after reset.

    Two problems with this:
    - if this runs after device is gone we will get use after free
    - access of config while reset is in progress is racy
    (as layout is changing).

    As a solution
    1. flush after reset when we know there will be no more interrupts
    2. add a flag to disable config access before reset

    Signed-off-by: Michael S. Tsirkin
    Signed-off-by: Rusty Russell

    Michael S. Tsirkin
     
  • Under the existing #ifdef DEBUG, check that they don't have more than
    1/10 of a second between an add_buf() and a
    virtqueue_notify()/virtqueue_kick_prepare() call.

    We could get false positives on a really busy system, but good for
    development.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • A virtio driver does virtqueue_add_buf() multiple times before finally
    calling virtqueue_kick(); previously we only exposed the added buffers
    in the virtqueue_kick() call. This means we don't need a memory
    barrier in virtqueue_add_buf(), but it reduces concurrency as the
    device (ie. host) can't see the buffers until the kick.

    In the unusual (but now possible) case where a driver does add_buf()
    and get_buf() without doing a kick, we do need to insert one before
    our counter wraps. Otherwise we could wrap num_added, and later on
    not realize that we have passed the marker where we should have
    kicked.

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Since we know vq->vring.num is a power of 2, modulus is lazy (it's asserted
    in vring_new_virtqueue()).

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Based on patch by Christoph for virtio_blk speedup:

    Split virtqueue_kick to be able to do the actual notification
    outside the lock protecting the virtqueue. This patch was
    originally done by Stefan Hajnoczi, but I can't find the
    original one anymore and had to recreated it from memory.
    Pointers to the original or corrections for the commit message
    are welcome.

    Stefan's patch was here:

    https://github.com/stefanha/linux/commit/a6d06644e3a58e57a774e77d7dc34c4a5a2e7496
    http://www.spinics.net/lists/linux-virtualization/msg14616.html

    Third time's the charm!

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Remove wrapper functions. This makes the allocation type explicit in
    all callers; I used GPF_KERNEL where it seemed obvious, left it at
    GFP_ATOMIC otherwise.

    Signed-off-by: Rusty Russell
    Reviewed-by: Christoph Hellwig

    Rusty Russell
     
  • The old documentation is left over from when we used a structure with
    strategy pointers.

    And move the documentation to the C file as per kernel practice.
    Though I disagree...

    Signed-off-by: Rusty Russell
    Reviewed-by: Christoph Hellwig

    Rusty Russell
     
  • Trivial changes to remove forgotten junk, format comments, and correct names.

    Cc: Rusty Russell
    Cc: "Michael S. Tsirkin"
    Cc: virtualization@lists.linux-foundation.org
    Signed-off-by: Sasha Levin
    Signed-off-by: Rusty Russell

    Sasha Levin
     
  • We were cheating with our barriers; using the smp ones rather than the
    real device ones. That was fine, until rpmsg came along, which is
    used to talk to a real device (a non-SMP CPU).

    Unfortunately, just putting back the real barriers (reverting
    d57ed95d) causes a performance regression on virtio-pci. In
    particular, Amos reports netbench's TCP_RR over virtio_net CPU
    utilization increased up to 35% while throughput went down by up to
    14%.

    By comparison, this branch is in the noise.

    Reference: https://lkml.org/lkml/2011/12/11/22

    Signed-off-by: Rusty Russell

    Rusty Russell
     
  • Paul Mundt
     
  • Conflicts:
    arch/sh/kernel/cpu/sh4a/clock-sh7723.c

    Signed-off-by: Paul Mundt

    Paul Mundt
     
  • When CONFIG_PM_RUNTIME is off, drivers/sh/pm_runtime.o still has to be
    built on sh platforms, because then it provides means to statically
    switch on device PM clocks.

    Signed-off-by: Guennadi Liakhovetski
    Signed-off-by: Paul Mundt

    Guennadi Liakhovetski
     
  • * 'x86-platform-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
    x86/intel config: Fix the APB_TIMER selection
    x86/mrst: Add additional debug prints for pb_keys
    x86/intel config: Revamp configuration to allow for Moorestown and Medfield
    x86/intel/scu/ipc: Match the changes in the x86 configuration
    x86/apb: Fix configuration constraints
    x86: Fix INTEL_MID silly
    x86/Kconfig: Cyclone-timer depends on x86-summit
    x86: Reduce clock calibration time during slave cpu startup
    x86/config: Revamp configuration for MID devices
    x86/sfi: Kill the IRQ as id hack

    Linus Torvalds
     
  • * 'next' of git://git.kernel.org/pub/scm/linux/kernel/git/davej/cpufreq: (23 commits)
    [CPUFREQ] EXYNOS: Removed useless headers and codes
    [CPUFREQ] EXYNOS: Make EXYNOS common cpufreq driver
    [CPUFREQ] powernow-k8: Update copyright, maintainer and documentation information
    [CPUFREQ] powernow-k8: Fix indexing issue
    [CPUFREQ] powernow-k8: Avoid Pstate MSR accesses on systems supporting CPB
    [CPUFREQ] update lpj only if frequency has changed
    [CPUFREQ] cpufreq:userspace: fix cpu_cur_freq updation
    [CPUFREQ] Remove wall variable from cpufreq_gov_dbs_init()
    [CPUFREQ] EXYNOS4210: cpufreq code is changed for stable working
    [CPUFREQ] EXYNOS4210: Update frequency table for cpu divider
    [CPUFREQ] EXYNOS4210: Remove code about bus on cpufreq
    [CPUFREQ] s3c64xx: Use pr_fmt() for consistent log messages
    cpufreq: OMAP: fixup for omap_device changes, include
    cpufreq: OMAP: fix freq_table leak
    cpufreq: OMAP: put clk if cpu_init failed
    cpufreq: OMAP: only supports OPP library
    cpufreq: OMAP: dont support !freq_table
    cpufreq: OMAP: deny initialization if no mpudev
    cpufreq: OMAP: move clk name decision to init
    cpufreq: OMAP: notify even with bad boot frequency
    ...

    Linus Torvalds
     
  • * git://git.infradead.org/battery-2.6: (68 commits)
    power_supply: Mark da9052 driver as broken
    power_supply: Drop usage of nowarn variant of sysfs_create_link()
    s3c_adc_battery: Average over more than one adc sample
    power_supply: Add DA9052 battery driver
    isp1704_charger: Fix missing check
    jz4740-battery: Fix signedness bug
    power_supply: Assume mains power by default
    sbs-battery: Fix devicetree match table
    ARM: rx51: Add bq27200 i2c board info
    sbs-battery: Change power supply name
    devicetree-bindings: Propagate bq20z75->sbs rename to dt bindings
    devicetree-bindings: Add vendor entry for Smart Battery Systems
    sbs-battery: Rename internals to new name
    bq20z75: Rename to sbs-battery
    wm97xx_battery: Use DEFINE_MUTEX() for work_lock
    max8997_charger: Remove duplicate module.h
    lp8727_charger: Some minor fixes for the header
    lp8727_charger: Add header file
    power_supply: Convert drivers/power/* to use module_platform_driver()
    power_supply: Add "unknown" in power supply type
    ...

    Linus Torvalds
     
  • Two bugfixes for md.

    One is a recently introduced regression that affects an unusual
    configuration with a guaranteed BUG_ON. Has been tagged for -stable.
    The other is minor missing functionality.

    * tag 'md-3.3-fixes' of git://neil.brown.name/md:
    md/raid1: perform bad-block tests for WriteMostly devices too.
    md: notify the 'degraded' sysfs attribute on failure.

    Linus Torvalds