safe/jmp/linux-2.6
16 years agoUSB: Don't let usb-storage steal Blackberry Pearl
Jeremy Katz [Thu, 19 Jul 2007 13:37:42 +0000 (09:37 -0400)]
USB: Don't let usb-storage steal Blackberry Pearl

The Blackberry Pearl can run in two modes; a usb-storage only mode
and a mode that allows access via mass storage and to its database.
The berry_charge module will set the device to dual mode and thus we
should ignore its native mode if that module is built

Signed-off-by: Jeremy Katz <katzj@redhat.com>
Signed-off-by: Phil Dibowitz <phil@ipom.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoUSB: devices misc: Trivial patch to build the IOWARRIOR when it is selected in Kconfig
Juergen Beisert [Thu, 19 Jul 2007 15:02:59 +0000 (17:02 +0200)]
USB: devices misc: Trivial patch to build the IOWARRIOR when it is selected in Kconfig

Trivial patch to build the IOWARRIOR when it is selected in Kconfig.

Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
16 years agoIB/ipath: Workaround problem of errormask register being overwritten
Dave Olson [Fri, 20 Jul 2007 21:41:26 +0000 (14:41 -0700)]
IB/ipath: Workaround problem of errormask register being overwritten

On some system hardware, we are seeing moderately common cases of the
chip errormask register being overwritten due to a chip bug in iba6120
that is triggered by a vendor-specific PCIe broadcast message.  This
patch merely checks periodically, and corrects it if needed (the
overwrite can cause us to not get error and hardware error
interrupts).  Also, make dd->ipath_errormask the one, true canonical
source for kr_errormask, and remove references to ipath_ignorederrs as
it is currently unused.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: John Gregor <john.gregor@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Fix some issues with buffer cancel and sendctrl register update
Dave Olson [Fri, 20 Jul 2007 21:23:37 +0000 (14:23 -0700)]
IB/ipath: Fix some issues with buffer cancel and sendctrl register update

There was confused use of INFINIPATH_S_PIOBUFAVAILUPD (value) and
IPATH_S_PIOBUFAVAILUPD (bit position).  Also, some callers of
ipath_cancel_sends() need kr_sendctrl restored, and some want to do it
later.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Use faster put_tid_2 routine after initialization
Dave Olson [Fri, 20 Jul 2007 20:34:02 +0000 (13:34 -0700)]
IB/ipath: Use faster put_tid_2 routine after initialization

At one time the ipath_minrev field was initialized prior to the
ipath_init_iba6120_funcs call, but that is no longer the case, so the
slower put_tid routine was always being used.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/ipath: Remove unsafe fastrcvint code from interrupt handler
Dave Olson [Fri, 20 Jul 2007 19:50:55 +0000 (12:50 -0700)]
IB/ipath: Remove unsafe fastrcvint code from interrupt handler

The fastrcvint code's purpose was to avoid reading the interrupt
status if kernel packets were in the receive queue (to reduce
overhead).  Because intstatus was not read, we could miss the error
interrupt bit indicating freeze mode, since it only delivers a single
interrupt, even if still pending after intclear is written.

This patch removes that unsafe optimization.

Signed-off-by: Dave Olson <dave.olson@qlogic.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoFix a potential NULL pointer dereference in mace_interrupt() in drivers/net/pcmcia...
Micah Gruber [Tue, 24 Jul 2007 02:44:56 +0000 (10:44 +0800)]
Fix a potential NULL pointer dereference in mace_interrupt() in drivers/net/pcmcia/nmclan_cs.c

This patch fixes a potential null dereference bug where we dereference
DEV before a null check. This patch simply moves the dereferencing after
the null check.

Signed-off-by: Micah Gruber <micah.gruber@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoPATCH kernel 2.6.22] PCMCIA-NETDEV : modify smc91c92_cs.c to become SMP safe
Komuro [Mon, 23 Jul 2007 12:36:06 +0000 (21:36 +0900)]
PATCH kernel 2.6.22] PCMCIA-NETDEV : modify smc91c92_cs.c to become SMP safe

protect smc_start_xmit, smc_interrupt and media_check by spin_lock.

Signed-off-by: Komuro <komurojun-mbn@nifty.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoS2io: Increment received packet count correctly
Ramkrishna Vepa [Thu, 26 Jul 2007 02:43:12 +0000 (19:43 -0700)]
S2io: Increment received packet count correctly

 - Fix to increment the received packet count correctly.

(Resending; Removed HTML sections in the patch)

Signed-off-by: Santosh Rastapur <santosh.rastapur@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoS2io: Fix crash when resetting adapter
Ramkrishna Vepa [Thu, 26 Jul 2007 02:40:33 +0000 (19:40 -0700)]
S2io: Fix crash when resetting adapter

- Removed the call to pci_set_power_state to reset the adapter as it was resulting
  in system crash on some platforms.

(Resending; Removed HTML sections in the patch)

Signed-off-by: Santosh Rastapur <santosh.rastapur@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoS2io: Mask spurious interrupts
Ramkrishna Vepa [Thu, 26 Jul 2007 02:35:09 +0000 (19:35 -0700)]
S2io: Mask spurious interrupts

- Mask single and double bit ETQ ecc errors to inhibit spurious interrupts.

(Resending; Removed HTML sections in the patch)

Signed-off-by: Santosh Rastapur <santosh.rastapur@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoS2IO: Implementing review comments from old patches
Veena Parat [Mon, 23 Jul 2007 06:39:43 +0000 (02:39 -0400)]
S2IO: Implementing review comments from old patches

 - Incorporated Jeff Garzik's comments on coding standards

Signed-off-by: Veena Parat <veena.parat@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoS2IO: Checking for the return value of pci map function
Veena Parat [Mon, 23 Jul 2007 06:37:14 +0000 (02:37 -0400)]
S2IO: Checking for the return value of pci map function

 - Checking for the return value of pci map function
 - Implemented Francois Romieu's comments on eliminating code duplication
   using goto
 - Implemented Francois Romieu's comments on using a temporary variable for
   accessing statistics structure

Signed-off-by: Veena Parat <veena.parat@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoS2IO: Removing MSI support from driver
Veena Parat [Mon, 23 Jul 2007 06:23:54 +0000 (02:23 -0400)]
S2IO: Removing MSI support from driver

 - Removed MSI support from driver - unused feature
 - Replaced request_mem_region with pci_request_regions

Signed-off-by: Veena Parat <veena.parat@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoS2IO: Removing 3 buffer mode support from the driver
Veena Parat [Mon, 23 Jul 2007 06:20:51 +0000 (02:20 -0400)]
S2IO: Removing 3 buffer mode support from the driver

 - Removed 3 buffer mode support from driver - unused feature
 - Incorporated Jeff Garzik's comments on elimination of inline typecasting
 - Code cleanup : Removed a few extra spaces

Signed-off-by: Veena Parat <veena.parat@neterion.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agonetxen: drop redudant spinlock
Dhananjay Phadke [Fri, 27 Jul 2007 17:42:11 +0000 (23:12 +0530)]
netxen: drop redudant spinlock

Some leftover code that makes use of adapter->lock in tx_timeout function,
which resets the interface under this lock. In close() when the workqueue
is flushed, prints the warning about sleeping with interrupts disabled
(when spinlock debug is enabled). The lock was required with private netxen
IOCTLs, which were removed a while ago.

Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agonetxen: Fix interrupt handling for multiport adapters
dhananjay@netxen.com [Wed, 25 Jul 2007 14:43:12 +0000 (20:13 +0530)]
netxen: Fix interrupt handling for multiport adapters

