pandora-kernel.git
17 years agohub driver: improve use of #ifdef
Alan Stern [Sun, 2 Jul 2006 02:14:24 +0000 (22:14 -0400)]
hub driver: improve use of #ifdef

This patch (as736) makes the hub driver more readable by improving the
usage of "#ifdef CONFIG_PM" and "#ifdef CONFIG_USB_SUSPEND".

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: suspending devices with no driver
Alan Stern [Sun, 2 Jul 2006 02:13:50 +0000 (22:13 -0400)]
usbcore: suspending devices with no driver

Since usb_generic can be unbound from a USB device, we need to be able
to handle the possibility that a suspend or resume request arrives for a
device with no driver.  This patch (as735) arranges things so that
resume requests will fail and suspend requests will use the standard USB
port-suspend code.  Attempts to suspend or resume an unbound interface
are handled similarly (although the error caused by trying to resume an
unbound interface is dropped by the calling routine).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: fix up device and power state tests
Alan Stern [Sun, 2 Jul 2006 02:13:04 +0000 (22:13 -0400)]
usbcore: fix up device and power state tests

This patch (as734) rationalizes the various tests of device state and
power states.  There are duplications and mistaken tests in several
places.

Perhaps the most interesting challenge is where the hub driver tests to
see that all the child devices are suspended before allowing itself to
be suspended.  When CONFIG_USB_SUSPEND is set the test is
straightforward, since we expect that the children _will_ be suspended.
But when CONFIG_USB_SUSPEND isn't set, it's not so clear what should be
done.  The code compromises by checking the child's
power.power_state.event field.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: set device and power states properly
Alan Stern [Sun, 2 Jul 2006 02:12:19 +0000 (22:12 -0400)]
usbcore: set device and power states properly

This patch (as733) fixes up the places where device states and power
states are set in usbcore.  Right now things are duplicated or missing;
this should straighten things out.

