safe/jmp/linux-2.6
16 years agoatyfb: the pseudo_palette is only 16 elements long
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:42 +0000 (04:05 -0700)]
atyfb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotx3912fb: fix improper assignment of info->pseudo_palette
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:42 +0000 (04:05 -0700)]
tx3912fb: fix improper assignment of info->pseudo_palette

There is no variable pseudo_palette.  Instead, there is u32 cfb8[16]. Use
this for info->pseudo_palette.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotridentfb: fix pseudo_palette array overrun in setcolreg
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:41 +0000 (04:05 -0700)]
tridentfb: fix pseudo_palette array overrun in setcolreg

The pseudo_palette has only 16 elements. Do not write if regno (the array
index) is more than 15.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agotgafb: actually allocate memory for the pseudo_palette
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:41 +0000 (04:05 -0700)]
tgafb: actually allocate memory for the pseudo_palette

No memory allocation was done for the pseudo_palette.  Allocate one for it.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: "Maciej W. Rozycki" <macro@linux-mips.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosgivwfb: the pseudo_palette is only 16 elements long
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:40 +0000 (04:05 -0700)]
sgivwfb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoq40fb: the pseudo_palette is only 16 elements long
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:40 +0000 (04:05 -0700)]
q40fb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agopvr2fb: fix pseudo_palette array overrun and typecast
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:39 +0000 (04:05 -0700)]
pvr2fb: fix pseudo_palette array overrun and typecast

- the pseudo_palette has only 16 elements. Do not write if regno (the array
  index) is more than 15.
- if using generic drawing libraries, the typecast of pseudo_palette is
  always u32 *

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: Paul Mundt <lethal@linux-sh.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoplatinumfb: the pseudo_palette is only 16 elements long
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:38 +0000 (04:05 -0700)]
platinumfb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agooffb: the pseudo_palette is only 16 elements long
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:38 +0000 (04:05 -0700)]
offb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomacfb: fix pseudo_palette size and overrun
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:37 +0000 (04:05 -0700)]
macfb: fix pseudo_palette size and overrun

- the pseudo_palette is only 16 elements long.
- do not write to the pseudo_palette if regno (array index) is more than 15.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agogbefb: the pseudo_palette is only 16 elements long
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:37 +0000 (04:05 -0700)]
gbefb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofm2fb: the pseudo_palette is only 16 elements long
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:36 +0000 (04:05 -0700)]
fm2fb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoepson1355fb: color setting fixes
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:36 +0000 (04:05 -0700)]
epson1355fb: color setting fixes

- the pseudo_palette is only 16 elements long
- allocate the pseudo_palette as part of epson1355_par

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocyblafb: fix pseudo_palette array overrun in setcolreg
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:35 +0000 (04:05 -0700)]
cyblafb: fix pseudo_palette array overrun in setcolreg

The pseudo_palette has only 16 elements. Do not write if regno (the array
index) is more than 15.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocontrolfb: the pseudo_palette is only 16 elements long
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:35 +0000 (04:05 -0700)]
controlfb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago68328fb: the pseudo_palette is only 16 elements long
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:34 +0000 (04:05 -0700)]
68328fb: the pseudo_palette is only 16 elements long

The pseudo_palette is only 16 elements long.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agovt: add comment for unbind_con_driver()
Jesse Barnes [Tue, 17 Jul 2007 11:05:34 +0000 (04:05 -0700)]
vt: add comment for unbind_con_driver()

- add comment for unbind_con_driver().
- bind_con_driver() is made private again

Signed-off-by: Jesse Barnes <jesse.barnes@intel.com>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofbdev: fbcon: console unregistration from unregister_framebuffer
Jesse Barnes [Tue, 17 Jul 2007 11:05:33 +0000 (04:05 -0700)]
fbdev: fbcon: console unregistration from unregister_framebuffer

This allows for proper console unregistration via the VT layer, and updates
the FB layer to use it.  This makes debugging new console drivers much easier,
since you can properly clean them up before unloading.

[adaplas]
unregister_framebuffer() is typically called as part of the driver's
module_exit(). Doing so otherwise will freeze the machine as the VT layer is
holding reference counts on fbcon, and fbcon on the driver.  With this change,
it allows unregister_framebuffer() to be called safely anywhere as needed.

Additions from the original:  If multiple drivers are used by fbcon, and if
one of them unregisters, a driver will take over the consoles vacated by the
outgoing one (via set_con2fb_map).   Once only the outgoing driver remains,
then fbcon will unbind from the VT layer (if CONFIG_HW_CONSOLE_UNBINDING is
set to y).

It is important that these drivers implement fb_open() and fb_release()
just to ensure that no other process is using the driver. Likewise, these
drivers _must_ check the return value of unregister_framebuffer().

[akpm@linux-foundation.org: make fbcon_unbind() stub inline]
Signed-off-by: Jesse Barnes <jesse.barnes@intel.com>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofbcon: Revise primary device selection
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:32 +0000 (04:05 -0700)]
fbcon: Revise primary device selection

Use set_con2fb_map() to select the primary display driver instead of using
unbind_con_driver() and bind_con_driver().  Using the former is much simpler
and safer than the current one.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofbcon: set_con2fb_map fixes
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:32 +0000 (04:05 -0700)]
fbcon: set_con2fb_map fixes

