05 Jan, 2006
10 commits
-
The klist reference counting in the find functions that use
klist_iter_init_node is broken. If the function (for example
driver_find_device) is called with a NULL start object then everything is
fine, the first call to next_device()/klist_next increases the ref-count of
the first node on the list and does nothing for the start object which is
NULL.If they are called with a valid start object then klist_next will decrement
the ref-count for the start object but nobody has incremented it. Logical
place to fix this would be klist_iter_init_node because the function puts a
reference of the object into the klist_iter struct.Signed-off-by: Martin Schwidefsky
Signed-off-by: Frank Pavlic
Cc: Patrick Mochel
Signed-off-by: Andrew Morton
Signed-off-by: Greg Kroah-Hartman -
This patch (as604) makes the driver core hold a device's parent's lock
as well as the device's lock during calls to the probe and remove
methods in a driver. This facility is needed by USB device drivers,
owing to the peculiar way USB devices work:A device provides multiple interfaces, and drivers are bound
to interfaces rather than to devices;Nevertheless a reset, reset-configuration, suspend, or resume
affects the entire device and requires the caller to hold the
lock for the device, not just a lock for one of the interfaces.Since a USB driver's probe method is always called with the interface
lock held, the locking order rules (always lock parent before child)
prevent these methods from acquiring the device lock. The solution
provided here is to call all probe and remove methods, for all devices
(not just USB), with the parent lock already acquired.Although currently only the USB subsystem requires these changes, people
have mentioned in prior discussion that the overhead of acquiring an
extra semaphore in all the prove/remove sequences is not overly large.Up to now, the USB core has been using its own set of private
semaphores. A followup patch will remove them, relying entirely on the
device semaphores provided by the driver core.The code paths affected by this patch are:
device_add and device_del: The USB core already holds the parent
lock, so no actual change is needed.driver_register and driver_unregister: The driver core will now
lock both the parent and the device before probing or removing.driver_bind and driver_unbind (in sysfs): These routines will
now lock both the parent and the device before binding or
unbinding.bus_rescan_devices: The helper routine will lock the parent
before probing a device.I have not tested this patch for conflicts with other subsystems. As
far as I can see, the only possibility of conflict would lie in the
bus_rescan_devices pathway, and it seems pretty remote. Nevertheless,
it would be good for this to get a lot of testing in -mm.Signed-off-by: Alan Stern
Signed-off-by: Greg Kroah-Hartman -
The first of these changes s/hotplug/uevent/ was needed to
compile sn2_defconfig (ia64/sn). The other three files
changed are blind changes of all remaining bus_type.hotplug
references I could find to bus_type.uevent.This patch attempts to finish similar changes made in the
gregkh-driver-kill-hotplug-word-from-driver-core Nov 22 patch.Signed-off-by: Paul Jackson
Signed-off-by: Greg Kroah-Hartman -
With modules, dynamic /dev, and uevents, people really want
CONFIG_HOTPLUG to be enabled in their kernels. If not, they can still
disable it, but it is discouraged.Signed-off-by: Greg Kroah-Hartman
-
Leave the overloaded "hotplug" word to susbsystems which are handling
real devices. The driver core does not "plug" anything, it just exports
the state to userspace and generates events.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
The distinction between hotplug and uevent does not make sense these
days, netlink events are the default.udev depends entirely on netlink uevents. Only during early boot and
in initramfs, /sbin/hotplug is needed. So merge the two functions and
provide only one interface without all the options.The netlink layer got a nice generic interface with named slots
recently, which is probably a better facility to plug events for
subsystem specific events.
Also the new poll() interface to /proc/mounts is a nicer way to
notify about changes than sending events through the core.
The uevents should only be used for driver core related requests to
userspace now.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
The names of these events have been confusing from the beginning
on, as they have been more like claim/release events. We needed these
events for noticing HAL if storage devices have been mounted.Thanks to Al, we have the proper solution now and can poll()
/proc/mounts instead to get notfied about mount tree changes.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
This deprecates the /proc/sys/kernel/hotplug file, as all
this stuff should be in /sys some day, right? :)
In /sys/kernel/ we have now uevent_seqnum and uevent_helper.
The seqnum is no longer used by udev, as the version for this
kernel depends on netlink which events will never get
out-of-order.Recent udev versions disable the /sbin/hotplug helper with
an init script, cause it leads to OOM on big boxes by running
hundreds of shells in parallel. It should be done now by:
echo "" > /sys/kernel/uevent_helper(Note that "-n" does not work, cause neighter proc nor sysfs
support truncate().)Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
It makes zero sense to have hotplug, but not the netlink
events enabled today. Remove this option and merge the
kobject_uevent.h header into the kobject.h header file.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman -
These days we use udev to manage all kernel events. /proc/sys/kernel/hotplug
will usually be disabled by an init-script. pnpnbios is not integrated with
the driver core and should stay away from the now disabled /sbin/hotplug.Set the helper to /sbin/phpbios, even when there is probably no current
user of this faciliy. If it's needed, it should definitely get proper driver
core integration instead of forking binaries from the kernel.Signed-off-by: Kay Sievers
Signed-off-by: Greg Kroah-Hartman
03 Jan, 2006
4 commits
-
Hey, it's fifteen years today since I bought the machine that got Linux
started. January 2nd is a good date. -
Otherwise a bad mem policy system call can confuse the interleaving
code into referencing undefined nodes.Originally reported by Doug Chapman
I was told it's CVE-2005-3358
(one has to love these security people - they make everything sound important)Signed-off-by: Andi Kleen
Signed-off-by: Linus Torvalds -
In commit 3D59121003721a8fad11ee72e646fd9d3076b5679c, the x86 and x86-64
was changed to include for the
configurable timer frequency.However, asm/param.h is sometimes used in userland (it is included
indirectly from ), so your commit pollutes the userland
namespace with tons of CONFIG_FOO macros. This greatly confuses
software packages (such as BusyBox) which use CONFIG_FOO macros
themselves to control the inclusion of optional features.After a short exchange, Christoph approved this patch
Signed-off-by: Linus Torvalds
-
Some G5s still occasionally experience shutdowns due to overtemp
conditions despite the recent fix. After analyzing logs from such
machines, it appears that the overtemp code is a bit too quick at
shutting the machine down when reaching the critical temperature (tmax +
8) and doesn't leave the fan enough time to actually cool it down. This
happens if the temperature of a CPU suddenly rises too high in a very
short period of time, or occasionally on boot (that is the CPUs are
already overtemp by the time the driver loads).This patches makes the code a bit more relaxed, leaving a few seconds to
the fans to do their job before kicking the machine shutown.Signed-off-by: Benjamin Herrenschmidt
Signed-off-by: Linus Torvalds
01 Jan, 2006
3 commits
-
This should fix multi-threaded core-files
Signed-off-by: stsp@aknet.ru
Signed-off-by: Linus Torvalds -
This is a slightly more complete fix for the previous minimal sysctl
string fix. It always terminates the returned string with a NUL, even
if the full result wouldn't fit in the user-supplied buffer.The returned length is the full untruncated length, so that you can
tell when truncation has occurred.Signed-off-by: Linus Torvalds
31 Dec, 2005
6 commits
-
For the sysctl syscall, if the user wants to get the old value of a
sysctl entry and set a new value for it in the same syscall, the old
value is always overwritten by the new value if the sysctl entry is of
string type and if the user sets its strategy to sysctl_string. This
issue lies in the strategy being run twice if the strategy is set to
sysctl_string, the general strategy sysctl_string always returns 0 if
success.Such strategy routines as sysctl_jiffies and sysctl_jiffies_ms return 1
because they do read and write for the sysctl entry.The strategy routine sysctl_string return 0 although it actually read
and write the sysctl entry.According to my analysis, if a strategy routine do read and write, it
should return 1, if it just does some necessary check but not read and
write, it should return 0, for example sysctl_intvec.Signed-off-by: Yi Yang
Signed-off-by: Linus Torvalds -
If the string was too long to fit in the user-supplied buffer,
the sysctl layer would zero-terminate it by writing past the
end of the buffer. Don't do that.Noticed by Yi Yang
Signed-off-by: Linus Torvalds
-
The old /proc interfaces were never updated to use loff_t, and are just
generally broken. Now, we should be using the seq_file interface for
all of the proc files, but converting the legacy functions is more work
than most people care for and has little upside..But at least we can make the non-LFS rules explicit, rather than just
insanely wrapping the offset or something.Signed-off-by: Linus Torvalds
-
This patch fixes a typo introduced by conversion to dynamic input_dev
allocation.Signed-off-by: Dmitry Torokhov
Signed-off-by: Linus Torvalds -
This patch fixes a typo introduced by conversion to dynamic input_dev
allocation.Signed-off-by: Dmitry Torokhov
Signed-off-by: Linus Torvalds -
This patch fixes a typo introduced by conversion to dynamic input_dev
allocation.Signed-off-by: Dmitry Torokhov
Signed-off-by: Linus Torvalds
30 Dec, 2005
15 commits
-
Patch from Erik Hovland
This patch provides two changes. An indent is supplied for an if/else clause so that it is more readable. An acronym is incorrectly typed as UER when it should be IER.
Signed-off-by: Erik Hovland
Signed-off-by: Russell King -
Thanks to Roman Zippel for the suggestion.
Signed-off-by: Jean Delvare
[ Short explanation: Kconfig uses ternary math: n/m/y, and !m is m ]
Signed-off-by: Linus Torvalds -
This reverts the series of commits
67dbb4ea33731415fe09c62149a34f472719ac1d
281ab031a8c9e5b593142eb4ec59a87faae8676a
47807ce381acc34a7ffee2b42e35e96c0f322e52that changed the GART VM start offset. It fixed some machines, but
seems to continually interact badly with some X versions.Quoth Ben Herrenschmidt:
"So I think at this point, the best is that we keep the old bogus code
that at least is consistent with the bug in the server. I'm working on a
big patch to X that reworks the memory map stuff completely and fixes
those issues on the server side, I'll do a DRM patch matching this X fix
as well so that the memory map is only ever set in one place and with
what I hope is a correct algorithm..."Signed-off-by: Linus Torvalds
-
Fix the cyclic dependency issue between CONFIG_SAA7134_ALSA and
CONFIG_SAA7134_OSS (credits to Mauro Carvalho Chehab.)Signed-off-by: Jean Delvare
Acked-by: Mauro Carvalho Chehab
Signed-off-by: Linus Torvalds -
Sonny has noticed hotplug CPU on ppc64 is broken in 2.6.15-*. One of the
problems is that htab_initialize_secondary is called when a cpu is being
brought up, but it is marked __init.Signed-off-by: Anton Blanchard
Acked-by: Paul Mackerras
Signed-off-by: Linus Torvalds -
Currently, we do not pass the correct start_pfn to e820_hole_size, to
calculate holes. Following patch fixes that.The bug results in incorrect number of node_present_pages for each pgdat
and causes ugly output in /sys and probably VM inbalances.Signed-off-by: Alok N Kataria
Signed-off-by: Ravikiran Thirumalai
Signed-off-by: Andi Kleen
Sighed-off-by: Shair Fultheim
Sighed-off-by: Linus Torvalds -
This patch fixes a typo introduced by conversion to dynamic input_dev
allocation.Signed-off-by: Dmitry Torokhov
Signed-off-by: Linus Torvalds -
__get_unaligned creates a typeof the var its passed, and writes to it,
which on gcc4.1, spits out the following error:drivers/char/vc_screen.c: In function 'vcs_write':
drivers/char/vc_screen.c:422: error: assignment of read-only variable 'val'Signed-off-by: Dave Jones
[ The "right" fix would be to try to fix
but that's hard to do with the tools gcc gives us. So this
simpler patch is preferable -- Linus ]
Signed-off-by: Linus Torvalds -
Fix UML compilation when SKAS mode is disabled. Indeed, we were compiling
SKAS-only object files, which failed due to some SKAS-only headers being
excluded from the search path.Thanks to the bug report from Pekka J Enberg.
Acked-by: Pekka J Enberg
Signed-off-by: Paolo 'Blaisorblade' Giarrusso
Signed-off-by: Linus Torvalds -
Today, when compiling UML, I got warnings for two used unexported symbols:
readdir64 and truncate64. Indeed, my glibc headers are aliasing readdir to
readdir64 and truncate to truncate64 (and so on).I'm then adding additional exports. Since I've no idea if the symbols where
always provided in the supported glibc's, I've added weak definitions too.Signed-off-by: Paolo 'Blaisorblade' Giarrusso
Signed-off-by: Linus Torvalds -
Prevent page->index << PAGE_CACHE_SHIFT from overflowing.
There is a casting there, but was added without care, so it's at the wrong
place. Note the extra parens around the shift - "+" is higher precedence than
"<
Signed-off-by: Linus Torvalds -
Trivial removal of unused variable from this file - doesn't even change the
generated assembly code, in fact (gcc should trigger a warning for unused value
here).Signed-off-by: Paolo 'Blaisorblade' Giarrusso
Signed-off-by: Linus Torvalds -
Don't use printk() where "current_thread_info()" is crap.
Until when we switch to running on init_stack, current_thread_info() evaluates
to crap. Printk uses "current" at times (in detail, ¤t is evaluated with
CONFIG_DEBUG_SPINLOCK to check the spinlock owner task).And this leads to random segmentation faults.
Exactly, what happens is that ¤t = *(current_thread_info()), i.e. round
down $esp and dereference the value. I.e. access the stack below $esp, which
causes SIGSEGV on a VM_GROWSDOWN vma (see arch/i386/mm/fault.c).Signed-off-by: Paolo 'Blaisorblade' Giarrusso
Signed-off-by: Linus Torvalds
29 Dec, 2005
2 commits
-
Noticed by Christophe Zimmerman, this explains the slow mouse movement
with 2.6.x kernels.And checking the 2.4.x drivers/sbus/char/sunmouse.c driver shows we
always used a 5-byte protocol with Sun mice in the past. I have no
idea how the 3-byte thing got into the 2.6.x driver, but it's surely
wrong.Signed-off-by: David S. Miller