The idea is that udev->state is USB_STATE_SUSPENDED exactly when the
device's upstream port has been suspended, whereas
udev->dev.power.power_state.event reflects the result of the last call
to the suspend/resume routines (which might not actually change the
device state, especially if CONFIG_USB_SUSPEND isn't set).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: track whether interfaces are suspended
Alan Stern [Sun, 2 Jul 2006 02:11:44 +0000 (22:11 -0400)]
usbcore: track whether interfaces are suspended

Currently we rely on intf->dev.power.power_state.event for tracking
whether intf is suspended.  This is not a reliable technique because
that value is owned by the PM core, not by usbcore.  This patch (as718b)
adds a new flag so that we can accurately tell which interfaces are
suspended and which aren't.

At first one might think these flags aren't needed, since interfaces
will be suspended along with their devices.  It turns out there are a
couple of intermediate situations where that's not quite true, such as
while processing a remote-wakeup request.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: resume device resume recursion
Alan Stern [Sun, 2 Jul 2006 02:11:02 +0000 (22:11 -0400)]
usbcore: resume device resume recursion

This patch (as717b) removes the existing recursion in hub resume code:
Resuming a hub will no longer automatically resume the devices attached
to the hub.

At the same time, it adds one level of recursion: Suspending a USB
device will automatically suspend all the device's interfaces.  Failure
at an intermediate stage will cause all the already-suspended interfaces
to be resumed. Attempts to suspend or resume an interface by itself will
do nothing, although they won't return an error.  Thus the regular
system-suspend and system-resume procedures should continue to work as
before; only runtime PM will be affected.

The patch also removes the code that tests state of the interfaces
before suspending a device.  It's no longer needed, since everything
gets suspended together.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: split suspend/resume for device and interfaces
Alan Stern [Sun, 2 Jul 2006 02:10:15 +0000 (22:10 -0400)]
usbcore: split suspend/resume for device and interfaces

This patch (as716b) splits up the core suspend and resume routines into
two parts each: one for handling devices and one for handling
interfaces.  The behavior of the parts should be the same as in the old
unified code.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: make usb_generic a usb_device_driver
Alan Stern [Sun, 2 Jul 2006 02:09:35 +0000 (22:09 -0400)]
usbcore: make usb_generic a usb_device_driver

This patch (as714b) makes usb_generic into a usb_device_driver capable
of being probed and unbound, just like other drivers.  A fair amount of
the work that used to get done during discovery or removal of a USB
device have been moved to the probe and disconnect methods of
usb_generic: creating the sysfs attributes and selecting an initial
configuration.  However the normal behavior should continue to be the
same as before.

We will now have the possibility of creating other USB device drivers,
They will assist with exporting devices to remote systems
(USB-over-TCPIP) or to paravirtual guest operating systems.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: add usb_device_driver definition
Alan Stern [Sun, 2 Jul 2006 02:08:49 +0000 (22:08 -0400)]
usbcore: add usb_device_driver definition

This patch (as732) adds a usb_device_driver structure, for representing
drivers that manage an entire USB device as opposed to just an
interface.  Support routines like usb_register_device_driver,
usb_deregister_device_driver, usb_probe_device, and usb_unbind_device
are also added.

Unlike an earlier version of this patch, the new code is type-safe.  To
accomplish this, the existing struct driver embedded in struct
usb_driver had to be wrapped in an intermediate wrapper.  This enables
the core to tell at runtime whether a particular struct driver belongs
to a device driver or to an interface driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: move code among source files
Alan Stern [Sun, 2 Jul 2006 02:08:06 +0000 (22:08 -0400)]
usbcore: move code among source files

This revised patch (as713b) moves a few routines among source files in
usbcore.  Some driver-related code in usb.c (claiming interfaces and
matching IDs) is moved to driver.c, where it belongs.  Also the
usb_generic stuff in driver.c is moved to a new source file: generic.c.
(That's the reason for revising the patch.)  Although not very big now,
it will get bigger in a later patch.

None of the code has been changed; it has only been re-arranged.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: rename usb_suspend_device to usb_port_suspend
Alan Stern [Sun, 2 Jul 2006 02:07:21 +0000 (22:07 -0400)]
usbcore: rename usb_suspend_device to usb_port_suspend

This revised patch (as715b) renames usb_suspend_device to
usb_port_suspend, usb_resume_device to usb_port_resume, and
finish_device_resume to finish_port_resume.  There was no objection to
the original version of the patch so this should be okay to apply.

The revision was needed only because I have re-arranged the order of the
earlier patches.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousb-skeleton: don't submit URBs after disconnection
Alan Stern [Sun, 2 Jul 2006 02:06:36 +0000 (22:06 -0400)]
usb-skeleton: don't submit URBs after disconnection

This patch (as712b) is a slight revision of one submitted earlier.  It
fixes the usb-skeleton example driver so that it won't try to submit
URBs after skel_disconnect() has returned.  This could cause errors, if
the driver was unbound and then a different driver was bound to the
device.  It also fixes a couple of small bugs in the skel_write()
routine.

The revised patch uses a slightly different test, suggested by Dave
Brownell, for determining whether to free a transfer buffer.  It's a
little clearer than the earlier version.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbfs: detect device unregistration
Alan Stern [Sun, 2 Jul 2006 02:05:56 +0000 (22:05 -0400)]
usbfs: detect device unregistration

This patch (as711b) is a revised version of an earlier submission.  It
modifies the usbfs code to detect when a device has been unregistered from
usbfs, even if the device is still connected.  Although this can't happen
now, it will be able to happen after the upcoming changes to usb_generic.

Nobody objected to this patch when it was submitted before, so it should
be okay to apply this version.  The revision is merely to take into
account the changes introduced by as723, which touches the same driver.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbfs: private mutex for open, release, and remove
Alan Stern [Sun, 2 Jul 2006 02:05:01 +0000 (22:05 -0400)]
usbfs: private mutex for open, release, and remove

The usbfs code doesn't provide sufficient mutual exclusion among open,
release, and remove.  Release vs. remove is okay because they both
acquire the device lock, but open is not exclusive with either one.  All
three routines modify the udev->filelist linked list, so they must not
run concurrently.

Apparently someone gave this a minimum amount of thought in the past by
explicitly acquiring the BKL at the start of the usbdev_open routine.
Oddly enough, there's a comment pointing out that locking is unnecessary
because chrdev_open already has acquired the BKL.

But this ignores the point that the files in /proc/bus/usb/* are not
char device files; they are regular files and so they don't get any
special locking.  Furthermore it's necessary to acquire the same lock in
the release and remove routines, which the code does not do.

Yet another problem arises because the same file_operations structure is
accessible through both the /proc/bus/usb/* and /dev/usb/usbdev* file
nodes.  Even when one of them has been removed, it's still possible for
userspace to open the other.  So simple locking around the individual
remove routines is insufficient; we need to lock the entire
usb_notify_remove_device notifier chain.

Rather than rely on the BKL, this patch (as723) introduces a new private
mutex for the purpose.  Holding the BKL while invoking a notifier chain
doesn't seem like a good idea.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Phidgets should check create_device_file() return value
Sean Young [Fri, 11 Aug 2006 09:28:28 +0000 (09:28 +0000)]
USB: Phidgets should check create_device_file() return value

device_create_file() could fail, add proper error paths for this condition.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Put phidgets driver in a sysfs class
Sean Young [Mon, 10 Jul 2006 09:56:25 +0000 (09:56 +0000)]
USB: Put phidgets driver in a sysfs class

This patch creates a device class phidget and add the phidget drivers to
them.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Add driver for PhidgetMotorControl
Sean Young [Sun, 9 Jul 2006 13:01:02 +0000 (13:01 +0000)]
USB: Add driver for PhidgetMotorControl

This driver add support for the Phidgets Inc., MotorControl via sysfs. Also
some minor fixes for the InterfaceKit.

Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agousbcore: add configuration_string to attribute group
Alan Stern [Thu, 6 Jul 2006 19:37:42 +0000 (15:37 -0400)]
usbcore: add configuration_string to attribute group

This patch (as737b) does a very small cleanup of core/sysfs.c by adding
the configuration_string attribute file to the existing attribute group
instead of treating it separately.  It doesn't need this separate
treatment because unlike the other device string attributes, it changes
along with the active configuration.

The patch also fixes a simple typo (which, oddly enough, doesn't seem to
bother the compiler).

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Make usb_buffer_free() NULL-safe
Dmitry Torokhov [Wed, 2 Aug 2006 02:33:34 +0000 (22:33 -0400)]
USB: Make usb_buffer_free() NULL-safe

kfree() handles NULL arguments which is handy in error handling paths as one
does need to  insert bunch of ifs. How about making usb_buffer_free() do the
same?

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ark3116: Formatting cleanups
Werner Lemberg [Tue, 18 Jul 2006 15:00:22 +0000 (17:00 +0200)]
USB: ark3116: Formatting cleanups

Formatting only.

Signed-off-by: Werner Lemberg <wl@gnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ark3116: Add TIOCGSERIAL and TIOCSSERIAL ioctl calls.
Werner Lemberg [Tue, 18 Jul 2006 15:00:52 +0000 (17:00 +0200)]
USB: ark3116: Add TIOCGSERIAL and TIOCSSERIAL ioctl calls.

Add (dummy?) support for TIOCGSERIAL and TIOCSSERIAL ioctl calls to the USB
serial driver file `ark3116.c'.  This is sufficient for me to run wvdial
successfully, receive my email, and do webbrowsing with firefox.  On the
other hand, running the cvs program to update archives seems not to work,
and the traceroute command sometimes says

  send failed: No buffer space available

Looks like a buffering problem...  My knowledge of serial device drivers is
zero, so I can't fix this -- I just did a cut'n'paste from other USB serial
drivers...

Signed-off-by: Werner Lemberg <wl@gnu.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: Allow compile in g_ether, fix typo
Tony Lindgren [Fri, 30 Jun 2006 05:27:36 +0000 (22:27 -0700)]
USB: Allow compile in g_ether, fix typo

Allows compiling g_ether in and fixes a typo with MUSB_HDRC

Signed-off-by: Tony Lindgren <tony@atomide.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: pxa2xx_udc understands GPIO based VBUS sensing
David Brownell [Thu, 29 Jun 2006 19:25:39 +0000 (12:25 -0700)]
USB: pxa2xx_udc understands GPIO based VBUS sensing

This updates the PXA 25x UDC board-independent infrastructure for VBUS sensing
and the D+ pullup.  The original code evolved from rather bizarre support on
Intel's "Lubbock" reference hardware, so that on more sensible hardware it
doesn't work as well as it could/should.

The change is just to teach the UDC driver how to use built-in PXA GPIO pins
directly.  This reduces the amount of board-specfic object code needed, and
enables the use of a VBUS sensing IRQ on boards (like Gumstix) that have one.
With VBUS sensing, the UDC is unclocked until a host is actually connected.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: move <linux/usb_otg.h> to <linux/usb/otg.h>
David Brownell [Thu, 29 Jun 2006 19:27:23 +0000 (12:27 -0700)]
USB: move <linux/usb_otg.h> to <linux/usb/otg.h>

Move <linux/usb_otg.h> to <linux/usb/otg.h>.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: kill usb kconfig warning
Andrew Morton [Fri, 7 Jul 2006 07:11:45 +0000 (00:11 -0700)]
USB: kill usb kconfig warning

drivers/usb/host/Kconfig:87:warning: 'select' used by config symbol 'USB_OHCI_HCD' refer to undefined symbol 'I2C_PNX'

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB OHCI controller support for PNX4008
Vitaly Wool [Thu, 29 Jun 2006 14:28:18 +0000 (18:28 +0400)]
USB OHCI controller support for PNX4008

inlined is the patch that adds basic support for USB OHCI controller
support for PNX4008 Philips PNX4008 ARM board. Due to HW design, it
depends on I2C driver for PNX4008 which I've recetnly posted to LKML and
i2c at lm-sensors.

Signed-off-by: Vitaly Wool <vitalywool@gmail.com>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: ohci-s3c2410.c: clock now usb-bus-host
Ben Dooks [Mon, 26 Jun 2006 22:36:07 +0000 (23:36 +0100)]
USB: ohci-s3c2410.c: clock now usb-bus-host

With the newer Samsung S3C2412 and S3C2413 SoC devices,
the 48MHz USB clock has been given an individual gate
into the USB OHCI and gadget blocks.

This clock is called usb-bus-clock, and we need to
replace the old use of the USB PLL (upll) directly
with the new usb-bus-host.

The S3C2410 clock driver has been updated already to
provide a virtual clock which is a child of the UPLL
to maintain compatibility. The S3C2412 clock driver
correctly enables the PLL when either usb-bus clock
is active.

Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: OHCI avoids root hub timer polling
David Brownell [Fri, 4 Aug 2006 18:31:55 +0000 (11:31 -0700)]
USB: OHCI avoids root hub timer polling

This teaches OHCI to use the root hub status change (RHSC) IRQ, bypassing
root hub timers most of the time and switching over to the "new" root hub
polling scheme.  It's complicated by the fact that implementations of OHCI
trigger and ack that IRQ differently (the spec is vague there).

Avoiding root hub timers helps mechanisms like "dynamic tick" leave the
CPU in lowpower modes for longer intervals.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB doc patch 2
Sam Bishop [Mon, 28 Aug 2006 22:52:15 +0000 (16:52 -0600)]
USB doc patch 2

A little more detail on how and when to poll() /proc/bus/usb/devices.

Signed-off-by: Sam Bishop <sam@bishop.dhs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: doc patch 1
Sam Bishop [Mon, 28 Aug 2006 22:42:10 +0000 (16:42 -0600)]
USB: doc patch 1

Grammar, spelling, and stylistic edits.

Signed-off-by: Sam Bishop <sam@bishop.dhs.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: unusual_dev entry for Sony P990i
Phil Dibowitz [Mon, 11 Sep 2006 07:27:40 +0000 (00:27 -0700)]
USB: unusual_dev entry for Sony P990i

This patch is a re-diffed version of one originally sent by Jan Mate
<mate@fiit.stuba.sk>.

Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoUSB: unusual_devs entry for Lacie DVD+-RW
Alan Stern [Thu, 14 Sep 2006 19:18:54 +0000 (15:18 -0400)]
USB: unusual_devs entry for Lacie DVD+-RW

This patch (as781) adds an entry to unusual_devs.h for the Lacie DVD+-RW
drive.  Apparently its USB interface has requirements similar to the
Genesys Logic interface; it doesn't like data to be sent too soon after
a command.

This fixes Bugzilla #6817.

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
17 years agoMerge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6
Linus Torvalds [Wed, 27 Sep 2006 17:53:30 +0000 (10:53 -0700)]
Merge branch 'release' of git://git./linux/kernel/git/aegl/linux-2.6

* 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/aegl/linux-2.6:
  [IA64] minor reformatting to vmlinux.lds.S
  [IA64] CMC/CPE: Reverse the order of fetching log and checking poll threshold
  [IA64] PAL calls need physical mode, stacked
  [IA64] ar.fpsr not set on MCA/INIT kernel entry
  [IA64] printing support for MCA/INIT
  [IA64] trim output of show_mem()
  [IA64] show_mem() printk levels
  [IA64] Make gp value point to Region 5 in mca handler
  Revert "[IA64] Unwire set/get_robust_list"
  [IA64] Implement futex primitives
  [IA64-SGI] Do not request DMA memory for BTE
  [IA64] Move perfmon tables from thread_struct to pfm_context
  [IA64] Add interface so modules can discover whether multithreading is on.
  [IA64] kprobes: fixup the pagefault exception caused by probehandlers
  [IA64] kprobe opcode 16 bytes alignment on IA64
  [IA64] esi-support
  [IA64] Add "model name" to /proc/cpuinfo

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6
Linus Torvalds [Wed, 27 Sep 2006 15:49:07 +0000 (08:49 -0700)]
Merge /pub/scm/linux/kernel/git/lethal/sh-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/lethal/sh-2.6: (108 commits)
  sh: Fix occasional flush_cache_4096() stack corruption.
  sh: Calculate shm alignment at runtime.
  sh: dma-mapping compile fixes.
  sh: Initial vsyscall page support.
  sh: Clean up PAGE_SIZE definition for assembly use.
  sh: Selective flush_cache_mm() flushing.
  sh: More intelligent entry_mask/way_size calculation.
  sh: Support for L2 cache on newer SH-4A CPUs.
  sh: Update kexec support for API changes.
  sh: Optimized readsl()/writesl() support.
  sh: Report movli.l/movco.l capabilities.
  sh: CPU flags in AT_HWCAP in ELF auxvt.
  sh: Add support for 4K stacks.
  sh: Enable /proc/kcore support.
  sh: stack debugging support.
  sh: select CONFIG_EMBEDDED.
  sh: machvec rework.
  sh: Solution Engine SH7343 board support.
  sh: SH7710VoIPGW board support.
  sh: Enable verbose BUG() support.
  ...

17 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Wed, 27 Sep 2006 15:32:01 +0000 (08:32 -0700)]
Merge /pub/scm/linux/kernel/git/davem/sparc-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Kill bogus check from bootmem_init().
  [SPARC64]: Update defconfig.

17 years ago[PATCH] x86: use probe_kernel_address in handle_BUG()
Andrew Morton [Wed, 27 Sep 2006 08:51:15 +0000 (01:51 -0700)]
[PATCH] x86: use probe_kernel_address in handle_BUG()

Avoid possible deadlock on a BUG() inside down_write(mmap_sem).  The deadlock
can only occur if something has gone horridly wrong, because a fault here
shouldn't happen.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] add probe_kernel_address()
Andrew Morton [Wed, 27 Sep 2006 08:51:14 +0000 (01:51 -0700)]
[PATCH] add probe_kernel_address()

Add a version of __get_user() which is safe to call inside mmap_sem.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] de_thread: Use tsk not current
Eric W. Biederman [Wed, 27 Sep 2006 08:51:13 +0000 (01:51 -0700)]
[PATCH] de_thread: Use tsk not current

Ingo Oeser pointed out that because current expands to an inline function
it is more space efficient and somewhat faster to simply keep a cached copy
of current in another variable.  This patch implements that for the
de_thread function.

(akpm: saves nearly 100 bytes of text on x86)

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] fs/nfs/: make code static
Adrian Bunk [Wed, 27 Sep 2006 08:51:13 +0000 (01:51 -0700)]
[PATCH] fs/nfs/: make code static

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Acked-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] add newline to nfs dprintk
Martin Bligh [Wed, 27 Sep 2006 08:51:12 +0000 (01:51 -0700)]
[PATCH] add newline to nfs dprintk

Add missing \n to dprintk

Signed-off-by: Martin Bligh <mbligh@google.com>
Acked-by: Trond Myklebust <trond.myklebust@fys.uio.no>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] pid: remove temporary debug code in attach_pid
Eric W. Biederman [Wed, 27 Sep 2006 08:51:11 +0000 (01:51 -0700)]
[PATCH] pid: remove temporary debug code in attach_pid

With the patches flying between Oleg and myself somehow this temporary
debug code got left in pid.c.  It was never intended to make it to the
stable kernel.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] pid: Implement transfer_pid and use it to simplify de_thread
Eric W. Biederman [Wed, 27 Sep 2006 08:51:06 +0000 (01:51 -0700)]
[PATCH] pid: Implement transfer_pid and use it to simplify de_thread

In de_thread we move pids from one process to another, a rather ugly case.
The function transfer_pid makes it clear what we are doing, and makes the
action atomic.  This is useful we ever want to atomically traverse the
process group and session lists, in a rcu safe manner.

Even if the atomic properties this change should be a win as transfer_pid
should be less code to execute than executing both attach_pid and
detach_pid, and this should make de_thread slightly smaller as only a
single function call needs to be emitted.  The only downside is that the
code might be slower to execute as the odds are against transfer_pid being
in cache.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Oleg Nesterov <oleg@tv-sign.ru>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] sysctl: Document that sys_sysctl will be removed
Eric W. Biederman [Wed, 27 Sep 2006 08:51:05 +0000 (01:51 -0700)]
[PATCH] sysctl: Document that sys_sysctl will be removed

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] sysctl: Allow /proc/sys without sys_sysctl
Eric W. Biederman [Wed, 27 Sep 2006 08:51:04 +0000 (01:51 -0700)]
[PATCH] sysctl: Allow /proc/sys without sys_sysctl

Since sys_sysctl is deprecated start allow it to be compiled out.  This
should catch any remaining user space code that cares, and paves the way
for further sysctl cleanups.

[akpm@osdl.org: If sys_sysctl() is not compiled-in, emit a warning]
Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] msi: use kmem_cache_zalloc()
Pekka J Enberg [Wed, 27 Sep 2006 08:51:03 +0000 (01:51 -0700)]
[PATCH] msi: use kmem_cache_zalloc()

Simpler, cleaner.

Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
Cc: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Include __param section in read-only data range
Marcelo Tosatti [Wed, 27 Sep 2006 08:51:02 +0000 (01:51 -0700)]
[PATCH] Include __param section in read-only data range

The param section is an array of "kernel_param" structures, storing only
constant data: pointer to name, permission of the variable pointed to by
(void *)arg and pointers to set/get methods.

Move end_rodata down to include __param section in the read-only range used
by CONFIG_DEBUG_RODATA.

Signed-off-by: Marcelo Tosatti <marcelo@kvack.org>
Acked-by: Arjan van de Ven <arjan@infradead.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] alloc_fdtable() cleanup
Andrew Morton [Wed, 27 Sep 2006 08:51:02 +0000 (01:51 -0700)]
[PATCH] alloc_fdtable() cleanup

free_fdset(NULL, ...) is legal.

Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] EISA bus MODALIAS attributes support
Michael Tokarev [Wed, 27 Sep 2006 08:50:56 +0000 (01:50 -0700)]
[PATCH] EISA bus MODALIAS attributes support

Add modalias attribute support for the almost forgotten now EISA bus and
(at least some) EISA-aware modules.

The modalias entry looks like (for an 3c509 NIC):

 eisa:sTCM5093

and the in-module alias like:

 eisa:sTCM5093*

The patch moves struct eisa_device_id declaration from include/linux/eisa.h
to include/linux/mod_devicetable.h (so that the former now #includes the
latter), adds proper MODULE_DEVICE_TABLE(eisa, ...) statements for all
drivers with EISA IDs I found (some drivers already have that DEVICE_TABLE
declared), and adds recognision of __mod_eisa_device_table to
scripts/mod/file2alias.c so that proper modules.alias will be generated.

There's no support for /lib/modules/$kver/modules.eisamap, as it's not used
by any existing tools, and because with in-kernel modalias mechanism those
maps are obsolete anyway.

The rationale for this patch is:

 a) to make EISA bus to act as other busses with modalias
    support, to unify driver loading

 b) to foget about EISA finally - with this patch, kernel
    (who still supports EISA) will be the only one who knows
    how to choose the necessary drivers for this bus ;)

[akpm@osdl.org: fix the kbuild bit]
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Acked-the-net-bits-by: Jeff Garzik <jeff@garzik.org>
Acked-the-tulip-bit-by: Valerie Henson <val_henson@linux.intel.com>
Cc: James Bottomley <James.Bottomley@steeleye.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] consistently use MAX_ERRNO in __syscall_return
Randy Dunlap [Wed, 27 Sep 2006 08:50:55 +0000 (01:50 -0700)]
[PATCH] consistently use MAX_ERRNO in __syscall_return

Consistently use MAX_ERRNO when checking for errors in __syscall_return().

[ralf@linux-mips.org: build fix]
Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] x86 microcode: don't check the size
Shaohua Li [Wed, 27 Sep 2006 08:50:54 +0000 (01:50 -0700)]
[PATCH] x86 microcode: don't check the size

IA32 manual says if micorcode update's size is 0, then the size is
default size (2048 bytes). But this doesn't suggest all microcode
update's size should be above 2048 bytes to me. We actually had a
microcode update whose size is 1024 bytes. The patch just removed the
check.

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Cc: Tigran Aivazian <tigran@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] x86 microcode: add sysfs and hotplug support
Shaohua Li [Wed, 27 Sep 2006 08:50:53 +0000 (01:50 -0700)]
[PATCH] x86 microcode: add sysfs and hotplug support

Add sysfs support.  Currently each CPU has three microcode related
attributes.  One is 'version' which shows current ucode version of CPU.
Tools can use the attribute do validation or show CPU ucode status.  one is
'reload' which allows manually reloading ucode.  Another is
'processor_flags', which exports processor flags, so we can write tools to
check if CPU has latest ucode.  Also add suspend/resume and CPU hotplug
support.

[akpm@osdl.org: cleanups, build fix]
[bunk@stusta.de: Kconfig fixes]
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Acked-by: Tigran Aivazian <tigran@veritas.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] x86 microcode: using request_firmware to pull microcode
Shaohua Li [Wed, 27 Sep 2006 08:50:52 +0000 (01:50 -0700)]
[PATCH] x86 microcode: using request_firmware to pull microcode

Using request_firmware to pull ucode from userspace, so we don't need the
application 'microcode_ctl' to assist.  We name each ucode file according
to CPU's info as intel-ucode/family-model-stepping.  In this way we could
split ucode file as small one.  This has a lot of advantages such as
selectively update and validate microcode for specific models, better
manage microcode file, easily write tools for administerators and so on.
with the changes, we should put all intel-ucode/xx-xx-xx microcode files
into the firmware dir (I had a tool to split previous big data file into
small one and later we will release new style data file).  The init script
should be changed to just loading the driver without unloading

Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Acked-by: Tigran Aivazian <tigran@veritas.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] x86 microcode: microcode driver cleanup.
Shaohua Li [Wed, 27 Sep 2006 08:50:51 +0000 (01:50 -0700)]
[PATCH] x86 microcode: microcode driver cleanup.

Clean up microcode update driver and make it more readable.

[akpm@osdl.org: cleanups]
Signed-off-by: Shaohua Li <shaohua.li@intel.com>
Acked-by: Tigran Aivazian <tigran@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] reiserfs: warn about the useless nolargeio option
Adrian Bunk [Wed, 27 Sep 2006 08:50:50 +0000 (01:50 -0700)]
[PATCH] reiserfs: warn about the useless nolargeio option

Since the nolargeio option no longer has any effect, print a warning
instead of setting a write-only variable.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Cc: Jeff Mahoney <jeffm@suse.com>
Cc: Chris Mason <mason@suse.com>
Cc: Hans Reiser <reiser@namesys.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] inode-diet: Eliminate i_blksize from the inode structure
Theodore Ts'o [Wed, 27 Sep 2006 08:50:49 +0000 (01:50 -0700)]
[PATCH] inode-diet: Eliminate i_blksize from the inode structure

This eliminates the i_blksize field from struct inode.  Filesystems that want
to provide a per-inode st_blksize can do so by providing their own getattr
routine instead of using the generic_fillattr() function.

Note that some filesystems were providing pretty much random (and incorrect)
values for i_blksize.

[bunk@stusta.de: cleanup]
[akpm@osdl.org: generic_fillattr() fix]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] inode-diet: Move i_cdev into a union
Theodore Ts'o [Wed, 27 Sep 2006 08:50:49 +0000 (01:50 -0700)]
[PATCH] inode-diet: Move i_cdev into a union

Move the i_cdev pointer in struct inode into a union.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] inode-diet: Move i_bdev into a union
Theodore Ts'o [Wed, 27 Sep 2006 08:50:48 +0000 (01:50 -0700)]
[PATCH] inode-diet: Move i_bdev into a union

Move the i_bdev pointer in struct inode into a union.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] inode-diet: Move i_pipe into a union
Theodore Ts'o [Wed, 27 Sep 2006 08:50:47 +0000 (01:50 -0700)]
[PATCH] inode-diet: Move i_pipe into a union

Move the i_pipe pointer into a union that will be shared with i_bdev and
i_cdev.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] inode_diet: Replace inode.u.generic_ip with inode.i_private
Theodore Ts'o [Wed, 27 Sep 2006 08:50:46 +0000 (01:50 -0700)]
[PATCH] inode_diet: Replace inode.u.generic_ip with inode.i_private

The following patches reduce the size of the VFS inode structure by 28 bytes
on a UP x86.  (It would be more on an x86_64 system).  This is a 10% reduction
in the inode size on a UP kernel that is configured in a production mode
(i.e., with no spinlock or other debugging functions enabled; if you want to
save memory taken up by in-core inodes, the first thing you should do is
disable the debugging options; they are responsible for a huge amount of bloat
in the VFS inode structure).

This patch:

The filesystem or device-specific pointer in the inode is inside a union,
which is pretty pointless given that all 30+ users of this field have been
using the void pointer.  Get rid of the union and rename it to i_private, with
a comment to explain who is allowed to use the void pointer.  This is just a
cleanup, but it allows us to reuse the union 'u' for something something where
the union will actually be used.

[judith@osdl.org: powerpc build fix]
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Signed-off-by: Judith Lebzelter <judith@osdl.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] fat: cleanup fat_get_block(s)
OGAWA Hirofumi [Wed, 27 Sep 2006 08:50:45 +0000 (01:50 -0700)]
[PATCH] fat: cleanup fat_get_block(s)

get_blocks() was removed.  So, this removes it on fat, and will take
advantage of the multi block mapping.

Signed-off-by: OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] kdump: introduce "reset_devices" command line option
Vivek Goyal [Wed, 27 Sep 2006 08:50:44 +0000 (01:50 -0700)]
[PATCH] kdump: introduce "reset_devices" command line option

Resetting the devices during driver initialization can be a costly
operation in terms of time (especially scsi devices).  This option can be
used by drivers to know that user forcibly wants the devices to be reset
during initialization.

This option can be useful while kernel is booting in unreliable
environment.  For ex.  during kdump boot where devices are in unknown
random state and BIOS execution has been skipped.

Signed-off-by: Vivek Goyal <vgoyal@in.ibm.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] autofs4 needs to force fail return revalidate
Ian Kent [Wed, 27 Sep 2006 08:50:44 +0000 (01:50 -0700)]
[PATCH] autofs4 needs to force fail return revalidate

For a long time now I have had a problem with not being able to return a
lookup failure on an existsing directory.  In autofs this corresponds to a
mount failure on a autofs managed mount entry that is browsable (and so the
mount point directory exists).

While this problem has been present for a long time I've avoided resolving
it because it was not very visible.  But now that autofs v5 has "mount and
expire on demand" of nested multiple mounts, such as is found when mounting
an export list from a server, solving the problem cannot be avoided any
longer.

I've tried very hard to find a way to do this entirely within the autofs4
module but have not been able to find a satisfactory way to achieve it.

So, I need to propose a change to the VFS.

Signed-off-by: Ian Kent <raven@themaw.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: fix allocation size
Jeff Dike [Wed, 27 Sep 2006 08:50:43 +0000 (01:50 -0700)]
[PATCH] uml: fix allocation size

Fix an instance of ptr=alloc(sizeof(ptr)).  Grepping showed no more instances
of this pattern.

Also fixed the formatting in the area.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: fix sleep length bug
Jeff Dike [Wed, 27 Sep 2006 08:50:42 +0000 (01:50 -0700)]
[PATCH] uml: fix sleep length bug

um_timer shouldn't add local_offset to the host time since get_time already
did it.  This threw off sleep when a settimeofday or equivalent had happened.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: add an export
Jeff Dike [Wed, 27 Sep 2006 08:50:41 +0000 (01:50 -0700)]
[PATCH] uml: add an export

Some modules need strnlen_user_skas.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: file renaming
Jeff Dike [Wed, 27 Sep 2006 08:50:40 +0000 (01:50 -0700)]
[PATCH] uml: file renaming

Move some foo_kern.c files to foo.c now that the old foo.c files are out
of the way.

Also cleaned up some whitespace and an emacs formatting comment.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: thread creation tidying
Jeff Dike [Wed, 27 Sep 2006 08:50:40 +0000 (01:50 -0700)]
[PATCH] uml: thread creation tidying

fork on UML has always somewhat subtle.  The underlying cause has been the
need to initialize a stack for the new process.  The only portable way to
initialize a new stack is to set it as the alternate signal stack and take a
signal.  The signal handler does whatever initialization is needed and jumps
back to the original stack, where the fork processing is finished.  The basic
context switching mechanism is a jmp_buf for each process.  You switch to a
new process by longjmping to its jmp_buf.

Now that UML has its own implementation of setjmp and longjmp, and I can poke
around inside a jmp_buf without fear that libc will change the structure, a
much simpler mechanism is possible.  The jmpbuf can simply be initialized by
hand.

This eliminates -
the need to set up and remove the alternate signal stack
sending and handling a signal
the signal blocking needed around the stack switching, since
there is no stack switching
setting up the jmp_buf needed to jump back to the original
stack after the new one is set up

In addition, since jmp_buf is now defined by UML, and not by libc, it can be
embedded in the thread struct.  This makes it unnecessary to have it exist on
the stack, where it used to be.  It also simplifies interfaces, since the
switch jmp_buf used to be a void * inside the thread struct, and functions
which took it as an argument needed to define a jmp_buf variable and assign it
from the void *.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: mark some tt-mode code
Jeff Dike [Wed, 27 Sep 2006 08:50:38 +0000 (01:50 -0700)]
[PATCH] uml: mark some tt-mode code

Mark a symbol and file as being tt-mode only.  This shrinks the binary
slightly when tt mode support is compiled out and makes it easier to identity
stuff when tt mode is removed.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: add checkstack support
Jeff Dike [Wed, 27 Sep 2006 08:50:37 +0000 (01:50 -0700)]
[PATCH] uml: add checkstack support

Make checkstack work for UML.  We need to pass the underlying architecture
name, rather than "um" to checkstack.pl.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Acked-by: Matt Mackall <mpm@selenic.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: use correct SIGBUS handler
Jeff Dike [Wed, 27 Sep 2006 08:50:37 +0000 (01:50 -0700)]
[PATCH] uml: use correct SIGBUS handler

BB noticed that we had the wrong bus error handler.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: fix gcov support
Jeff Dike [Wed, 27 Sep 2006 08:50:36 +0000 (01:50 -0700)]
[PATCH] uml: fix gcov support

Make __bb_init_func weak in order to avoid a link failure with some libcs
and/or gccs.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: fix missing x86_64 register definitions
Jeff Dike [Wed, 27 Sep 2006 08:50:35 +0000 (01:50 -0700)]
[PATCH] uml: fix missing x86_64 register definitions

The UML/x86_64 headers were missing ptrace support for some segment registers.
 The underlying problem was that the x86_64 kernel uses user_regs_struct
rather than the ptrace register definitions in ptrace.  This patch switches
UML/x86_64 to using user_regs_struct for its definitions of the host's
registers.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: get rid of ZONE_DMA use
Jeff Dike [Wed, 27 Sep 2006 08:50:34 +0000 (01:50 -0700)]
[PATCH] uml: get rid of ZONE_DMA use

ZONE_DMA might become dependent on CONFIG_ZONE_DMA, which UML doesn't define
(we're still arguing about this) So, let's change ZONE_DMA to ZONE_NORMAL.

This is prompted by optional-zone_dma-in-the-vm.patch, but should be harmless
on its own.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: const more data
Jeff Dike [Wed, 27 Sep 2006 08:50:33 +0000 (01:50 -0700)]
[PATCH] uml: const more data

Make lots of structures const in order to make it obvious that they need no
locking.

Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: fix proc-vs-interrupt context spinlock deadlock
Paolo 'Blaisorblade' Giarrusso [Wed, 27 Sep 2006 08:50:31 +0000 (01:50 -0700)]
[PATCH] uml: fix proc-vs-interrupt context spinlock deadlock

This spinlock can be taken on interrupt too, so spin_lock_irq[save] must be
used.

However, Documentation/networking/netdevices.txt explains we are called with
rtnl_lock() held - so we don't need to care about other concurrent opens.
Verified also in LDD3 and by direct checking.  Also verified that the network
layer (through a state machine) guarantees us that nobody will close the
interface while it's being used.  Please correct me if I'm wrong.

Also, we must check we don't sleep with irqs disabled!!!  But anyway, this is
not news - we already can't sleep while holding a spinlock.  Who says this is
guaranted really by the present code?

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] uml: use -mcmodel=kernel for x86_64
Paolo 'Blaisorblade' Giarrusso [Wed, 27 Sep 2006 08:50:27 +0000 (01:50 -0700)]
[PATCH] uml: use -mcmodel=kernel for x86_64

We have never used this flag and recently one user experienced a complaining
warning about this (there was a symbol in the positive half of the address space
IIRC). So fix it.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Cc: Jeff Dike <jdike@addtoit.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] m32r: revise __raw_read_trylock()
Hirokazu Takata [Wed, 27 Sep 2006 08:50:24 +0000 (01:50 -0700)]
[PATCH] m32r: revise __raw_read_trylock()

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] m32r: Fix "value computed not used" warnings
Hirokazu Takata [Wed, 27 Sep 2006 08:50:24 +0000 (01:50 -0700)]
[PATCH] m32r: Fix "value computed not used" warnings

Fix to remove annoying gcc-4.1 warnings "value computed not used" for m32r;
Modify set_mb to cast to void for SMP.

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: move the fallback arch_vma_name() to a sensible place
David Howells [Wed, 27 Sep 2006 08:50:23 +0000 (01:50 -0700)]
[PATCH] NOMMU: move the fallback arch_vma_name() to a sensible place

Move the fallback arch_vma_name() to a sensible place (kernel/signal.c).

Currently it's in fs/proc/task_mmu.c, a file that is dependent on both
CONFIG_PROC_FS and CONFIG_MMU being enabled, but it's used from
kernel/signal.c from where it is called unconditionally.

[akpm@osdl.org: build fix]
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Make futexes work under NOMMU conditions
David Howells [Wed, 27 Sep 2006 08:50:22 +0000 (01:50 -0700)]
[PATCH] NOMMU: Make futexes work under NOMMU conditions

Make futexes work under NOMMU conditions.

This can be tested by running this in one shell:

#define SYSERROR(X, Y) \
do { if ((long)(X) == -1L) { perror(Y); exit(1); }} while(0)

int main()
{
int shmid, tmp, *f, n;

shmid = shmget(23, 4, IPC_CREAT|0666);
SYSERROR(shmid, "shmget");

f = shmat(shmid, NULL, 0);
SYSERROR(f, "shmat");

n = *f;
printf("WAIT: %p{%x}\n", f, n);
tmp = futex(f, FUTEX_WAIT, n, NULL, NULL, 0);
SYSERROR(tmp, "futex");
printf("WAITED: %d\n", tmp);

tmp = shmdt(f);
SYSERROR(tmp, "shmdt");

exit(0);
}

And then this in the other shell:

#define SYSERROR(X, Y) \
do { if ((long)(X) == -1L) { perror(Y); exit(1); }} while(0)

int main()
{
int shmid, tmp, *f;

shmid = shmget(23, 4, IPC_CREAT|0666);
SYSERROR(shmid, "shmget");

f = shmat(shmid, NULL, 0);
SYSERROR(f, "shmat");

(*f)++;
printf("WAKE: %p{%x}\n", f, *f);
tmp = futex(f, FUTEX_WAKE, 1, NULL, NULL, 0);
SYSERROR(tmp, "futex");
printf("WOKE: %d\n", tmp);

tmp = shmdt(f);
SYSERROR(tmp, "shmdt");

exit(0);
}

The first program will set up a SYSV IPC SHM segment and wait on a futex in it
for the number at the start to change.  The program will increment that number
and wake the first program up.  This leads to output of the form:

SHELL 1 SHELL 2
======================= =======================
# /dowait
WAIT: 0xc32ac000{0}
# /dowake
WAKE: 0xc32ac000{1}
WAITED: 0 WOKE: 1

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Add docs about shared memory
David Howells [Wed, 27 Sep 2006 08:50:21 +0000 (01:50 -0700)]
[PATCH] NOMMU: Add docs about shared memory

Add documentation about using shared memory in NOMMU mode.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Make mremap() partially work for NOMMU kernels
David Howells [Wed, 27 Sep 2006 08:50:21 +0000 (01:50 -0700)]
[PATCH] NOMMU: Make mremap() partially work for NOMMU kernels

Make mremap() partially work for NOMMU kernels.  It may resize a VMA provided
that it doesn't exceed the size of the slab object in which the storage is
allocated that the VMA refers to.  Shareable VMAs may not be resized.

Moving VMAs (as permitted by MREMAP_MAYMOVE) is not currently supported.

This patch also makes use of the fact that the VMA list is now ordered to cut
it short when possible.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Order the per-mm_struct VMA list
David Howells [Wed, 27 Sep 2006 08:50:20 +0000 (01:50 -0700)]
[PATCH] NOMMU: Order the per-mm_struct VMA list

Order the per-mm_struct VMA list by address so that searching it can be cut
short when the appropriate address has been exceeded.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Implement /proc/pid/maps for NOMMU
David Howells [Wed, 27 Sep 2006 08:50:19 +0000 (01:50 -0700)]
[PATCH] NOMMU: Implement /proc/pid/maps for NOMMU

Implement /proc/pid/maps for NOMMU by reading the vm_area_list attached to
current->mm->context.vmlist.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Permit ptrace to ignore non-PROT_WRITE VMAs in NOMMU mode
David Howells [Wed, 27 Sep 2006 08:50:19 +0000 (01:50 -0700)]
[PATCH] NOMMU: Permit ptrace to ignore non-PROT_WRITE VMAs in NOMMU mode

Permit ptrace to modify a section that's non-shared but is marked
unwritable, such as is obtained by mapping the text segment of an ELF-FDPIC
executable binary with into a binary that's being ptraced[*].

[*] Under NOMMU conditions ptrace causes read-only MAP_PRIVATE mmaps to become
    totally private copies because if a private mapping was actually shared
    then the debugging setting breakpoints in it would potentially crash
    other processes.

This is done by using the VM_MAYWRITE flag rather than the VM_WRITE flag
when deciding whether to permit a write.

Without this patch a debugger can't set breakpoints in the mapped text
sections of executables that are mapped read-only private, even if the
mmap() syscall has taken a private copy because PT_PTRACED is set.

In addition, VM_MAYREAD is used instead of VM_READ for similar reasons.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Check VMA protections
David Howells [Wed, 27 Sep 2006 08:50:18 +0000 (01:50 -0700)]
[PATCH] NOMMU: Check VMA protections

Check the VMA protections in get_user_pages() against what's being asked.

This checks to see that we don't accidentally write on a non-writable VMA or
permit an I/O mapping VMA to be accessed (which may lack page structs).

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Check if start address is in vma region in NOMMU function get_user_pages()
Sonic Zhang [Wed, 27 Sep 2006 08:50:17 +0000 (01:50 -0700)]
[PATCH] Check if start address is in vma region in NOMMU function get_user_pages()

In NOMMU arch, if run "cat /proc/self/mem", data from physical address 0
are read.  This behavior is different from MMU arch.  In IA32, message
"cat: /proc/self/mem: Input/output error" is reported.

This issue is rootcaused by not validate the start address in NOMMU
function get_user_pages().  Following patch solves this issue.

Signed-off-by: Sonic Zhang <sonic.adi@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Use find_vma() rather than reimplementing a VMA search
David Howells [Wed, 27 Sep 2006 08:50:16 +0000 (01:50 -0700)]
[PATCH] NOMMU: Use find_vma() rather than reimplementing a VMA search

Use find_vma() in the NOMMU version of access_process_vm() rather than
reimplementing it.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Set BDI capabilities for /dev/mem and /dev/kmem
David Howells [Wed, 27 Sep 2006 08:50:16 +0000 (01:50 -0700)]
[PATCH] NOMMU: Set BDI capabilities for /dev/mem and /dev/kmem

Set the backing device info capabilities for /dev/mem and /dev/kmem to
permit direct sharing under no-MMU conditions and full mapping capabilities
under MMU conditions.  Make the BDI used by these available to all directly
mappable character devices.

Also comment the capabilities for /dev/zero.

[akpm@osdl.org: ifdef reductions]
Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] NOMMU: Check that access_process_vm() has a valid target
David Howells [Wed, 27 Sep 2006 08:50:15 +0000 (01:50 -0700)]
[PATCH] NOMMU: Check that access_process_vm() has a valid target

Check that access_process_vm() is accessing a valid mapping in the target
process.

This limits ptrace() accesses and accesses through /proc/<pid>/maps to only
those regions actually mapped by a program.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] AVR32: Use unsigned long flags for saving interrupt state
Haavard Skinnemoen [Wed, 27 Sep 2006 08:50:14 +0000 (01:50 -0700)]
[PATCH] AVR32: Use unsigned long flags for saving interrupt state

Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Mark __remove_vm_area() static
Rolf Eike Beer [Wed, 27 Sep 2006 08:50:13 +0000 (01:50 -0700)]
[PATCH] Mark __remove_vm_area() static

The function is exported but not used from anywhere else.  It's also marked as
"not for driver use" so noone out there should really care.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Fix kerneldoc comments in mm/vmalloc.c
Rolf Eike Beer [Wed, 27 Sep 2006 08:50:13 +0000 (01:50 -0700)]
[PATCH] Fix kerneldoc comments in mm/vmalloc.c

The empty line between the short description and the first argument
description causes a section to appear twice in the generated manpage.
Also the short description should really be short: the script can't handle
multiple lines.

Signed-off-by: Rolf Eike Beer <eike-kernel@sf-tec.de>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mm/page_alloc: use NULL instead of 0 for ptr
Randy Dunlap [Wed, 27 Sep 2006 08:50:12 +0000 (01:50 -0700)]
[PATCH] mm/page_alloc: use NULL instead of 0 for ptr

Use NULL instead of 0 for pointer value, eliminate sparse warnings.

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] mspec driver
Jes Sorensen [Wed, 27 Sep 2006 08:50:11 +0000 (01:50 -0700)]
[PATCH] mspec driver

Implement the special memory driver (mspec) based on the do_no_pfn
approach.  The driver is currently used only on SN2 hardware with special
fetchop support but could be beneficial on other architectures using the
uncached mode.

Signed-off-by: Jes Sorensen <jes@sgi.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] do_no_pfn()
Jes Sorensen [Wed, 27 Sep 2006 08:50:10 +0000 (01:50 -0700)]
[PATCH] do_no_pfn()

Implement do_no_pfn() for handling mapping of memory without a struct page
backing it.  This avoids creating fake page table entries for regions which
are not backed by real memory.

This feature is used by the MSPEC driver and other users, where it is
highly undesirable to have a struct page sitting behind the page (for
instance if the page is accessed in cached mode via the struct page in
parallel to the the driver accessing it uncached, which can result in data
corruption on some architectures, such as ia64).

This version uses specific NOPFN_{SIGBUS,OOM} return values, rather than
expect all negative pfn values would be an error.  It also bugs on cow
mappings as this would not work with the VM.

[akpm@osdl.org: micro-optimise]
Signed-off-by: Jes Sorensen <jes@sgi.com>
Cc: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] zone_statistics: Use hot node instead of cold zone_pgdat
Christoph Lameter [Wed, 27 Sep 2006 08:50:10 +0000 (01:50 -0700)]
[PATCH] zone_statistics: Use hot node instead of cold zone_pgdat

Now that we have the node in the hot zone of struct zone we can avoid
accessing zone_pgdat in zone_statistics.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Do not allocate pagesets for unpopulated zones.
Christoph Lameter [Wed, 27 Sep 2006 08:50:09 +0000 (01:50 -0700)]
[PATCH] Do not allocate pagesets for unpopulated zones.

We do not need to allocate pagesets for unpopulated zones.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] Add node to zone for the NUMA case
Christoph Lameter [Wed, 27 Sep 2006 08:50:08 +0000 (01:50 -0700)]
[PATCH] Add node to zone for the NUMA case

Add the node in order to optimize zone_to_nid.

Signed-off-by: Christoph Lameter <clameter@sgi.com>
Acked-by: Paul Jackson <pj@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
17 years ago[PATCH] GFP_THISNODE for the slab allocator
Christoph Lameter [Wed, 27 Sep 2006 08:50:08 +0000 (01:50 -0700)]
[PATCH] GFP_THISNODE for the slab allocator

This patch insures that the slab node lists in the NUMA case only contain
slabs that belong to that specific node.  All slab allocations use
GFP_THISNODE when calling into the page allocator.  If an allocation fails
then we fall back in the slab allocator according to the zonelists appropriate
for a certain context.

This allows a replication of the behavior of alloc_pages and alloc_pages node
in the slab layer.

Currently allocations requested from the page allocator may be redirected via
cpusets to other nodes.  This results in remote pages on nodelists and that in
turn results in interrupt latency issues during cache draining.  Plus the slab
is handing out memory as local when it is really remote.

Fallback for slab memory allocations will occur within the slab allocator and
not in the page allocator.  This is necessary in order to be able to use the
existing pools of objects on the nodes that we fall back to before adding more
pages to a slab.

The fallback function insures that the nodes we fall back to obey cpuset
restrictions of the current context.  We do not allocate objects from outside
of the current cpuset context like before.

Note that the implementation of locality constraints within the slab allocator
requires importing logic from the page allocator.  This is a mischmash that is
not that great.  Other allocators (uncached allocator, vmalloc, huge pages)
face similar problems and have similar minimal reimplementations of the basic
fallback logic of the page allocator.  There is another way of implementing a
slab by avoiding per node lists (see modular slab) but this wont work within
the existing slab.

V1->V2:
- Use NUMA_BUILD to avoid #ifdef CONFIG_NUMA
- Exploit GFP_THISNODE being 0 in the NON_NUMA case to avoid another
  #ifdef

[akpm@osdl.org: build fix]
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>