summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Driver Core: add ability for drivers to do a threaded probeGreg Kroah-Hartman2006-09-253-27/+89
| | | | | | | | | | | | | | | | | | | | This adds the infrastructure for drivers to do a threaded probe, and waits at init time for all currently outstanding probes to complete. A new kernel thread will be created when the probe() function for the driver is called, if the multithread_probe bit is set in the driver saying it can support this kind of operation. I have tested this with USB and PCI, and it works, and shaves off a lot of time in the boot process, but there are issues with finding root boot disks, and some USB drivers assume that this can never happen, so it is currently not enabled for any bus type. Individual drivers can enable this right now if they wish, and bus authors can selectivly turn it on as well, once they determine that their subsystem will work properly with it. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: add proper sysfs_init() prototypeAndrew Morton2006-09-252-9/+8
| | | | | | | | | Don't be crufty. Mark it __must_check too. Cc: "Randy.Dunlap" <rdunlap@xenotime.net> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* drivers/base: check errorsAndrew Morton2006-09-254-50/+104
| | | | | | | | | | | Add lots of return-value checking. <pcornelia.huck@de.ibm.com>: fix bus_rescan_devices()] Cc: "Randy.Dunlap" <rdunlap@xenotime.net> Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* drivers/base: Platform notify needs to occur before drivers attach to the deviceBrian Walsh2006-09-251-4/+4
| | | | | | | | | | The platform_notify call for Arm and PPC architectures needs to be called before the driver attaches to the device. The problem only presents itself when hotplugging certain devices while the driver is already loaded. Signed-off-by: Brian Walsh <brian@walsh.ws> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* v4l-dev2: handle __must_checkAndrew Morton2006-09-251-1/+1
| | | | | | | | | | | We get hundreds of these: include/media/v4l2-dev.h:348: warning: ignoring return value of 'class_device_create_file', declared with attribute warn_unused_result Handle it, and propagate the __must_check back a level. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* add CONFIG_ENABLE_MUST_CHECKAndrew Morton2006-09-252-0/+12
| | | | | | | | | Those 1500 warnings can be a bit of a pain. Add a config option to shut them up. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* add __must_check to device management codeAndrew Morton2006-09-254-55/+66
| | | | | | | | | | | | | | | | | We're getting a lot of crashes in the sysfs/kobject/device/bus/class code and they're very hard to diagnose. I'm suspecting that in some cases this is because drivers aren't checking return values and aren't handling errors correctly. So the code blithely blunders on and crashes later in very obscure ways. There's just no reason to ignore errors which can and do occur. So the patch sprinkles __must_check all over these APIs. Causes 1,513 new warnings. Heh. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: fixed add_bind_files() definitionYoichi Yuasa2006-09-251-1/+1
| | | | | | | | | When CONFIG_HOTPLUG is n, add_bind_files() definition is wrong. This patch has fixed it. Signed-off-by: Yoichi Yuasa <yoichi_yuasa@tripeaks.co.jp> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: fix comments in drivers/base/power/resume.cDmitry Torokhov2006-09-251-4/+4
| | | | | | | | Driver core: fix comments in drivers/base/power/resume.c Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs_remove_bin_file: no return value, dump_stack on errorRandy.Dunlap2006-09-255-13/+19
| | | | | | | | | | | | | | | | Make sysfs_remove_bin_file() void. If it detects an error, printk the file name and call dump_stack(). sysfs_hash_and_remove() now returns an error code indicating its success or failure so that sysfs_remove_bin_file() can know success/failure. Convert the only driver that checked the return value of sysfs_remove_bin_file(). Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* kobject: must_check fixesRandy Dunlap2006-09-251-1/+8
| | | | | | | | Check all __must_check warnings in lib/kobject.c Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: add ability for devices to create and remove bin filesGreg Kroah-Hartman2006-09-252-0/+30
| | | | | | | | | Makes it easier for devices to create and remove binary attribute files so they don't have to call directly into sysfs. This is needed to help with the conversion from struct class_device to struct device. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Class: add support for class interfaces for devicesGreg Kroah-Hartman2006-09-253-1/+25
| | | | | | | | | When moving class_device usage over to device, we need to handle class_interfaces properly with devices. This patch adds that support. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: create devices/virtual/ treeGreg Kroah-Hartman2006-09-253-1/+28
| | | | | | | | | | | This change creates a devices/virtual/CLASS_NAME tree for struct devices that belong to a class, yet do not have a "real" struct device for a parent. It automatically creates the directories on the fly as needed. Cc: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: add device_rename functionGreg Kroah-Hartman2006-09-252-0/+56
| | | | | | | | The network layer needs this to convert to using struct device instead of a struct class_device. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: add ability for classes to handle devices properlyGreg Kroah-Hartman2006-09-252-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | This adds two new callbacks to the class structure: int (*dev_uevent)(struct device *dev, char **envp, int num_envp, char *buffer, int buffer_size); void (*dev_release)(struct device *dev); And one pointer: struct device_attribute * dev_attrs; which all corrispond with the same thing as the "normal" class devices do, yet this is for when a struct device is bound to a class. Someday soon, struct class_device will go away, and then the other fields in this structure can be removed too. But this is necessary in order to get the transition to work properly. Tested out on a network core patch that converted it to use struct device instead of struct class_device. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: allow devices in classes to have no parentGreg Kroah-Hartman2006-09-251-10/+11
| | | | | | | | | | | | | | | This fixes an oops when a device is attached to a class, yet has no "parent" device. An example of this would be the "lo" device in the network core. We should create a "virtual" subdirectory under /sys/devices/ for these, but no one seems to agree on a proper name for it yet... Oh, and update my copyright on the driver core. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: add groups support to struct deviceGreg Kroah-Hartman2006-09-252-0/+35
| | | | | | | | This is needed for the network class devices in order to be able to convert over to use struct device. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: platform_bus and late_suspend/early_resumeDavid Brownell2006-09-252-2/+30
| | | | | | | | | | | Teach platform_bus about the new suspend_late/resume_early PM calls, issued with IRQs off. Do we really need sysdev and friends any more, or can janitors start switching its users over to platform_device so we can do a minor code-ectomy? Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: device_suspend/resume may sleepPavel Machek2006-09-252-0/+2
| | | | | | | | | This adds warning when someone tries them from atomic context. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: add /sys/power documentation to Documentation/ABIRafael J. Wysocki2006-09-251-0/+88
| | | | | | | | | | | The file sysfs-power that documents the interface in the /sys/power/ directory is added to Documentation/ABI/testing. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: no suspend_prepare() phaseDavid Brownell2006-09-255-47/+0
| | | | | | | | | | | | Remove the new suspend_prepare() phase. It doesn't seem very usable, has never been tested, doesn't address fault cleanup, and would need a sibling resume_complete(); plus there are no real use cases. It could be restored later if those issues get resolved. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: schedule /sys/devices/.../power/state for removalPavel Machek2006-09-251-0/+15
| | | | | | | | | | This lists the /sys/devices/.../power/state file, and its internal support, as due for removal next year. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: add kconfig option for deprecated .../power/state filesDavid Brownell2006-09-252-0/+17
| | | | | | | | | | | | Add a new PM_SYSFS_DEPRECATED config option to control whether or not the /sys/devices/.../power/state files are provided. This will make it easier to get rid of that mechanism when the time comes, and to verify that userspace tools work right without it. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: update docs for writing .../power/stateDavid Brownell2006-09-251-10/+19
| | | | | | | | | | | | | | | Updates to match current code: - Make writes to the /sys/devices/.../power/state files fail cleanly if the device requires the irqs-off call variants. - Fix comments describing the /sys/devices/.../power/state file writes to match the code; the last several releases have invalidated the previous text. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* updated Documentation/power/devices.txtDavid Brownell2006-09-251-190/+535
| | | | | | | | | | | | | | | | | | | | | | | | This turned into a rewrite of Documentation/power/devices.txt: - Provide more of the "big picture" - Fixup some of the horribly ancient/obsolete description of device suspend() semantics; lots of text just got deleted. - Add a decent description of PM_EVENT_* codes, including the new PRETHAW code needed in some swsusp scenarios. - Describe the new PM factorization from Linus: * class suspend, current suspend, then suspend_late * NOT suspend_prepare, it wasn't really usable * resume_early, current resume, class resume. - Updates power/state docs to be correct, and deprecate its usage except for driver testing. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: issue PM_EVENT_PRETHAWDavid Brownell2006-09-254-4/+12
| | | | | | | | | | | | | | | | This patch is the first of this series that should actually change any behavior ... by issuing the new event, now tha the rest of the kernel is prepared to receive it. This converts the PM core to issue the new PRETHAW message, which the rest of the kernel is now ready to receive. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: USB HCDs use PM_EVENT_PRETHAWDavid Brownell2006-09-255-3/+23
| | | | | | | | | | | | | This teaches several USB host controller drivers to treat PRETHAW as a chip reset since the controller, and all devices connected to it, are no longer in states compatible with how the snapshotted suspend() left them. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: video drivers and PM_EVENT_PRETHAWDavid Brownell2006-09-254-24/+30
| | | | | | | | | | | | Video drivers which explicitly test for messages reporting PM_EVENT_FREEZE will now handle PM_EVENT_PRETHAW the same way. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: PCI and IDE handle PM_EVENT_PRETHAWDavid Brownell2006-09-252-3/+7
| | | | | | | | | | | | | | | | | Convert some framework code to handle the new PRETHAW message. - IDE just treats it like a FREEZE. - The pci_choose_state() thingie still doesn't use PCI_D0 when it gets a FREEZE (and now PRETHAW) event, which seems rather buglike but wasn't something to change with this patch. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* PM: define PM_EVENT_PRETHAWDavid Brownell2006-09-251-15/+47
| | | | | | | | | | | | | | | | | | | | | | | | | This adds a new pm_message_t event type to use when preparing to restore a swsusp snapshot. Devices that have been initialized by Linux after resume (rather than left in power-up-reset state) may need to be reset; this new event type give drivers the chance to do that. The drivers that will care about this are those which understand more hardware states than just "on" and "reset", relying on hardware state during resume() methods to be either the state left by the preceding suspend(), or a power-lost reset. The best current example of this class of drivers are USB host controller drivers, which currently do not work through swsusp when they're statically linked. When the swsusp freeze/thaw mechanism kicks in, a troublesome third state could exist: one state set up by a different kernel instance, before a snapshot image is resumed. This mechanism lets drivers prevent that state. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Cc: "Rafael J. Wysocki" <rjw@sisk.pl> Cc: Pavel Machek <pavel@ucw.cz> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* fix broken/dubious driver suspend() methodsDavid Brownell2006-09-253-11/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Small driver suspend() fixes in preparation for the PRETHAW events: - Only compare message events for equality against PM_EVENT_* codes; not against integers, or using greater/less-than comparisons. (PM_EVENT_* should really become a __bitwise thing.) - Explicitly test for SUSPEND events (rather than not-something-else) before suspending devices. - Removes more of the confusion between a pm_message_t (wraps event code) and a "state" ... suspend() originally took a target system state. These updates are correct and appropriate even without new PM_EVENT codes. benh: "I think in the Mesh case, we should handle the freeze case as well or we might get wild DMA." Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Pavel Machek <pavel@ucw.cz> Cc: Greg KH <greg@kroah.com> Cc: Paul Mackerras <paulus@samba.org> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Cc: Mauro Carvalho Chehab <mchehab@infradead.org> Cc: James Bottomley <James.Bottomley@steeleye.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* make suspend quieterDavid Brownell2006-09-251-5/+0
| | | | | | | | | | Fix a goof in Linus' recent PM API updates: don't emit any messages in the typical NOP "already suspended it" late suspend case. Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> Acked-by: Pavel Machek <pavel@ucw.cz> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Suspend changes for PCI coreLinus Torvalds2006-09-252-1/+43
| | | | | | | | Changes the PCI core to use the new suspend infrastructure changes. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Suspend infrastructure cleanup and extensionLinus Torvalds2006-09-255-36/+130
| | | | | | | | | | | | Allow devices to participate in the suspend process more intimately, in particular, allow the final phase (with interrupts disabled) to also be open to normal devices, not just system devices. Also, allow classes to participate in device suspend. Signed-off-by: Linus Torvalds <torvalds@osdl.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* SYSFS: allow sysfs_create_link to create symlinks in the root of sysfsGreg Kroah-Hartman2006-09-251-2/+12
| | | | | | | This is needed to make the compatible link for /sys/block in the future. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Debugfs: kernel-doc fixes for debugfsRandy Dunlap2006-09-252-40/+31
| | | | | | | | Fix kernel-doc and typos/spellos in fs/debugfs/. Signed-off-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* sysfs: Make poll behaviour consistentJuha Yrjölä2006-09-251-1/+1
| | | | | | | | | | | | | | When no events have been reported by sysfs_notify(), sd->s_events was previously set to zero. The initial value for new readers is also zero, so poll was blocking, regardless of whether the attribute was read by the process or not. Make poll behave consistently by setting the initial value of sd->s_events to non-zero. Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Driver core: add const to class_createMiguel Ojeda Sandonis2006-09-252-2/+2
| | | | | | | | | | | | | | Adds const to class_create second parameter, because: struct class { const char * name; /*...*/ } Signed-off-by: Miguel Ojeda Sandonis <maxextreme@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* device_create(): make fmt argument 'const char *'Greg Kroah-Hartman2006-09-252-2/+2
| | | | | Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* class_device_create(): make fmt argument 'const char *'Dmitry Torokhov2006-09-252-2/+3
| | | | | | Signed-off-by: Dmitry Torokhov <dtor@mail.ru> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* deprecate PHYSDEV* keysKay Sievers2006-09-253-4/+20
| | | | | | | | | | | | | | deprecate PHYSDEV* values in the uevent environment These values are no longer needed and inconsistent with the stacking of class devices. The event environment should not carry properties of a parent device. The key PHYSDEVDRIVER is available as DRIVER, PHYDEVBUS is indentical SUBSYSTEM. Class devices should not carry any of these values. Signed-off-by: Kay Sievers <kay.sievers@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Documentation/ABI: devfs is not obsolete, but removed!jens m. noedler2006-09-251-3/+2
| | | | | | Signed-off-by: Jens M. Noedler <noedler@web.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6Linus Torvalds2006-09-2532-1505/+1389
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: [NetLabel]: update docs with website information [NetLabel]: rework the Netlink attribute handling (part 2) [NetLabel]: rework the Netlink attribute handling (part 1) [Netlink]: add nla_validate_nested() [NETLINK]: add nla_for_each_nested() to the interface list [NetLabel]: change the SELinux permissions [NetLabel]: make the CIPSOv4 cache spinlocks bottom half safe [NetLabel]: correct improper handling of non-NetLabel peer contexts [TCP]: make cubic the default [TCP]: default congestion control menu [ATM] he: Fix __init/__devinit conflict [NETFILTER]: Add dscp,DSCP headers to header-y [DCCP]: Introduce dccp_probe [DCCP]: Use constants for CCIDs [DCCP]: Introduce constants for CCID numbers [DCCP]: Allow default/fallback service code.
| * [NetLabel]: update docs with website informationPaul Moore2006-09-252-1/+11
| | | | | | | | | | | | | | | | Now that all of the supporting pieces of NetLabel have a home at SourceForge update the Kconfig help text and add an entry to the MAINTAINERS file. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * [NetLabel]: rework the Netlink attribute handling (part 2)Paul Moore2006-09-256-830/+895
| | | | | | | | | | | | | | | | At the suggestion of Thomas Graf, rewrite NetLabel's use of Netlink attributes to better follow the common Netlink attribute usage. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * [NetLabel]: rework the Netlink attribute handling (part 1)Paul Moore2006-09-257-604/+76
| | | | | | | | | | | | | | | | At the suggestion of Thomas Graf, rewrite NetLabel's use of Netlink attributes to better follow the common Netlink attribute usage. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * [Netlink]: add nla_validate_nested()Paul Moore2006-09-251-0/+19
| | | | | | | | | | | | | | | | Add a new function, nla_validate_nested(), to validate nested Netlink attributes. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * [NETLINK]: add nla_for_each_nested() to the interface listPaul Moore2006-09-251-0/+1
| | | | | | | | | | | | | | | | | | At the top of include/net/netlink.h is a list of Netlink interfaces, however, the nla_for_each_nested() macro was not listed. This patch adds this interface to the list at the top of the header file. Signed-off-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
| * [NetLabel]: change the SELinux permissionsPaul Moore2006-09-251-4/+4
| | | | | | | | | | | | | | | | | | | | Change NetLabel to use the 'recvfrom' socket permission and the SECINITSID_NETMSG SELinux SID as the NetLabel base SID for incoming packets. This patch effectively makes the old, and currently unused, SELinux NETMSG permissions NetLabel permissions. Signed-of-by: Paul Moore <paul.moore@hp.com> Signed-off-by: David S. Miller <davem@davemloft.net>