set_con2fb_map() has regressed for some time.  Using fbcon=map:01, for
example, works only if there is only 1 working framebuffer. Trying to do a
set_con2fb_map() on a non-allocated vc will freeze the system.

- ensure that succeeding drivers after the first gets mapped to the console
- remove fbcon_preset_display() and modify fbcon_set_display() to include the
  former's functionality
- ensure that binding and unbinding succeeds if multiple drivers are mapped to
  the console

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agopm2fb: white spaces clean up
Krzysztof Helt [Tue, 17 Jul 2007 11:05:31 +0000 (04:05 -0700)]
pm2fb: white spaces clean up

This patch removes trailing spaces and tabs and spaces before tabs.

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agonvidiafb: Add proper support for Geforce 7600 chipset
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:30 +0000 (04:05 -0700)]
nvidiafb: Add proper support for Geforce 7600 chipset

Add proper support for the Geforce 7600 (device id 0x039x).  This also sync's
nvidiafb with the latest Xorg nv driver.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoradeonfb: Add support for Radeon Xpress 200M (RS485)
Stephan Wolf [Tue, 17 Jul 2007 11:05:29 +0000 (04:05 -0700)]
radeonfb: Add support for Radeon Xpress 200M (RS485)

Add PCI ids for the Radeon Xpress 200M (RS485).

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofbcon: allow fbcon to use the primary display driver
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:28 +0000 (04:05 -0700)]
fbcon: allow fbcon to use the primary display driver

Allow fbcon to select the primary display adapter using the
fb_is_primary_device() arch-specific helper.  If a a primary adapter is
detected, fbcon will unbind the old adapter from the VT layer, then rebind
using the new adapter.  This requires that bind_/unbind_con_driver() be made
public.

Because this feature may produce unexpected behavior (from the user's POV),
this must be explicitly enabled in Kconfig.

[akpm@linux-foundation.org: export unbind_con_driver]
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofbdev: detect primary display device
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:28 +0000 (04:05 -0700)]
fbdev: detect primary display device

Add function helper, fb_is_primary_device().  Given struct fb_info, it will
return a nonzero value if the device is the primary display.

Currently, only the i386 is supported where the function checks for the
IORESOURCE_ROM_SHADOW flag.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Cc: David Miller <davem@davemloft.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofbdev: move arch-specific bits to their respective subdirectories
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:27 +0000 (04:05 -0700)]
fbdev: move arch-specific bits to their respective subdirectories

Move arch-specific bits of fb_mmap() to their respective subdirectories

[bob.picco@hp.com: efi_range_is_wc is referenced but not declared]
[bunk@stusta.de: fix include/asm-m68k/fb.h]
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofbcon: use struct device instead of struct class_device
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:26 +0000 (04:05 -0700)]
fbcon: use struct device instead of struct class_device

Port fbcon.c to use struct device from using struct class_device

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofbcon: cursor blink control
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:26 +0000 (04:05 -0700)]
fbcon: cursor blink control

Add sysfs attribute to enable or disable cursor blinking.  This will also
disable cursor blinking if the VT layer's softcursor is active.  These changes
are required to enable some machines to enter low-power states properly.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agonvidiafb: adjust flags to take advantage of new scroll method
Antonino A. Daplas [Tue, 17 Jul 2007 11:05:25 +0000 (04:05 -0700)]
nvidiafb: adjust flags to take advantage of new scroll method

The SCROLL_MOVE method has been optimized such that it is significantly faster
than SCROLL_REDRAW.  Adjust flags to indicate that blitting is preferred over
rendering.

Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofbcon: smart blitter usage for scrolling
Krzysztof Helt [Tue, 17 Jul 2007 11:05:25 +0000 (04:05 -0700)]
fbcon: smart blitter usage for scrolling

This patch replaces the current SCROLL_MOVE method with smarter method using
the same logic as the SCROLL_REDRAW method.  This brings these two methods
much closer in performance and benefits all framebuffers which uses the
SCROLL_MOVE method.

[adaplas]
- remove unnecessary char attribute checking
- whitespace cleanups and 80-column line fixes

Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl>
Signed-off-by: Antonino Daplas <adaplas@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agostallion: remove unneeded lock_kernel
Alan Cox [Tue, 17 Jul 2007 11:05:24 +0000 (04:05 -0700)]
stallion: remove unneeded lock_kernel

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: istallion, init+locking fixes
Ingo Korb [Tue, 17 Jul 2007 11:05:23 +0000 (04:05 -0700)]
Char: istallion, init+locking fixes

Move brdp->iosize assignment in stli_initecp up a few lines to stop the
driver from requesting an I/O region of length 0.

Remove spin_lock_irqsave/spin_unlock_irqrestore from __stli_sendcmd as
all users of that function take the lock already.

Signed-off-by: Ingo Korb <ml@akana.de>
Cc: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: stallion, remove user class report request
Jiri Slaby [Tue, 17 Jul 2007 11:05:22 +0000 (04:05 -0700)]
Char: stallion, remove user class report request

stallion, remove user class report request

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: Kconfig, mxser_new: remove experimental comment
Jiri Slaby [Tue, 17 Jul 2007 11:05:22 +0000 (04:05 -0700)]
Char: Kconfig, mxser_new: remove experimental comment

