26 Dec, 2011

2 commits

  • Since the SH7372's INTCS in included into syscore suspend/resume,
    which causes the chip to be accessed when PM domains have been
    turned off during system suspend, the A4R domain containing the
    INTCS has to stay on during system sleep, which is suboptimal
    from the power consumption point of view.

    For this reason, add a new INTC flag, skip_syscore_suspend, to mark
    the INTCS for intc_suspend() and intc_resume(), so that they don't
    touch it. This allows the A4R domain to be turned off during
    system suspend and the INTCS state is resrored during system
    resume by the A4R's "power on" code.

    Suggested-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     
  • The sh7372 contains a power domain named A4S which in turn
    contains power domains for both I/O Devices and CPU cores.

    At this point only System wide Suspend-to-RAM is supported,
    but the the hardware can also support CPUIdle. With more
    efforts in the future CPUIdle can work with bot A4S and A3SM.

    Tested on the sh7372 Mackerel board.

    [rjw: Rebased on top of the current linux-pm tree.]

    Signed-off-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Magnus Damm
     

10 Dec, 2011

3 commits

  • The S3C64xx SoCs contain a set of gateable power domains which can be
    enabled and disabled at runtime in order to save power. Use the generic
    power domain code to implement support for these in software, enabling
    runtime control of most domains:

    - ETM (not supported in mainline).
    - Domain G: 3D acceleration (no mainline support).
    - Domain V: MFC (no mainline support).
    - Domain I: JPEG and camera interface (no mainline support).
    - Domain P: 2D acceleration, TV encoder and scaler (no mainline support)
    - Domain S: Security (no mainline support).
    - Domain F: LCD (driver already uses runtime PM), post processing and
    rotation (no mainline support).

    The IROM domain is marked as always enabled as we should arrange for it
    to be enabled when we suspend which will need a bit more work.

    Due to all the conditional device registration that the platform does
    wrap s3c_pm_init() with s3c64xx_pm_init() which actually puts the device
    into the power domain after the machines have registered, looking for
    platform data to tell if the device was registered. Since currently only
    Cragganmore actually sets up PM that is the only machine updated.

    Signed-off-by: Mark Brown
    Acked-by: Kukjin Kim
    Signed-off-by: Rafael J. Wysocki

    Mark Brown
     
  • Saves a tiny amount of code.

    Signed-off-by: Mark Brown
    Acked-by: Magnus Damm
    Signed-off-by: Rafael J. Wysocki

    Mark Brown
     
  • Since systems are likely to have power domains that can't be turned off
    for various reasons at least temporarily while implementing power domain
    support provide a default governor which will always refuse to power off
    the domain, saving platforms having to implement their own.

    Since the code is so tiny don't bother with a Kconfig symbol for it.

    Signed-off-by: Mark Brown
    Signed-off-by: Rafael J. Wysocki

    Mark Brown
     

09 Dec, 2011

1 commit

  • Commit d23b9b00cdde5c93b914a172cecd57d5625fcd04 (PM / Domains: Rework
    system suspend callback routines (v2)) broke the system suspend and
    resume handling by devices belonging to generic PM domains, because
    it used freeze/thaw callbacks instead of suspend/resume ones and
    didn't initialize device callbacks for system suspend/resume
    properly at all. Fix those problems.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

07 Dec, 2011

1 commit


02 Dec, 2011

