Commit graph

153311 commits

Author SHA1 Message Date
Dongxiao Xu afcf462a1f Staging: heci: fix the problem that file_ext->state should be protected by device_lock
While access file_ext->state, we should use device_lock to protect it. The
original codes miss this in some places.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:55 -07:00
Dongxiao Xu 8d1c50e982 Staging: heci: do not print error when heci_bh_handler is already on workqueue
schedule_work returns 0, if the work is already on the work_queue, else
returns non-zero. Do not print error message if heci_bh_handlerwork was
already on queue.

Signed-off-by: Nikanth Karthikesan <knikanth@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:55 -07:00
Dongxiao Xu ad914a3ec5 Staging: heci: fix setting h_is bit in h_csr register
Host software could issue interrupts to ME firmware, using H_IG bit. While
Setting H_IG bit, host software should preserve all the other bits in H_CSR
unchanged. In the original function which sets H_CSR register, they first read
the register, then set some bits, and write the whole 32bits back to the
register. And that the special behavior of H_IS (write-one-to-zero) causes problem.
This patch fixes the issue in the following ways:

 - Modify heci_set_csr_register() function so that it doesn't change H_IS bit.
 - Add interface heci_csr_clear_his() to clear H_IS bit. This function is called
   after H_IS checking (dev->host_hw_state & H_IS == H_IS).
 - In original heci_csr_disable_interrupts() function, it not only clears H_IE
   bit, sometimes it also clears H_IS bit. This patch separates the two parts.
 - Avoid calling write_heci_register() function to set H_CSR register directly,
   and instead using heci_set_csr_register() function

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:55 -07:00
Dongxiao Xu 52b855600c Staging: heci: fix typos and add wait after disconnect
- Fix typo for enum HECI_WRITE.
 - Fix timeout issue. If the time period is greater or equal 15s, it's timeout.
 - Add 10ms wait time after disconnect, to ensure that hardware is ready.
   Otherwise in the next time connection, hardware resource may be busy.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:55 -07:00
Dongxiao Xu 58b25a63a1 Staging: heci: fix softirq safe to unsafe spinlock issue
When spinlock is nested, and the outside one is spin_lock_bh, the inner
spinlock should also be spin_lock_bh, otherwise it will bring softirq-safe
to softirq-unsafe lock conversion.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:55 -07:00
Dongxiao Xu 72abd22883 Staging: heci: fix spinlock order mess of device_lock and read_io_lock
In orginal code, the device_lock and read_io_lock is mess order when nested,
which may bring dead lock. This patch unify the spinlock order of device_lock
and read_io_lock. First acquire device_lock, then read_io_lock.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:55 -07:00
Dongxiao Xu 171df63819 Staging: heci: fix wrong order of device_lock and file_lock
When the two locks are nested, the code should always first acquire file_lock,
and then acquire device_lock in order not to generate dead-lock race.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:55 -07:00
Dongxiao Xu 36e844671c Staging: heci: fix userspace pointer mess
Fix userspace pointer mess.
 - In memcmp(), dest and src pointer should be both in kernel space.
 - Add (void __user *) modification before userspace pointer.

Signed-off-by: Dongxiao Xu <dongxiao.xu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
vibi sreenivasan 7a80bfcd1f Staging: rspiusb: copy_to/from_user related fixes
The patch does copy_to/from_user related fixes

*) __copy_from/to_user is enough for user space data buffer checked by access_ok.
*) return -EFAULT if __copy_from/to_user fails.
*) Do not use memcpy to copy from user space.

Signed-off-by: Vibi Sreenivasan <vibi_sreenivasan@cms.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
vibi sreenivasan 8d2db5169d Staging: rspiusb: Fix a bunch of warnings.
The patch fixes the following warnings.