This patch fixes masking of interrupts on multiport adapters. Also disables
interrupts upon ifdown interface. The wrong mask could result in interrupt
flood after interface is down.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agonetxen: re-init station address after h/w init
dhananjay@netxen.com [Wed, 25 Jul 2007 14:43:11 +0000 (20:13 +0530)]
netxen: re-init station address after h/w init

This is a workaround for firmware bug with 2nd port of multiport adapter,
where MAC address is reset. Driver just needs to overwrite it with the
value read from PROM.

Signed-off-by: Dhananjay Phadke <dhananjay@netxen.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agotulip: Remove tulip maintainer
Valerie Henson [Mon, 30 Jul 2007 19:10:52 +0000 (13:10 -0600)]
tulip: Remove tulip maintainer

Remove Val Henson as tulip maintainer and let her roam free, FREE!

Signed-off-by: Val Henson <val@nmt.edu>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoforcedeth: mac address correct
Ayaz Abdulla [Fri, 27 Jul 2007 03:46:00 +0000 (23:46 -0400)]
forcedeth: mac address correct

In older chipsets, the mac address was stored in reversed order.
However, in newer chipsets, the mac address is in correct order. This
patch takes those newer chipsets into account and does not rely on a
special bit setup by BIOS'.

Signed-Off-By: Ayaz Abdulla <aabdulla@nvidia.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agogfar: Fix modpost warning
Kumar Gala [Thu, 26 Jul 2007 05:52:34 +0000 (00:52 -0500)]
gfar: Fix modpost warning

Fix the following modpost warning:

WARNING: vmlinux.o(.init.text+0x1aa6c): Section mismatch: reference to .exit.text:gfar_mdio_exit (between 'gfar_init' and 'gfar_mdio_init')

Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agolib8390: comment on locking by Alan Cox
Jarek Poplawski [Thu, 26 Jul 2007 12:44:01 +0000 (14:44 +0200)]
lib8390: comment on locking by Alan Cox

Additional explanation of problems with locking by Alan Cox.

Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Cc: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoFix a potential NULL pointer dereference in write_bulk_callback() in drivers/net...
Micah Gruber [Mon, 23 Jul 2007 08:05:52 +0000 (16:05 +0800)]
Fix a potential NULL pointer dereference in write_bulk_callback() in drivers/net/usb/pegasus.c

This patch fixes a potential null dereference bug where we dereference
pegasus before a null check. This patch simply moves the dereferencing
after the null check.

Signed-off-by: Micah Gruber <micah.gruber@gmail.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
16 years agoMerge branch 'to-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/christoph...
Linus Torvalds [Mon, 30 Jul 2007 19:39:15 +0000 (12:39 -0700)]
Merge branch 'to-linus' of git://git./linux/kernel/git/christoph/slab

* 'to-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/christoph/slab:
  slub: fix bug in slub debug support
  slub: add lock debugging check

16 years agoMerge branch 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab...
Linus Torvalds [Mon, 30 Jul 2007 19:38:57 +0000 (12:38 -0700)]
Merge branch 'master' of ssh:///linux/kernel/git/mchehab/v4l-dvb

* 'master' of ssh://master.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb:
  V4L/DVB (5939): dvb-pll: make struct dvb_pll_fcv1236d static
  V4L/DVB (5933): Dvb-usb/af9005-fe.c: error check fixes
  V4L/DVB (5932): Af9005 fix tuner module unload
  V4L/DVB (5920): ivtv: fix incorrect fw size report.
  V4L/DVB (5918): ivtv: fix TV-out VBI handling, only reset on last close.
  V4L/DVB (5917): ivtv: improve mailbox responsiveness.
  V4L/DVB (5916): ivtv: fix pause/continue/play handling
  V4L/DVB (5900): usbvision: fix bugs [sg]_register functions
  V4L/DVB (5899): bttv: Fix Viewcast Osprey 440 support
  V4L/DVB (5893): DVB: fix includes of video.h when __KERNEL__ is undefined
  V4L/DVB (5891): zr36067: Turn off raw capture properly
  V4L/DVB (5890): zr36067: Add UYVY, RGB555X, RGB565X, and RGB32 formats
  V4L/DVB (5888): zr36067: Driver was not returning correct image size
  V4L/DVB (5887): zr36067: Fix poll() operation
  V4L/DVB (5886): zr36067: Fix problem setting norms

16 years agoV4L/DVB (5939): dvb-pll: make struct dvb_pll_fcv1236d static
Adrian Bunk [Sun, 29 Jul 2007 15:40:48 +0000 (12:40 -0300)]
V4L/DVB (5939): dvb-pll: make struct dvb_pll_fcv1236d static

The fcv1236d support patch was created before the "dvb: remove static
dependencies on dvb-pll" patch was applied, but the fcv1236d patch didn't
get merged until after the fact.

struct dvb_pll_fcv1236d can become static.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5933): Dvb-usb/af9005-fe.c: error check fixes
Adrian Bunk [Fri, 27 Jul 2007 14:09:57 +0000 (11:09 -0300)]
V4L/DVB (5933): Dvb-usb/af9005-fe.c: error check fixes

This patch:
- adds a missing error check and
- removes an error check that could never be true

Both spotted by the Coverity checker.

Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5932): Af9005 fix tuner module unload
Luca Olivetti [Fri, 27 Jul 2007 13:27:47 +0000 (10:27 -0300)]
V4L/DVB (5932): Af9005 fix tuner module unload

This patch removes the useless tuner field and avoids a double free of
the tuner (either mt2060 or qt1010).

Signed-off-by: Luca Olivetti <luca@ventoso.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5920): ivtv: fix incorrect fw size report.
Hans Verkuil [Sun, 22 Jul 2007 14:12:26 +0000 (11:12 -0300)]
V4L/DVB (5920): ivtv: fix incorrect fw size report.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5918): ivtv: fix TV-out VBI handling, only reset on last close.
Hans Verkuil [Sun, 22 Jul 2007 12:39:56 +0000 (09:39 -0300)]
V4L/DVB (5918): ivtv: fix TV-out VBI handling, only reset on last close.

While decoding (MPEG or YUV) is active or when VBI output is in use, then
do not clear the VBI output of the saa7127. Only after the last user is
gone can we clear it.

This fixes the case where playback was stopped, another channel was chosen
and playback was restarted, while /dev/vbi16 was used to set the WSS
(widescreen) setting. Without this fix the WSS was reset on every stop
instead of just keeping the last value.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5917): ivtv: improve mailbox responsiveness.
Hans Verkuil [Sun, 22 Jul 2007 11:49:32 +0000 (08:49 -0300)]
V4L/DVB (5917): ivtv: improve mailbox responsiveness.

First try polling for the result of a mailbox command, then
switch to a test/sleep loop. Also reduce the sleep time from 10 ms
to 1 ms. Improves the responsiveness of the mailbox handling.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5916): ivtv: fix pause/continue/play handling
Hans Verkuil [Sun, 22 Jul 2007 11:46:38 +0000 (08:46 -0300)]
V4L/DVB (5916): ivtv: fix pause/continue/play handling

Pausing a decoder followed by a Play command would do nothing. Fixed.
Pausing a decoder running at non-standard speed following by a Continue
would reset the speed to 100%. Fixed.

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5900): usbvision: fix bugs [sg]_register functions
Trent Piepho [Mon, 23 Jul 2007 09:58:31 +0000 (06:58 -0300)]
V4L/DVB (5900): usbvision: fix bugs [sg]_register functions

s_register was assigning the return code to (unsigned)reg->val, rather than
errCode, which it what it would return.  Except reg->val can't be < 0, so it
would never actually return an error.

g_register never actually put the value it read into reg->val.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5899): bttv: Fix Viewcast Osprey 440 support
Trent Piepho [Sun, 22 Jul 2007 00:26:40 +0000 (21:26 -0300)]
V4L/DVB (5899): bttv: Fix Viewcast Osprey 440 support

