summaryrefslogtreecommitdiff
path: root/lib
AgeCommit message (Collapse)Author
2004-11-10[PATCH] lib/parser: fix %% parsingDomen Puncer
Code looks like it intended to parse "%%" in pattern string as "%". Fix it, so it really does that. Compile and run tested. Signed-off-by: Domen Puncer <domen@coderock.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-08[PATCH] kobject: fix double kobject_put() in error path of kobject_add()Greg Kroah-Hartman
This fixes a problem introduced in the previous set of driver model changes that has been seen by a lot of people (most notibly the greater than 256 pty users, but others might also be hitting this without realizing it.) Also add a comment so we don't try to "fix" this again. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-11-03[PATCH] kobject_uevent: fix init orderingRobert Love
Looks like kobject_uevent_init is executed before netlink_proto_init and consequently always fails. Not cool. Attached patch switches the initialization over from core_initcall (init level 1) to postcore_initcall (init level 2). Netlink's initialization is done in core_initcall, so this should fix the problem. We should be fine waiting until postcore_initcall. Also a couple white space changes mixed in, because I am anal. Signed-Off-By: Robert Love <rml@novell.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-11-03kevent: fix build error if CONFIG_KOBJECT_UEVENT is not selected.Greg Kroah-Hartman
Thanks to Serge Hallyn <serue@us.ibm.com> for pointing this out. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-11-03[PATCH] driver-model: kobject_add() error path reference counting fixTejun Heo
df_04_kobject_add_ref_fix.patch In kobject_add(), @kobj wasn't put'd properly on error path. This patch fixes it. Signed-off-by: Tejun Heo <tj@home-tj.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-31[PATCH] take me home, hotplug_path[]Kay Sievers
Move hotplug_path[] out of kmod.[ch] to kobject_uevent.[ch] where it belongs now. At some time in the future we should fix the remaining bad hotplug calls (no SEQNUM, no netlink uevent): ./drivers/input/input.c (no DEVPATH on some hotplug events!) ./drivers/pnp/pnpbios/core.c ./drivers/s390/crypto/z90main.c Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-31[PATCH] kobject: fix hotplug bug with seqnumKay Sievers
On Sat, Oct 30, 2004 at 04:54:29AM +0200, Kay Sievers wrote: > On Sat, Oct 30, 2004 at 02:25:23AM +0200, Kay Sievers wrote: > > On Sat, Oct 30, 2004 at 02:00:45AM +0200, Kay Sievers wrote: > > > On Fri, Oct 29, 2004 at 06:13:19PM -0500, Greg KH wrote: > > > > On Fri, Oct 29, 2004 at 11:28:56PM +0200, Kay Sievers wrote: > > > > > > But there might still be a problem. With this change, the sequence > > > > > > number is not sent out the kevent message. Kay, do you think this is an > > > > > > issue? I don't think we can get netlink messages out of order, right? > > > > > > > > > > Right, especially not the events with the same DEVPATH, like "remove" > > > > > beating an "add". But I'm not sure if the number isn't useful. Whatever > > > > > we may do with the hotplug over netlink in the future, we will only have > > > > > /sbin/hotplug for the early boot and it may be nice to know, what events > > > > > we have already handled... > > > > > > > > > > > I'll hold off on applying this patch until we figure this out... > > > > > > > > > > How about just reserving 20 bytes for the number (u64 will never be > > > > > more than that), save the pointer to that field, and fill the number in > > > > > later? > > > > > > > > Ah, something like this instead? I like it, it's even smaller than the > > > > previous patch. Compile tested only... > > > > > > I like that. How about the following. It will keep the buffer clean from > > > random chars, cause the kevent does not have the vector and relies on > > > the '\0' to separate the strings from each other. > > > I've tested it. The netlink-hotplug message looks like this: > > > > > > recv(3, "remove@/class/input/mouse2\0ACTION=remove\0DEVPATH=/class/input/mouse2\0SUBSYSTEM=input\0SEQNUM=961 \0", 1024, 0) = 113 > > > > Hmm, these trailing spaces are just bad, sorry. I'll better pass the > > envp array over to send_uevent() and clean up the keys while copying > > the env values into the skb buffer. This will make the event payload > > more safe too. So your first version looks better. > > How about this? We copy over key by key into the skb buffer and the > netlink message can get the envp array without depending on a single > continuous buffer. > > The netlink message looks nice like this now: > > recv(3, " > add@/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0\0 > HOME=/\0 > PATH=/sbin:/bin:/usr/sbin:/usr/bin\0 > ACTION=add\0 > DEVPATH=/devices/pci0000:00/0000:00:1d.1/usb3/3-2/3-2:1.0\0 > SUBSYSTEM=usb\0 > SEQNUM=991\0 > DEVICE=/proc/bus/usb/003/008\0 > PRODUCT=46d/c03e/2000\0 > TYPE=0/0/0\0 > INTERFACE=3/1/2\0 > ", 1024, 0) = 268 Here is an improved version that uses skb_put() to fill the skb buffer, instead of trimming the buffer to the final size after we've copied over all keys. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-31[PATCH] parisc: Kconfig debugging optionsMatthew Wilcox
PA-RISC does have spinlock debugging and doesn't have the frame pointer option. USERMODE had been added twice to spinlock debugging, so remove that. Committed-by: Randolph Chung <tausq@parisc-linux.org> Committed-by: Matthew Wilcox <willy@parisc-linux.org>
2004-10-30Make "atomic_dec_and_lock()" a macro.Linus Torvalds
We rename the actual architecture-specific low-level implementation to have a prepended underscore: "_atomic_dec_and_lock()". This extra macro indirection is so that we can make the macro do the lock context counting. That will be the next patch.
2004-10-27[PATCH] uml: Kconfig.debug updateChris Wedgwood
Update Kconfig.debug so we get SYSRQ back and also the spinlock debugging options. Signed-off-by: Chris Wedgwood <cw@f00f.org> Acked-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-27[PATCH] ia64 iomap implementationBjorn Helgaas
This preserves the ioreadX() == inX() semantics (same as i386), since it's not clear that the speedup of omitting the mf.a for port operations is worth the risk of breaking drivers. Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-27Merge bk://linux-sam.bkbits.net/kbuildSam Ravnborg
into mars.ravnborg.org:/home/sam/bk/to-linus
2004-10-25[PATCH] idr_remove safety checkingJim Houston
idr_remove() should fail gracefully and warn if the id being removed is not valid. The attached patch should do the job without additional overhead. With the existing code, removing an id which was not allocated could remove a valid id which shares the same lowest layer of the radix tree. I ran a kernel with this patch but have not done any tests to force a failure. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-25Allow BKL re-acquire to fail, causing us to re-schedule.Linus Torvalds
This allows for low-latency BKL contention even with preemption. Previously, since preemption is disabled over context switches, re-acquiring the kernel lock when resuming a process would be non-preemtible.
2004-10-24Un-inline the big kernel lock.Linus Torvalds
Now that spinlocks are uninlined, it is silly to keep the BKL inlined. And this should make it a lot easier for people to play around with variations on the locking (ie Ingo's semaphores etc).
2004-10-22hotplug: prevent skips in sequence number from happeningGreg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-22[PATCH] kobject_uevent warning fixAndrew Morton
lib/kobject_uevent.c:39: warning: `action_to_string' defined but not used Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-22[PATCH] remove cpu_run_sbin_hotplug()Andrew Morton
From: Keshavamurthy Anil S <anil.s.keshavamurthy@intel.com> Remove cpu_run_sbin_hotplug() - use kobject_hotplug() instead. Signed-off-by: Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-22[PATCH] kobject_hotplug: permit no hotplug_opsAndrew Morton
Make kobject_hotplug() work even if the kobject's kset doesn't implement any hotplug_ops. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-21Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-10-21Shared Reed-Solomon ECC libraryThomas Gleixner
The attached patch contains a shared Reed-Solomon Library analogous to the shared zlib. (N)AND FLASH is gaining popularity and there are a lot of ASIC/SoC/FPGA controllers around which implement hardware support for Reed-Solomon error correction. As usual they use different implementations (polynomials etc.). So it's obvious to use a shared library for the common tasks of error correction. A short scan through the kernel revealed that at least the ftape driver uses Reed-Solomon error correction. It could be easily converted to use the shared library code. The encoder/decoder code is lifted from the GPL'd userspace RS-library written by Phil Karn. I modified/wrapped it to provide the different functions which we need in the MTD/NAND code. The library is tested in extenso under various MTD/NAND configurations. The lib should be usable for other purposes right out of the box. Adjustment for currently not implemented functionality is an easy task. I'm willing to take the maintainership of the library. Signed-Off-By: Thomas Gleixner <tglx@linutronix.de> Signed-Off-By: David Woodhouse <dwmw2@infradead.org> "No objections at all. Just keep the authorship notices." -- Phil Karn
2004-10-20kobject: add CONFIG_DEBUG_KOBJECTGreg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-10-19[PATCH] Enable config_schedstats for all archesKenneth W. Chen
Config option CONFIG_SCHEDSTATS is currently enabled via arch specific Kconfig.debug. Only x86 and ppc arches has code to turn it on. Why not put it in generic lib/Kconfig.debug so it is done once to enable everyone? Signed-off-by: Ken Chen <kenneth.w.chen@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-19[PATCH] #include <asm/bitops.h> -> #include <linux/bitops.h>Adrian Bunk
There's no reason to directly #include <asm/bitops.h> since it's available on all architectures and also included by #include <linux/bitops.h>. This patch changes #include <asm/bitops.h> to #include <linux/bitops.h>. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-18Trivial Makefile mergeLinus Torvalds
2004-10-18[PATCH] Simplify last lib/idr.c changeUlrich Drepper
The last change to alloc_layer in lib/idr.c unnecessarily complicates the code and depending on the definition of spin_unlock will cause worse code to be generated than necessary. The following patch should improve the situation. Signed-off-by: Ulrich Drepper <drepper@redhat.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-10-18mergeGreg Kroah-Hartman
2004-10-18Add copyright notice on ppc64 iomap files.Linus Torvalds
Paul cares. I think there's something in the water at IBM that makes people sticklers ;)
2004-10-17kconfig.debug: mention that DEBUG_SLAB can slow down machine quite a bitDenis Vlasenko
I experienced x3 slowdown due to this option being set. Please add this small warning to DEBUG_SLAB help text. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
2004-10-15kevent: add __bitwise kobject_action to help the compiler check for misusagesGreg Kroah-Hartman
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-29[PATCH] kobject: add add_hotplug_env_var()Roland Dreier
Add a (non-inlined) add_hotplug_env_var() function to <linux/kobject.h> and lib/kobject.c. There's a lot of boilerplate code involved in setting environment variables in a hotplug method, so we should have a convenience function to consolidate it (and avoid subtle bugs). Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-24Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-09-23The generic iomap library needs to be linked unconditionally.Linus Torvalds
Otherwise modules that get loaded dynamically will not be able to resolve the iomap functions, if no built-in drivers caused it to be linked in at compile-time.
2004-09-22[PATCH] idr: fix missing spin_unlock()Li Shaohua
Signed-off-by: Li Shaohua <shaohua.li@intel.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-22Merge gregkh@kernel.bkbits.net:linux/driver-2.6Greg Kroah-Hartman
into press.kroah.org:/home/greg/linux/BK/driver-2.6
2004-09-15kevent: add block mount and umount supportGreg Kroah-Hartman
Send notification over the new netlink socket to let userspace know that the filesystem code claims/releases the superblock on an blockdevice. This way, userspace can get rid of constantly polling /proc/mounts to watch for filesystem changes. Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-14kevent: standardize on the event typesGreg Kroah-Hartman
This prevents any potential typos from happening. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-14Add support for "string" ioread/iowrite.Linus Torvalds
Things like SATA use this for data transfer. Also export the iomap routines on ppc64.
2004-09-13[PATCH] kobject_uevent warning fixAndrew Morton
lib/kobject_uevent.c: In function `kobject_hotplug': lib/kobject_uevent.c:225: warning: long long int format, u64 arg (arg 3) Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-13[IOMAP]: Make ioport_map() take unsigned long port argument.David S. Miller
Signed-off-by: David S. Miller <davem@davemloft.net>
2004-09-12Export new PCI iomem access interfaces to modules too.Linus Torvalds
2004-09-12Add skeleton "generic IO mapping" infrastructure.Linus Torvalds
Jeff wants to use this to clean up SATA and some network drivers.
2004-09-12Merge kroah.com:/home/greg/linux/BK/bleed-2.6Greg Kroah-Hartman
into kroah.com:/home/greg/linux/BK/driver-2.6
2004-09-10Kobject Userspace Event NotificationGreg Kroah-Hartman
Implemetation of userspace events through a netlink socket. The kernel events layer provides the functionality to raise an event from a given kobject represented by its sysfs-path and a signal string to describe the type of event. Currently, kobject additions and removals are signalized to userspace by forking the /sbin/hotplug helper. This patch moves this special case of userspace-event out of the kobject core to the new kobject_uevent implementation. This makes it possible to send all hotplug messages also through the new netlink transport. Possible new users of the kernel userspace functionality are filesystem mount events (block device claim/release) or simple device state transitions (cpu overheating). To send an event, the user needs to pass the kobject, a optional sysfs-attribute and the signal string to the following function: kobject_uevent(const char *signal, struct kobject *kobj, struct attribute *attr) Example: kobject_uevent("overheating", &cpu->kobj, NULL); The message itself is sent over multicast netlink socket, which makes it possible for userspace to listen with multiple applications for the same messages. Signed-off-by: Robert Love <rml@novell.com> Signed-off-by: Kay Sievers <kay.sievers@vrfy.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-08[PATCH] ksyms: don't implement /sys/kernel/hotplug_seqnum if CONFIG_HOTPLUG ↵Greg Kroah-Hartman
is not enabled. Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-08[PATCH] kobject: hotplug_seqnum is not 64 bits on all platforms, so fix it.Greg Kroah-Hartman
Thanks to Kay Sievers for pointing this out. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2004-09-07[PATCH] zlib_inflate: Make zlib_inflate_trees_fixed(...) generate the tableTom Rini
The following changes zlib_inflate_trees_fixed(...) from using a statically defined table, to generating this table. This cuts out 4-8kB from inftrees.o (4kB on IBM 440GP, 8kB on PPC 74xx). Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-07[PATCH] zlib_inflate: Move zlib_inflateSync & friendsTom Rini
The following patch moves zlib_inflateSync and friends, which are used by PPP and not a 'normal' gzip, into inflate_sync.c. Signed-off-by: Tom Rini <trini@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-07[PATCH] Convert in-kernel users of EXPORT_SYMBOL_NOVERS() to EXPORT_SYMBOL()Geert Uytterhoeven
Convert all in-kernel users of the deprecated EXPORT_SYMBOL_NOVERS() to EXPORT_SYMBOL(). Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2004-09-05kobject: fix build error if CONFIG_HOTPLUG is not enabled.Greg Kroah-Hartman
Thanks to Kay Sievers for pointing this out. Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>