Commit graph

286651 commits

Author SHA1 Message Date
Larry Finger 86587b671b staging: r8712u: Simplify semaphores
I am preparing to convert this driver from semaphore to mutex locking,
The first step has been to eliminate a number of semaphores that were
initialized but never used, and one whose only use was a single "up"
after initialization. A total of 9 semaphores were removed in this process.

One other change was to remove some inline semaphore routines that were
unused.

In addition, several cases had the following structure:

down()
if () {
   ...
}
up()

The locking overhead was reduced by moving the up/down inside the if
block.

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:12:55 -08:00
Tomas Winkler d8e4cd99d5 staging: fix the build breakage cuased by telephony drivers
Fix build error caused by commit:

6222d7a177
telephony: Move to staging

The telephony driver was moved to staging but the Makefiles
weren't updated

Cc: Joe Perches <joe@perches.com>
Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:07:46 -08:00
Thomas Meyer 2d9ebe77b7 Staging: bcm: Use memdup_user rather than duplicating its implementation
This is a little bit restricted to reduce false positives

The semantic patch that makes this change is available
in scripts/coccinelle/api/memdup_user.cocci.

More information about semantic patching is available at
http://coccinelle.lip6.fr/

Signed-off-by: Thomas Meyer <thomas@m3y3r.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:22:16 -08:00
Kevin McKinney 5cf4d6b936 Staging: bcm: Alter name, datatype, and default value of iterator variables.
This patch renames variables used in iteration
statements with i, changes the datatype to int,
and removes any default value.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:19:06 -08:00
Kevin McKinney ce4bbc2ae4 Staging: bcm: Replace variables and function outputs defined as INT with int.
This patch replaces all variables and function output
that have a datatype definition of "INT" with "int".

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:19:05 -08:00
Kevin McKinney cffae184c3 Staging: bcm: Remove assignment from if statement and reverse if logic for readability.
This patch removes an assignment from an if statement,
and it reverses the logic in several if statements to
make them more readable and understandable.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:19:05 -08:00
Kevin McKinney 5db125fb5c Staging: bcm: Remove typedef from CmHost.c and use enum.
This patch removes a typedef from a variable definition
in CmHost.c, and uses a enum instead. This Warning
was reported by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:19:05 -08:00
Kevin McKinney e4868623bf Staging: bcm: Replace dated variable __FUNCTION__.
This patch replaces the obsolete variable, __FUNCTION__,
that holds the name of the current function with
variable, __func__.  Reported by checkpatch.pl.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:19:04 -08:00
Kevin McKinney 9937fdb022 Staging: bcm: Fix coding style issues in CmHost.c
This patch cleans up several code style issues found
in CmHost.c reported by checkpatch.pl.  These include:
white space, braces, indents, and comments.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:19:04 -08:00
Kevin McKinney b71dbbcfaa Staging: bcm: Fix an integer overflow in IOCTL_BCM_NVM_READ/WRITE
Variables stNVMReadWrite.uioffset and stNVMReadWrite.uiNumBytes
are chosen from userspace and can be very high. The sum of
these two digits would result in a small number. Therefore,
this patch verifies a negative number was not entered, and
reorganizes the equation to remove the integer overflow.

Signed-off-by: Kevin McKinney <klmckinney1@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:19:03 -08:00
Szymon Janc 3c92e38dc4 Staging: quickstart: Rename quickstart_btn to quickstart_button
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:51 -08:00
Szymon Janc 21c1ddf314 Staging: quickstart: Use %u for printing button id
Button id is of unsigned int type.

Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:50 -08:00
Szymon Janc 505d2ad227 Staging: quickstart: Use list.h API for buttons list
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:50 -08:00
Szymon Janc 3991eae943 Staging: quickstart: Get rid of quickstart_data struct
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:50 -08:00
Szymon Janc 4a0908322a Staging: quickstart: Remove unused defines
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:49 -08:00
Szymon Janc 55e4036986 Staging: quickstart: Use switch-case in quickstart_acpi_notify
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:49 -08:00
Szymon Janc ffe1c0565c Staging: quickstart: Cleanup quickstart_acpi_config
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:49 -08:00
Szymon Janc f27a551968 Staging: quickstart: Cleanup quickstart_acpi_add
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:49 -08:00
Szymon Janc 60955f15d9 Staging: quickstart: Cleanup quickstart_acpi_remove
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:48 -08:00
Szymon Janc 2ac16967b8 Staging: quickstart: Cleanup quickstart_acpi_ghid
Also fix memory leak (buffer.pointer) when returned buffer of length
less than 8.

Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:48 -08:00
Szymon Janc 1692caa949 Staging: quickstart: Make quickstart_input static
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:48 -08:00
Szymon Janc 605926ef5a Staging: quickstart: Move some code to avoid forward declarations
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:47 -08:00
Szymon Janc 7267d2610a Staging: quickstart: Prefix remaining functions names with quickstart_
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:47 -08:00
Szymon Janc 5c9ed5bedf Staging: quickstart: Some style, whitespaces and typos fixes
Signed-off-by: Szymon Janc <szymon@janc.net.pl>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:16:47 -08:00
Nitin Gupta b154ff05e1 staging: zram: remove xvmalloc
Removes the xvmalloc allocator code from the zram driver

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:13:01 -08:00
Nitin Gupta fd1a30dea1 staging: zram: replace xvmalloc with zsmalloc
Replaces xvmalloc with zsmalloc as the compressed page allocator
for zram

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Acked-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:13:00 -08:00
Seth Jennings 94add674a7 staging: add zsmalloc to Kconfig/Makefile
Adds the new zsmalloc library to the staging Kconfig and Makefile

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:12:54 -08:00
Nitin Gupta 61989a80fb staging: zsmalloc: zsmalloc memory allocation library
This patch creates a new memory allocation library named
zsmalloc.

