05 Oct, 2011

2 commits

  • Update the documentation for the recently updated pm_qos API, kernel
    and user space. Add documentation for the per-device PM QoS
    (dev_pm_qos) framework API.

    Signed-off-by: Jean Pihet
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • To read the current PM QoS value for a given device we need to
    make sure that the device's power.constraints object won't be
    removed while we're doing that. For this reason, put the
    operation under dev->power.lock and acquire the lock
    around the initialization and removal of power.constraints.

    Moreover, since we're using the value of power.constraints to
    determine whether or not the object is present, the
    power.constraints_state field isn't necessary any more and may be
    removed. However, dev_pm_qos_add_request() needs to check if the
    device is being removed from the system before allocating a new
    PM QoS constraints object for it, so make it use the
    power.power_state field of struct device for this purpose.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     

25 Aug, 2011

29 commits

  • Add a global notification chain that gets called upon changes to the
    aggregated constraint value for any device.
    The notification callbacks are passing the full constraint request data
    in order for the callees to have access to it. The current use is for the
    platform low-level code to access the target device of the constraint.

    Signed-off-by: Jean Pihet
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • Implement the per-device PM QoS constraints by creating a device
    PM QoS API, which calls the PM QoS constraints management core code.

    The per-device latency constraints data strctures are stored
    in the device dev_pm_info struct.

    The device PM code calls the init and destroy of the per-device constraints
    data struct in order to support the dynamic insertion and removal of the
    devices in the system.

    To minimize the data usage by the per-device constraints, the data struct
    is only allocated at the first call to dev_pm_qos_add_request.
    The data is later free'd when the device is removed from the system.
    A global mutex protects the constraints users from the data being
    allocated and free'd.

    Signed-off-by: Jean Pihet
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • In preparation for the per-device constratins support:
    - rename update_target to pm_qos_update_target
    - generalize and export pm_qos_update_target for usage by the upcoming
    per-device latency constraints framework:
    * operate on struct pm_qos_constraints for constraints management,
    * introduce an 'action' parameter for constraints add/update/remove,
    * the return value indicates if the aggregated constraint value has
    changed,
    - update the internal code to operate on struct pm_qos_constraints
    - add a NULL pointer check in the API functions

    Signed-off-by: Jean Pihet
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • In preparation for the per-device constratins support, re-organize
    the data strctures:
    - add a struct pm_qos_constraints which contains the constraints
    related data
    - update struct pm_qos_object contents to the PM QoS internal object
    data. Add a pointer to struct pm_qos_constraints
    - update the internal code to use the new data structs.

    Signed-off-by: Jean Pihet
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • Move around the PM QoS misc devices management code
    for better readability.

    Signed-off-by: Jean Pihet
    Acked-by: markgross
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • - Misc fixes to improve code readability:
    * rename struct pm_qos_request_list to struct pm_qos_request,
    * rename pm_qos_req parameter to req in internal code,
    consistenly use req in the API parameters,
    * update the in-kernel API callers to the new parameters names,
    * rename of fields names (requests, list, node, constraints)

    Signed-off-by: Jean Pihet
    Acked-by: markgross
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • The PM QoS implementation files are better named
    kernel/power/qos.c and include/linux/pm_qos.h.

    The PM QoS support is compiled under the CONFIG_PM option.

    Signed-off-by: Jean Pihet
    Acked-by: markgross
    Reviewed-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Jean Pihet
     
  • Since the PM clock management code in drivers/base/power/clock_ops.c
    is used for both runtime PM and system suspend/hibernation, the
    definitions of data structures and headers related to it should not
    be located in include/linux/pm_rumtime.h. Move them to a separate
    header file.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Currently pm_genpd_runtime_resume() has to walk the list of devices
    from the device's PM domain to find the corresponding device list
    object containing the need_restore field to check if the driver's
    .runtime_resume() callback should be executed for the device.
    This is suboptimal and can be simplified by using power.sybsys_data
    to store device information used by the generic PM domains code.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Since the power.subsys_data device field will be used by multiple
    filesystems, introduce a reference counting mechanism for it to avoid
    freeing it prematurely or changing its value at a wrong time.

    Make the PM clocks management code that currently is the only user of
    power.subsys_data use the new reference counting.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Introduce struct pm_subsys_data that may be subclassed by subsystems
    to store subsystem-specific information related to the device. Move
    the clock management fields accessed through the power.subsys_data
    pointer in struct device to the new strucutre.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Instead of coding the undocumented dependencies between power domains
    A3RV and A4LC on SH7372 directly into the low-level power up/down
    routines, make A3RV be a subdomain of A4LC, which will cause the
    same dependecies to hold.

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

    Rafael J. Wysocki
     
  • Change the name of the second argument of pm_genpd_add_subdomain()
    so that it is (a) shorter and (b) in agreement with the name of
    the second argument of pm_genpd_add_subdomain().

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Since it is now possible for a PM domain to have multiple masters
    instead of one parent, rename the "wait for parent" status to reflect
    the new situation.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Currently, for a given generic PM domain there may be only one parent
    domain (i.e. a PM domain it depends on). However, there is at least
    one real-life case in which there should be two parents (masters) for
    one PM domain (the A3RV domain on SH7372 turns out to depend on the
    A4LC domain and it depends on the A4R domain and the same time). For
    this reason, allow a PM domain to have multiple parents (masters) by
    introducing objects representing links between PM domains.

    The (logical) links between PM domains represent relationships in
    which one domain is a master (i.e. it is depended on) and another
    domain is a slave (i.e. it depends on the master) with the rule that
    the slave cannot be powered on if the master is not powered on and
    the master cannot be powered off if the slave is not powered off.
    Each struct generic_pm_domain object representing a PM domain has
    two lists of links, a list of links in which it is a master and
    a list of links in which it is a slave. The first of these lists
    replaces the list of subdomains and the second one is used in place
    of the parent pointer.

    Each link is represented by struct gpd_link object containing
    pointers to the master and the slave and two struct list_head
    members allowing it to hook into two lists (the master's list
    of "master" links and the slave's list of "slave" links). This
    allows the code to get to the link from each side (either from
    the master or from the slave) and follow it in each direction.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • The next patch will make it possible for a generic PM domain to have
    multiple parents (i.e. multiple PM domains it depends on). To
    prepare for that change it is necessary to change pm_genpd_poweron()
    so that it doesn't jump to the start label after running itself
    recursively for the parent domain. For this purpose, introduce a new
    PM domain status value GPD_STATE_WAIT_PARENT that will be set by
    pm_genpd_poweron() before calling itself recursively for the parent
    domain and modify the code in drivers/base/power/domain.c so that
    the GPD_STATE_WAIT_PARENT status is guaranteed to be preserved during
    the execution of pm_genpd_poweron() for the parent.

    This change also causes pm_genpd_add_subdomain() and
    pm_genpd_remove_subdomain() to wait for started pm_genpd_poweron() to
    complete and allows pm_genpd_runtime_resume() to avoid dropping the
    lock after powering on the PM domain.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • If pm_genpd_remove_subdomain() is called to remove a PM domain's
    subdomain and pm_genpd_poweron() is called for that subdomain at
    the same time, and the pm_genpd_poweron() called by it recursively
    for the parent returns an error, the first pm_genpd_poweron()'s
    error code path will attempt to decrement the subdomain counter of
    a PM domain that it's not a subdomain of any more.

    Rearrange the code in pm_genpd_poweron() to prevent this from
    happening.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • After the subdomain counter in struct generic_pm_domain has been
    changed into an atomic_t field, it is possible to modify
    pm_genpd_poweron() and pm_genpd_poweroff() so that they don't take
    the parents locks. This requires pm_genpd_poweron() to increment
    the parent's subdomain counter before calling itself recursively
    for the parent and to decrement it if an error is to be returned.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Currently, pm_genpd_poweron() and pm_genpd_poweroff() need to take
    the parent PM domain's lock in order to modify the parent's counter
    of active subdomains in a nonracy way. This causes the locking to be
    considerably complex and in fact is not necessary, because the
    subdomain counters may be implemented as atomic fields and they
    won't have to be modified under a lock.

    Replace the unsigned in sd_count field in struct generic_pm_domain
    by an atomic_t one and modify the code in drivers/base/power/domain.c
    to take this change into account.

    This patch doesn't change the locking yet, that is going to be done
    in a separate subsequent patch.

    Signed-off-by: Rafael J. Wysocki

    Rafael J. Wysocki
     
  • Commit c03f007a8bf0e092caeb6856a5c8a850df10b974 (OMAP: PM:
    omap_device: add system PM methods for PM domain handling) mistakenly
    used SET_SYSTEM_SLEEP_PM_OPS() when trying to configure custom methods
    for the PM domains noirq methods. Fix that by setting only the
    suspend_noirq and resume_noirq methods with custom versions.

    Note that all other PM domain methods (including the "normal"
    suspend/resume methods) are populated using USE_PLATFORM_PM_SLEEP_OPS,
    which configures them all to the default subsystem (platform_bus)
    methods.

    Reported-by: Santosh Shilimkar
    Tested-by: Santosh Shilimkar
    Signed-off-by: Kevin Hilman
    Signed-off-by: Rafael J. Wysocki

    Kevin Hilman
     
  • The description of pm_runtime_irq_safe() has to be updated to follow
    the code after commit 02b2677 (PM / Runtime: Allow _put_sync() from
    interrupts-disabled context).

    Signed-off-by: Rafael J. Wysocki
    Acked-by: Kevin Hilman

    Rafael J. Wysocki
     
  • Associate the HDMI clock together with LCDC1 on sh7372.

    Without this patch Suspend-to-RAM hangs on the boards
    AP4EVB and Mackerel. The code hangs in the LCDC driver
    where the software is waiting forever for the hardware to
    power down. By explicitly associating the HDMI clock with
    LCDC1 we can make sure the HDMI clock is enabled using
    Runtime PM whenever the driver is accessing the hardware.

    This HDMI and LCDC1 dependency is documented in the sh7372
    data sheet. Older kernels did work as expected but the
    recently merged (3.1-rc)

    794d78f drivers: sh: late disabling of clocks V2

    introduced code to turn off clocks lacking software reference
    which happens to include the HDMI clock that is needed by
    LCDC1 to operate as expected.

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

    Magnus Damm
     
  • Since sci_port_enable() and sci_port_disable() may be run with
    interrupts off and they execute pm_runtime_get_sync() and
    pm_runtime_put_sync(), respectively, the SCI device's
    power.irq_safe flag has to be set to indicate that it is safe
    to execute runtime PM callbacks for this device with interrupts off.

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

    Rafael J. Wysocki
     
  • The lock member of struct pm_clk_data is of type struct mutex,
    which is a problem, because the suspend and resume routines
    defined in drivers/base/power/clock_ops.c cannot be executed
    with interrupts disabled for this reason. Modify
    struct pm_clk_data so that its lock member is a spinlock.

    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/jikos/hid:
    HID: wiimote: Add status and return request handlers
    HID: wiimote: Add drm request
    HID: wiimote: Register led class devices
    HID: wiimote: Correctly call HID open/close callbacks
    HID: wiimote: Simplify synchronization
    HID: usbhid: Add support for SiGma Micro chip
    HID: add support for new revision of Apple aluminum keyboard

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
    Input: ad714x - read the interrupt status registers in a row
    Input: ad714x - use DMA-safe buffers for spi_write()
    Input: ad714x - fix endianness issues
    Input: ad714xx-spi - force SPI bus into the default 8-bit mode
    Input: ep93xx_keypad - add missing include of linux/module.h
    Input: tnetv107x-ts - add missing include of linux/module.h
    Input: max11801_ts - correct license statement
    Input: atmel_mxt_ts - report pressure information from the driver
    Input: bcm5974 - Add support for newer MacBookPro8,2
    Input: wacom - report id 3 returns 4 bytes of data
    Input: wacom - add WAC_MSG_RETRIES define
    Input: wacom - add support for the Wacom Bamboo Pen (CTL-660/K)
    Input: tegra-kbc - correct call to input_free_device
    Input: mpu3050 - correct call to input_free_device
    Input: bcm5974 - add support for touchpads found in MacBookAir4,2
    Input: mma8450 - fix module device table type
    Input: remove CLOCK_TICK_RATE from analog joystick driver

    Linus Torvalds
     
  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mszeredi/fuse:
    fuse: check size of FUSE_NOTIFY_INVAL_ENTRY message
    fuse: mark pages accessed when written to
    fuse: delete dead .write_begin and .write_end aops
    fuse: fix flock
    fuse: fix non-ANSI void function notation

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
    sparc: Allow handling signals when stack is corrupted.

    Linus Torvalds
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net: (29 commits)
    bridge: fix a possible net_device leak
    net: Documentation: RFC 2553bis is now RFC 3493
    atm: br2684: Fix oops due to skb->dev being NULL
    ipv6: Fix ipv6_getsockopt for IPV6_2292PKTOPTIONS
    net: netdev-features.txt update to Documentation/networking/00-INDEX
    vlan: reset headers on accel emulation path
    forcedeth: call vlan_mode only if hw supports vlans
    via-velocity: remove non-tagged packet filtering
    bonding:reset backup and inactive flag of slave
    net_sched: fix port mirror/redirect stats reporting
    sit tunnels: propagate IPv6 transport class to IPv4 Type of Service
    gianfar: reduce stack usage in gianfar_ethtool.c
    net: minor update to Documentation/networking/scaling.txt
    net: add missing entries to Documentation/networking/00-INDEX
    gianfar: prevent buggy hw rx vlan tagging
    net: sh_eth: Fix build by forgot including linux/interrupt.h
    drivers/net/can/sja1000/plx_pci.c: eliminate double free
    usbnet/cdc_ncm: Don't use stack variables for DMA
    vmxnet3: Don't enable vlan filters in promiscuous mode.
    iwlagn: sysfs couldn't find the priv pointer
    ...

    Linus Torvalds
     

24 Aug, 2011

9 commits

  • Jiri Kosina
     
  • FUSE_NOTIFY_INVAL_ENTRY didn't check the length of the write so the
    message processing could overrun and result in a "kernel BUG at
    fs/fuse/dev.c:629!"

    Reported-by: Han-Wen Nienhuys
    Signed-off-by: Miklos Szeredi
    CC: stable@kernel.org

    Miklos Szeredi
     
  • …/git/tip/linux-2.6-tip

    * 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86-32, vdso: On system call restart after SYSENTER, use int $0x80
    x86, UV: Remove UV delay in starting slave cpus
    x86, olpc: Wait for last byte of EC command to be accepted

    Linus Torvalds
     
  • When we enter a 32-bit system call via SYSENTER or SYSCALL, we shuffle
    the arguments to match the int $0x80 calling convention. This was
    probably a design mistake, but it's what it is now. This causes
    errors if the system call as to be restarted.

    For SYSENTER, we have to invoke the instruction from the vdso as the
    return address is hardcoded. Accordingly, we can simply replace the
    jump in the vdso with an int $0x80 instruction and use the slower
    entry point for a post-restart.

    Suggested-by: Linus Torvalds
    Signed-off-by: H. Peter Anvin
    Link: http://lkml.kernel.org/r/CA%2B55aFztZ=r5wa0x26KJQxvZOaQq8s2v3u50wCyJcA-Sc4g8gQ@mail.gmail.com
    Cc:

    H. Peter Anvin
     
  • Fixes fallout due to the removal of the cast in commit aa462abe8aaf
    ("mm: fix __page_to_pfn for a const struct page argument")

    Signed-off-by: Ian Campbell
    Cc: Andrew Morton
    Acked-by: Geert Uytterhoeven
    Cc: linux-m68k@lists.linux-m68k.org
    Signed-off-by: Linus Torvalds

    Ian Campbell
     
  • * 'for-linus' of git://oss.sgi.com/xfs/xfs:
    xfs: fix tracing builds inside the source tree
    xfs: remove subdirectories
    xfs: don't expect xfs headers to be in subdirectories

    Linus Torvalds
     
  • * git://git.infradead.org/users/cbou/battery-3.1:
    s3c-adc-battery: Fix compilation error due to missing header (module.h)
    max8997_charger: Needs module.h
    max8998_charger: Needs module.h

    Linus Torvalds
     
  • * 'drm-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6:
    drm/radeon: Extended DDC Probing for Toshiba L300D Radeon Mobility X1100 HDMI-A Connector
    drm/ttm: ensure ttm for new node is bound before calling move_notify()
    drm/ttm: unbind ttm before destroying node in accel move cleanup
    drm/ttm: fix ttm_bo_add_ttm(user) failure path
    drm/radeon: Make vramlimit parameter actually work.
    drm/radeon: Explicitly print GTT/VRAM offsets on test failure.
    drm/radeon: Take IH ring into account for test size calculation.
    drm/radeon/alpha: Add Alpha support to Radeon DRM code

    Linus Torvalds
     
  • This reverts commit f3637a5f2e2eb391ff5757bc83fb5de8f9726464.

    It turns out that this breaks several drivers, one example being OMAP
    boards which use the on-board OMAP UARTs and the omap-serial driver that
    will not boot to userspace after the commit.

    Paul Walmsley reports that enabling CONFIG_DEBUG_SHIRQ reveals 'IRQ
    handler type mismatch' errors:

    IRQ handler type mismatch for IRQ 74
    current handler: serial idle
    ...

    and the reason is that setting IRQF_ONESHOT will now result in those
    interrupt handlers having different IRQF flags, and thus being
    unsharable. So the commit log in the reverted commit:

    "Since it is required for those users and
    there is no difference for others it makes sense to add this flag
    unconditionally."

    is simply not true: there may not be any difference from a "actions at
    irq time", but there is a *big* difference wrt this flag testing irq
    management (see __setup_irq() in kernel/irq/manage.c).

    One solution may be to stop verifying IRQF_ONESHOT in __setup_irq(), but
    right now the safe course of action is to revert the change. Let's
    revisit this in a later merge window.

    Reported-by: Paul Walmsley
    Cc: Sebastian Andrzej Siewior
    Requested-by: Alan Cox
    Acked-by: Thomas Gleixner
    Signed-off-by: Linus Torvalds

    Linus Torvalds