Kconfig, mxser_new: remove experimental comment

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: vt, use ARRAY_SIZE
Jiri Slaby [Tue, 17 Jul 2007 11:05:21 +0000 (04:05 -0700)]
Char: vt, use ARRAY_SIZE

vt, use ARRAY_SIZE

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: vt, use kzalloc
Jiri Slaby [Tue, 17 Jul 2007 11:05:21 +0000 (04:05 -0700)]
Char: vt, use kzalloc

vt, use kzalloc

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Acked-by: Alan Cox <alan@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: riscom8, eliminate busy loop
Jiri Slaby [Tue, 17 Jul 2007 11:05:20 +0000 (04:05 -0700)]
Char: riscom8, eliminate busy loop

riscom8, eliminate busy loop

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: specialix, remove busy waiting
Jiri Slaby [Tue, 17 Jul 2007 11:05:19 +0000 (04:05 -0700)]
Char: specialix, remove busy waiting

use msleep instead, because not in atomic

Cc: Roger Wolff <R.E.Wolff@BitWizard.nl>
Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: moxa, eliminate busy waiting
Jiri Slaby [Tue, 17 Jul 2007 11:05:19 +0000 (04:05 -0700)]
Char: moxa, eliminate busy waiting

blah, moxa delays 250+ ms in busy waiting, use msleep instead.

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: isicom, proper variables types
Jiri Slaby [Tue, 17 Jul 2007 11:05:18 +0000 (04:05 -0700)]
Char: isicom, proper variables types

irq is int, base is unsigned long

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: isicom, del_timer at exit
Jiri Slaby [Tue, 17 Jul 2007 11:05:18 +0000 (04:05 -0700)]
Char: isicom, del_timer at exit

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: isicom, cleanup locking
Jiri Slaby [Tue, 17 Jul 2007 11:05:17 +0000 (04:05 -0700)]
Char: isicom, cleanup locking

Don't spin processor when not needed (use sleep instead of delay).  Don't
release the lock when needed in next iteration -- this actually fixes a bug --
missing braces

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: cyclades, fix sparse warning
Jiri Slaby [Tue, 17 Jul 2007 11:05:17 +0000 (04:05 -0700)]
Char: cyclades, fix sparse warning

cyclades, fix sparse warning

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoChar: cyclades, add firmware loading
Jiri Slaby [Tue, 17 Jul 2007 11:05:16 +0000 (04:05 -0700)]
Char: cyclades, add firmware loading

cyclades, add firmware loading

Signed-off-by: Jiri Slaby <jirislaby@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoremove options depending on OSS_OBSOLETE
Adrian Bunk [Tue, 17 Jul 2007 11:05:16 +0000 (04:05 -0700)]
remove options depending on OSS_OBSOLETE

This patch contains the scheduled removal of options depending on
OSS_OBSOLETE.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoOSS trident: replace deprecated pci_find_device with pci_get_device
Muli Ben-Yehuda [Tue, 17 Jul 2007 11:05:15 +0000 (04:05 -0700)]
OSS trident: replace deprecated pci_find_device with pci_get_device

Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoOSS trident: fix locking around write_voice_regs
Muli Ben-Yehuda [Tue, 17 Jul 2007 11:05:15 +0000 (04:05 -0700)]
OSS trident: fix locking around write_voice_regs

trident_write_voice_regs() was getting called with the card spinlock held in
only some cases.  Fix it.

Explanation: we allocate a new virtual channel in open, and then we frob some
hardware registers (in write_voice_regs) for that channel.  But the hardware
registers are shared with other channels, which may be trying to frob the some
registers (albeit for another channel) via ioctl(SNDCTL_DSP_SPEED).

Fixed bugzilla.kernel.org bug #8172 (http://bugme.osdl.org/show_bug.cgi?id=8172)

Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: <tammy000@gmail.com>
Cc: <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoOSS trident: massive whitespace removal
Muli Ben-Yehuda [Tue, 17 Jul 2007 11:05:13 +0000 (04:05 -0700)]
OSS trident: massive whitespace removal

Signed-off-by: Muli Ben-Yehuda <muli@il.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agocsb337 supports "new style" rtc-ds1307
David Brownell [Tue, 17 Jul 2007 11:05:12 +0000 (04:05 -0700)]
csb337 supports "new style" rtc-ds1307

Update csb337 board specific init to support "new style" rtc-ds1307 code.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Andrew Victor <andrew@sanpeople.com>
Cc: Bill Gatliff <bgat@billgatliff.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc-ds1307 becomes new-style i2c driver
David Brownell [Tue, 17 Jul 2007 11:05:10 +0000 (04:05 -0700)]
rtc-ds1307 becomes new-style i2c driver

Convert the rtc-ds1307 driver into a "new style" driver.

Also improve probe() checks:  be more correct about switching out of
AM/PM mode, and issue a (debug) diagnostic when failing due to bogus
register values.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Andrew Victor <andrew@sanpeople.com>
Cc: Bill Gatliff <bgat@billgatliff.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Kumar Gala <galak@gate.crashing.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc-ds1307: oscillator restart for ds13{37,38,39,40}
Rodolfo Giometti [Tue, 17 Jul 2007 11:05:06 +0000 (04:05 -0700)]
rtc-ds1307: oscillator restart for ds13{37,38,39,40}

When we find a ds1337 or ds1339 with the oscillator powered off, turn it
on.  If the oscillator fault flag was set, clear it and warn that the clock
needs to be set.

