aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2010-10-18spi/bfin_spi: use dma_disable_irq_nosync() in irq handlerBarry Song1-1/+1
Using disable_irq() on the IRQ whose handler we are currently executing in can easily lead to a hang. So use the nosync variant here. Signed-off-by: Barry Song <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: combine duplicate SPI_CTL read/write logicMike Frysinger2-90/+18
While combining things, also switch to the proper SPI bit define names. This lets us punt the rarely used SPI defines. Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: reset ctl_reg bits when setup is run again on a deviceMike Frysinger1-3/+9
During runtime, the spi setup function may be called multiple times on the same device in order to reconfigure some settings on the fly. When this happens, we need to reset the ctl_reg bits so that changing the mode works as expected. Reported-by: Andy Getzendanner <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: push all size checks into the transfer functionMike Frysinger1-43/+14
This reduces duplication between the setup/transfer functions and keeps values cached during setup from overriding values changed on a transfer basis (like bits_per_word). Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: use nosync when disabling the IRQ from the IRQ handlerYi Li1-1/+1
Using disable_irq() on the IRQ whose handler we are currently executing in can easily lead to a hang. So use the nosync variant here. Signed-off-by: Yi Li <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: sync hardware state before reprogramming everythingBarry Song1-0/+2
Sometimes under load, the Blackfin core is able to send SPI register updates out before the controller is actually disabled. So when we go to reprogram the entire state (to switch to a different slave), make sure we sync after disabling the controller. Signed-off-by: Barry Song <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: save/restore state when suspending/resumingBarry Song1-4/+13
We can't rely on the SPI_CTL/SPI_FLG registers retaining their state when suspending, so save/restore their entire values. Signed-off-by: Barry Song <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: redo GPIO CS handlingBarry Song2-20/+23
The common SPI layers take care of detecting CS conflicts and preventing two devices from claiming the same CS. This causes problems for the GPIO CS support we currently have as we are using CS0 to mean "GPIO CS". But if we have multiple devices using a GPIO CS, the common SPI layers see multiple devices using the virtual "CS0" and reject any such attempts. To make both work, we introduce an offset define. This represents the max number of hardware CS values that the SPI peripheral supports. If the CS is below this limit, we know we can use the hardware CS. If it's above, we treat it as a GPIO CS. This keeps the CS unique as seen by the common code and prevents conflicts. Signed-off-by: Barry Song <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18Blackfin: SPI: expand SPI bitmasksMike Frysinger1-4/+7
Expand the BIT_CTL defines to use the naming convention of the hardware, and expand the masks to cover all documented bits. Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: use the SPI namespaced bit namesMike Frysinger1-10/+11
This lets us push the short SPI MMR bit names out of the global namespace. Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: drop extra memory we don't needMike Frysinger1-2/+2
The driver that we based ours on uses a little extra memory behind the normal driver state, but we don't. So drop this useless bit of memory. Reported-by: David Brownell <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: convert struct names to something more logicalMike Frysinger1-50/+50
The current structure names are a bit confusing as to what they represent, so use better names. Reported-by: David Brownell <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: convert read/write/duplex funcs to a dedicated ops structureMike Frysinger1-26/+32
Rather than having to look up the same 3 sets of functions at the same time, just use an ops structure so we only need to set one pointer. Reported-by: David Brownell <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: convert queue run state to true/falseMike Frysinger1-10/+8
No point in creating our own version of true/false defines when there is already a standard stdbool available to us. Reported-by: David Brownell <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: fix up some unused/misleading commentsMike Frysinger1-6/+2
Reported-by: David Brownell <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: punt useless null read/write funcsMike Frysinger1-42/+5
The chip ops should always be initialized, so having null fallback functions are useless. Reported-by: David Brownell <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: drop custom cs_change_per_word supportMike Frysinger2-137/+12
As David points out, the cs_change_per_word option isn't standard, nor is anyone actually using it. So punt all of the dead code considering it makes up ~10% of the code size. Reported-by: David Brownell <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: fix CS handlingBarry Song1-6/+27
The CS helper functions were toggling both the Flag Enable and the Flag Value bits, but the Flag Value bit is ignored if the corresponding Flag Enable bit is cleared. So under high speed transactions, the CS sometimes would not toggle properly. Since it makes no sense to toggle the Flag Enable bit dynamically when we actually want to control the Flag Value, do this when setting up the device and then only handle toggling of the CS value during runtime. Signed-off-by: Barry Song <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: utilize the SPI interrupt in PIO modeYi Li1-50/+185
The current behavior in PIO mode is to poll the SPI status registers which can obviously lead to higher latencies when doing a lot of SPI traffic. There is a SPI interrupt which can be used instead to signal individual completion of transactions. Signed-off-by: Yi Li <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: force sane master-mode state at bootWolfgang Muees1-0/+6
We should make sure the SPI controller is in a sane state in case the boot loader left it in a crappy state. Such as DMA pending which causes interrupts to fire on us. When setting a sane initial state, do not default to slave mode. If we do, then the SPI peripheral may implicitly take over the SPISS pin which other things might be using. For example, the BF533-STAMP uses this pin as a GPIO to control switching between ethernet and flash. If the SPI peripheral controls the output state instead, the ethernet is no longer accessible. URL: http://blackfin.uclinux.org/gf/tracker/5630 Signed-off-by: Wolfgang Muees <[email protected]> Signed-off-by: Michael Hennerich <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: work around anomaly 05000119Sonic Zhang1-4/+0
Anomaly 05000119 states that the DMA_RUN bit with peripherals isn't reliable. However, the way the driver is currently written (DMA IRQ callback), we don't need the polling in the first place, so drop it. Signed-off-by: Sonic Zhang <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18spi/bfin_spi: fix resources leakageDaniel Mack1-45/+75
Re-order setup() a bit so we don't leak memory/dma/gpio resources upon errors. Also make sure we don't call kfree() twice on the same object. Signed-off-by: Daniel Mack <[email protected]> Signed-off-by: Bryan Wu <[email protected]> Signed-off-by: Yi Li <[email protected]> Signed-off-by: Mike Frysinger <[email protected]>
2010-10-18ARM: S5P64X0: Update Kconfig and MakefileKukjin Kim8-66/+96
This patch updates the Kconfig and Makefile for the S5P6440 and S5P6450 machines. It also updates arch/arm/ Kconfig and Makefile to include for support ARCH_S5P64X0 with one kernel image. Signed-off-by: Kukjin Kim <[email protected]>
2010-10-18ARM: S5P: Moves initial map for merging S5P64X0Kukjin Kim10-66/+125
This patch moves some initial maps from plat-s5p to machine, so that can merge mach-s5p6440 and mach-s5p6450. Signed-off-by: Kukjin Kim <[email protected]>
2010-10-18ARM: S5P: Move OneNAND device definitions in plat-s5pKukjin Kim11-24/+37
This patch moves OneNAND device definitions from mach-s5pv210 to plat-s5p so that can support it commonly. Note: S5PC110 and S5PC210 have same OneNAND driver. Signed-off-by: Kukjin Kim <[email protected]> Cc: Kyungmin Park <[email protected]>
2010-10-18i2c-imx: do not allow interruptions when waiting for I2C to completeMarc Kleine-Budde1-9/+3
The i2c_imx_trx_complete() function is using wait_event_interruptible_timeout() to wait for the I2C controller to signal that it has completed an I2C bus operation. If the process that causes the I2C operation receives a signal, the wait will be interrupted, returning an error. It is better to let the I2C operation finished before handling the signal (i.e. returning into userspace). It is safe to use wait_event_timeout() instead, because the timeout will allow the process to exit if the I2C bus hangs. It's also better to allow the I2C operation to finish, because unacknowledged I2C operations can cause the I2C bus to hang. Signed-off-by: Marc Kleine-Budde <[email protected]> Reviewed-by: Wolfram Sang <[email protected]> Signed-off-by: Ben Dooks <[email protected]>
2010-10-18i2c-davinci: Fix TX setup for more SoCsJon Povey1-9/+15
This patch is an improvement to 4bba0fd8d1c6d405df666e2573e1a1f917098be0 which got to mainline a little early. Sudhakar Rajashekhara explains that at least OMAP-L138 requires MDR mode settings before DXR for correct behaviour, so load MDR first with STT cleared and later load again with STT set. Tested on DM355 connected to Techwell TW2836 and Wolfson WM8985 Signed-off-by: Jon Povey <[email protected]> Acked-by: Troy Kisky <[email protected]> Tested-by: Sudhakar Rajashekhara <[email protected]> Acked-by: Kevin Hilman <[email protected]> Signed-off-by: Ben Dooks <[email protected]>
2010-10-18drm/radeon/kms: avivo cursor workaround applies to evergreen as wellAlex Deucher1-16/+12
Fixes cursor corruption in certain cases. Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected] Signed-off-by: Dave Airlie <[email protected]>
2010-10-17Merge branch 'fix/misc' of ↵Linus Torvalds1-1/+3
git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 * 'fix/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: rawmidi: fix oops (use after free) when unloading a driver module
2010-10-17firewire: ohci: fix TI TSB82AA2 regression since 2.6.35Stefan Richter2-26/+1
Revert commit 54672386ccf36ffa21d1de8e75624af83f9b0eeb "firewire: ohci: fix up configuration of TI chips". It caused massive slow-down and data corruption with a TSB82AA2 based StarTech EC1394B2 ExpressCard and FireWire 800 harddisks. https://bugs.launchpad.net/ubuntu/+source/linux/+bug/657081 http://thread.gmane.org/gmane.linux.kernel.firewire.user/4013 The fact that some card EEPROMs do not program these enhancements may be related to TSB81BA3 phy chip errata, if not to bugs of TSB82AA2 itself. We could re-add these configuration steps, but only conditional on a whitelist of cards on which these enhancements bring a proven positive effect. Reported-and-tested-by: Eric Shattow <[email protected]> Cc: Clemens Ladisch <[email protected]> Cc: <[email protected]> 2.6.35 Signed-off-by: Stefan Richter <[email protected]>
2010-10-17ALSA: rawmidi: fix oops (use after free) when unloading a driver moduleClemens Ladisch1-1/+3
When a driver module is unloaded and the last still open file is a raw MIDI device, the card and its devices will be actually freed in the snd_card_file_remove() call when that file is closed. Afterwards, rmidi and rmidi->card point into freed memory, so the module pointer is likely to be garbage. (This was introduced by commit 9a1b64caac82aa02cb74587ffc798e6f42c6170a.) Signed-off-by: Clemens Ladisch <[email protected]> Reported-by: Krzysztof Foltman <[email protected]> Cc: 2.6.30-2.6.35 <[email protected]> Signed-off-by: Takashi Iwai <[email protected]>
2010-10-17PM: Introduce library for device-specific OPPs (v7)Nishanth Menon6-0/+1125
SoCs have a standard set of tuples consisting of frequency and voltage pairs that the device will support per voltage domain. These are called Operating Performance Points or OPPs. The actual definitions of OPP varies over silicon versions. For a specific domain, we can have a set of {frequency, voltage} pairs. As the kernel boots and more information is available, a default set of these are activated based on the precise nature of device. Further on operation, based on conditions prevailing in the system (such as temperature), some OPP availability may be temporarily controlled by the SoC frameworks. To implement an OPP, some sort of power management support is necessary hence this library depends on CONFIG_PM. Contributions include: Sanjeev Premi for the initial concept: http://patchwork.kernel.org/patch/50998/ Kevin Hilman for converting original design to device-based. Kevin Hilman and Paul Walmsey for cleaning up many of the function abstractions, improvements and data structure handling. Romit Dasgupta for using enums instead of opp pointers. Thara Gopinath, Eduardo Valentin and Vishwanath BS for fixes and cleanups. Linus Walleij for recommending this layer be made generic for usage in other architectures beyond OMAP and ARM. Mark Brown, Andrew Morton, Rafael J. Wysocki, Paul E. McKenney for valuable improvements. Discussions and comments from: http://marc.info/?l=linux-omap&m=126033945313269&w=2 http://marc.info/?l=linux-omap&m=125482970102327&w=2 http://marc.info/?t=125809247500002&r=1&w=2 http://marc.info/?l=linux-omap&m=126025973426007&w=2 http://marc.info/?t=128152609200064&r=1&w=2 http://marc.info/?t=128468723000002&r=1&w=2 incorporated. v1: http://marc.info/?t=128468723000002&r=1&w=2 Signed-off-by: Nishanth Menon <[email protected]> Signed-off-by: Kevin Hilman <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM: Add sysfs attr for rechecking dev hash from PM traceJames Hogan5-0/+87
If the device which fails to resume is part of a loadable kernel module it won't be checked at startup against the magic number stored in the RTC. Add a read-only sysfs attribute /sys/power/pm_trace_dev_match which contains a list of newline separated devices (usually just the one) which currently match the last magic number. This allows the device which is failing to resume to be found after the modules are loaded again. Signed-off-by: James Hogan <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM: Lock PM device list mutex in show_dev_hash()James Hogan1-1/+4
Lock the PM device list mutex using device_pm_lock() and device_pm_unlock() around the list iteration in show_dev_hash(). show_dev_hash() was reverse iterating dpm_list without first locking the mutex that the functions in drivers/base/power/main.c lock. I assume this was unintentional since there is no comment suggesting why the lock might not be necessary. Signed-off-by: James Hogan <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM / Runtime: Remove idle notification after failing suspendRafael J. Wysocki1-9/+2
If runtime suspend of a device fails returning -EAGAIN or -EBUSY, which means that it's safe to try to suspend it again, the PM core runs the runtime idle helper function for it. Unfortunately this may lead to problems, for example for PCI devices whose drivers don't implement the ->runtime_idle() callback, because in that case the PCI bus type's ->runtime_idle() always calls pm_runtime_suspend() for the given device. Then, if there's an automatic idle notification after the driver's ->runtime_suspend() returning -EAGAIN or -EBUSY, it will make the suspend happen again possibly causing a busy loop to appear. To avoid that, remove the idle notification after failing runtime suspend of a device altogether and let the callers of pm_runtime_suspend() repeat the operation if need be. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Alan Stern <[email protected]>
2010-10-17PM / Hibernate: Modify signature used to mark swapRafael J. Wysocki1-3/+3
Since we are adding compression to the kernel's hibernate code, change signature used by it to mark swap spaces, so that earlier kernels don't attempt to restore compressed images they cannot handle. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Pavel Machek <[email protected]>
2010-10-17PM / Runtime: Reduce code duplication in core helper functionsRafael J. Wysocki1-68/+54
Reduce code duplication in rpm_idle(), rpm_suspend() and rpm_resume() by using local pointers to store callback addresses and moving some duplicated code into a separate function. Signed-off-by: Rafael J. Wysocki <[email protected]> Reviewed-by: Alan Stern <[email protected]>
2010-10-17PM: Allow wakeup events to abort freezing of tasksRafael J. Wysocki2-2/+11
If there is a wakeup event during the freezing of tasks, suspend or hibernation will fail anyway. Since try_to_freeze_tasks() can take up to 20 seconds to complete or fail, aborting it as soon as a wakeup event is detected improves the worst case wakeup latency. Based on a patch from Arve Hjønnevåg. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Pavel Machek <[email protected]>
2010-10-17PM: runtime: add missed pm_request_autosuspendMing Lei1-0/+5
The patch "PM / Runtime: Implement autosuspend support" introduces "autosuspend" facility for runtime PM, but misses helper function of pm_request_autosuspend, so add it. Signed-off-by: Ming Lei <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM / Hibernate: Make some boot messages look less scaryRafael J. Wysocki2-8/+8
The hibernate resume code checks if there is an image to resume from on every boot and, if the kernel is built with CONFIG_PM_DEBUG set and the image is not present, it prints some scary messages suggesting there was a boot error of some sort. Apparently, some users are confused by them, so make them look less scary and adjust the other hibernate resume debug messages to match them. Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM / Runtime: Implement autosuspend supportAlan Stern6-14/+473
This patch (as1427) implements the "autosuspend" facility for runtime PM. A few new fields are added to the dev_pm_info structure and several new PM helper functions are defined, for telling the PM core whether or not a device uses autosuspend, for setting the autosuspend delay, and for marking periods of device activity. Drivers that do not want to use autosuspend can continue using the same helper functions as before; their behavior will not change. In addition, drivers supporting autosuspend can also call the old helper functions to get the old behavior. The details are all explained in Documentation/power/runtime_pm.txt and Documentation/ABI/testing/sysfs-devices-power. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM / Runtime: Add no_callbacks flagAlan Stern6-8/+149
Some devices, such as USB interfaces, cannot be power-managed independently of their parents, i.e., they cannot be put in low power while the parent remains at full power. This patch (as1425) creates a new "no_callbacks" flag, which tells the PM core not to invoke the runtime-PM callback routines for the such devices but instead to assume that the callbacks always succeed. In addition, the non-debugging runtime-PM sysfs attributes for the devices are removed, since they are pretty much meaningless. The advantage of this scheme comes not so much from avoiding the callbacks themselves, but rather from the fact that without the need for a process context in which to run the callbacks, more work can be done in interrupt context. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM / Runtime: Combine runtime PM entry pointsAlan Stern2-130/+110
This patch (as1424) combines the various public entry points for the runtime PM routines into three simple functions: one for idle, one for suspend, and one for resume. A new bitflag specifies whether or not to increment or decrement the usage_count field. The new entry points are named __pm_runtime_idle, __pm_runtime_suspend, and __pm_runtime_resume, to reflect that they are trampolines. Simultaneously, the corresponding internal routines are renamed to rpm_idle, rpm_suspend, and rpm_resume. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM / Runtime: Merge synchronous and async runtime routinesAlan Stern1-235/+140
This patch (as1423) merges the asynchronous routines __pm_request_idle(), __pm_request_suspend(), and __pm_request_resume() with their synchronous counterparts. The RPM_ASYNC bitflag argument serves to indicate what sort of operation to perform. In the course of performing this merger, it became apparent that the various functions don't all behave consistenly with regard to error reporting and cancellation of outstanding requests. A new routine, rpm_check_suspend_allowed(), was written to centralize much of the testing, and the other functions were revised to follow a simple algorithm: If the operation is disallowed because of the device's settings or current state, return an error. Cancel pending or scheduled requests of lower priority. Schedule, queue, or perform the desired operation. A few special cases and exceptions are noted in comments. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM / Runtime: Replace boolean arguments with bitflagsAlan Stern2-44/+54
The "from_wq" argument in __pm_runtime_suspend() and __pm_runtime_resume() supposedly indicates whether or not the function was called by the PM workqueue thread, but in fact it isn't always used this way. It really indicates whether or not the function should return early if the requested operation is already in progress. Along with this badly-named boolean argument, later patches in this series will add several other boolean arguments to these functions and others. Therefore this patch (as1422) begins the conversion process by replacing from_wq with a bitflag argument. The same bitflags are also used in __pm_runtime_get() and __pm_runtime_put(), where they indicate whether or not the operation should be asynchronous. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM / Runtime: Move code in drivers/base/power/runtime.cAlan Stern1-39/+38
This patch (as1421) moves the PM runtime accounting subroutines up to the beginning of runtime.c, taking them out of the middle of the functions that do the actual work. No operational changes. Signed-off-by: Alan Stern <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17sysfs: Add sysfs_merge_group() and sysfs_unmerge_group()Alan Stern2-0/+74
This patch (as1420) adds sysfs_merge_group() and sysfs_unmerge_group() functions, allowing drivers easily to add and remove sets of attributes to a pre-existing attribute group directory. Signed-off-by: Alan Stern <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
2010-10-17PM: Fix potential issue with failing asynchronous suspendRafael J. Wysocki2-8/+14
There is a potential issue with the asynchronous suspend code that a device driver suspending asynchronously may not notice that it should back off. There are two failing scenarions, (1) when the driver is waiting for a driver suspending synchronously to complete and that second driver returns error code, in which case async_error won't be set and the waiting driver will continue suspending and (2) after the driver has called device_pm_wait_for_dev() and the waited for driver returns error code, in which case the caller of device_pm_wait_for_dev() will not know that there was an error and will continue suspending. To fix this issue make __device_suspend() set async_error, so async_suspend() doesn't need to set it any more, and make device_pm_wait_for_dev() return async_error, so that its callers can check whether or not they should continue suspending. No more changes are necessary, since device_pm_wait_for_dev() is not used by any drivers' suspend routines. Reported-by: Colin Cross <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]>
2010-10-17PM / Wakeup: Introduce wakeup source objects and event statistics (v3)Rafael J. Wysocki10-125/+756
Introduce struct wakeup_source for representing system wakeup sources within the kernel and for collecting statistics related to them. Make the recently introduced helper functions pm_wakeup_event(), pm_stay_awake() and pm_relax() use struct wakeup_source objects internally, so that wakeup statistics associated with wakeup devices can be collected and reported in a consistent way (the definition of pm_relax() is changed, which is harmless, because this function is not called directly by anyone yet). Introduce new wakeup-related sysfs device attributes in /sys/devices/.../power for reporting the device wakeup statistics. Change the global wakeup events counters event_count and events_in_progress into atomic variables, so that it is not necessary to acquire a global spinlock in pm_wakeup_event(), pm_stay_awake() and pm_relax(), which should allow us to avoid lock contention in these functions on SMP systems with many wakeup devices. Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]>
2010-10-17PM: Fix signed/unsigned warning in dpm_show_time()Kevin Cernekee1-1/+1
Seen on MIPS32, gcc 4.4.3, 2.6.36-rc4: drivers/base/power/main.c: In function 'dpm_show_time': drivers/base/power/main.c:415: warning: comparison of distinct pointer types lacks a cast do_div() takes unsigned parameters: uint32_t do_div(uint64_t *n, uint32_t base); Using an unsigned variable for usecs64 should not cause any problems, because calltime >= starttime . Signed-off-by: Kevin Cernekee <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>