Timo Kokkonen [Fri, 27 Mar 2009 14:42:17 +0000 (16:42 +0200)]
[WATCHDOG] twl4030 watchdog driver
Implementation of twl4030 watchdog driver.
Signed-off-by: Timo Kokkonen <timo.t.kokkonen@nokia.com> Signed-off-by: Atal Shargorodsky <ext-atal.shargorodsky@nokia.com> Signed-off-by: Wim Van Sebroeck <wim@iguana.be>
Linus Torvalds [Sat, 20 Jun 2009 17:17:02 +0000 (10:17 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (35 commits)
Input: add driver for Synaptics I2C touchpad
Input: synaptics - add support for reporting x/y resolution
Input: ALPS - handle touchpoints buttons correctly
Input: gpio-keys - change timer to workqueue
Input: ads7846 - pin change interrupt support
Input: add support for touchscreen on W90P910 ARM platform
Input: appletouch - improve finger detection
Input: wacom - clear Intuos4 wheel data when finger leaves proximity
Input: ucb1400 - move static function from header into core
Input: add driver for EETI touchpanels
Input: ads7846 - more detailed model name in sysfs
Input: ads7846 - support swapping x and y axes
Input: ati_remote2 - use non-atomic bitops
Input: introduce lm8323 keypad driver
Input: psmouse - ESD workaround fix for OLPC XO touchpad
Input: tsc2007 - make sure platform provides get_pendown_state()
Input: uinput - flush all pending ff effects before destroying device
Input: simplify name handling for certain input handles
Input: serio - do not use deprecated dev.power.power_state
Input: wacom - add support for Intuos4 tablets
...
Linus Torvalds [Sat, 20 Jun 2009 17:15:30 +0000 (10:15 -0700)]
Merge branch 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6
* 'drm-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (24 commits)
agp/intel: Make intel_i965_mask_memory use dma_addr_t for physical addresses
agp: add user mapping support to ATI AGP bridge.
drm/i915: enable GEM on PAE.
drm/radeon: fix unused variables warning
agp: switch AGP to use page array instead of unsigned long array
agpgart: detected ALi M???? chipset with M1621
drm/radeon: command stream checker for r3xx-r5xx hardware
drm/radeon: Fully initialize LVDS info also when we can't get it from the ROM.
radeon: Fix CP byte order on big endian architectures with KMS.
agp/uninorth: Handle user memory types.
drm/ttm: Add some powerpc cache flush code.
radeon: Enable modesetting on non-x86.
drm/radeon: Respect AGP cant_use_aperture flag.
drm: EDID endianness fixes.
drm/radeon: this VRAM vs aperture test is wrong, just remove it.
drm/ttm: fix an error path to exit function correctly
drm: Apply "Memory fragmentation from lost alignment blocks"
ttm: Return -ERESTART when a signal interrupts bo eviction.
drm: Remove memory debugging infrastructure.
drm/i915: Clear fence register on tiling stride change.
...
Linus Torvalds [Sat, 20 Jun 2009 16:52:27 +0000 (09:52 -0700)]
x86: don't use 'access_ok()' as a range check in get_user_pages_fast()
It's really not right to use 'access_ok()', since that is meant for the
normal "get_user()" and "copy_from/to_user()" accesses, which are done
through the TLB, rather than through the page tables.
Why? access_ok() does both too few, and too many checks. Too many,
because it is meant for regular kernel accesses that will not honor the
'user' bit in the page tables, and because it honors the USER_DS vs
KERNEL_DS distinction that we shouldn't care about in GUP. And too few,
because it doesn't do the 'canonical' check on the address on x86-64,
since the TLB will do that for us.
So instead of using a function that isn't meant for this, and does
something else and much more complicated, just do the real rules: we
don't want the range to overflow, and on x86-64, we want it to be a
canonical low address (on 32-bit, all addresses are canonical).
Acked-by: Ingo Molnar <mingo@elte.hu> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Randy Dunlap [Thu, 18 Jun 2009 00:36:15 +0000 (17:36 -0700)]
kernel-doc: ignore kmemcheck_bitfield_begin/end
Teach kernel-doc to ignore kmemcheck_bitfield_{begin,end} sugar
so that it won't generate warnings like this:
Warning(include/net/sock.h:297): No description found for parameter 'kmemcheck_bitfield_begin(flags)'
Warning(include/net/sock.h:297): No description found for parameter 'kmemcheck_bitfield_end(flags)'
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Amerigo Wang [Fri, 19 Jun 2009 07:06:54 +0000 (03:06 -0400)]
kbuild: fix build error during make htmldocs
Fix the following build error when do 'make htmldocs':
DOCPROC Documentation/DocBook/debugobjects.xml
exec /scripts/kernel-doc: No such file or directory
exec /scripts/kernel-doc: No such file or directory
Reported-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: WANG Cong <amwang@redhat.com> Acked-by: Randy Dunlap <randy.dunlap@oracle.com> Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Rainer Weikusat [Thu, 18 Jun 2009 15:04:00 +0000 (17:04 +0200)]
ide-cd: prevent null pointer deref via cdrom_newpc_intr
With 2.6.30, the error handling code in cdrom_newpc_intr was changed
to deal with partial request failures by normally completing the 'good'
parts of a request and only 'error' the last (and presumably,
incompletely transferred) bio associated with a particular
request. In order to do this, ide_complete_rq is called over
ide_cd_error_cmd() to partially complete the rq. The block layer
does partial completion only for requests with bio's and if the
rq doesn't have one (eg 'GPCMD_READ_DISC_INFO') the request is
completed as a whole and the drive->hwif->rq pointer set to NULL
afterwards. When calling ide_complete_rq again to report
the error, this null pointer is derefenced, resulting in a kernel
crash.
This fixes http://bugzilla.kernel.org/show_bug.cgi?id=13399.
Mike Rapoport [Thu, 11 Jun 2009 15:08:39 +0000 (08:08 -0700)]
Input: add driver for Synaptics I2C touchpad
This driver supports Synaptics I2C touchpad controller on eXeda
mobile device. Unfortunaltely it only works in relative mode and
thus is not comaptible with Xorg Synaptics driver.
Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Tero Saarni [Thu, 11 Jun 2009 06:27:24 +0000 (23:27 -0700)]
Input: synaptics - add support for reporting x/y resolution
Synaptics uses anisotropic coordinate system. On some wide touchpads
vertical resolution can be twice as high as horizontal which causes
unequal sensitivity on x/y directions. Add support for reading the
resolution with EVIOCGABS ioctl.
Linus Torvalds [Sat, 20 Jun 2009 00:45:51 +0000 (17:45 -0700)]
Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
i2c: New macro to initialize i2c address lists on the fly
i2c: Don't advertise i2c functions when not available
i2c: Use rwsem instead of mutex for board info
i2c: Add a sysfs interface to instantiate devices
i2c: Limit core locking to the necessary sections
i2c: Kill the redundant client list
i2c: Kill is_newstyle_driver
i2c: Merge i2c_attach_client into i2c_new_device
i2c: Drop i2c_probe function
i2c: Get rid of the legacy binding model
i2c: Kill client_register and client_unregister methods
Linus Torvalds [Sat, 20 Jun 2009 00:34:46 +0000 (17:34 -0700)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/vapier/blackfin:
Blackfin: convert page/tlb to asm-generic
Blackfin: convert types to asm-generic
Blackfin: convert irq/process to asm-generic
Blackfin: convert signal/mmap to asm-generic
Blackfin: convert locking primitives to asm-generic
Blackfin: convert termios to asm-generic
Blackfin: convert simple headers to asm-generic
Blackfin: convert socket/poll to asm-generic
Blackfin: convert user/elf to asm-generic
Blackfin: convert shm/sysv/ipc to asm-generic
Blackfin: convert asm/ioctls.h to asm-generic/ioctls.h
Blackfin: only build irqpanic.c when needed
Blackfin: pull in asm/io.h in ksyms for prototypes
Blackfin: use common test_bit() rather than __test_bit()
Joe Perches [Thu, 18 Jun 2009 23:49:25 +0000 (16:49 -0700)]
MAINTAINERS: kmemtrace pattern update
Signed-off-by: Joe Perches <joe@perches.com> Cc: Eduard - Gabriel Munteanu <eduard.munteanu@linux360.ro> Cc: Pekka Enberg <penberg@cs.helsinki.fi> Cc: Ingo Molnar <mingo@elte.hu> Cc: Zhao Lei <zhaolei@cn.fujitsu.com> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Joe Perches [Thu, 18 Jun 2009 23:49:23 +0000 (16:49 -0700)]
MAINTAINERS: update Ftrace documentation pattern
Signed-off-by: Joe Perches <joe@perches.com> Cc: Randy Dunlap <rdunlap@xenotime.net> Cc: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Krzysztof Helt <krzysztof.h1@wp.pl> Reported-by: Werner Lemberg <wl@gnu.org> Cc: Michal Januszewski <spock@gentoo.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Andrew Morton [Thu, 18 Jun 2009 23:49:17 +0000 (16:49 -0700)]
convert some DMA_nnBIT_MASK() callers
We're about to make DMA_nnBIT_MASK() emit `deprecated' warnings. Convert the
remaining stragglers which are visible to the x86_64 build.
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> Cc: James Bottomley <James.Bottomley@HansenPartnership.com> Cc: Eric Moore <Eric.Moore@lsil.com> Cc: Takashi Iwai <tiwai@suse.de> Cc: "David S. Miller" <davem@davemloft.net> Cc: Alexander Duyck <alexander.h.duyck@intel.com> Cc: Yi Zou <yi.zou@intel.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Dirk Eibach [Thu, 18 Jun 2009 23:49:15 +0000 (16:49 -0700)]
char: moxa, prevent opening unavailable ports
In moxa.c there are 32 minor numbers reserved for each device. The number
of ports actually available per device is stored in
moxa_board_conf->numPorts. This number is not considered in moxa_open().
Opening a port that is not available results in a kernel oops. This patch
adds a test to moxa_open() that prevents opening unavailable ports.
Mike Frysinger [Thu, 18 Jun 2009 23:49:14 +0000 (16:49 -0700)]
istallion: add missing __devexit marking
The remove member of the pci_driver stli_pcidriver uses __devexit_p(), so
the remove function itself should be marked with __devexit. Even more so
considering the probe function is marked with __devinit.
Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Greg Ungerer <gerg@uclinux.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Roel Kluin [Thu, 18 Jun 2009 23:49:13 +0000 (16:49 -0700)]
dtlk: off by one in {read,write}_tts()
With a postfix increment retries is incremented beyond DTLK_MAX_RETRIES so
the error message is not displayed correctly.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com> Cc: James R. Van Zandt <jrv@vanzandt.mv.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Oleg Nesterov [Thu, 18 Jun 2009 23:49:11 +0000 (16:49 -0700)]
ptrace: wait_task_zombie: do not account traced sub-threads
The bug is ancient.
If we trace the sub-thread of our natural child and this sub-thread exits,
we update parent->signal->cxxx fields. But we should not do this until
the whole thread-group exits, otherwise we account this thread (and all
other live threads) twice.
Add the task_detached() check. No need to check thread_group_empty(),
wait_consider_task()->delay_group_leader() already did this.
Signed-off-by: Oleg Nesterov <oleg@redhat.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Acked-by: Roland McGrath <roland@redhat.com> Cc: Stanislaw Gruszka <sgruszka@redhat.com> Cc: Vitaly Mayatskikh <vmayatsk@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Atsushi Nemoto [Thu, 18 Jun 2009 23:49:09 +0000 (16:49 -0700)]
rtc: make rtc_update_irq callable with irqs enabled
The rtc_update_irq() might be called with irqs enabled, if a interrupt
handler was registered without IRQF_DISABLED. Use
spin_lock_irqsave/spin_unlock_irqrestore instead of spin_lock/spin_unlock.
Also update kerneldoc and drivers which do extra work to follow the
current interface spec, as suggestted by David Brownell.
Signed-off-by: Atsushi Nemoto <anemo@mba.ocn.ne.jp> Cc: Alessandro Zummo <a.zummo@towertech.it> Cc: David Brownell <david-b@pacbell.net> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Anton Vorontsov [Thu, 18 Jun 2009 23:49:08 +0000 (16:49 -0700)]
spi_mpc8xxx: s/83xx/8xxx/g
Since we renamed the file, we might want to rename the file internals too.
Though we don't bother with changing platform driver name and platform
module alias. The stuff is legacy and hopefully we'll remove it soon.
Suggested-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Anton Vorontsov [Thu, 18 Jun 2009 23:49:08 +0000 (16:49 -0700)]
spi_mpc83xx: rename spi_83xx.c to spi_8xxx.c
The driver handles MPC83xx, MPC85xx and MPC86xx SPI controllers, so rename
the file for clarity.
Suggested-by: Kumar Gala <galak@kernel.crashing.org> Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Anton Vorontsov [Thu, 18 Jun 2009 23:49:07 +0000 (16:49 -0700)]
spi_mpc83xx: remove dead code
This patch removes #if 0'ed code, and spi_mpc83xx->busy variable that is
used by that dead snippet only.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Anton Vorontsov [Thu, 18 Jun 2009 23:49:06 +0000 (16:49 -0700)]
spi_mpc83xx: split mpc83xx_spi_work() into two routines
mpc83xx_spi_work() is quite large, with up to five indentation levels and
is quite difficult to read.
So, split the function in two parts:
1. mpc83xx_spi_work() now only traverse queued spi messages;
2. mpc83xx_spi_do_one_msg() only manages single messages.
There should be no functional changes.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Anton Vorontsov [Thu, 18 Jun 2009 23:49:05 +0000 (16:49 -0700)]
spi_mpc83xx: fix checkpatch issues
Checkpatch is spitting errors when seeing the rename patch, so fix the
errors prior to moving.
Following errors and warnings were fixed:
WARNING: Use #include <linux/io.h> instead of <asm/io.h>
#1027: FILE: drivers/spi/spi_mpc8xxx.c:37:
+#include <asm/io.h>
ERROR: "foo * bar" should be "foo *bar"
#1111: FILE: drivers/spi/spi_mpc8xxx.c:121:
+static inline void mpc83xx_spi_write_reg(__be32 __iomem * reg, u32 val)
ERROR: "foo * bar" should be "foo *bar"
#1116: FILE: drivers/spi/spi_mpc8xxx.c:126:
+static inline u32 mpc83xx_spi_read_reg(__be32 __iomem * reg)
ERROR: "foo * bar" should be "foo *bar"
#1125: FILE: drivers/spi/spi_mpc8xxx.c:135:
+ type * rx = mpc83xx_spi->rx; \
ERROR: "foo * bar" should be "foo *bar"
#1135: FILE: drivers/spi/spi_mpc8xxx.c:145:
+ const type * tx = mpc83xx_spi->tx; \
WARNING: suspect code indent for conditional statements (16, 25)
#1504: FILE: drivers/spi/spi_mpc8xxx.c:514:
+ while (((event =
[...]
+ cpu_relax();
Following warnings were left over, since fixing them will hurt the
readability. We'd better fix them by lowering the indentation level by
splitting mpc83xx_spi_work function into two parts.
WARNING: line over 80 characters
#1371: FILE: drivers/spi/spi_mpc8xxx.c:381:
+ status = mpc83xx_spi_setup_transfer(spi, t);
WARNING: line over 80 characters
#1392: FILE: drivers/spi/spi_mpc8xxx.c:402:
+ mpc83xx_spi_chipselect(spi, BITBANG_CS_INACTIVE);
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Anton Vorontsov [Thu, 18 Jun 2009 23:49:02 +0000 (16:49 -0700)]
powerpc/86xx: add MMC SPI support for MPC8610HPCD boards
This patch adds spi and mmc-spi-slot nodes, plus a gpio-controller for
PIXIS' sdcsr bank that is used for managing SPI chip-select and for
reading card's states.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Anton Vorontsov [Thu, 18 Jun 2009 23:49:01 +0000 (16:49 -0700)]
spi_mpc83xx: add small delay after asserting chip-select line
This is needed for some underlaying GPIO controllers that may be a bit
slow, or if chip-select signal need some time to stabilize.
For what it's worth, we already have the similar delay for chip-select
de-assertion case.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Anton Vorontsov [Thu, 18 Jun 2009 23:49:01 +0000 (16:49 -0700)]
spi_mpc83xx: quieten down the "Requested speed is too low" message
When a platform is running at high frequencies it's not always possible to
scale-down a frequency to a requested value, and using mmc_spi driver this
leads to the following printk flood during card polling:
...
mmc_spi spi32766.0: Requested speed is too low: 400000 Hz. Will use
520828 Hz instead.
mmc_spi spi32766.0: Requested speed is too low: 400000 Hz. Will use
520828 Hz instead.
...
Fix this by using WARN_ONCE(), it's better than the flood, and also better
than turning dev_err() into dev_dbg(), since we actually want to warn that
some things may not work correctly.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Anton Vorontsov [Thu, 18 Jun 2009 23:48:59 +0000 (16:48 -0700)]
spi_mpc83xx: handle other Freescale processors
With this patch we'll able to select spi_mpc83xx driver on the MPC86xx
platforms. Let the driver depend on FSL_SOC, so we don't have to worry
about Kconfig anymore.
Also remove the "experimental" dependency, the driver has been tested to
work on a various hardware, and surely not experimental anymore.
Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com> Cc: Kumar Gala <galak@gate.crashing.org> Cc: David Brownell <david-b@pacbell.net> Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Baruch Siach [Thu, 18 Jun 2009 23:48:58 +0000 (16:48 -0700)]
gpio: driver for PrimeCell PL061 GPIO controller
This is a driver for the ARM PrimeCell PL061 GPIO AMBA peripheral. The
driver is implemented using the gpiolib framework.
This driver also includes support for the use of the PL061 as an interrupt
controller (secondary).
Signed-off-by: Baruch Siach <baruch@tkos.co.il> Cc: David Brownell <david-b@pacbell.net> Acked-by: Russell King <rmk@arm.linux.org.uk> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Dongxiao Xu [Sun, 31 May 2009 06:43:58 +0000 (14:43 +0800)]
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.
Dongxiao Xu [Sun, 31 May 2009 06:43:55 +0000 (14:43 +0800)]
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
Dongxiao Xu [Sun, 31 May 2009 06:43:51 +0000 (14:43 +0800)]
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.
Dongxiao Xu [Sun, 31 May 2009 06:43:46 +0000 (14:43 +0800)]
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.
Dongxiao Xu [Sun, 31 May 2009 06:43:42 +0000 (14:43 +0800)]
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.
Dongxiao Xu [Sun, 31 May 2009 06:43:35 +0000 (14:43 +0800)]
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.
*) __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.
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
Serge E. Hallyn [Wed, 20 May 2009 15:15:28 +0000 (10:15 -0500)]
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>
David Rowe [Wed, 20 May 2009 01:48:27 +0000 (11:18 +0930)]
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>