aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Merge git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6Linus Torvalds2010-05-2086-2139/+1179
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * git://git.kernel.org/pub/scm/linux/kernel/git/brodo/pcmcia-2.6: (29 commits) pcmcia: disable PCMCIA ioctl also for ARM drivers/staging/comedi: dev_node removal (quatech_daqp_cs) drivers/staging/comedi: dev_node removal (ni_mio_cs) drivers/staging/comedi: dev_node removal (ni_labpc_cs) drivers/staging/comedi: dev_node removal (ni_daq_dio24) drivers/staging/comedi: dev_node removal (ni_daq_700) drivers/staging/comedi: dev_node removal (das08_cs) drivers/staging/comedi: dev_node removal (cb_das16_cs) pata_pcmcia: get rid of extra indirection pcmcia: remove suspend-related comment from yenta_socket.c pcmcia: call pcmcia_{read,write}_cis_mem with ops_mutex held pcmcia: remove pcmcia_add_device_lock pcmcia: update gfp/slab.h includes pcmcia: remove unused mem_op.h pcmcia: do not autoadd root PCI bus resources pcmcia: clarify alloc_io_space, move it to resource handlers pcmcia: move all pcmcia_resource_ops providers into one module pcmcia: move high level CIS access code to separate file pcmcia: dev_node removal (core) pcmcia: dev_node removal (remaining drivers) ...
| * pcmcia: disable PCMCIA ioctl also for ARMDominik Brodowski2010-05-171-20/+0
| | | | | | | | | | | | | | As per a3f916f2c84f2b9e1d32cc0dbfe326a9e380dbfb, disable the long obsolete PCMCIA ioctl also for ARM. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * drivers/staging/comedi: dev_node removal (quatech_daqp_cs)Javier Martinez Canillas2010-05-171-20/+3
| | | | | | | | | | Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * drivers/staging/comedi: dev_node removal (ni_mio_cs)Javier Martinez Canillas2010-05-171-9/+1
| | | | | | | | | | Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * drivers/staging/comedi: dev_node removal (ni_labpc_cs)Javier Martinez Canillas2010-05-171-16/+3
| | | | | | | | | | Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * drivers/staging/comedi: dev_node removal (ni_daq_dio24)Javier Martinez Canillas2010-05-171-16/+3
| | | | | | | | | | Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * drivers/staging/comedi: dev_node removal (ni_daq_700)Javier Martinez Canillas2010-05-171-16/+3
| | | | | | | | | | Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * drivers/staging/comedi: dev_node removal (das08_cs)Javier Martinez Canillas2010-05-171-16/+3
| | | | | | | | | | Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * drivers/staging/comedi: dev_node removal (cb_das16_cs)Javier Martinez Canillas2010-05-171-16/+3
| | | | | | | | | | Signed-off-by: Javier Martinez Canillas <martinez.javier@gmail.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pata_pcmcia: get rid of extra indirectionDominik Brodowski2010-05-101-35/+6
| | | | | | | | | | | | | | We don't need ata_pcmcia_info any more. Acked-by: Jeff Garzik <jgarzik@redhat.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: remove suspend-related comment from yenta_socket.cDominik Brodowski2010-05-101-7/+0
| | | | | | | | | | | | | | | | | | | | | | While pci_set_power_state() is called by the PCI core unconditionally on all PCI devices, it is not called on _any_ PCI bridge device. Therefore, it is not surprising calling pci_set_power_state() on CardBus devices causes trouble. CC: dbrownell@users.sourceforge.net CC: gregkh@suse.de Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: call pcmcia_{read,write}_cis_mem with ops_mutex heldDominik Brodowski2010-05-103-19/+19
| | | | | | | | | | | | This avoids multiple lock takings in several codepaths. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: remove pcmcia_add_device_lockDominik Brodowski2010-05-101-16/+2
| | | | | | | | | | | | | | | | | | As all cards to pcmcia_device_add() are already locked by skt_mutex, and the critical sections inside this function are further protected by ops_mutex, there's no need to keep a third lock around. Therfore, remove pcmcia_add_device_lock. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: update gfp/slab.h includesTejun Heo2010-05-103-1/+2
| | | | | | | | | | | | | | | | | | Implicit slab.h inclusion via percpu.h is about to go away. Make sure gfp.h or slab.h is included as necessary. Signed-off-by: Tejun Heo <tj@kernel.org> Cc: Stephen Rothwell <sfr@canb.auug.org.au> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: remove unused mem_op.hDominik Brodowski2010-05-104-119/+0
| | | | | | | | Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: do not autoadd root PCI bus resourcesDominik Brodowski2010-05-101-6/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the PCI root bus on the x86 architecture, the risk of hitting some strange system devices is too high: If a driver isn't loaded, the resources are not claimed; even if a driver is loaded, it may not request all resources or even the wrong one. We can neither trust the rest of the kernel nor ACPI/PNP and CRS parsing to get it right. Therefore, explicitly spell out what safeguards we provide, and add a safeguard to only use resources which are set up exclusively for the secondary PCI bus (non-subtractive mode): the risk of hitting system devices is quite low, as they usually aren't connected to the secondary PCI bus. CC: Jesse Barnes <jbarnes@virtuousgeek.org> CC: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: clarify alloc_io_space, move it to resource handlersDominik Brodowski2010-05-106-101/+204
| | | | | | | | | | | | | | | | | | | | | | Clean up the alloc_io_space() function by moving most of it to the actual resource_ops. This allows for a bit less re-directions. Future cleanups will follow, and will make up for the code duplication currently present between rsrc_iodyn and rsrc_nonstatic (which are hardly ever built at the same time anyway, therefore no increase in built size). Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: move all pcmcia_resource_ops providers into one moduleDominik Brodowski2010-05-106-117/+141
| | | | | | | | Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: move high level CIS access code to separate fileDominik Brodowski2010-05-104-330/+356
| | | | | | | | | | | | No code changes. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: dev_node removal (core)Dominik Brodowski2010-05-104-24/+6
| | | | | | | | | | | | | | Remove the dev_node declaration. We now only pass the device name to the deprecated userspace tools. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: dev_node removal (remaining drivers)Dominik Brodowski2010-05-105-72/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As a fourth step, remove any remaining usages of dev_node_t from drivers: - ipwireless can be simplified a bit, as we do not need to pass around the (write-only) dev_node_t around. - avma1_cs can be simplified as well, if we only keep the minor number around as "priv" data, not a full-fledged struct. Acked-by: Jiri Kosina <jkosina@suse.cz> Acked-by: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: dev_node removal (drivers with unregister_netdev check)Dominik Brodowski2010-05-1016-145/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | As a third step, remove any usage of dev_node_t from drivers which only wrote to this typedef/struct, except to determine whether register_netdev() succeeded previously. However, the function calling unregister_netdev() was only ever called by the PCMCIA core if register_netdev() succeeded previously. The lonely exception was easily fixed. CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: dev_node removal (drivers with updated printk call)Dominik Brodowski2010-05-109-227/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | As a second step, remove any usage of dev_node_t from drivers which only wrote to this typedef/struct, except one printk() which can easily be replaced by a dev_info()/dev_warn() call. CC: Harald Welte <laforge@gnumonks.org> CC: linux-ide@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: netdev@vger.kernel.org CC: linux-usb@vger.kernel.org Acked-by: Karsten Keil <isdn@linux-pingi.de> Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: dev_node removal (write-only drivers)Dominik Brodowski2010-05-1021-111/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dev_node_t was only used to transport some minor/major numbers from the PCMCIA device drivers to deprecated userspace helpers. However, only a few drivers made use of it, and the userspace helpers are deprecated anyways. Therefore, get rid of dev_node_t . As a first step, remove any usage of dev_node_t from drivers which only wrote to this typedef/struct, but did not make use of it. CC: linux-bluetooth@vger.kernel.org CC: Harald Welte <laforge@gnumonks.org> CC: linux-mtd@lists.infradead.org CC: linux-wireless@vger.kernel.org CC: netdev@vger.kernel.org CC: linux-serial@vger.kernel.org CC: alsa-devel@alsa-project.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: clean up cs.hDominik Brodowski2010-05-101-11/+0
| | | | | | | | | | | | With req_irq_t gone, we can get rid of some definitions. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: re-work pcmcia_request_irq()Dominik Brodowski2010-05-1058-593/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of the old pcmcia_request_irq() interface, drivers may now choose between: - calling request_irq/free_irq directly. Use the IRQ from *p_dev->irq. - use pcmcia_request_irq(p_dev, handler_t); the PCMCIA core will clean up automatically on calls to pcmcia_disable_device() or device ejection. - drivers still not capable of IRQF_SHARED (or not telling us so) may use the deprecated pcmcia_request_exclusive_irq() for the time being; they might receive a shared IRQ nonetheless. CC: linux-bluetooth@vger.kernel.org CC: netdev@vger.kernel.org CC: linux-wireless@vger.kernel.org CC: linux-serial@vger.kernel.org CC: alsa-devel@alsa-project.org CC: linux-usb@vger.kernel.org CC: linux-ide@vger.kernel.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: pass FORCED_PULSE parameter in pcmcia_request_configuration()Dominik Brodowski2010-05-104-13/+10
| | | | | | | | | | | | | | As it's only used there it makes no sense relying on pcmcia_request_irq(). CC: alsa-devel@alsa-project.org Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: replace struct irq with uint pcmcia_irq in struct pcmcia_socketDominik Brodowski2010-05-107-31/+17
| | | | | | | | | | | | | | As we don't need the "Config" counter any more, we can simplify struct pcmcia_socket. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: setup IRQ to be used by PCMCIA drivers at card insertDominik Brodowski2010-05-104-94/+140
| | | | | | | | | | | | | | | | | | Setup the IRQ to be used by PCMCIA drivers already during the device registration stage, making use of a new function pcmcia_setup_irq(). This will allow us to get rid of quite a lot of indirection in the future. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
| * pcmcia: remove unused IRQ modification featureDominik Brodowski2010-05-101-13/+3
| | | | | | | | | | | | The IRQ modification feature was unused, and I see no reason to keep it. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net>
* | Merge branch 'for-linus' of ↵Linus Torvalds2010-05-2031-949/+1251
|\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6 * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/suspend-2.6: PM: PM QOS update fix Freezer / cgroup freezer: Update stale locking comments PM / platform_bus: Allow runtime PM by default i2c: Fix bus-level power management callbacks PM QOS update PM / Hibernate: Fix block_io.c printk warning PM / Hibernate: Group swap ops PM / Hibernate: Move the first_sector out of swsusp_write PM / Hibernate: Separate block_io PM / Hibernate: Snapshot cleanup FS / libfs: Implement simple_write_to_buffer PM / Hibernate: document open(/dev/snapshot) side effects PM / Runtime: Add sysfs debug files PM: Improve device power management document PM: Update device power management document PM: Allow runtime_suspend methods to call pm_schedule_suspend() PM: pm_wakeup - switch to using bool
| * | PM: PM QOS update fixMark Gross2010-05-171-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This update handles a use case where pm_qos update requests need to silently fail if the update is being sent to a handle that is NULL. The problem was that the original pm_qos silently fails when a request update is passed to a parameter that has not been added to the list yet. This update restores that behavior. Signed-off-by: markgross <markgross@thegnar.org> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | Freezer / cgroup freezer: Update stale locking commentsMatt Helsley2010-05-101-8/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | Update stale comments regarding locking order and add a little more detail so it's easier to follow the locking between the cgroup freezer and the power management freezer code. Signed-off-by: Matt Helsley <matthltc@us.ibm.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM / platform_bus: Allow runtime PM by defaultMark Brown2010-05-101-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the default runtime PM callbacks for platform devices return -ENOSYS, preventing the use of runtime PM platforms until they have provided at least a default implementation. This hinders the use of runtime PM by devices which work with many platforms such as memory mapped devices, MFDs and on chip IPs shared by multiple architectures. Change the default implementation to the standard pm_generic_runtime one, allowing drivers to use runtime PM without per-architecture changes. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | i2c: Fix bus-level power management callbacksRafael J. Wysocki2010-05-102-69/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three issues with the i2c bus type's power management callbacks at the moment. First, they don't include any hibernate callbacks, although they should at least include the .restore() callback (there's no guarantee that the driver will be present in memory before loading the image kernel and we must restore the pre-hibernation state of the device). Second, the "legacy" callbacks are not going to be invoked by the PM core since the bus type's pm object is not NULL. Finally, the system sleep PM (ie. suspend/resume) callbacks don't check if the device has been already suspended at run time, in which case they should skip suspending it. Also, it looks like the i2c bus type can use the generic subsystem-level runtime PM callbacks. For these reasons, rework the system sleep PM callbacks provided by the i2c bus type to handle hibernation correctly and to invoke the "legacy" callbacks for drivers that provide them. In addition to that make the i2c bus type use the generic subsystem-level runtime PM callbacks. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jean Delvare <khali@linux-fr.org>
| * | PM QOS updateMark Gross2010-05-1014-171/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch changes the string based list management to a handle base implementation to help with the hot path use of pm-qos, it also renames much of the API to use "request" as opposed to "requirement" that was used in the initial implementation. I did this because request more accurately represents what it actually does. Also, I added a string based ABI for users wanting to use a string interface. So if the user writes 0xDDDDDDDD formatted hex it will be accepted by the interface. (someone asked me for it and I don't think it hurts anything.) This patch updates some documentation input I got from Randy. Signed-off-by: markgross <mgross@linux.intel.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM / Hibernate: Fix block_io.c printk warningRandy Dunlap2010-05-101-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix printk format warning in block_io.c: kernel/power/block_io.c:41: warning: format '%ld' expects type 'long int', but argument 2 has type 'sector_t' Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM / Hibernate: Group swap opsJiri Slaby2010-05-101-43/+74
| | | | | | | | | | | | | | | | | | | | | | | | Move all the swap processing into one function. It will make swap calls from a non-swap code easier. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM / Hibernate: Move the first_sector out of swsusp_writeJiri Slaby2010-05-101-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first sector knowledge is swap-only specific. Move it into the swap handle. This will be needed for later non-swap specific code moving into snapshot.c. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: "Rafael J. Wysocki" <rjw@sisk.pl>
| * | PM / Hibernate: Separate block_ioJiri Slaby2010-05-104-112/+139
| | | | | | | | | | | | | | | | | | | | | | | | Move block I/O operations to a separate file. It is because it will be used later not only by the swap writer. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM / Hibernate: Snapshot cleanupJiri Slaby2010-05-104-120/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove support of reads with offset. This means snapshot_read/write_next now does not accept count parameter. It allows to clean up the functions and snapshot handle which no longer needs to care about offsets. /dev/snapshot handler is converted to simple_{read_from,write_to}_buffer which take care of offsets. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | FS / libfs: Implement simple_write_to_bufferJiri Slaby2010-05-102-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It will be used in suspend code and serves as an easy wrap around copy_from_user. Similar to simple_read_from_buffer, it takes care of transfers with proper lengths depending on available and count parameters and advances ppos appropriately. Signed-off-by: Jiri Slaby <jslaby@suse.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM / Hibernate: document open(/dev/snapshot) side effectsPavel Machek2010-05-101-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Opening and closing /dev/snapshot causes the kernel to carry out some hibernate preparations that should be documented. [rjw: Added the changelog.] Signed-off-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM / Runtime: Add sysfs debug filesDominik Brodowski2010-05-101-3/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a few sysfs files relating to runtime power management for advanced debug purposes: runtime_enabled: is runtime PM enabled for this device? States are "enabled", "disabled", "forbidden" or a combination of the latter two. runtime_status: what state is the device in currently? E.g., it reports "suspended" for runtime-suspended devices, and "active" for active devices. NOTE: if runtime_enabled returns "disabled", the value of this file may not reflect its physical state. runtime_usage: the runtime PM usage count of a device runtime_active_kids: the runtime PM children usage count of a device, or 0 if the ignore_children flag is set. Also, CONFIG_PM_SLEEP_ADVANCED_DEBUG is not defined in any Kconfig file, so replace it with CONFIG_PM_ADVANCED_DEBUG. Signed-off-by: Dominik Brodowski <linux@dominikbrodowski.net> Acked-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM: Improve device power management documentAlan Stern2010-05-101-428/+383
| | | | | | | | | | | | | | | | | | | | | | | | Improve the device power management document after it's been updated by the previous patch. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM: Update device power management documentRafael J. Wysocki2010-05-101-267/+431
| | | | | | | | | | | | | | | | | | | | | | | | | | | The device PM document, Documentation/power/devices.txt, is badly outdated and requires total rework to fit the current design of the PM framework. Make it more up to date. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Reviewed-by: Randy Dunlap <randy.dunlap@oracle.com>
| * | PM: Allow runtime_suspend methods to call pm_schedule_suspend()Alan Stern2010-05-101-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch (as1361) changes the runtime PM interface slightly; it allows suspend requests to be scheduled while the runtime_suspend method is running. If the method succeeds then the scheduled request is cancelled, whereas if the method fails then an idle notification is sent only if no request was scheduled. Being able to schedule suspend requests from within a runtime_suspend method is useful for drivers that need to test for idleness and suspend the device all while holding a single spinlock, or for drivers that want to check for idleness by polling. Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
| * | PM: pm_wakeup - switch to using boolDmitry Torokhov2010-05-101-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Also change couple of stubs implemented as macros in !CONFIG_PM case in statinc inline functions to provide proper typechecking of arguments regardless of config. Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
* | | Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wqLinus Torvalds2010-05-201-1/+35
|\ \ \ | | | | | | | | | | | | | | | | | | | | * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/wq: workqueue: change cancel_work_sync() to clear work->data workqueue: warn about flush_scheduled_work()
| * | | workqueue: change cancel_work_sync() to clear work->dataOleg Nesterov2010-04-301-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In short: change cancel_work_sync(work) to mark this work as "never queued" upon return. When cancel_work_sync(work) succeeds, we know that this work can't be queued or running, and since we own WORK_STRUCT_PENDING nobody can change the bits in work->data under us. This means we can also clear the "cwq" part along with _PENDING bit lockless before return, unless the work is queued nobody can assume get_wq_data() is stable even under cwq->lock. This change can speedup the subsequent cancel/flush requests, and as Dmitry pointed out this simplifies the usage of work_struct's which can be queued on different workqueues. Consider this pseudo code from the input subsystem: struct workqueue_struct *WQ; struct work_struct *WORK; for (;;) { WQ = create_workqueue(); ... if (condition()) queue_work(WQ, WORK); ... cancel_work_sync(WORK); destroy_workqueue(WQ); } If condition() returns T and then F, cancel_work_sync() will crash the kernel because WORK->data still points to the already destroyed workqueue. With this patch the code like above becomes correct. Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com> Signed-off-by: Oleg Nesterov <oleg@redhat.com> Signed-off-by: Tejun Heo <tj@kernel.org>