Various gpio and mux settings for the Osprey 440 weren't correct.  Fix them
and provide some documentation about how the gpios work.

The osprey eeprom routine wasn't run for the 440, add it.  It was also crap,
re-written to be better.

Add the Osprey 440 to the Bt878 ALSA driver's whitelist.  Currently the sample
rate is fixed at 32kHz, as the driver doesn't support different rates for
digital input mode, though the card can select the rate from 32, 44.1, or 48
kHz via gpio.

Setting the audio gain via ALSA isn't supported yet; a userspace tool that
programs the X9221 via i2c-dev must be used.

The Bt878 digital audio format isn't programmed correctly for the CS5331A ADC
used, resulting in extremely garbled sound.  That is fixed in a followup
patch.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5893): DVB: fix includes of video.h when __KERNEL__ is undefined
Anssi Hannula [Fri, 20 Jul 2007 20:18:10 +0000 (17:18 -0300)]
V4L/DVB (5893): DVB: fix includes of video.h when __KERNEL__ is undefined

linux/dvb/video.h uses types __u32, __s32, etc., but does not include
any header defining those when __KERNEL__ is not defined.

Fix this by including asm/types.h when __KERNEL__ is not defined.

Signed-off-by: Anssi Hannula <anssi.hannula@gmail.com>
Signed-off-by: Michael Krufky <mkrufky@linuxtv.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5891): zr36067: Turn off raw capture properly
Trent Piepho [Tue, 17 Jul 2007 21:29:45 +0000 (18:29 -0300)]
V4L/DVB (5891): zr36067: Turn off raw capture properly

When raw capture was turned off, the current capturing frame (v4l_grab_frame)
wasn't reset to NO_GRAB_ACTIVE.  If capture was turned back on, the driver
would think this frame was currently being captured, and wait for it to
complete before starting a new frame.  The hardware on the other hand would
not be actively capturing a frame.  The result was the driver would wait
forever for v4l_grab_frame to be captured.

Some calls to zr36057_set_memgrab(0) were missing spin-locks, which have been
added.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5890): zr36067: Add UYVY, RGB555X, RGB565X, and RGB32 formats
Trent Piepho [Tue, 17 Jul 2007 21:29:44 +0000 (18:29 -0300)]
V4L/DVB (5890): zr36067: Add UYVY, RGB555X, RGB565X, and RGB32 formats

Add support for the UYVY and the other big endian output formats.  The
driver was naming formats based on the host endianess.  This is different
that all the other drivers appear to work and not what software appears
to expect.

Use ARRAY_SIZE() to find the the size of the zoran_formats array.

Change the way the driver handles setting the video format register.  Rather
than use some if and switch statements to set to register by looking at the
format id, the format list simply has a field with the proper bits to set.

Adds a bit of ifdef to make a driver without V4L1 support more possible.
Also create a macro for defining formats that handles vl41 and/or vl42
support to avoid repeated ifdefs in the format list.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5888): zr36067: Driver was not returning correct image size
Trent Piepho [Tue, 17 Jul 2007 21:29:43 +0000 (18:29 -0300)]
V4L/DVB (5888): zr36067: Driver was not returning correct image size

The driver was returning the size of the (fixed) buffer it allocated as the
sizeimage field in the v4l2 pixel format, rather than the actual size of the
image.  For example, a 192x128 YUYV image is 49152 bytes but the driver would
always return 131072 bytes since if that was the size of the v4l buffer.

This violates the v4l2 spec, which says that sizeimage should be the actual
size of the image for uncompressed formats.  It also caused mplayer to crash.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5887): zr36067: Fix poll() operation
Trent Piepho [Tue, 17 Jul 2007 21:29:43 +0000 (18:29 -0300)]
V4L/DVB (5887): zr36067: Fix poll() operation

During uncompressed capture, the poll() function was looking the wrong frame.
It was using the frame the driver was going to capture into next (pend_tail),
when it should have been looking at the next frame to be de-queued with
DQBUF/SYNC (sync_tail).

It also wasn't looking in the right spot.  It was looking at the file handle's
copy of the buffer status, rather than the driver core copy.  The interrupt
routine marks frames as done in the driver core copy, the file handle copy
isn't updated.  So even if poll() looked at the right frame, it would never
see it transition to done and return POLLIN.

The compressed capture code has this same problem, looking in fh->jpg_buffers
when it should have used zr->jpg_buffers.

There was some logic to detect when there was no current capture in process
nor any frames queued and try to return an error, which ends up being a bad
idea.  It's possible to call select() from one thread while no capture is in
process, or no frames queued, and then start a capture or queue frames from
another thread.

The buffer state variables are protected by a spin lock, which the code wasn't
acquiring.  That is fixed too.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoV4L/DVB (5886): zr36067: Fix problem setting norms
Trent Piepho [Tue, 17 Jul 2007 21:29:42 +0000 (18:29 -0300)]
V4L/DVB (5886): zr36067: Fix problem setting norms

The zr36067 driver doesn't make a distinction between the different sub-types
of NTSC, PAL, or SECAM norms.  For example, when the enum std ioctl returns
the PAL standard it returns PAL_BG|PAL_DK|PAL_H|PAL_I.

When setting the norm, it required the bitmask to match exactly the set of
norms used during the enumeration.  If just one norm was specified, for
example PAL_BG or NTSC_M, it would fail.  This violates the V4L2 spec,
"VIDIOC_S_STD accepts *one* or more flags..."

The key thing to realize is that V4L2_STD_PAL is not one bit, it is multiple
bits.  It's ok to call S_STD with any *one* of those bits, but the driver was
requiring *all* of them.

This fixes the S_STD function so that it will accept any set of one or more
PAL norms as PAL, and the same for NTSC and SECAM.

Signed-off-by: Trent Piepho <xyzzy@speakeasy.org>
Acked-by: Ronald S. Bultje <rbultje@ronald.bitfreak.net>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
16 years agoFallout from "Remove fs.h from mm.h" patch
Alexey Dobriyan [Mon, 30 Jul 2007 19:08:46 +0000 (23:08 +0400)]
Fallout from "Remove fs.h from mm.h" patch

While I was busy compile-testing my patch, ENOSYS sneaked into pm.h
leading to some compile-breakages mostly on ia64 and some mips configs.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoslub: fix bug in slub debug support
Peter Zijlstra [Thu, 26 Jul 2007 18:54:34 +0000 (20:54 +0200)]
slub: fix bug in slub debug support

We ClearSlabDebug() before the last SlabDebug() check. Clear it later.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
16 years agoslub: add lock debugging check
Peter Zijlstra [Thu, 26 Jul 2007 18:01:38 +0000 (20:01 +0200)]
slub: add lock debugging check

Ingo noticed that the SLUB code does include the lock debugging free
check.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Signed-off-by: Christoph Lameter <clameter@sgi.com>
16 years agoMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
Linus Torvalds [Mon, 30 Jul 2007 18:06:55 +0000 (11:06 -0700)]
Merge branch 'master' of /linux/kernel/git/davem/sparc-2.6

* 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
  [SPARC64]: Fix show_stack() when stack argument is NULL.
  [SPARC]: Fix serial console node string creation.
  [SPARC]: Mark SBUS framebuffer ioctls as IGNORE in compat_ioctl.c
  [SPARC64]: asm-sparc64/floppy.h needs linux/pci.h
  [SPARC64]: Fix conflicts in SBUS/PCI/EBUS/ISA DMA handling.
  [VIDEO]: Fix OOPS in all SBUS framebuffer drivers.
  [SPARC64]: Handle mostek clock type in mini_rtc driver.
  [PARTITION]: Sun/Solaris VTOC table corrections
  [SPARC]: Fix floppy on some sun4c systems.
  [SPARC64]: Fix sun4u PCI config space accesses on sun4u.
  [PARTITION] MSDOS: Fix Sun num_partitions handling.
  [SPARC]: Update defconfig.