David Brownell: Bugfixes; provide corresponding update for ds1338, and the
core of the fix for ds1340.  Use a common warning message ("SET TIME!")
whenever the clock needs to be set after oscillator fault (or oscillator
enable, if fault is not a separate status).

Signed-off-by: Rodolfo Giometti <giometti@linux.it>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoRTC driver for DS1216 chips
Thomas Bogendoerfer [Tue, 17 Jul 2007 11:05:06 +0000 (04:05 -0700)]
RTC driver for DS1216 chips

RTC driver for Dallas/Maxim DS126 chips used in SNI RM200/RM400

[akpm@linux-foundation.org: cleanups]
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc: add support for the ST M48T59 RTC
Mark Zhan [Tue, 17 Jul 2007 11:05:05 +0000 (04:05 -0700)]
rtc: add support for the ST M48T59 RTC

[akpm@linux-foundation.org: x86_64 build fix]
[akpm@linux-foundation.org: The acpi guys changed the bin_attribute code]
Signed-off-by: Mark Zhan <rongkai.zhan@windriver.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc: watchdog support for rtc-m41t80 driver
Atsushi Nemoto [Tue, 17 Jul 2007 11:05:04 +0000 (04:05 -0700)]
rtc: watchdog support for rtc-m41t80 driver

Add a watchdog driver interface to rtc-m41t80 driver.  This is derived from
works by Alexander Bigga <ab@mycable.de>

Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Alexander Bigga <ab@mycable.de>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc: add rtc-m41t80 driver
Atsushi Nemoto [Tue, 17 Jul 2007 11:05:02 +0000 (04:05 -0700)]
rtc: add rtc-m41t80 driver

This is a new-style i2c driver for ST M41T80 series RTC chip, derived from
works by Alexander Bigga <ab@mycable.de> who wrote the original
rtc-m41txx.c based on drivers/i2c/chips/m41t00.c driver.

This driver supports M41T8[0-4] and M41ST8[457].  The old m41t00 driver
supports M41T00, M41T81 and M41T85(M41ST85).  While the M41T00 chip is now
supported by rtc-ds1307 driver, this driver does not include support for
the chip.