8 commits

  • Fix the following compalitaion breakage:

    In file included from linux/drivers/sh/pm_runtime.c:15:
    linux/include/linux/pm_domain.h: In function 'dev_to_genpd':
    linux/include/linux/pm_domain.h:142: error: implicit declaration of function 'ERR_PTR'
    linux/include/linux/pm_domain.h:142: warning: return makes pointer from integer without a cast
    In file included from linux/include/linux/sh_clk.h:10,
    from linux/drivers/sh/pm_runtime.c:19:
    linux/include/linux/err.h: At top level:
    linux/include/linux/err.h:22: error: conflicting types for 'ERR_PTR'
    linux/include/linux/pm_domain.h:142: note: previous implicit declaration of 'ERR_PTR' was here
    make[3]: *** [drivers/sh/pm_runtime.o] Error 1

    Reported-by: Nobuhiro Iwamatsu
    Signed-off-by: Guennadi Liakhovetski
    Signed-off-by: Rafael J. Wysocki

    Guennadi Liakhovetski
     
  • Measure the time of execution of the .stop(), .start(), .save_state()
    and .restore_state() PM domain device callbacks and if the result
    is greater than the corresponding latency value stored in the
    device's struct generic_pm_domain_data object, replace the inaccurate
    value with the measured time.

    Do analogously for the PM domains' .power_off() and .power_off()
    callbacks.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Add a function deciding whether or not a given PM domain should
    be powered off on the basis of the PM QoS constraints of devices
    belonging to it and their PM QoS timing data.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Add a function deciding whether or not devices should be stopped in
    pm_genpd_runtime_suspend() depending on their PM QoS constraints
    and stop/start timing values. Make it possible to add information
    used by this function to device objects.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     
  • The current generic PM domains code attempts to use the generic
    system suspend operations along with the domains' device stop/start
    routines, which requires device drivers to assume that their
    system suspend/resume (and hibernation/restore) callbacks will always
    be used with generic PM domains. However, in theory, the same
    hardware may be used in devices that don't belong to any PM domain,
    in which case it would be necessary to add "fake" PM domains to
    satisfy the above assumption. Also, the domain the hardware belongs
    to may not be handled with the help of the generic code.

    To allow device drivers that may be used along with the generic PM
    domains code of more flexibility, add new device callbacks,
    .suspend(), .suspend_late(), .resume_early(), .resume(), .freeze(),
    .freeze_late(), .thaw_early(), and .thaw(), that can be supplied by
    the drivers in addition to their "standard" system suspend and
    hibernation callbacks. These new callbacks, if defined, will be used
    by the generic PM domains code for the handling of system suspend and
    hibernation instead of the "standard" ones. This will allow drivers
    to be designed to work with generic PM domains as well as without
    them.

    For backwards compatibility, introduce default implementations of the
    new callbacks for PM domains that will execute pm_generic_suspend(),
    pm_generic_suspend_noirq(), pm_generic_resume_noirq(),
    pm_generic_resume(), pm_generic_freeze(), pm_generic_freeze_noirq(),
    pm_generic_thaw_noirq(), and pm_generic_thaw(), respectively, for the
    given device if its driver doesn't define those callbacks.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The current PM domains code uses device drivers' .runtime_suspend()
    and .runtime_resume() callbacks as the "save device state" and
    "restore device state" operations, which may not be appropriate in
    general, because it forces drivers to assume that they always will
    be used with generic PM domains. However, in theory, the same
    hardware may be used in devices that don't belong to any PM
    domain, in which case it would be necessary to add "fake" PM
    domains to satisfy the above assumption. It also may be located in
    a PM domain that's not handled with the help of the generic code.

    To allow device drivers that may be used along with the generic PM
    domains code of more flexibility, introduce new device callbacks,
    .save_state() and .restore_state(), that can be supplied by the
    drivers in addition to their "standard" runtime PM callbacks. This
    will allow the drivers to be designed to work with generic PM domains
    as well as without them.

    For backwards compatibility, introduce default .save_state() and
    .restore_state() callback routines for PM domains that will execute
    a device driver's .runtime_suspend() and .runtime_resume() callbacks,
    respectively, for the given device if the driver doesn't provide its
    own implementations of .save_state() and .restore_state().

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The current generic PM domains code requires that the same .stop(),
    .start() and .active_wakeup() device callback routines be used for
    all devices in the given domain, which is inflexible and may not
    cover some specific use cases. For this reason, make it possible to
    use device specific .start()/.stop() and .active_wakeup() callback
    routines by adding corresponding callback pointers to struct
    generic_pm_domain_data. Add a new helper routine,
    pm_genpd_register_callbacks(), that can be used to populate
    the new per-device callback pointers.

    Modify the shmobile's power domains code to allow drivers to add
    their own code to be run during the device stop and start operations
    with the help of the new callback pointers.

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Magnus Damm

    Rafael J. Wysocki
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
    Btrfs: fix meta data raid-repair merge problem
    Btrfs: skip allocation attempt from empty cluster
    Btrfs: skip block groups without enough space for a cluster
    Btrfs: start search for new cluster at the beginning
    Btrfs: reset cluster's max_size when creating bitmap
    Btrfs: initialize new bitmaps' list
    Btrfs: fix oops when calling statfs on readonly device
    Btrfs: Don't error on resizing FS to same size
    Btrfs: fix deadlock on metadata reservation when evicting a inode
    Fix URL of btrfs-progs git repository in docs
    btrfs scrub: handle -ENOMEM from init_ipath()

    Linus Torvalds
     