16 years agoAPM support depends on CONFIG_PM_SLEEP
Stephen Rothwell [Mon, 30 Jul 2007 10:12:37 +0000 (20:12 +1000)]
APM support depends on CONFIG_PM_SLEEP

Commit 296699de6bdc717189a331ab6bbe90e05c94db06 broke building APM
support if CONFIG_PM_SLEEP is not set.

Reported by Toralf Förster <toralf.foerster@gmx.de>

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
[ Simplified a bit as suggested by Rafael.   -Linus ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agom32r: build fix for removing fs.h from mm.h
Hirokazu Takata [Mon, 30 Jul 2007 13:00:47 +0000 (22:00 +0900)]
m32r: build fix for removing fs.h from mm.h

This patch fixes the m32r build after the commit "Remove fs.h from mm.h"
was merged (commit 4e950f6f0189f65f8bf069cf2272649ef418f5e4).

Signed-off-by: Hirokazu Takata <takata@linux-m32r.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agosetup and detect 2nd phy on MCF5275 in FEC driver
Mike Cruse [Mon, 30 Jul 2007 06:29:29 +0000 (16:29 +1000)]
setup and detect 2nd phy on MCF5275 in FEC driver

Added code to recognize the second interface on M5275 boards.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoclean up reading of ICR register in FEC driver
Greg Ungerer [Mon, 30 Jul 2007 06:29:16 +0000 (16:29 +1000)]
clean up reading of ICR register in FEC driver

On the MCF5272, there is no need to read the ICR before writing it :
the bit 4n+3 is a write-enable for the bits 4n,4n+1 and 4n+2.

Signed-off-by: Philippe De Muyter <phdm@macqel.be>
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofix work queues in FEC driver
Greg Ungerer [Mon, 30 Jul 2007 06:29:09 +0000 (16:29 +1000)]
fix work queues in FEC driver

Fix the work queue code in the FEC driver.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoremove unused config symbol from FEC driver
Greg Ungerer [Mon, 30 Jul 2007 06:28:57 +0000 (16:28 +1000)]
remove unused config symbol from FEC driver

Removed unused CONFIG symbol and its conditional code from FEC driver.
Pointed out by Robert P. J. Day <rpjday@mindspring.com>.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoinclude cacheflush.h in FEC driver
Greg Ungerer [Mon, 30 Jul 2007 06:28:46 +0000 (16:28 +1000)]
include cacheflush.h in FEC driver

Include cacheflush.h to get definitions for cache functions used
in this code.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years ago[SPARC64]: Fix show_stack() when stack argument is NULL.
David S. Miller [Mon, 30 Jul 2007 07:17:12 +0000 (00:17 -0700)]
[SPARC64]: Fix show_stack() when stack argument is NULL.

It didn't handle that case at all, and now dump_stack()
can be implemented directly as show_stack(current, NULL)

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SPARC]: Fix serial console node string creation.
David S. Miller [Sun, 29 Jul 2007 09:10:37 +0000 (02:10 -0700)]
[SPARC]: Fix serial console node string creation.

The string setting code depends upon the original value of the
"skip" variable, not the one that gets modified by the node
traversal loop.

Based upon a patch by Mark Fortescue.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SPARC]: Mark SBUS framebuffer ioctls as IGNORE in compat_ioctl.c
David S. Miller [Sun, 29 Jul 2007 07:50:42 +0000 (00:50 -0700)]
[SPARC]: Mark SBUS framebuffer ioctls as IGNORE in compat_ioctl.c

They are handled in a ->compat_ioctl() handler, so it's just noise
when compat_ioctl.c warns which occurs when they are used on non-SBUS
framebuffer devices.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SPARC64]: asm-sparc64/floppy.h needs linux/pci.h
David S. Miller [Sun, 29 Jul 2007 06:39:30 +0000 (23:39 -0700)]
[SPARC64]: asm-sparc64/floppy.h needs linux/pci.h

It uses pci_dev, calls pci_map_*(), etc.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SPARC64]: Fix conflicts in SBUS/PCI/EBUS/ISA DMA handling.
David S. Miller [Sat, 28 Jul 2007 05:39:14 +0000 (22:39 -0700)]
[SPARC64]: Fix conflicts in SBUS/PCI/EBUS/ISA DMA handling.

Fully unify all of the DMA ops so that subordinate bus types to
the DMA operation providers (such as ebus, isa, of_device) can
work transparently.

Basically, we just make sure that for every system device we
create, the dev->archdata 'iommu' and 'stc' fields are filled
in.

Then we have two platform variants of the DMA ops, one for SUN4U which
actually programs the real hardware, and one for SUN4V which makes
hypervisor calls.

This also fixes the crashes in parport_pc on sparc64, reported by
Meelis Roos.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[VIDEO]: Fix OOPS in all SBUS framebuffer drivers.
David S. Miller [Sat, 28 Jul 2007 05:31:46 +0000 (22:31 -0700)]
[VIDEO]: Fix OOPS in all SBUS framebuffer drivers.

All of these drivers use a silly:

struct all_info {
struct fb_info info;
struct foo_par par;
};

struct all_info *all = kzalloc(sizeof(*all), GFP_KERNEL);
all->info.par = &all->par;

etc. etc. code sequence, basically replicating the provided
framebuffer_alloc()/framebuffer_release(), and doing it badly.

Not only is this massive code duplication, it also caused a
bug in that we weren't setting the fb_info->device pointer
which results in an OOPS when fb_is_primary_device() runs.

Fix all of this by using framebuffer_{alloc,release}() and
passing in "&of_device->dev" as the device pointer.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SPARC64]: Handle mostek clock type in mini_rtc driver.
David S. Miller [Fri, 27 Jul 2007 21:40:27 +0000 (14:40 -0700)]
[SPARC64]: Handle mostek clock type in mini_rtc driver.

Now that drivers/sbus/char/rtc.c is sparc32 only, we need this.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PARTITION]: Sun/Solaris VTOC table corrections
Mark Fortescue [Thu, 26 Jul 2007 07:17:22 +0000 (00:17 -0700)]
[PARTITION]: Sun/Solaris VTOC table corrections

Start doing VTOC validation before using its contents.
The validation is adjusted so as not to break existing setups
that do not set the VTOC version, sanity and partition count entries.
VTOC tables with more than 8 partitions will NOT be used.

Signed-off-by: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SPARC]: Fix floppy on some sun4c systems.
Mark Fortescue [Thu, 26 Jul 2007 06:45:10 +0000 (23:45 -0700)]
[SPARC]: Fix floppy on some sun4c systems.

Add in code to support an 82077 FDC on sun4c systems. There is a
problem with spurious interrupts but it does apear to work.

Testing on my SS2 (82072A FDC) shows that the floppy driver is not
100% with sun4c any way (any spurious interrupt kills it, requiring a
reboot to recover).

Signed-off-by: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SPARC64]: Fix sun4u PCI config space accesses on sun4u.
David S. Miller [Thu, 26 Jul 2007 06:30:16 +0000 (23:30 -0700)]
[SPARC64]: Fix sun4u PCI config space accesses on sun4u.

Don't provide fake PCI config space for sun4u.

Also, put back the funny host controller space handling that
at least Sabre needs.  You have to read PCI host controller
registers at their nature size otherwise you get zeros instead
of correct values.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[PARTITION] MSDOS: Fix Sun num_partitions handling.
Mark Fortescue [Thu, 26 Jul 2007 01:30:08 +0000 (18:30 -0700)]
[PARTITION] MSDOS: Fix Sun num_partitions handling.