drivers/staging/rspiusb/rspiusb.c: In function ‘pixel_data’:
drivers/staging/rspiusb/rspiusb.c:267: warning: passing argument 1 of ‘SetPageDirty’ makes
pointer from integer without a cast
drivers/staging/rspiusb/rspiusb.c: In function ‘UnMapUserBuffer’:
drivers/staging/rspiusb/rspiusb.c:500: warning: passing argument 1 of ‘put_page’ makes
pointer from integer without a cast
drivers/staging/rspiusb/rspiusb.c: In function ‘MapUserBuffer’:
drivers/staging/rspiusb/rspiusb.c:662: warning: assignment makes integer from pointer without a cast
drivers/staging/rspiusb/rspiusb.c:670: warning: assignment makes integer from pointer without a cast

Signed-off-by: Vibi Sreenivasan <vibi_sreenivasan@cms.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
Richard Genoud 14e8bcd086 Staging: rspiusb: duplicate code in pixis_io
It seems that pixis_io and pixis_io2 should do the same thing.


Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
Richard Genoud c854b5e58f Staging: rspiusb.c: break the huge piusb_ioctl function into several ones
This makes the code more readable, makes checkpatch really happy and factorize some code.

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
Richard Genoud f2d46e248a Staging: rspiusb: clean rspiusb code
This first patch makes checkpatch happier

Signed-off-by: Richard Genoud <richard.genoud@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
J.R. Mauro 6546f08d21 Staging: rspiusb: make driver compile
Convert undefined info() function calls to dev_err, making rspiusb compile

Signed-off-by: J.R. Mauro <jrm8005@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
Serge E. Hallyn f82ebea5c8 staging: p9auth: prevent some oopses and memory leaks
Before all testcases, do:
	mknod /dev/caphash c 253 0
	mknod /dev/capuse c 253 1

This patch does the following:

1. caphash write of > CAP_NODE_SIZE bytes overruns node_ptr->data
	(test: cat /etc/mime.types > /dev/caphash)
2. make sure we don't dereference a NULL cap_devices[0].head
	(test: cat serge@root@abab > /dev/capuse)
3. don't let strlen dereference a NULL target_user etc
	(test: echo ab > /dev/capuse)
4. Don't leak a bunch of memory in cap_write().  Note that
   technically node_ptr is not needed for the capuse write case.
   As a result I have a much more extensive patch splitting up
   cap_write(), but I thought a smaller patch that is easier to test
   and verify would be a better start.  To test:
	cnt=0
	while [ 1 ]; do
		echo /etc/mime.types > /dev/capuse
		if [ $((cnt%25)) -eq 0 ]; then
			head -2 /proc/meminfo
		fi
		cnt=$((cnt+1))
		sleep 0.3
	done
   Without this patch, it MemFree steadily drops.  With the patch,
   it does not.

I have *not* tested this driver (with or without these patches)
with factotum or anything - only using the tests described above.

Signed-off-by: Serge E. Hallyn <serue@us.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
David Rowe 0f51010e87 Staging: oslec bug fix
I have just had a bug fix submitted for Oslec which I have applied to
Oslec SVN. The bug can potentially stops the echo canceller adapting
after a few seconds, although it hasn't caused many problems in
practice.

Signed-off-by: David Rowe <david@rowetel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
Andre Lopes 99dc2a7f12 staging: b3dfg: clean up MODULE_PARM_DESC newline
Remove incorrect MODULE_PARM_DESC newline.

Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
Roel Kluin 315d7fa9d6 staging: wis-sony-tuner.c: fix &&/|| error
Fix &&/|| typo

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
Julia Lawall 385269885f Staging: rtl8192su: Correct use of ! and &
Correct priority problem in the use of ! and &.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@ expression E; constant C; @@
- !E & C
+ !(E & C)
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:54 -07:00
Greg Kroah-Hartman 36dbd40139 Staging: rtl8192su: fix build warnings
This fixes some build warnings in the rtl8192su driver.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Jerry Chuang 5f53d8ca3d Staging: add rtl8192SU wireless usb driver
Driver from Realtek for the Realtek RTL8192 USB wifi device