01 Dec, 2011

15 commits

  • Commit 4a54c8c16 introduced raid-repair, killing the individual
    readpage_io_failed_hook entries from inode.c and disk-io.c. Commit
    4bb31e92 introduced new readahead code, adding a readpage_io_failed_hook to
    disk-io.c.

    The raid-repair commit had logic to disable raid-repair, if
    readpage_io_failed_hook is set. Thus, the readahead commit effectively
    disabled raid-repair for meta data.

    This commit changes the logic to always attempt raid-repair when needed and
    call the readpage_io_failed_hook in case raid-repair fails. This is much
    more straight forward and should have been like that from the beginning.

    Signed-off-by: Jan Schmidt
    Reported-by: Stefan Behrens
    Signed-off-by: Chris Mason

    Jan Schmidt
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/roland/infiniband:
    IB: Fix RCU lockdep splats
    IB/ipoib: Prevent hung task or softlockup processing multicast response
    IB/qib: Fix over-scheduling of QSFP work
    RDMA/cxgb4: Fix retry with MPAv1 logic for MPAv2
    RDMA/cxgb4: Fix iw_cxgb4 count_rcqes() logic
    IB/qib: Don't use schedule_work()

    Linus Torvalds
     
  • * 'dt-for-linus' of git://sources.calxeda.com/kernel/linux:
    of: Add Silicon Image vendor prefix
    of/irq: of_irq_init: add check for parent equal to child node

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
    regulator: twl: fix twl4030 support for smps regulators
    regulator: fix use after free bug
    regulator: aat2870: Fix the logic of checking if no id is matched in aat2870_get_regulator

    Linus Torvalds
     
  • * 'fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (45 commits)
    ARM: ux500: update defconfig
    ARM: u300: update defconfig
    ARM: at91: enable additional boards in existing soc defconfig files
    ARM: at91: refresh soc defconfig files for 3.2
    ARM: at91: rename defconfig files appropriately
    ARM: OMAP2+: Fix Compilation error when omap_l3_noc built as module
    ARM: OMAP2+: Remove empty io.h
    ARM: OMAP2: select ARM_AMBA if OMAP3_EMU is defined
    ARM: OMAP: smartreflex: fix IRQ handling bug
    ARM: OMAP: PM: only register TWL with voltage layer when device is present
    ARM: OMAP: hwmod: Fix the addr space, irq, dma count APIs
    arm: mx28: fix bit operation in clock setting
    ARM: imx: export imx_ioremap
    ARM: imx/mm-imx3: conditionally compile i.MX31 and i.MX35 code
    ARM: mx5: Fix checkpatch warnings in cpu-imx5.c
    MAINTAINERS: Add missing directory
    ARM: imx: drop 'ARCH_MX31' and 'ARCH_MX35'
    ARM: imx6q: move clock register map to machine_desc.map_io
    ARM: pxa168/gplugd: add the correct SSP device
    ARM: Update mach-types to fix mxs build breakage
    ...

    Linus Torvalds
     
  • If we don't have a cluster, don't bother trying to allocate from it,
    jumping right away to the attempt to allocate a new cluster.

    Signed-off-by: Alexandre Oliva
    Signed-off-by: Chris Mason

    Alexandre Oliva
     
  • We test whether a block group has enough free space to hold the
    requested block, but when we're doing clustered allocation, we can
    save some cycles by testing whether it has enough room for the cluster
    upfront, otherwise we end up attempting to set up a cluster and
    failing. Only in the NO_EMPTY_SIZE loop do we attempt an unclustered
    allocation, and by then we'll have zeroed the cluster size, so this
    patch won't stop us from using the block group as a last resort.

    Signed-off-by: Alexandre Oliva
    Signed-off-by: Chris Mason

    Alexandre Oliva
     
  • Instead of starting at zero (offset is always zero), request a cluster
    starting at search_start, that denotes the beginning of the current
    block group.

    Signed-off-by: Alexandre Oliva
    Signed-off-by: Chris Mason

    Alexandre Oliva
     
  • The field that indicates the size of the largest contiguous chunk of
    free space in the cluster is not initialized when setting up bitmaps,
    it's only increased when we find a larger contiguous chunk. We end up
    retaining a larger value than appropriate for highly-fragmented
    clusters, which may cause pointless searches for large contiguous
    groups, and even cause clusters that do not meet the density
    requirements to be set up.

    Signed-off-by: Alexandre Oliva
    Signed-off-by: Chris Mason

    Alexandre Oliva
     
  • We're failing to create clusters with bitmaps because
    setup_cluster_no_bitmap checks that the list is empty before inserting
    the bitmap entry in the list for setup_cluster_bitmap, but the list
    field is only initialized when it is restored from the on-disk free
    space cache, or when it is written out to disk.

    Besides a potential race condition due to the multiple use of the list
    field, filesystem performance severely degrades over time: as we use
    up all non-bitmap free extents, the try-to-set-up-cluster dance is
    done at every metadata block allocation. For every block group, we
    fail to set up a cluster, and after failing on them all up to twice,
    we fall back to the much slower unclustered allocation.

    To make matters worse, before the unclustered allocation, we try to
    create new block groups until we reach the 1% threshold, which
    introduces additional bitmaps and thus block groups that we'll iterate
    over at each metadata block request.

    Alexandre Oliva
     
  • To reproduce this bug:

    # dd if=/dev/zero of=img bs=1M count=256
    # mkfs.btrfs img
    # losetup -r /dev/loop1 img
    # mount /dev/loop1 /mnt
    OOPS!!

    It triggered BUG_ON(!nr_devices) in btrfs_calc_avail_data_space().

    To fix this, instead of checking write-only devices, we check all open
    deivces:

    # df -h /dev/loop1
    Filesystem Size Used Avail Use% Mounted on
    /dev/loop1 250M 28K 238M 1% /mnt

    Signed-off-by: Li Zefan

    Li Zefan
     
  • It seems overly harsh to fail a resize of a btrfs file system to the
    same size when a shrink or grow would succeed. User app GParted trips
    over this error. Allow it by bypassing the shrink or grow operation.

    Signed-off-by: Mike Fleetwood

    Mike Fleetwood
     
  • When I ran the xfstests, I found the test tasks was blocked on meta-data
    reservation.

    By debugging, I found the reason of this bug:
    start transaction
    |
    v
    reserve meta-data space
    |
    v
    flush delay allocation -> iput inode -> evict inode
    ^ |
    | v
    wait for delay allocation flush

    Miao Xie
     
  • The location of the btrfs-progs repository has been changed.
    This patch updates the documentation accordingly.

    Signed-off-by: Arnd Hannemann

    Arnd Hannemann
     
  • init_ipath() can return an ERR_PTR(-ENOMEM).

    Signed-off-by: Dan Carpenter

    Dan Carpenter
     