Correct the Solaris x86 number of partitions (slices) is a way that is
backward compatible with the earlier size.

This works without a new VTOC structure definition as the timestamp
and v_asciilabel fields in the VTOC are not used by the kernel yet.

Signed-off-by: Mark Fortescue <mark@mtfhpc.demon.co.uk>
Signed-off-by: David S. Miller <davem@davemloft.net>
16 years ago[SPARC]: Update defconfig.
David S. Miller [Wed, 25 Jul 2007 23:51:20 +0000 (16:51 -0700)]
[SPARC]: Update defconfig.

Signed-off-by: David S. Miller <davem@davemloft.net>
16 years agoMake lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n
Rusty Russell [Mon, 30 Jul 2007 00:25:22 +0000 (10:25 +1000)]
Make lguest compile with CONFIG_BLOCK=n and CONFIG_NET=n

Gabriel C reports lguest doesn't compile with CONFIG_BLOCK=n.  Fix this
by introducing a config var for the block device, which depends on
LGUEST && BLOCK.  Do the same for the net driver, rather then depending
gratuitously on CONFIG_NET.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Cc: Gabriel C <nix.or.die@googlemail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6
Linus Torvalds [Mon, 30 Jul 2007 00:22:03 +0000 (17:22 -0700)]
Merge /linux/kernel/git/jejb/scsi-rc-fixes-2.6

* master.kernel.org:/pub/scm/linux/kernel/git/jejb/scsi-rc-fixes-2.6: (28 commits)
  [SCSI] mpt fusion: Changes in mptctl.c for logging support
  [SCSI] mpt fusion: Changes in mptfc.c mptlan.c mptsas.c and mptspi.c for logging support
  [SCSI] mpt fusion: Changes in mptscsih.c for logging support
  [SCSI] mpt fusion: Changes in mptbase.c for logging support
  [SCSI] mpt fusion: logging support in Kconfig, Makefile, mptbase.h and addition of mptdebug.h
  [SCSI] libsas: Fix potential NULL dereference in sas_smp_get_phy_events()
  [SCSI] bsg: Fix build for CONFIG_BLOCK=n
  [SCSI] aacraid: fix Sunrise Lake reset handling
  [SCSI] aacraid: add SCSI SYNCHONIZE_CACHE range checking
  [SCSI] add easyRAID to the no report luns blacklist
  [SCSI] advansys: lindent and other large, uninteresting changes
  [SCSI] aic79xx, aic7xxx: Fix incorrect width setting
  [SCSI] qla2xxx: fix to honor ignored parameters in sysfs attributes
  [SCSI] aacraid: draw line in sand, sundry cleanup and version update
  [SCSI] iscsi_tcp: Turn off bounce buffers
  [SCSI] libiscsi: fix cmd seqeunce number checking
  [SCSI] iscsi_tcp, ib_iser Enable module refcounting for iscsi host template
  [SCSI] libiscsi: make sure session is not blocked when removing host
  [SCSI] libsas: Remove PCI dependencies
  [SCSI] simscsi: convert to use the data buffer accessors
  ...

16 years agoRemove fs.h from mm.h
Alexey Dobriyan [Sun, 29 Jul 2007 22:36:13 +0000 (02:36 +0400)]
Remove fs.h from mm.h

Remove fs.h from mm.h. For this,
 1) Uninline vma_wants_writenotify(). It's pretty huge anyway.
 2) Add back fs.h or less bloated headers (err.h) to files that need it.

As result, on x86_64 allyesconfig, fs.h dependencies cut down from 3929 files
rebuilt down to 3444 (-12.3%).

Cross-compile tested without regressions on my two usual configs and (sigh):

alpha              arm-mx1ads        mips-bigsur          powerpc-ebony
alpha-allnoconfig  arm-neponset      mips-capcella        powerpc-g5
alpha-defconfig    arm-netwinder     mips-cobalt          powerpc-holly
alpha-up           arm-netx          mips-db1000          powerpc-iseries
arm                arm-ns9xxx        mips-db1100          powerpc-linkstation
arm-assabet        arm-omap_h2_1610  mips-db1200          powerpc-lite5200
arm-at91rm9200dk   arm-onearm        mips-db1500          powerpc-maple
arm-at91rm9200ek   arm-picotux200    mips-db1550          powerpc-mpc7448_hpc2
arm-at91sam9260ek  arm-pleb          mips-ddb5477         powerpc-mpc8272_ads
arm-at91sam9261ek  arm-pnx4008       mips-decstation      powerpc-mpc8313_rdb
arm-at91sam9263ek  arm-pxa255-idp    mips-e55             powerpc-mpc832x_mds
arm-at91sam9rlek   arm-realview      mips-emma2rh         powerpc-mpc832x_rdb
arm-ateb9200       arm-realview-smp  mips-excite          powerpc-mpc834x_itx
arm-badge4         arm-rpc           mips-fulong          powerpc-mpc834x_itxgp
arm-carmeva        arm-s3c2410       mips-ip22            powerpc-mpc834x_mds
arm-cerfcube       arm-shannon       mips-ip27            powerpc-mpc836x_mds
arm-clps7500       arm-shark         mips-ip32            powerpc-mpc8540_ads
arm-collie         arm-simpad        mips-jazz            powerpc-mpc8544_ds
arm-corgi          arm-spitz         mips-jmr3927         powerpc-mpc8560_ads
arm-csb337         arm-trizeps4      mips-malta           powerpc-mpc8568mds
arm-csb637         arm-versatile     mips-mipssim         powerpc-mpc85xx_cds
arm-ebsa110        i386              mips-mpc30x          powerpc-mpc8641_hpcn
arm-edb7211        i386-allnoconfig  mips-msp71xx         powerpc-mpc866_ads
arm-em_x270        i386-defconfig    mips-ocelot          powerpc-mpc885_ads
arm-ep93xx         i386-up           mips-pb1100          powerpc-pasemi
arm-footbridge     ia64              mips-pb1500          powerpc-pmac32
arm-fortunet       ia64-allnoconfig  mips-pb1550          powerpc-ppc64
arm-h3600          ia64-bigsur       mips-pnx8550-jbs     powerpc-prpmc2800
arm-h7201          ia64-defconfig    mips-pnx8550-stb810  powerpc-ps3
arm-h7202          ia64-gensparse    mips-qemu            powerpc-pseries
arm-hackkit        ia64-sim          mips-rbhma4200       powerpc-up
arm-integrator     ia64-sn2          mips-rbhma4500       s390
arm-iop13xx        ia64-tiger        mips-rm200           s390-allnoconfig
arm-iop32x         ia64-up           mips-sb1250-swarm    s390-defconfig
arm-iop33x         ia64-zx1          mips-sead            s390-up
arm-ixp2000        m68k              mips-tb0219          sparc
arm-ixp23xx        m68k-amiga        mips-tb0226          sparc-allnoconfig
arm-ixp4xx         m68k-apollo       mips-tb0287          sparc-defconfig
arm-jornada720     m68k-atari        mips-workpad         sparc-up
arm-kafa           m68k-bvme6000     mips-wrppmc          sparc64
arm-kb9202         m68k-hp300        mips-yosemite        sparc64-allnoconfig
arm-ks8695         m68k-mac          parisc               sparc64-defconfig
arm-lart           m68k-mvme147      parisc-allnoconfig   sparc64-up
arm-lpd270         m68k-mvme16x      parisc-defconfig     um-x86_64
arm-lpd7a400       m68k-q40          parisc-up            x86_64
arm-lpd7a404       m68k-sun3         powerpc              x86_64-allnoconfig
arm-lubbock        m68k-sun3x        powerpc-cell         x86_64-defconfig
arm-lusl7200       mips              powerpc-celleb       x86_64-up
arm-mainstone      mips-atlas        powerpc-chrp32

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoACPI: restore CONFIG_ACPI_SLEEP
Len Brown [Sat, 28 Jul 2007 07:33:16 +0000 (03:33 -0400)]
ACPI: restore CONFIG_ACPI_SLEEP

