net/9p: set correct stat size when sending Twstat messages

The 9P2000 Twstat message requires the size of the stat structure to be
specified. Currently the 9p code writes zero instead of the actual size.
This behavior confuses some of the file servers that check if the size is
correct.

This patch adds a new function that calculcates the stat size and puts the
value in the appropriate place in the 9P message.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Reviewed-by: Eric Van Hensbergen <ericvh@gmail.com>
net/9p: return error when p9_client_stat fails

p9_client_stat function doesn't return correct value if it fails.
p9_client_stat should return ERR_PTR of the error value when it fails.
Instead, it always returns a value to the allocated p9_wstat struct even
when it is not populated correctly.

This patch makes p9_client_stat to handle failure correctly.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
Reviewed-by: Eric Van Hensbergen <ericvh@gmail.com>
net/9p: handle correctly interrupted 9P requests

Currently the 9p code crashes when a operation is interrupted, i.e. for
example when the user presses ^C while reading from a file.

This patch fixes the code that is responsible for interruption and flushing
of 9P operations.

Signed-off-by: Latchesar Ionkov <lucho@ionkov.net>
HID: hidraw -- fix missing unlocks in unlocked_ioctl

There were 2 places that returned directly instead of releasing their
locks.  I sent a fix for this file earlier but ended up missing these
spots.  I think what happened is that I have improved my checker script
since then...  Or maybe I just screwed up.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
ocfs2: Reserve 1 more cluster in expanding_inline_dir for indexed dir.

In ocfs2_expand_inline_dir, we calculate whether we need 1 extra
cluster if we can't store the dx inline the root and save it in
dx_alloc. So add it when we call ocfs2_reserve_clusters.

Signed-off-by: Tao Ma <tao.ma@oracle.com>
Signed-off-by: Mark Fasheh <mfasheh@suse.com>
drm/i915: allow tiled front buffers on 965+

This patch corrects a pretty big oversight in the KMS code for 965+
chips.  The current code is missing tiled surface register programming,
so userland can allocate a tiled surface and use it for mode setting,
resulting in corruption.  This patch fixes that, allowing for tiled
front buffers on 965+.

Cc: stable@kernel.org
Tested-by: Arkadiusz Miskiewicz <arekm@maven.pl>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
HID: Add support for the G25 force feedback wheel in native mode

Add Product Id 0xc299 for the Logitech G25 force feedback wheel
The Logitech G25 force feedback wheel, is first recognize by the kernel
with the product id "0xc294". In this mode, we can't use all the axes
and buttons of the wheel.

Using a userland utility, it is possible to make the wheel switch to native
mode -- http://svn.vdrift.net/viewvc.cgi/trunk/tools/G25manage/?root=VDrift
In native mode, the wheel change its id number to "0xc299".

The packet that needs to be sent to the wheel to swtich to native mode and
change its PID is

	{ 0xf8, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00 }

Signed-off-by: Christophe Borivant <christophe.borivant@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
drm/i915: Don't let an oops get triggered from irq_emit without dma init.

Userland is broken if it's trying this, but we also shouldn't allow oopses.

Signed-off-by: Eric Anholt <eric@anholt.net>
drm/i915: fix transition to I915_TILING_NONE

Transitions to TILING_NONE skipped the call to unbind the object, which left
the fence register set and caused future CPU access through the GTT to
access the object in tiled mode.

Signed-off-by: Keith Packard <keithp@keithp.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drm/i915: Register ACPI video even when not modesetting

The ACPI video driver defers registration to the i915 driver if the
system supports opregion-mediated backlight control. This registration
was only being performed in the KMS case. Ensure it's done even if we
don't have modesetting enabled.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drm/i915: Unregister ACPI video driver when exiting

The i915 DRM triggers registration of the ACPI video driver on load. It
should unregister it at unload in order to avoid generating backtraces on
being reloaded.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
drm/i915: Enable ASLE if present

The changes to opregion initialisation order meant that the ASLE setup
code might not be run at the correct time. Ensure that the interrupts are
set up.

Signed-off-by: Matthew Garrett <mjg@redhat.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Input: omap-keypad - use disable_irq_nosync() in irq handler

disable_irq() waits for all running handlers to complete before
returning.  As such, if it's used to disable an interrupt from
that interrupt's handler it will deadlock.  This replaces the
dangerous instances with the _nosync() variant which doesn't have
this problem.

Signed-off-by: Ben Nizette <bn@niasdigital.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Input: sa1111ps2 - use disable_irq_nosync() in irq handlers

disable_irq() waits for all running handlers to complete before
returning.  As such, if it's used to disable an interrupt from
that interrupt's handler it will deadlock.  This replaces the
dangerous instances with the _nosync() variant which doesn't have
this problem.

Signed-off-by: Ben Nizette <bn@niasdigital.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Input: tsc2007 - use disable_irq_nosync() in irq handler

disable_irq() waits for all running handlers to complete before
returning.  As such, if it's used to disable an interrupt from
that interrupt's handler it will deadlock.  This replaces the
dangerous instances with the _nosync() variant which doesn't have
this problem.

Signed-off-by: Ben Nizette <bn@niasdigital.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Input: ucb1400 - use disable_irq_nosync() in irq handler

disable_irq() waits for all running handlers to complete before
returning.  As such, if it's used to disable an interrupt from
that interrupt's handler it will deadlock.  This replaces the
dangerous instances with the _nosync() variant which doesn't have
this problem.

Signed-off-by: Ben Nizette <bn@niasdigital.com>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Input: elantech - provide a workaround for jumpy cursor on firmware 2.34

It seems that Elantech touchpad firmware version 2.34 on the Hercules eCAFÉ
suffers from a problem where bogus coordinates get reported at the beginning
of a touch action. This causes the mouse cursor or the scrolled page to
jump.

Included patch provides a workaround that discards mouse packets that are
likely to contain bogus coordinates. The workaround is activated when we
detect touchpad with fimware version 2.34.

Signed-off-by: Arjan Opmeer <arjan@opmeer.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Input: elantech - make sure touchpad is really in absolute mode

There exist laptops with Elantech touchpads where switching to absolute mode
does not happen, although writing the configuration register succeeds
without error. Reading back the register afterwards reveils that the
absolute mode bit is not set as if masked out by the touchpad firmware.

Always read back register 0x10, make sure that for hardware version 1 the
absolute mode bit is actually set and fail otherwise. This prevents the case
where the touchpad is claimed by the Elantech driver but is nonetheless not
working.

Signed-off-by: Arjan Opmeer <arjan@opmeer.net>
Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
mtd: mtd in mtd_release is unused without CONFIG_MTD_CHAR

drivers/mtd/mtdcore.c: In function 'mtd_release':
drivers/mtd/mtdcore.c:51: warning: unused variable 'mtd'

[akpm: make it actually build]
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
mtd: expose subpage size via sysfs

MTD has got sysfs support in 2.6.30-rc1. But subpage size is not
exposed there - do this.

UBI utilities badly need this parameter. At the moment there is
no way to get subpage size - ioctls do not return it. And we
just got sysfs support, so we can easilly extend it with this
additional parameter.

This can be merged late in the development cycle because:
1. sysfs support has been just added - there are no users for
   it so far, even.
2. UBI utilities really need this parameter, and it is better
   not to delay this.

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>