30 Nov, 2011

6 commits

  • Roland Dreier
     
  • * 'pm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
    PM: Update comments describing device power management callbacks
    PM / Sleep: Update documentation related to system wakeup
    PM / Runtime: Make documentation follow the new behavior of irq_safe
    PM / Sleep: Correct inaccurate information in devices.txt
    PM / Domains: Document how PM domains are used by the PM core
    PM / Hibernate: Do not leak memory in error/test code paths

    Linus Torvalds
     
  • Commit f2c31e32b37 ("net: fix NULL dereferences in check_peer_redir()")
    forgot to take care of infiniband uses of dst neighbours.

    Many thanks to Marc Aurele who provided a nice bug report and feedback.

    Reported-by: Marc Aurele La France
    Signed-off-by: Eric Dumazet
    Cc: David Miller
    Cc:
    Signed-off-by: Roland Dreier

    Eric Dumazet
     
  • This following can occur with ipoib when processing a multicast reponse:

    BUG: soft lockup - CPU#0 stuck for 67s! [ib_mad1:982]
    Modules linked in: ...
    CPU 0:
    Modules linked in: ...
    Pid: 982, comm: ib_mad1 Not tainted 2.6.32-131.0.15.el6.x86_64 #1 ProLiant DL160 G5
    RIP: 0010:[] [] _spin_unlock_irqrestore+0x17/0x20
    RSP: 0018:ffff8802119ed860 EFLAGS: 00000246
    0000000000000004 RBX: ffff8802119ed860 RCX: 000000000000a299
    RDX: ffff88021086c700 RSI: 0000000000000246 RDI: 0000000000000246
    RBP: ffffffff8100bc8e R08: ffff880210ac229c R09: 0000000000000000
    R10: ffff88021278aab8 R11: 0000000000000000 R12: ffff8802119ed860
    R13: ffffffff8100be6e R14: 0000000000000001 R15: 0000000000000003
    FS: 0000000000000000(0000) GS:ffff880028200000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0018 ES: 0018 CR0: 000000008005003b
    CR2: 00000000006d4840 CR3: 0000000209aa5000 CR4: 00000000000406f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Call Trace:
    [] ? ipoib_mcast_send+0x157/0x480 [ib_ipoib]
    [] ? apic_timer_interrupt+0xe/0x20
    [] ? apic_timer_interrupt+0xe/0x20
    [] ? ipoib_path_lookup+0x124/0x2d0 [ib_ipoib]
    [] ? ipoib_start_xmit+0x17c/0x430 [ib_ipoib]
    [] ? dev_hard_start_xmit+0x2c8/0x3f0
    [] ? sch_direct_xmit+0x15a/0x1c0
    [] ? dev_queue_xmit+0x388/0x4d0
    [] ? ipoib_mcast_join_finish+0x2c7/0x510 [ib_ipoib]
    [] ? ipoib_mcast_sendonly_join_complete+0x1b8/0x1f0 [ib_ipoib]
    [] ? mcast_work_handler+0x1a6/0x710 [ib_sa]
    [] ? ib_send_mad+0xfe/0x3c0 [ib_mad]
    [] ? ib_get_cached_lmc+0xa3/0xb0 [ib_core]
    [] ? join_handler+0xeb/0x200 [ib_sa]
    [] ? ib_sa_mcmember_rec_callback+0x5c/0xa0 [ib_sa]
    [] ? recv_handler+0x3c/0x70 [ib_sa]
    [] ? ib_mad_completion_handler+0x844/0x9d0 [ib_mad]
    [] ? ib_mad_completion_handler+0x0/0x9d0 [ib_mad]
    [] ? worker_thread+0x170/0x2a0
    [] ? autoremove_wake_function+0x0/0x40
    [] ? worker_thread+0x0/0x2a0
    [] ? kthread+0x96/0xa0
    [] ? child_rip+0xa/0x20

    Coinciding with stack trace is the following message:

    ib0: ib_address_create failed

    The code below in ipoib_mcast_join_finish() will note the above
    failure in the address handle but otherwise continue:

    ah = ipoib_create_ah(dev, priv->pd, &av);
    if (!ah) {
    ipoib_warn(priv, "ib_address_create failed\n");
    } else {

    The while loop at the bottom of ipoib_mcast_join_finish() will attempt
    to send queued multicast packets in mcast->pkt_queue and eventually
    end up in ipoib_mcast_send():

    if (!mcast->ah) {
    if (skb_queue_len(&mcast->pkt_queue) < IPOIB_MAX_MCAST_QUEUE)
    skb_queue_tail(&mcast->pkt_queue, skb);
    else {
    ++dev->stats.tx_dropped;
    dev_kfree_skb_any(skb);
    }

    My read is that the code will requeue the packet and return to the
    ipoib_mcast_join_finish() while loop and the stage is set for the
    "hung" task diagnostic as the while loop never sees a non-NULL ah, and
    will do nothing to resolve.

    There are GFP_ATOMIC allocates in the provider routines, so this is
    possible and should be dealt with.

    The test that induced the failure is associated with a host SM on the
    same server during a shutdown.

    This patch causes ipoib_mcast_join_finish() to exit with an error
    which will flush the queued mcast packets. Nothing is done to unwind
    the QP attached state so that subsequent sends from above will retry
    the join.

    Reviewed-by: Ram Vepa
    Reviewed-by: Gary Leshner
    Signed-off-by: Mike Marciniszyn
    Signed-off-by: Roland Dreier

    Mike Marciniszyn
     
  • * 'slab/urgent' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/linux:
    slub: avoid potential NULL dereference or corruption
    slub: use irqsafe_cpu_cmpxchg for put_cpu_partial
    slub: move discard_slab out of node lock
    slub: use correct parameter to add a page to partial list tail

    Linus Torvalds
     
  • * 'dev' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
    ext4: fix racy use-after-free in ext4_end_io_dio()

    Linus Torvalds
     

29 Nov, 2011

4 commits