[akpm@linux-foundation.org: remove bogus `static']
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Signed-off-by: Alexander Bigga <ab@mycable.de>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Cc: David Brownell <david-b@pacbell.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoRTC Kconfig tweax
David Brownell [Tue, 17 Jul 2007 11:05:02 +0000 (04:05 -0700)]
RTC Kconfig tweax

Minor fix to the Kconfig for RTCs: don't display section headers for I2C or
SPI unless they're configured.  And depend on SPI_MASTER; having slave
support wouldn't help.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Acked-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoRTC_CLASS is no longer considered EXPERIMENTAL
Alessandro Zummo [Tue, 17 Jul 2007 11:05:01 +0000 (04:05 -0700)]
RTC_CLASS is no longer considered EXPERIMENTAL

RTC class is mature enough.

Signed-off-by: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoDriver for the Atmel on-chip RTC on AT32AP700x devices
Hans-Christian Egtvedt [Tue, 17 Jul 2007 11:05:00 +0000 (04:05 -0700)]
Driver for the Atmel on-chip RTC on AT32AP700x devices

Tested on the AT32AP7000/ATSTK1000.  Driver does only suport time, wake up
and a very simple alarm, because of hardware limitations.

Hardware documentation can be found in the AT32AP7000 data sheet, which can
be downloaded from

http://www.atmel.com/dyn/products/datasheets.asp?family_id=682

From: David Brownell <david-b@pacbell.net>

 - Strike some alarm setup code that's no longer needed.
   (This patch seems to have gotten lost somewhere...)

 - Make the driver name (and its module alias) match what
   the platform setup code uses, so the driver can bind
   and hotplug.

[akpm@linux-foundation.org: fix several checkpatch.pl warnings]
Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc-dev: return -ENOTTY in ioctl if irq_set_freq is not implemented by driver
Hans-Christian Egtvedt [Tue, 17 Jul 2007 11:05:00 +0000 (04:05 -0700)]
rtc-dev: return -ENOTTY in ioctl if irq_set_freq is not implemented by driver

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc: make example code jump to done instead of return when ioctl not supported
Hans-Christian Egtvedt [Tue, 17 Jul 2007 11:04:59 +0000 (04:04 -0700)]
rtc: make example code jump to done instead of return when ioctl not supported

Signed-off-by: Hans-Christian Egtvedt <hcegtvedt@atmel.com>
Cc: Haavard Skinnemoen <hskinnemoen@atmel.com>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoThecus N2100: register rtc-rs5c372 i2c device
Martin Michlmayr [Tue, 17 Jul 2007 11:04:57 +0000 (04:04 -0700)]
Thecus N2100: register rtc-rs5c372 i2c device

Use the new i2c framework to load rtc-rs5c372 for the Thecus N2100.

Signed-off-by: Martin Michlmayr <tbm@cyrius.com>
Tested-by: Voipio Riku <Riku.Voipio@movial.fi>
Cc: Russell King <rmk@arm.linux.org.uk>
Cc: Lennert Buytenhek <buytenh@wantstofly.org>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: David Brownell <david-b@pacbell.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc-rs5c372 becomes a new-style i2c driver
David Brownell [Tue, 17 Jul 2007 11:04:55 +0000 (04:04 -0700)]
rtc-rs5c372 becomes a new-style i2c driver

Convert rtc-rs5c372 to be a "new style" I2C driver, and update the
Kconfig text to be more complete..

Verified on an OMAP H4 development platform, along with a board
init patch to declare its rv5c387a device.

Only one defconfig -- powerpc/linkstation -- uses this driver; but
several other platforms use it, just without defconfig support.

Such platforms need to be converted so (a) their I2C adapter driver
supports new-style drivers, and (b) board init code declares this
I2C device.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Voipio Riku <Riku.Voipio@movial.fi>
Acked-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Cc: Martin Michlmayr <tbm@cyrius.com>
Cc: Jean Delvare <khali@linux-fr.org>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agortc-ds1307 cleanups
David Brownell [Tue, 17 Jul 2007 11:04:55 +0000 (04:04 -0700)]
rtc-ds1307 cleanups

This updates the rtc-ds1307 driver so that converting it to a "new style"
driver (driver model, not legacy i2c model) will involve fewer changes.

 - Use pointer to i2c_client almost everywhere, so that it's easy
   to let the i2c core create that object;

 - Avoid using i2c_client.adapter, since that field is redundant and
   thus may go away (same object as i2c_client.dev.parent).

 - Extend type enum to include various RTCs this is expected to
   work with, and include register support for them.

It also cleans up the support for multiple chip types, and fixes a
glitch that could appear with an un-initialized RTC.

Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoeCryptfs: Move ecryptfs docs into Documentation/filesystems/
Josef 'Jeff' Sipek [Tue, 17 Jul 2007 11:04:54 +0000 (04:04 -0700)]
eCryptfs: Move ecryptfs docs into Documentation/filesystems/

Signed-off-by: Josef 'Jeff' Sipek <jsipek@cs.sunysb.edu>
Acked-by: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoCouple fixes to fs/ecryptfs/inode.c
Mika Kukkonen [Tue, 17 Jul 2007 11:04:53 +0000 (04:04 -0700)]
Couple fixes to fs/ecryptfs/inode.c

Following was uncovered by compiling the kernel with '-W' flag:

  CC [M]  fs/ecryptfs/inode.o
fs/ecryptfs/inode.c: In function â€˜ecryptfs_lookup’:
fs/ecryptfs/inode.c:304: warning: comparison of unsigned expression < 0 is always false
fs/ecryptfs/inode.c: In function â€˜ecryptfs_symlink’:
fs/ecryptfs/inode.c:486: warning: comparison of unsigned expression < 0 is always false

Function ecryptfs_encode_filename() can return -ENOMEM, so change the
variables to plain int, as in the first case the only real use actually
expects int, and in latter case there is no use beoynd the error check.

Signed-off-by: Mika Kukkonen <mikukkon@iki.fi>
Cc: Michael Halcrow <mhalcrow@us.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: enforce per-flavor id squashing
J. Bruce Fields [Tue, 17 Jul 2007 11:04:52 +0000 (04:04 -0700)]
knfsd: nfsd: enforce per-flavor id squashing

Allow root squashing to vary per-pseudoflavor, so that you can (for example)
allow root access only when sufficiently strong security is in use.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: allow auth_sys nlm on rpcsec_gss exports
J. Bruce Fields [Tue, 17 Jul 2007 11:04:52 +0000 (04:04 -0700)]
knfsd: nfsd: allow auth_sys nlm on rpcsec_gss exports

Our clients (like other clients, as far as I know) use only auth_sys for nlm,
even when using rpcsec_gss for the main nfs operations.

Administrators that want to deny non-kerberos-authenticated locking requests
will need to turn off NFS protocol versions less than 4....

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: secinfo handling without secinfo= option
J. Bruce Fields [Tue, 17 Jul 2007 11:04:51 +0000 (04:04 -0700)]
knfsd: nfsd4: secinfo handling without secinfo= option

We could return some sort of error in the case where someone asks for secinfo
on an export without the secinfo= option set--that'd be no worse than what
we've been doing.  But it's not really correct.  So, hack up an approximate
secinfo response in that case--it may not be complete, but it'll tell the
client at least one acceptable security flavor.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: implement secinfo
Andy Adamson [Tue, 17 Jul 2007 11:04:51 +0000 (04:04 -0700)]
knfsd: nfsd4: implement secinfo

Implement the secinfo operation.

(Thanks to Usha Ketineni wrote an earlier version of this support.)

Cc: Usha Ketineni <uketinen@us.ibm.com>
Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: rpc: add gss krb5 and spkm3 oid values
Usha Ketineni [Tue, 17 Jul 2007 11:04:50 +0000 (04:04 -0700)]
knfsd: rpc: add gss krb5 and spkm3 oid values

Adds oid values to the gss_api mechanism structures.  On the NFSV4 server
side, these are required as part of the security triple (oid,qop,service)
information being sent in the response of the SECINFO operation.

Signed-off-by: Usha Ketineni <uketinen@us.ibm.com>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: display export secinfo information
J. Bruce Fields [Tue, 17 Jul 2007 11:04:49 +0000 (04:04 -0700)]
knfsd: nfsd: display export secinfo information

Add secinfo information to the display in proc/net/sunrpc/nfsd.export/content.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: factor out code from show_expflags
J. Bruce Fields [Tue, 17 Jul 2007 11:04:49 +0000 (04:04 -0700)]
knfsd: nfsd: factor out code from show_expflags

Factor out some code to be shared by secinfo display code.  Remove some
unnecessary conditional printing of commas where we know the condition is
true.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: make readonly access depend on pseudoflavor
J. Bruce Fields [Tue, 17 Jul 2007 11:04:48 +0000 (04:04 -0700)]
knfsd: nfsd4: make readonly access depend on pseudoflavor

Allow readonly access to vary depending on the pseudoflavor, using the flag
passed with each pseudoflavor in the export downcall.  The rest of the flags
are ignored for now, though some day we might also allow id squashing to vary
based on the flavor.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: return nfserr_wrongsec
Andy Adamson [Tue, 17 Jul 2007 11:04:48 +0000 (04:04 -0700)]
knfsd: nfsd4: return nfserr_wrongsec

Make the first actual use of the secinfo information by using it to return
nfserr_wrongsec when an export is found that doesn't allow the flavor used on
this request.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: factor nfsd_lookup into 2 pieces
J. Bruce Fields [Tue, 17 Jul 2007 11:04:47 +0000 (04:04 -0700)]
knfsd: nfsd: factor nfsd_lookup into 2 pieces

Factor nfsd_lookup into nfsd_lookup_dentry, which finds the right dentry and
export, and a second part which composes the filehandle (and which will later
check the security flavor on the new export).

No change in behavior.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: use ip-address-based domain in secinfo case
J. Bruce Fields [Tue, 17 Jul 2007 11:04:46 +0000 (04:04 -0700)]
knfsd: nfsd: use ip-address-based domain in secinfo case

With this patch, we fall back on using the gss/pseudoflavor only if we fail to
find a matching auth_unix export that has a secinfo list.

As long as sec= options aren't used, there's still no change in behavior here
(except possibly for some additional auth_unix cache lookups, whose results
will be ignored).

The sec= option, however, is not actually enforced yet; later patches will add
the necessary checks.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: set rq_client to ip-address-determined-domain
J. Bruce Fields [Tue, 17 Jul 2007 11:04:46 +0000 (04:04 -0700)]
knfsd: nfsd: set rq_client to ip-address-determined-domain

We want it to be possible for users to restrict exports both by IP address and
by pseudoflavor.  The pseudoflavor information has previously been passed
using special auth_domains stored in the rq_client field.  After the preceding
patch that stored the pseudoflavor in rq_pflavor, that's now superfluous; so
now we use rq_client for the ip information, as auth_null and auth_unix do.

However, we keep around the special auth_domain in the rq_gssclient field for
backwards compatibility purposes, so we can still do upcalls using the old
"gss/pseudoflavor" auth_domain if upcalls using the unix domain to give us an
appropriate export.  This allows us to continue supporting old mountd.

In fact, for this first patch, we always use the "gss/pseudoflavor"
auth_domain (and only it) if it is available; thus rq_client is ignored in the
auth_gss case, and this patch on its own makes no change in behavior; that
will be left to later patches.

Note on idmap: I'm almost tempted to just replace the auth_domain in the idmap
upcall by a dummy value--no version of idmapd has ever used it, and it's
unlikely anyone really wants to perform idmapping differently depending on the
where the client is (they may want to perform *credential* mapping
differently, but that's a different matter--the idmapper just handles id's
used in getattr and setattr).  But I'm updating the idmapd code anyway, just
out of general backwards-compatibility paranoia.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: provide export lookup wrappers which take a svc_rqst
J. Bruce Fields [Tue, 17 Jul 2007 11:04:44 +0000 (04:04 -0700)]
knfsd: nfsd: provide export lookup wrappers which take a svc_rqst

Split the callers of exp_get_by_name(), exp_find(), and exp_parent() into
those that are processing requests and those that are doing other stuff (like
looking up filehandles for mountd).

No change in behavior, just a (fairly pointless, on its own) cleanup.

(Note this has the effect of making nfsd_cross_mnt() pass rqstp->rq_client
instead of exp->ex_client into exp_find_by_name().  However, the two should
have the same value at this point.)

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: remove superfluous assignment from nfsd_lookup
J. Bruce Fields [Tue, 17 Jul 2007 11:04:44 +0000 (04:04 -0700)]
knfsd: nfsd: remove superfluous assignment from nfsd_lookup

The "err" variable will only be used in the final return, which always happens
after either the preceding

err = fh_compose(...);

or after the following

err = nfserrno(host_err);

So the earlier assignment to err is ignored.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: simplify exp_pseudoroot arguments
J. Bruce Fields [Tue, 17 Jul 2007 11:04:43 +0000 (04:04 -0700)]
knfsd: nfsd4: simplify exp_pseudoroot arguments

We're passing three arguments to exp_pseudoroot, two of which are just fields
of the svc_rqst.  Soon we'll want to pass in a third field as well.  So let's
just give up and pass in the whole struct svc_rqst.

Also sneak in some minor style cleanups while we're at it.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: parse secinfo information in exports downcall
Andy Adamson [Tue, 17 Jul 2007 11:04:42 +0000 (04:04 -0700)]
knfsd: nfsd4: parse secinfo information in exports downcall

We add a list of pseudoflavors to each export downcall, which will be used
both as a list of security flavors allowed on that export, and (in the order
given) as the list of pseudoflavors to return on secinfo calls.

This patch parses the new downcall information and adds it to the export
structure, but doesn't use it for anything yet.

Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: store pseudoflavor in request
Andy Adamson [Tue, 17 Jul 2007 11:04:42 +0000 (04:04 -0700)]
knfsd: nfsd4: store pseudoflavor in request

Add a new field to the svc_rqst structure to record the pseudoflavor that the
request was made with.  For now we record the pseudoflavor but don't use it
for anything.

Signed-off-by: Andy Adamson <andros@citi.umich.edu>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: build rpcsec_gss whenever nfsd4 is built
J. Bruce Fields [Tue, 17 Jul 2007 11:04:41 +0000 (04:04 -0700)]
knfsd: nfsd4: build rpcsec_gss whenever nfsd4 is built

Select rpcsec_gss support whenever asked for NFSv4 support.  The rfc actually
requires gss, and gss is also the main reason to migrate to v4.  We already do
this on the client side.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: make all exp_finding functions return -errno's on err
J. Bruce Fields [Tue, 17 Jul 2007 11:04:40 +0000 (04:04 -0700)]
knfsd: nfsd: make all exp_finding functions return -errno's on err

Currently exp_find(), exp_get_by_name(), and friends, return an export on
success, and on failure return:

errors -EAGAIN (drop this request pending an upcall) or
-ETIMEDOUT (an upcall has timed out), or
return NULL, which can mean either that there was a memory allocation
failure, or that an export was not found, or that a passed-in
export lacks an auth_domain.

Many callers seem to assume that NULL means that an export was not found,
which may lead to bugs in the case of a memory allocation failure.

Modify these functions to distinguish between the two NULL cases by returning
either -ENOENT or -ENOMEM.  They now never return NULL.  We get to simplify
some code in the process.

We return -ENOENT in the case of a missing auth_domain.  This case should
probably be removed (or converted to a bug) after confirming that it can never
happen.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: don't delegate files that have had conflicts
Meelap Shah [Tue, 17 Jul 2007 11:04:40 +0000 (04:04 -0700)]
knfsd: nfsd4: don't delegate files that have had conflicts

One more incremental delegation policy improvement: don't give out a
delegation on a file if conflicting access has previously required that a
delegation be revoked on that file.  (In practice we'll forget about the
conflict when the struct nfs4_file is removed on close, so this is of limited
use for now, though it should at least solve a temporary problem with
self-conflicts on write opens from the same client.)

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: vary maximum delegation limit based on RAM size
Meelap Shah [Tue, 17 Jul 2007 11:04:39 +0000 (04:04 -0700)]
knfsd: nfsd4: vary maximum delegation limit based on RAM size

Our original NFSv4 delegation policy was to give out a read delegation on any
open when it was possible to.

Since the lifetime of a delegation isn't limited to that of an open, a client
may quite reasonably hang on to a delegation as long as it has the inode
cached.  This becomes an obvious problem the first time a client's inode cache
approaches the size of the server's total memory.

Our first quick solution was to add a hard-coded limit.  This patch makes a
mild incremental improvement by varying that limit according to the server's
total memory size, allowing at most 4 delegations per megabyte of RAM.

My quick back-of-the-envelope calculation finds that in the worst case (where
every delegation is for a different inode), a delegation could take about
1.5K, which would make the worst case usage about 6% of memory.  The new limit
works out to be about the same as the old on a 1-gig server.

[akpm@linux-foundation.org: Don't needlessly bloat vmlinux]
[akpm@linux-foundation.org: Make it right for highmem machines]
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd: remove unused header interface.h
J. Bruce Fields [Tue, 17 Jul 2007 11:04:38 +0000 (04:04 -0700)]
knfsd: nfsd: remove unused header interface.h

It looks like Al Viro gutted this header file five years ago and it hasn't
been touched since.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: fix handling of acl errrors
J. Bruce Fields [Tue, 17 Jul 2007 11:04:37 +0000 (04:04 -0700)]
knfsd: nfsd4: fix handling of acl errrors

nfs4_acl_nfsv4_to_posix() returns an error and returns any posix acls
calculated in two caller-provided pointers.  It was setting these pointers to
-errno in some error cases, resulting in nfsd4_set_nfs4_acl() calling
posix_acl_release() with a -errno as an argument.

Fix both the caller and the callee, by modifying nfsd4_set_nfs4_acl() to
stop relying on the passed-in-pointers being left as NULL in the error
case, and by modifying nfs4_acl_nfsv4_to_posix() to stop returning
garbage in those pointers.

Thanks to Alex Soule for reporting the bug.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Cc: Alexander Soule <soule@umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: fix enc_stateid_sz for nfsd callbacks
Benny Halevy [Tue, 17 Jul 2007 11:04:37 +0000 (04:04 -0700)]
knfsd: nfsd4: fix enc_stateid_sz for nfsd callbacks

enc_stateid_sz should be given in u32 words units, not bytes, so we were
overestimating the buffer space needed here.

Signed-off-by: Benny Halevy <bhalevy@panasas.com>
Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: silence a compiler warning in ACL code
J. Bruce Fields [Tue, 17 Jul 2007 11:04:36 +0000 (04:04 -0700)]
knfsd: nfsd4: silence a compiler warning in ACL code

Silence a compiler warning in the ACL code, and add a comment making clear the
initialization serves no other purpose.

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: nfsd4: fix NFSv4 filehandle size units confusion
J. Bruce Fields [Tue, 17 Jul 2007 11:04:35 +0000 (04:04 -0700)]
knfsd: nfsd4: fix NFSv4 filehandle size units confusion

NFS4_FHSIZE is measured in bytes, not 4-byte words, so much more space than
necessary is being allocated for struct nfs4_cb_recall.

I should have wondered why this structure was so much larger than it needed to
be!

Signed-off-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: lockd: nfsd4: use same grace period for lockd and nfsd4
Marc Eshel [Tue, 17 Jul 2007 11:04:35 +0000 (04:04 -0700)]
knfsd: lockd: nfsd4: use same grace period for lockd and nfsd4

Both lockd and (in the nfsv4 case) nfsd enforce a "grace period" after reboot,
during which clients may reclaim locks from the previous server instance, but
may not acquire new locks.

Currently the lockd and nfsd enforce grace periods of different lengths.  This
may cause problems when we reboot a server with both v2/v3 and v4 clients.
For example, if the lockd grace period is shorter (as is likely the case),
then a v3 client might acquire a new lock that conflicts with a lock already
held (but not yet reclaimed) by a v4 client.

This patch calculates a lease time that lockd and nfsd can both use.

Signed-off-by: Marc Eshel <eshel@almaden.ibm.com>
Signed-off-by: J. Bruce Fields <bfields@citi.umich.edu>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agonfsd warning fix
Andrew Morton [Tue, 17 Jul 2007 11:04:34 +0000 (04:04 -0700)]
nfsd warning fix

gcc-4.3:

fs/nfsd/nfsctl.c: In function 'write_getfs':
fs/nfsd/nfsctl.c:248: warning: cast from pointer to integer of different size

Cc: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: exportfs: split out reconnecting a dentry from find_exported_dentry
Christoph Hellwig [Tue, 17 Jul 2007 11:04:33 +0000 (04:04 -0700)]
knfsd: exportfs: split out reconnecting a dentry from find_exported_dentry

There's a clear subfunctionality of reconnecting a given dentry to the main
dentry tree in find_exported_dentry, that can be called both for the dentry
we're looking for or it's parent directory.

This patch splits the subfunctionality out into a separate helper to make the
code more readable and document it's intent.  As a nice side-optimization we
can avoid getting a superfluous dentry reference count in the case we need to
reconnect a directory on it's own.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: exportfs: add find_disconnected_root helper
Christoph Hellwig [Tue, 17 Jul 2007 11:04:32 +0000 (04:04 -0700)]
knfsd: exportfs: add find_disconnected_root helper

Break the loop that finds the root of a disconnected subtree into a helper of
its own to make reading easier and document the intent.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: exportfs: move acceptable check into find_acceptable_alias
Christoph Hellwig [Tue, 17 Jul 2007 11:04:32 +0000 (04:04 -0700)]
knfsd: exportfs: move acceptable check into find_acceptable_alias

All callers of find_acceptable_alias check if the current dentry is acceptable
before looking for other acceptable aliases using find_acceptable_alias.  Move
the check into find_acceptable_alias to make the code a little more dense and
add a comment to find_acceptable_alias that documents its intent.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: exportfs: untangle ISDIR logic in find_exported_dentry
Christoph Hellwig [Tue, 17 Jul 2007 11:04:31 +0000 (04:04 -0700)]
knfsd: exportfs: untangle ISDIR logic in find_exported_dentry

Rework some logic in find_exported_dentry so that we only have a single
S_ISDIR check and logic that makes clear to the reader what we're really doing
here.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: exportfs: remove CALL macro
Christoph Hellwig [Tue, 17 Jul 2007 11:04:31 +0000 (04:04 -0700)]
knfsd: exportfs: remove CALL macro

Currently exportfs uses a way to call methods very differently from the rest
of the kernel.  This patch changes it to the standard conventions for method
calls.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: exportfs: add procedural interface for NFSD
Christoph Hellwig [Tue, 17 Jul 2007 11:04:30 +0000 (04:04 -0700)]
knfsd: exportfs: add procedural interface for NFSD

Currently NFSD calls directly into filesystems through the export_operations
structure.  I plan to change this interface in various ways in later patches,
and want to avoid the export of the default operations to NFSD, so this patch
adds two simple exportfs_encode_fh/exportfs_decode_fh helpers for NFSD to call
instead of poking into exportfs guts.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoknfsd: exportfs: remove iget abuse
Christoph Hellwig [Tue, 17 Jul 2007 11:04:29 +0000 (04:04 -0700)]
knfsd: exportfs: remove iget abuse

When the exportfs interface was added the expectation was that filesystems
provide an operation to convert from a file handle to an inode/dentry, but it
kept a backwards compat option that still calls into iget.

Calling into iget from non-filesystem code is very bad, because it gives too
little information to filesystem, and simply crashes if the filesystem doesn't
implement the ->read_inode routine.

Fortunately there are only two filesystems left using this fallback: efs and
jfs.  This patch moves a copy of export_iget to each of those to implement the
get_dentry method.

While this is a temporary increase of lines of code in the kernel it allows
for a much cleaner interface and important code restructuring in later
patches.

[akpm@linux-foundation.org: add jfs_get_inode_flags() declaration]
Signed-off-by: Dave Kleikamp <shaggy@linux.vnet.ibm.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>