Restore the 2.6.22 CONFIG_ACPI_SLEEP build option, but now shadowing the
new CONFIG_PM_SLEEP option.

Signed-off-by: Len Brown <len.brown@intel.com>
[ Modified to work with the PM config setup changes. ]
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoIntroduce CONFIG_SUSPEND for suspend-to-Ram and standby
Rafael J. Wysocki [Sun, 29 Jul 2007 21:27:18 +0000 (23:27 +0200)]
Introduce CONFIG_SUSPEND for suspend-to-Ram and standby

Introduce CONFIG_SUSPEND representing the ability to enter system sleep
states, such as the ACPI S3 state, and allow the user to choose SUSPEND
and HIBERNATION independently of each other.

Make HOTPLUG_CPU be selected automatically if SUSPEND or HIBERNATION has
been chosen and the kernel is intended for SMP systems.

Also, introduce CONFIG_PM_SLEEP which is automatically selected if
CONFIG_SUSPEND or CONFIG_HIBERNATION is set and use it to select the
code needed for both suspend and hibernation.

The top-level power management headers and the ACPI code related to
suspend and hibernation are modified to use the new definitions (the
changes in drivers/acpi/sleep/main.c are, mostly, moving code to reduce
the number of ifdefs).

There are many other files in which CONFIG_PM can be replaced with
CONFIG_PM_SLEEP or even with CONFIG_SUSPEND, but they can be updated in
the future.

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoReplace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION
Rafael J. Wysocki [Sun, 29 Jul 2007 21:24:36 +0000 (23:24 +0200)]
Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION

Replace CONFIG_SOFTWARE_SUSPEND with CONFIG_HIBERNATION to avoid
confusion (among other things, with CONFIG_SUSPEND introduced in the
next patch).

Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoIB/ehca: Move extern declarations from .c files to .h files
Hoang-Nam Nguyen [Sun, 29 Jul 2007 04:47:53 +0000 (21:47 -0700)]
IB/ehca: Move extern declarations from .c files to .h files

Make sure declarations stay in sync with definitions by keeping all
extern declarations in common .h files.

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoIB/mlx4: Whitespace fix
Roland Dreier [Sun, 29 Jul 2007 03:52:44 +0000 (20:52 -0700)]
IB/mlx4: Whitespace fix

Remove extra dumb-looking blank line that snuck in somehow.

Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years agoProvide timespec to guests rather than jiffies clock.
Rusty Russell [Fri, 27 Jul 2007 03:42:52 +0000 (13:42 +1000)]
Provide timespec to guests rather than jiffies clock.

A non-periodic clock_event_device and the "jiffies" clock don't mix well:
tick_handle_periodic() can go into an infinite loop.

Currently lguest guests use the jiffies clock when the TSC is
unusable.  Instead, make the Host write the current time into the lguest
page on every interrupt.  This doesn't cost much but is more precise
and at least as accurate as the jiffies clock.  It also gets rid of
the GET_WALLCLOCK hypercall.

Also, delay setting sched_clock until our clock is set up, otherwise
the early printk timestamps can go backwards (not harmful, just ugly).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoFix lguest bzImage loading with CONFIG_RELOCATABLE=y
Rusty Russell [Fri, 27 Jul 2007 03:35:43 +0000 (13:35 +1000)]
Fix lguest bzImage loading with CONFIG_RELOCATABLE=y

Jason Yeh sent his crashing .config: bzImages made with
CONFIG_RELOCATABLE=y put the relocs where the BSS is expected, and we
crash with unusual results such as:

lguest: unhandled trap 14 at 0xc0122ae1 (0xa9)

Relying on BSS being zero was merely laziness on my part, and
unfortunately, lguest doesn't go through the normal startup path (which
does this in asm).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agom68knommu: remove crap from machdep.h
Greg Ungerer [Fri, 27 Jul 2007 00:38:16 +0000 (10:38 +1000)]
m68knommu: remove crap from machdep.h

Removed unused dead crap from machdep.h header.

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agom68knommu: fix declaration of mach_sched_init
Greg Ungerer [Fri, 27 Jul 2007 00:38:01 +0000 (10:38 +1000)]
m68knommu: fix declaration of mach_sched_init

Make declaration of mach_sched_init match definition
(which is in arch/m68knommu/kernel/setup.c).

Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoFix procfs compat_ioctl regression
David Miller [Sat, 28 Jul 2007 05:58:37 +0000 (22:58 -0700)]
Fix procfs compat_ioctl regression

It is important to only provide the compat_ioctl method
if the downstream de->proc_fops does too, otherwise this
utterly confuses the logic in fs/compat_ioctl.c and we
end up doing the wrong thing.

Signed-off-by: David S. Miller <davem@davemloft.net>
Acked-by: Alexey Dobriyan <adobriyan@sw.ru>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoaudit: fix two bugs in the new execve audit code
Peter Zijlstra [Fri, 27 Jul 2007 22:55:18 +0000 (00:55 +0200)]
audit: fix two bugs in the new execve audit code

copy_from_user() returns the number of bytes not copied, hence 0 is the
expected output.

axi->mm might not be valid anymore when not equal to current->mm, do not
dereference before checking that - thanks to Al for spotting that.

Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
Tested-by: Steve Grubb <sgrubb@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agorip some includes from linux/interrupt.h
Al Viro [Fri, 27 Jul 2007 13:24:33 +0000 (14:24 +0100)]
rip some includes from linux/interrupt.h

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Acked-by: Jeff Garzik <jeff@garzik.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agofix preprocessor idiocy in reiserfs
Al Viro [Fri, 27 Jul 2007 13:23:44 +0000 (14:23 +0100)]
fix preprocessor idiocy in reiserfs

#x blocks expansion of macro argument, but it won't do you any
good if it's already been expanded...  As it is, RFALSE(cond, ....)
ended up with stringified _expanded_ cond.  Real fun when cond contains
something like le32_to_cpu() and you are on a big-endian box...

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agomore include order horrors
Al Viro [Fri, 27 Jul 2007 13:19:52 +0000 (14:19 +0100)]
more include order horrors

... because somebody had added preempt.h -> list.h, resulting in
asm/system.h -> hardirq.h -> preempt.h -> list.h -> asm/system.h on m68k,
with smp_wmb() used in list.h and defined in asm/system.h below the include
of hardirq.h.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
16 years agoMerge branch 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6
Linus Torvalds [Sun, 29 Jul 2007 02:33:23 +0000 (19:33 -0700)]
Merge branch 'for-linus' of git://git390.osdl.marist.edu/linux-2.6

* 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6:
  [S390] Fix sclp_vt220 error handling.
  [S390] cio: Reorganize initialization.
  [S390] cio: Make CIO_* macros safe if dbfs are not available.
  [S390] cio: Clean up messages.
  [S390] Fix IRQ tracing.
  [S390] vmur: fix diag14_read.
  [S390] Wire up sys_fallocate.
  [S390] add types.h include to s390_ext.h
  [S390] cio: Remove deprecated rdc/rcd.
  [S390] Get rid of new section mismatch warnings.
  [S390] sclp: kill unused SCLP config option.
  [S390] cio: Remove remains of _ccw_device_get_device_number().
  [S390] cio: css_sch_device_register() can be made static.
  [S390] Improve __smp_call_function_map.
  [S390] Convert to smp_call_function_single.