Based on the r8187 driver from Andrea Merello <andreamrl@tiscali.it> and
others.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Greg Kroah-Hartman d01c3c8e13 Staging: cpc-usb: fix build warnings
This fixes some build warnings in the cpc-usb driver.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Alexander Beregalov 5e23f3e962 Staging: cpc-usb: fix printk format warnings
Fix this warnings:
cpc-usb_drv.c:478: warning: format '%d' expects type 'int',
	but argument 4 has type 'size_t'
cpc-usb_drv.c:1034: warning: format '%d' expects type 'int',
	but argument 3 has type 'long unsigned int'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Alexander Beregalov c32a4e066c Staging: cpc-usb: depends on PROC_FS
Fix this build error when PROC_FS is not enabled:
cpc-usb_drv.c:61:2: error: #error "PROCFS needed"
cpc-usb_drv.c:1159: error: implicit declaration of function 'proc_mkdir'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Julia Lawall a3d97c9b19 Staging: cpc-usb: Adjust NULL test
Since card must already be non-NULL, it seems that what was intended
was to test the result of kmalloc.

The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)

// <smpl>
@@
expression E,E1;
identifier f,fld,fld1;
statement S1,S2;
@@

E->fld = f(...);
... when != E = E1
    when != E->fld1 = E1
if (
-   E
+   E->fld
           == NULL) S1 else S2
// </smpl>

Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Greg Kroah-Hartman 562bf4845f Staging: cpc-usb: add TODO file
List what needs to be done to get this driver merged into
the main part of the kernel tree.

Cc: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Greg Kroah-Hartman 240f3ee0c8 Staging: cpc-usb: fix checkpatch warnings in sja2m16c.h
This fixes most of the coding style issues in sja2m16c.h

Cc: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Greg Kroah-Hartman 0f064b52ce Staging: cpc-usb: fix up checkpatch errors in cpc-usb_drv.c
This resolves the checkpatch errors in cpc-usb_drv.c

Cc: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Greg Kroah-Hartman 936b623053 Staging: cpc-usb: add driver to the build
This adds the cpc-usb driver to the kernel build

Cc: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Greg Kroah-Hartman 84a209d01c Staging: cpc-usb: fix some build problems in the driver
It will now build properly on the latest kernel tree.

Cc: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:53 -07:00
Sebastian Haas e0ce8a7265 Staging: add cpc-usb driver to the staging tree
This is a CPC CAN USB driver.

Just some comments:
cpcusb.h and cpc-usb_drv.c: Essential driver source code
sja2m16c_2.c: Helper for converting bitrate timings
cpc.h: Structures and definition needed to communicate with the device

From: Sebastian Haas <haas@ems-wuensche.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Oleg Nesterov 6456f0b768 Staging: epl: do not use CLONE_SIGHAND with allow_signal()
Not sure this patch is really needed since kernel_thread() is deprecated
(and checkpatch.pl complains).

But we should not use kernel_thread(CLONE_SIGHAND) if we are going to play
with signals.

Signed-off-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Greg Kroah-Hartman d604fc995e Staging: android: fix Kconfig issues
Wrap all ANDROID config items with a #if to keep from asking if you want
specific Android drivers even if you say N to CONFIG_ANDROID

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Greg Kroah-Hartman 3dffc8271f Staging: android: binder: fix up some checkpatch warnings
This cleans up the majority of the checkpatch warnings in the android
binder driver.  All that is left now is a bunch of too-long-line stuff.


Cc: San Mehat <san@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Greg Kroah-Hartman e93daf9f8d Staging: android: ram_console: fix up remaining checkpatch warnings
This cleans up the last of the checkpatch warnings in the android
ram_console driver.


Cc: San Mehat <san@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Greg Kroah-Hartman 66b20608c9 Staging: android: logger: fix up remaining checkpatch warnings
This cleans up the last of the checkpatch warnings in the android logger
driver.


Cc: San Mehat <san@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Greg Kroah-Hartman 1dbb5765ac Staging: android: lowmemorykiller: fix up remaining checkpatch warnings
This cleans up the last of the checkpatch warnings in the android
lowmemorykiller driver.