NOTE: zsmalloc currently depends on SPARSEMEM for the MAX_PHYSMEM_BITS
value needed to determine the format of the object handle. There may
be a better way to do this.  Feedback is welcome.

Signed-off-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:12:53 -08:00
Seth Jennings 17dd9f831a staging: zcache: crypto API support
This patch allow zcache to use the crypto API for page compression.
It replaces the direct LZO compress/decompress calls with calls
into the crypto compression API. The compressor to be used is
specified in the kernel boot line with the zcache parameter like:
zcache=lzo or zcache=deflate.  If the specified compressor can't
be loaded, zcache uses lzo as the default compressor.

Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Acked-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:09:27 -08:00
K. Y. Srinivasan af9584b82d Staging: hv: storvsc: Consolidate all the wire protocol definitions
Consolidate all definitions that support communication with the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:39 -08:00
K. Y. Srinivasan 61eaffc91d Staging: hv: storvsc: Consolidate the request structure
Consolidate the request structure by getting rid of struct hv_storvsc_request.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:39 -08:00
K. Y. Srinivasan 410c52ed66 Staging: hv: storvsc: Get rid of some unused defines
Get rid of some unused defines.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:39 -08:00
K. Y. Srinivasan 6b2f949559 Staging: hv: storvsc: Cleanup some protocol related constants
Cleanup some protocol related constants.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:38 -08:00
K. Y. Srinivasan 85904a5e55 Staging: hv: storvsc: Cleanup the code for generating protocol version
Cleanup the code for generating protocol version.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:38 -08:00
K. Y. Srinivasan c649114a5d Staging: hv: storvsc: Miscellaneous cleanup of storvsc driver
Miscellaneous cleanup of storvsc driver - get rid of unnecessary defines and
use fixed size types for structures used for communication with the host.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:37 -08:00
K. Y. Srinivasan 93a1bf4dd0 Staging: hv: storvsc: Rename the context field in hv_storvsc_request
Rename the context field in hv_storvsc_request. As part of this change
fix the type of this field.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:37 -08:00
K. Y. Srinivasan 2707388c7c Staging: hv: storvsc: Get rid of the on_io_completion in hv_storvsc_request
Get rid of the on_io_completion field  in struct hv_storvsc_request. As part of this
relocate the bounce buffer handling code (to avoid having forward declarations).

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:36 -08:00
K. Y. Srinivasan a8c18c573b Staging: hv: storvsc: Add a comment to explain life-cycle management
Add a comment to explain life-cycle management and fix format issue.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:36 -08:00
K. Y. Srinivasan ddcbf65e48 Staging: hv: storvsc: Move and cleanup storvsc_remove()
Relocate the storvsc_remove() function to a different location in the file
and invoke scsi_host_put() only after all the cleanup.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:35 -08:00
K. Y. Srinivasan 4b270c8b23 Staging: hv: storvsc: Cleanup storvsc_host_reset_handler()
Cleanup storvsc_host_reset_handler() by getting rid of storvsc_host_reset().

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:35 -08:00
K. Y. Srinivasan 160463204f Staging: hv: storvsc: Introduce defines for srb status codes
Introduce defines for srb status codes.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:35 -08:00
K. Y. Srinivasan c77b63b639 Staging: hv: storvsc: Cleanup storvsc_queuecommand()
Cleanup storvsc_queuecommand(). As part of this cleanup, rename the function to
check if the scsi command can be sent to the host, consolidate error recovery
and get rid of some dead code.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:35 -08:00
K. Y. Srinivasan 59d22950b2 Staging: hv: storvsc: Cleanup storvsc_probe()
Cleanup storvsc_probe(). As part of this cleanup, get rid of
storvsc_get_ide_info() by inlining the necessary code.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:34 -08:00
K. Y. Srinivasan 09f0355f06 Staging: hv: storvsc: Cleanup some comments
Use consistent format for comments and get rid of some unnecessary
comments.

