Staging: comedi: fix coding style issues in ni_labpc.c
This is a patch to the ni_labpc.c file that fixes the brace warnings and
comments over 80 characters found by the checkpatch.pl tool. Some code
still goes over 80 characters because I didn't know what to do with it.
Signed-off-by: Stewart Robertson <stewart_r@aliencamel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Linus Luessing [Fri, 19 Feb 2010 15:18:08 +0000 (16:18 +0100)]
Staging: batman-adv: atomic variable for vis-srv activation
This fixes the bug discovered by Marek Lindner which did not allow
turning on the vis-server before an interface has been added. With this
patch we are using a global atomic variable for activating and
deactiating the vis-server-mode, which can be used before
inserting an interface.
Marek Lindner [Fri, 19 Feb 2010 15:18:06 +0000 (16:18 +0100)]
Staging: batman-adv: avoid having the same error message more than once
The routing code has 2 sections which warn about ttl exceeded. The
corresponding warnings were identical which makes it hard to debug. In
addition, batman-adv does not need to warn about ttl exceeded in case
we encountered an echo request as this is commonly used to generate
traceroute graphs.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Simon Wunderlich [Fri, 19 Feb 2010 15:18:05 +0000 (16:18 +0100)]
Staging: batman-adv: don't lock while sending packets
As in other parts of batman-adv, we should not lock while sending a packet but
keep the lock held for as short as possible. Additionally, we should check
whether the interface is active, otherwise batman_if->net_dev might not be
available ...
Signed-off-by: Simon Wunderlich <siwu@hrz.tu-chemnitz.de> Acked-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sven Eckelmann [Fri, 19 Feb 2010 15:18:04 +0000 (16:18 +0100)]
Staging: batman-adv: depend on NET instead of PACKET in Kconfig
The code which uses the raw packet sockets was removed. The only related
dependencies are the skb and netdev handling code. This is provided by
NET in Kconfig.
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Andrew Lunn <andrew@lunn.ch> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Mark Brown [Thu, 18 Feb 2010 17:19:17 +0000 (17:19 +0000)]
Staging: iio: Staticise non-exported functions
Staticise a number of functions which aren't exported outside their
source files, and also add a __user annotation for the buffer in
iio_event_chrdev_read().
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Acked-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arthur Benilov [Tue, 16 Feb 2010 14:41:51 +0000 (15:41 +0100)]
Staging: vme: VMIVME-7805 board support
VMIVME-7805 board has a special control register that has to be used in
order to activate the VME bus access via the Universe II bridge.
This control register also handles endianess convertion.
Signed-off-by: Arthur Benilov <arthur.benilov@iba-group.com> Signed-off-by: Vincent Bossier <vincent.bossier@iba-group.com> Acked-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arthur Benilov [Tue, 16 Feb 2010 14:41:21 +0000 (15:41 +0100)]
Staging: vme: Allocate memory buffers for master windows
For VME device I/O operations on master windows the user driver tends
to use kern_buf buffer array which is not allocated. This causes an error
when reading from master window device files.
Signed-off-by: Arthur Benilov <arthur.benilov@iba-group.com> Signed-off-by: Vincent Bossier <vincent.bossier@iba-group.com> Acked-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Arthur Benilov [Tue, 16 Feb 2010 14:40:58 +0000 (15:40 +0100)]
Staging: vme: Use A24 when requesting slave resource
When requesting slave resources A16 addressing mode flag is used to find
available windows. Since the ca91cx42 bridge only supports two A16 slave windows
but four are requested, the driver fails to initialize. The flag has been
changed to A24, which is supported by all slave windows.
Signed-off-by: Arthur Benilov <arthur.benilov@iba-group.com> Signed-off-by: Vincent Bossier <vincent.bossier@iba-group.com> Acked-by: Martyn Welch <martyn.welch@ge.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Martyn Welch [Thu, 18 Feb 2010 15:13:32 +0000 (15:13 +0000)]
Staging: vme: Correct ca91cx42 resource handling
The ca91cx42 driver currently incorrectly handles master windows, setting
and retrieving the sizing parameters incorrectly. Also, in the slave window
handling, it uses an incorrectly set variable.
Martyn Welch [Thu, 18 Feb 2010 15:13:05 +0000 (15:13 +0000)]
Staging: vme: Enable drivers to handle more than one bridge
At the moment the vme bridge drivers are written in a way that only
allows them to support one bridge at a time. Modify the drivers to
enable more than one bridge to be present per board.
Randy Dunlap [Tue, 16 Feb 2010 22:59:07 +0000 (14:59 -0800)]
Staging: rtl8187se: needs semaphore.h
rtl8187se needs to include semaphore.h to prevent build errors:
drivers/staging/rtl8187se/ieee80211/ieee80211.h:1004: error: field 'wx_sem' has incomplete type
drivers/staging/rtl8187se/ieee80211/ieee80211.h:1005: error: field 'scan_sem' has incomplete type
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Bernie Thompson [Mon, 15 Feb 2010 14:46:35 +0000 (06:46 -0800)]
Staging: udlfb: explicit dependencies and warnings
Specify Kconfig dependencies, and include warnings for building as a module
udlfb is dependent on FB_DEFERRED_IO, FB_SYS_*, and FB_MODE_HELPERS
Because many kernels do not include defio (which cannot be built
as a module), yet users want to be able to build udlfb as a module later,
udlfb has ifdefs and these dependency warnings to help udlfb build with or
without certain dependencies, but also print warnings for any lost function.
Even though this kind of flexibility isn't common, we've gotten feedback
from a significant portion of users that they were frustrated without it.
Bernie Thompson [Mon, 15 Feb 2010 14:46:26 +0000 (06:46 -0800)]
Staging: udlfb: Support for fbdev mmap clients (defio)
Add support for fbdev mmap clients who don't send damage ioctls
Because DisplayLink devices are out on the other end of usb, their
"framebuffer" is just normal system memory. So memory mapped writes
don't automatically trigger anything. So up to this point, standard
fbdev clients who rely on mmap() will get an unchanging screen.
This patch makes udlfb a client of Jaya Kumar's defio framework - which sets
up page fault triggers, and those faults are accumulated and sent to udlfb
on a defferred basis, to process as damage notifications for the framebuffer.
Because this involves more overhead than a notification directly from
the application (e.g. just passing on X DAMAGE extension notifications),
a sysfs attribute is provided by udlfb to control defio support.
/sys/class/graphics/fb*/use_defio - writing a "0" to this file before
calling mmap() causes defio to not be initialized - instead udlfb
will rely on getting damage notifications directly through the damage ioctl.
There are unsolved rendering problems with defio (horizontal dead regions
on framebuffer, that accumulate over time) which still needs a fix.
Bernie Thompson [Mon, 15 Feb 2010 14:46:21 +0000 (06:46 -0800)]
Staging: udlfb: improved rendering performance
Rework rendering for improved performance
Approx 10-20% gain avg across several "benchmarks": x11perf, gtkperf, glxgears
Moves from a single pre-alloc'd urb protected by a long-held mutex
To a list of (4) pre-alloc'd urbs which can be dispatched asynchonously
Improved rendering algorithm to hardware with lower CPU consumption,
fewer system memory accesses, and slightly higher compression.
Better scalability to multiple processors, especially with
multiple framebuffers active.
Bernie Thompson [Mon, 15 Feb 2010 14:46:13 +0000 (06:46 -0800)]
Staging: udlfb: Rework startup and teardown to fix race conditions
Rework probe to use refcounts and std functions
Because the different parts of the driver (usb, fbdev) tear down
in different orders, the driver previously could crash accessing
data that had already been freed. Refcounting system used to handle.
Reworked probe to make use of refcounts, set mode using std fbops,
and set up sysfs and pre-allocated urbs.
Bernie Thompson [Mon, 15 Feb 2010 14:46:08 +0000 (06:46 -0800)]
Staging: udlfb: Add functions to expose sysfs metrics and controls
Add sysfs controls for edid and performance metrics
There are 8 new files exposed in /sys/class/graphics/fb*
edid - returns 128 byte edid blog, suitable for parsing with parse-edid
metrics_bytes_identical
metrics_bytes_rendered
metrics_bytes_sent
metrics_cpu_kcycles_used
metrics_misc
and metrics_reset, which resets all perf metrics to zero
The 6 perf metrics are of type atomic_t.
So these metrics return precise results for short benchmarks, but
any test approx a minute or longer runtime may roll over.
Bernie Thompson [Mon, 15 Feb 2010 14:46:04 +0000 (06:46 -0800)]
Staging: udlfb: clean up function naming
Move to more consistent naming scheme
All udlfb functions start with udlfb_
All functions for udlfb's fbdev interface start with udlfb_ops_
All functinos for udlfb's usb interface start with udlfb_usb_
Bernie Thompson [Mon, 15 Feb 2010 14:45:55 +0000 (06:45 -0800)]
Staging: udlfb: pre-allocated urb list helpers
Add functions to pre-allocate and free usb bulk urbs for core render path.
Udlfb currently allocates a single urb, guarded by a mutex, that is a key
bottleneck. Because udlfb sends so much data, preallocation is most efficient.
Functions will be used by new rendering functions in later patches.
It turns out that Mimio has a userspace solution for this product using
libusb, and the in-kernel driver is just getting in the way now and
causing problems. So they have asked that the in-kernel driver be
removed. As the staging driver wasn't quite working anyway, and Mimio
supports their libusb solution for all distros, I am removing the
in-kernel driver.
The libusb solution can be downloaded from:
http://www.mimio.com/downloads/mimio_studio_software/linux.asp
Cc: <mwilder@cs.nmsu.edu> Cc: Phil Hannent <phil@hannent.co.uk> Cc: Marc Rousseau <Marc.Rousseau@mimio.com> Cc: stable <stable@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Nitin Gupta [Thu, 28 Jan 2010 15:49:59 +0000 (21:19 +0530)]
Staging: ramzswap: Handle case for invalid backing swap
Currently, we crash (issue BUG_ON) if backing swap
disk size is zero. This can happen is user specified
an extended partition or simply a bad disk as backing
swap. A crash is really an unpleasant surprise to user
for such trivial problems.
Now, we check for this condition and simply fail device
initialization if this is the case.
Additional cleanups:
* use static for all functions
* remove extra newline between functions
* memset backing_swap_name to NULL on device reset
Nitin Gupta [Thu, 28 Jan 2010 15:43:40 +0000 (21:13 +0530)]
Staging: ramzswap: Return proper error code on device create failure
Currently, we return 0 if create_device() fails and 1 otherwise.
Now, proper error code is returned from create_device() and the
same is propagated as module error code from ramzswap_init().
Also added some cleanups for ramzswap_init(), improving function
structure.
Nitin Gupta [Thu, 28 Jan 2010 15:43:39 +0000 (21:13 +0530)]
Staging: ramzswap: Set block size to PAGE_SIZE
ramzswap block size needs to be set equal to PAGE_SIZE to
avoid receiving any unaligned block I/O requests (happens
due to readahead logic during swapon). These unaligned
accesses produce unnecessary I/O errors, scaring users.
Nitin Gupta [Thu, 28 Jan 2010 15:43:37 +0000 (21:13 +0530)]
Staging: ramzswap: Use lock for 64-bit stats
64-bit stats corruption was observed when ramzswap was
used on SMP systems. To prevent this, use separate spinlock
to protect these stats.
Also, replace stat_*() with rzs_stat*() to avoid possible
conflict with core kernel code.
Eventually, these will be converted to per-cpu counters
if this driver finds use on large scale systems and this
locking is found to affect scalability.