16 years agoMerge branch 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney...
Linus Torvalds [Sun, 29 Jul 2007 02:33:04 +0000 (19:33 -0700)]
Merge branch 'for-linus' of /linux/kernel/git/cooloney/blackfin-2.6

* 'for-linus' of master.kernel.org:/pub/scm/linux/kernel/git/cooloney/blackfin-2.6:
  Input Serio: Blackfin doesnt support I8042 - make sure it doesnt get selected
  Blackfin arch: add BF54x I2C/TWI TWI0 driver support
  Blackfin On-Chip RTC driver update for supporting BF54x
  Blackfin Ethernet MAC driver: fix bug Report returned -ENOMEM upwards (in case L1/uncached memory alloc fails)
  Blackfin arch: add error message when IRQ no available
  Blackfin arch: Initialize the exception vectors early in the boot process
  Blackfin arch: fix a compiling warning about dma-mapping
  Blackfin arch: switch to using proper defines this time THREAD_SIZE and PAGE_SIZE instead of just PAGE_SIZE everywhere
  Blackfin arch: fix bug which unaligns the init thread's stack and causes the current macro to fail.
  Blackfin arch: Load P0 before storing through it
  Blackfin arch: fix KGDB bug, dont forget last parameter.
  Blackfin arch: add selections for BF544 and BF542
  Blackfin arch: use bfin_read_SWRST() now that BF561 provides it
  Blackfin arch: setup aliases for some core Core A MMRs

16 years agoMerge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block
Linus Torvalds [Sun, 29 Jul 2007 02:31:13 +0000 (19:31 -0700)]
Merge branch 'for-linus' of git://git.kernel.dk/linux-2.6-block

* 'for-linus' of git://git.kernel.dk/linux-2.6-block:
  docbook: add pipes, other fixes
  blktrace: use cpu_clock() instead of sched_clock()
  bsg: Fix build for CONFIG_BLOCK=n
  [patch] QUEUE_FLAG_READFULL QUEUE_FLAG_WRITEFULL comment fix

16 years agoMerge branch 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied...
Linus Torvalds [Sun, 29 Jul 2007 02:30:24 +0000 (19:30 -0700)]
Merge branch 'agp-patches' of git://git./linux/kernel/git/airlied/agp-2.6

* 'agp-patches' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/agp-2.6:
  agp: AMD AGP is used on UP1100 & UP1500 alpha boxen
  intel_agp: really fix 945/965GME
  agp: don't lock pages
  AGP: document boot options
  Fix "use after free" / "double free" bug in ati_create_gatt_pages / ati_free_gatt_pages

16 years agoMerge master.kernel.org:/home/rmk/linux-2.6-arm
Linus Torvalds [Sun, 29 Jul 2007 02:29:37 +0000 (19:29 -0700)]
Merge master.kernel.org:/home/rmk/linux-2.6-arm

* master.kernel.org:/home/rmk/linux-2.6-arm:
  [ARM] 4527/1: pxa: fix pxa27x ac97 cold reset in ASoC due to CKEN change
  [ARM] 4530/1: MXC: fix elf_hwcap compile breakage as in iop13xx
  [ARM] 4529/1: [HP Jornada 7XX] - Fix jornada720.c to use SSP driver
  [ARM] 4528/1: [HP Jornada 7XX] - Fix typo in jornada720_ssp.c
  [ARM] Remove CONFIG_IGNORE_FIQ
  [ARM] 4526/1: pxa: make ARCH_PXA select GENERIC_CLOCKEVENTS
  [ARM] setup_profiling_timer must not be __init

16 years ago[ARM] 4527/1: pxa: fix pxa27x ac97 cold reset in ASoC due to CKEN change
Eric Miao [Thu, 26 Jul 2007 01:01:04 +0000 (02:01 +0100)]
[ARM] 4527/1: pxa: fix pxa27x ac97 cold reset in ASoC due to CKEN change

due to CKEN_xxx definition and pxa_set_cken() change,  the pxa27x
ac97 cold reset is broken in ASoC, fixed to use bit index instead
of bit mask

Signed-off-by: eric miao <eric.y.miao@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4530/1: MXC: fix elf_hwcap compile breakage as in iop13xx
Quinn Jensen [Fri, 27 Jul 2007 22:30:55 +0000 (23:30 +0100)]
[ARM] 4530/1: MXC: fix elf_hwcap compile breakage as in iop13xx

MXC needs the same change as IOP.  See [ARM] 4494/1
or commit 7dea1b20066cd30fb54da7e686b16b5e38b46b2d

An undefined reference to elf_hwcap prevents linkage, due
to changes made by f884b1cf578e079f01682514ae1ae64c74586602
and d1cbbd6b413510c6512f4f80ffd48db1a8dd554a

Removing processor.h removes the extern definition of
elf_hwcap, which fixes the link issue, but forgets cpu_relax().
So, instead, we'll call barrier() directly.

Cc: Lennert Buytenhek <kernel@wantstofly.org>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Acked-by: Ross Wille <wille@freescale.com>
Signed-off-by: Quinn Jensen <quinn.jensen@freescale.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years ago[ARM] 4529/1: [HP Jornada 7XX] - Fix jornada720.c to use SSP driver
Kristoffer Ericson [Thu, 26 Jul 2007 06:46:17 +0000 (07:46 +0100)]
[ARM] 4529/1: [HP Jornada 7XX] - Fix jornada720.c to use SSP driver

This fixes the jornada720.c file :

* ifdef for CONFIG_SA1100_JORNADA720_SSP since we dont want to include anything not selected in menyconfig.
* add documentation for init for future reference
* change platform driver name from jornada720_mcu ->
jornada_ssp.
* change maintainer in file.

Signed-off-by: Kristoffer Ericson <Kristoffer.Ericson@gmail.com>
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
16 years agoIB/ehca: Fix include order to better match kernel style
Hoang-Nam Nguyen [Sat, 28 Jul 2007 15:36:32 +0000 (08:36 -0700)]
IB/ehca: Fix include order to better match kernel style

Include <rdma/...> headers after <asm/...> headers.

Signed-off-by: Hoang-Nam Nguyen <hnguyen@de.ibm.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years ago[SCSI] mpt fusion: Changes in mptctl.c for logging support
Prakash, Sathya [Tue, 24 Jul 2007 10:19:05 +0000 (15:49 +0530)]
[SCSI] mpt fusion: Changes in mptctl.c for logging support

This patch contains changes in mptctl.c to support logging in MPT fusion drivers

The changes are majorly in debug printks, the existing debugprintk are
modified accroding to new debug macros defined in the file mptbdebug.h

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16 years ago[SCSI] mpt fusion: Changes in mptfc.c mptlan.c mptsas.c and mptspi.c for logging...
Prakash, Sathya [Tue, 24 Jul 2007 10:17:41 +0000 (15:47 +0530)]
[SCSI] mpt fusion: Changes in mptfc.c mptlan.c mptsas.c and mptspi.c for logging support

This patch contains changes in mptfc.c, mptlan.c, mptsas.c and mptspi.c to
support logging in MPT fusion drivers.

The changes are majorly in debug printks, the existing debugprintk are
modified accroding to new debug macros defined in the file mptbdebug.h

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16 years agomlx4_core: Remove kfree() in mlx4_mr_alloc() error flow
Jack Morgenstein [Thu, 26 Jul 2007 08:16:58 +0000 (11:16 +0300)]
mlx4_core: Remove kfree() in mlx4_mr_alloc() error flow

mlx4_mr_alloc() doesn't actually allocate mr (it just initializes the
pointer that the caller passes in), so it shouldn't free it if an
error occurs.