Signed-off-by: K. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:07:34 -08:00
Dan Magenheimer 1739441c29 staging: ramster: enable as staging driver
Enable build of ramster as a staging driver

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:05:28 -08:00
Dan Magenheimer 14a3cd58dd staging: ramster: ramster-specific new files
New files for ramster support:  The file ramster.h declares externs
and some pampd bitfield manipulation.  The file zcache.h declares
some zcache functions that now must be accessed from the ramster
glue code.  The file ramster_o2net.c is the glue between
zcache and the o2net messaging code, providing routines called
from zcache that initiate messages, and routines that handle
messages by calling zcache. TODO explains future plans for merging.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:04:08 -08:00
Dan Magenheimer 0fb3860a82 staging: ramster: ramster-specific changes to zcache/tmem
In tmem.[ch], new "repatriate" (provoke async get) and "localify" (handle
incoming data resulting from an async get) routines combine with a handful
of changes to existing pamops interfaces allow the generic tmem code
to support asynchronous operations.  Also, a new tmem_xhandle struct
groups together key information that must be passed to remote tmem stores.

Zcache-main.c is augmented with a large amount of ramster-specific code
to handle remote operations and "foreign" pages on both ends of the
"remotify" protocol.  New "foreign" pools are auto-created on demand.
A "selfshrinker" thread periodically repatriates remote persistent pages
when local memory conditions allow.  For certain operations, a queue is
necessary to guarantee strict ordering as out-of-order puts/flushes can
cause strange race conditions.  Pampd pointers now either point to local
memory OR describe a remote page; to allow the same 64-bits to describe
either, the LSB is used to differentiate.  Some acrobatics must be performed
to ensure local memory is available to handle a remote persistent get,
or deal with the data directly anyway if the malloc failed.  Lots
of ramster-specific statistics are available via sysfs.

Note: Some debug ifdefs left in for now.
Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:04:07 -08:00
Dan Magenheimer b083e8619c staging: ramster: ramster-specific changes to cluster code
Ramster-specific changes to ocfs2 cluster foundation, including:
A method for fooling the o2 heartbeat into starting without
an ocfs2 filesystem; a new message mechanism ("data magic") for handling
a reply to a message requesting data; a hack for keeping the cluster
alive even after timeouts so cluster machines can be rebooted separately.

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:04:07 -08:00
Dan Magenheimer ba351b02ab staging: ramster: local compression + tmem
Copy files from drivers/staging/zcache.  Ramster compresses pages
locally before transmitting them to another node, so we can
leverage the zcache and tmem code directly.  Note: there are
no ramster-specific changes yet to these files.

(Why copy?  The ramster tmem.c/tmem.h changes are definitely shareable
between zcache and ramster; the eventual destination for tmem.c
is the linux lib directory.  Ramster changes to zcache are more substantial
and zcache is currently undergoing some significant unrelated changes
(including a new allocator and breaking zcache-main.c into smaller files),
so it seemed best to branch temporarily and merge later.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:04:07 -08:00
Dan Magenheimer 1135ca9c86 staging: ramster: cluster/messaging foundation
Copy cluster subdirectory from ocfs2.  These files implement
the basic cluster discovery, mapping, heartbeat / keepalive, and
messaging ("o2net") that ramster requires for internode communication.
Note: there are NO ramster-specific changes yet; this commit
does NOT pass checkpatch since the copied source files do not.

(Why copy?  This particular part of ocfs2 has never been broken out
for non-ocfs2 use before, some (small) changes are required for ramster
to use that code, and ramster is currently incompatible with real
ocfs2 anyway (requires !CONFIG_OCFS2_FS).  Before ramster can be promoted
out of staging, we will need to work with the ocfs2 maintainers to
see if the code interdependencies can be merged, but for now, for
staging, this seemed to be an expedient way to make use of the ocfs2
core cluster code while still incorporating necessary changes for ramster.)

Signed-off-by: Dan Magenheimer <dan.magenheimer@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-08 17:04:06 -08:00