Cc: San Mehat <san@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Cc: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Mike Lockwood 241e12879b Staging: android: timed_gpio: Separate timed_output class into a separate driver.
Signed-off-by: Mike Lockwood <lockwood@android.com>
Signed-off-by: Arve Hjønnevåg <arve@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
David Rientjes 5d14a573a4 Staging: android: lowmemorykiller: fix possible android low memory killer NULL pointer
get_mm_rss() atomically dereferences the actual without checking for a
NULL pointer, which is possible since task_lock() is not held.

Cc: San Mehat <san@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
David Rientjes 34006e11ee Staging: android: lowmemorykiller: cleanup android low memory killer
Clean up the code in lowmem_shrink() for the Android low memory killer so
that it follows the kernel coding style.

It's unnecessary to check for p->oomkilladj >= min_adj if the selected
task's oomkilladj score is stored since get_mm_rss() will always be
greater than zero.

Cc: San Mehat <san@android.com>
Cc: Arve Hjønnevåg <arve@android.com>
Signed-off-by: David Rientjes <rientjes@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Arve Hjønnevåg 31d59a4198 Staging: android: lowmemorykiller: Don't count free space unless it meets the specified limit by itself
From: Arve Hjønnevåg <arve@android.com>

This allows processes to be killed when the kernel evict cache pages in
an attempt to get more contiguous free memory.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Cc: David Rientjes <rientjes@google.com>
Cc: San Mehat <san@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Arve Hjønnevåg f501d00144 Staging: android: lowmemorykiller: Only iterate over process list when needed.
Use NR_ACTIVE plus NR_INACTIVE as a size estimate for our fake cache
instead the sum of rss. Neither method is accurate.

Also skip the process scan, if the amount of memory available is above
the largest threshold set.

Signed-off-by: Arve Hjønnevåg <arve@android.com>
Cc: David Rientjes <rientjes@google.com>
Cc: San Mehat <san@android.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Randy Dunlap 4900dea69f Staging: vt6655: uses pci functions, should depend on PCI
This driver uses lots of pci_*() calls, so it should depend on PCI.

drivers/staging/vt6655/device_main.c:3942: error: implicit declaration of function 'pci_dev_driver'

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:52 -07:00
Forest Bond 1d69a1c65b Staging: vt6655: Integrate drivers/staging/vt6655 into build system.
Integrate drivers/staging/vt6655 into build system.

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:51 -07:00
Forest Bond 5721135408 Staging: vt6655: use net_device_ops for management functions
vt6655: use net_device_ops for management functions

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:51 -07:00
Forest Bond 7bb8dc2d7e Staging: vt6655: Remove LINUX_VERSION_CODE preprocessor conditionals.
vt6655: Remove LINUX_VERSION_CODE preprocessor conditionals.

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:51 -07:00
Forest Bond c9d0352914 Staging: vt6655: Replace net_device->priv accesses with netdev_priv calls.
vt6655: Replace net_device->priv accesses with netdev_priv calls.

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:51 -07:00
Forest Bond e2ce5277eb Staging: vt6655: Build vt6655.ko, not viawget.ko.
As you requested, this series is to be applied on top of patches 1, 2, and 6
(and replaces patches 3, 4, 5, 7, and 8) from the previous series.

Build vt6655.ko, not viawget.ko.

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:51 -07:00
Forest Bond 756f94e638 Staging: vt6655: Drop obsolete fsuid/fsgid accesses.
drivers/staging/vt6655/device_main.c: Drop obsolete fsuid/fsgid accesses.

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:51 -07:00
Forest Bond 1cb648b348 Staging: vt6655 Add includes to drivers/staging/vt6655.
Add includes to drivers/staging/vt6655.  These came from the includes directory
in the upstream source archive.

Signed-off-by: Forest Bond <forest@alittletooquiet.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-06-19 11:00:51 -07:00