Signed-off-by: Jack Morgenstein <jackm@dev.mellanox.co.il>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years ago[SCSI] mpt fusion: Changes in mptscsih.c for logging support
Prakash, Sathya [Wed, 25 Jul 2007 05:44:01 +0000 (11:14 +0530)]
[SCSI] mpt fusion: Changes in mptscsih.c for logging support

This patch contains changes in mptscsih.c to support logging in MPT fusion
drivers.

The changes are majorly in debug printks, the existing debugprintk are
modified accroding to new debug macros defined in the file mptbdebug.h

A new sysfs attribute is added to retrieve and modify the debug level.

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16 years ago[SCSI] mpt fusion: Changes in mptbase.c for logging support
Prakash, Sathya [Tue, 24 Jul 2007 10:12:08 +0000 (15:42 +0530)]
[SCSI] mpt fusion: Changes in mptbase.c for logging support

This patch contains changes in mptbase.c to support logging in MPT fusion
drivers.

The changes are majorly in debug printks, the existing debugprintk are
modified accroding to new debug macros defined in the file mptbdebug.h

A new module parameter mpt_debug_level is added to pass the debug level as
module parameter.

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16 years ago[SCSI] mpt fusion: logging support in Kconfig, Makefile, mptbase.h and addition of...
Prakash, Sathya [Tue, 24 Jul 2007 10:10:08 +0000 (15:40 +0530)]
[SCSI] mpt fusion: logging support in Kconfig, Makefile, mptbase.h and addition of mptdebug.h

This patch adds a new file mptdebug.h in the fusion source directory,
which contains different debug macros.  The existing debug macros and
flags are removed from the mptbase.h and Makefile In Kconfig a new
configuration parameter FUSION_LOGGING is added to enable/disable the
logging support during compile time.

signed-off-by: Sathya Prakash <sathya.prakash@lsi.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16 years agoRDMA/amso1100: Initialize the wait_queue_head_t in the c2_qp structure
Tom Tucker [Tue, 24 Jul 2007 19:31:52 +0000 (14:31 -0500)]
RDMA/amso1100: Initialize the wait_queue_head_t in the c2_qp structure

Fix a crash if the driver has to wait for a QP reference to be dropped
when destroying the QP.

Signed-off-by: Ethan Burns <eaburns@iol.unh.edu>
Acked-by: Tom Tucker <tom@opengridcomputing.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
16 years ago[SCSI] libsas: Fix potential NULL dereference in sas_smp_get_phy_events()
Jesper Juhl [Fri, 27 Jul 2007 23:13:33 +0000 (01:13 +0200)]
[SCSI] libsas: Fix potential NULL dereference in sas_smp_get_phy_events()

In sas_smp_get_phy_events() we never test if the call to
alloc_smp_req(RPEL_REQ_SIZE) succeeds or fails. That means we run
the risk of dereferencing a NULL pointer if it does fail. Far
better to test if we got NULL back and in that case return -ENOMEM
just as we already do for the other memory allocation in that
function.

Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16 years ago[SCSI] bsg: Fix build for CONFIG_BLOCK=n
Paul Mundt [Sat, 28 Jul 2007 14:45:43 +0000 (23:45 +0900)]
[SCSI] bsg: Fix build for CONFIG_BLOCK=n

BLK_DEV_BSG was added outside of the if BLOCK check, which allows it to
be enabled when CONFIG_BLOCK=n. This leads to many screenlengths of
errors, starting with a parse error on the request_queue_t definition.
Obviously this wasn't intended for CONFIG_BLOCK=n usage, so just move the
option back in to the block.

Caught with a randconfig on sh.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16 years ago[SCSI] aacraid: fix Sunrise Lake reset handling
Salyzyn, Mark [Fri, 27 Jul 2007 14:29:26 +0000 (10:29 -0400)]
[SCSI] aacraid: fix Sunrise Lake reset handling

The patch is *much* smaller than the description. I am attempting to
answer to those that want to understand an issue that was reported in
May this year.

If a Sunrise Lake based card that requires an alternate reset mechanism
is set up to ignore the commanded IOP_RESET it reports 0x00000010
(IOP_RESET ignored) instead of 0x3803000F (use alternate reset mechanism
to reset all cores), and thus the reset platform function decides to
switch to IOP_RESET_ALWAYS because the reset platform function
parameters indicate that we *need* to reset the card. IOP_RESET_ALWAYS
then responds with the 0x3803000F return code, but alas we treat this as
an error instead of using the alternate reset mechanism (put a 0x03 into
the register offset 0x38). The reset fails, but the fact that the
IOP_RESET_ALWAYS command was issued has put the card in a purposeful
shutdown state in preparation for the alternate hardware reset to be
applied. Yuck.

IOP_RESET is ignored in internal production cards, typically to ensure
that we catch all adapter lockup issues without the driver progressing
further, so this would not appear to be a field issue and thus this
patch was destined to be only in the internal Adaptec source tree.
IOP_RESET_ALWAYS is reserved for
kexec/kdump/FirmwareUpdate/AutomatedTestFrames so we did not function as
expected in any case. Also in the past we have had OEMs specifically
request that cards not be resetable after a BlinkLED/FirmwareAssert for
one reason or another and To head off the possibility that the Sunrise
Lake based cards would suffer a similar fate, we propose the enclosed
fix.

Yinghai Lu of SUN had a pre-production card with IOP_RESET disabled when
he reported an issue to the linux kernel list back in May regarding a
kexec problem resulting from this reset being ignore. His fix was to
update the Firmware to one that did not ignore the IOP_RESET. Previous
kernels did not attempt to reset the adapter and that is why it surfaced
as a regression in his hands.

The current list of aacraid based cards that use Sunrise Lake:

9005:0285:9005:02b5     Adaptec 5445
9005:0285:9005:02b6     Adaptec 5805
9005:0285:9005:02b7     Adaptec 5085
9005:0285:9005:02c3     Adaptec 51205
9005:0285:9005:02c4     Adaptec 51605
9005:0285:9005:02ce     Adaptec 51245
9005:0285:9005:02cf     Adaptec 51645
9005:0285:9005:02d0     Adaptec 52445
9005:0285:9005:02d1     Adaptec 5405
9005:0285:9005:02b8     ICP     ICP5445SL
9005:0285:9005:02b9     ICP     ICP5085SL
9005:0285:9005:02ba     ICP     ICP5805SL
9005:0285:9005:02c5     ICP     ICP5125SL
9005:0285:9005:02c6     ICP     ICP5165SL
9005:0285:108e:7aac     SUN     STK RAID REM
9005:0285:108e:0286     SUN     STK RAID INT
9005:0285:108e:0287     SUN     STK RAID EXT
9005:0285:108e:7aae     SUN     STK RAID EM

All of these are publicly released with IOP_RESET enabled. So there is
no immediate need for this patch.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
16 years ago[SCSI] aacraid: add SCSI SYNCHONIZE_CACHE range checking
Salyzyn, Mark [Fri, 27 Jul 2007 13:48:49 +0000 (09:48 -0400)]
[SCSI] aacraid: add SCSI SYNCHONIZE_CACHE range checking

Customer running an application that issues SYNCHRONIZE_CACHE calls
directly noticed the broad stroke of the current implementation in the
aacraid driver resulting in multiple applications feeding I/O to the
storage causing the issuing application to stall for long periods of
time. By only waiting for the current WRITE commands, rather than all
commands, to complete; and those that are in range of the
SYNCHRONIZE_CACHE call that would associate more tightly with the
issuing application before telling the Firmware to flush it's dirty
cache, we managed to reduce the stalling. The Firmware itself still
flushes all the dirty cache associated with the array ignoring the
range, it just does so in a more timely manner.

Signed-off-by: Mark Salyzyn <aacraid@adaptec.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>