Sven Eckelmann [Sun, 21 Nov 2010 23:55:57 +0000 (00:55 +0100)]
Staging: batman-adv: Remove hashdata_choose_cb from hash
Function pointers cannot be inlined by a compiler and thus always has
the overhead of an call. hashdata_choose_cb's are one of the most often
called function pointers and its overhead must kept relative low.
As first step, every function which uses this function pointer takes it
as parameter instead of storing it inside the hash abstraction
structure.
This not generate any performance gain right now. The called functions
must also be able to be inlined by the calling functions to enable
inlining of the function pointer.
Reported-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sven Eckelmann [Sun, 21 Nov 2010 23:55:56 +0000 (00:55 +0100)]
Staging: batman-adv: Remove hashdata_compare_cb from hash
Function pointers cannot be inlined by a compiler and thus always has
the overhead of an call. hashdata_compare_cb's are one of the most often
called function pointers and its overhead must kept relative low.
As first step, every function which uses this function pointer takes it
as parameter instead of storing it inside the hash abstraction
structure.
This not generate any performance gain right now. The called functions
must also be able to be inlined by the calling functions to enable
inlining of the function pointer.
Reported-by: David S. Miller <davem@davemloft.net> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Linus Lüssing [Sun, 21 Nov 2010 23:55:55 +0000 (00:55 +0100)]
Staging: batman-adv: Make hop_penalty configurable via sysfs
When having a mixed topology of both very mobile and rather static
nodes, you are usually best advised to set the originator interval on
all nodes to a level best suited for the most mobile node.
However, if most of the nodes are rather static, this can create a lot
of undesired overhead as a trade-off then. If setting the interval too
low on the static nodes, a mobile node might be chosen as a router for
too long, not switching away from it fast enough because of its
mobility and the low frequency of ogms of static nodes.
Exposing the hop_penalty is especially useful for the stated scenario: A
static node can keep the default originator interval, a mobile node can
select a quicker one resulting in faster route updates towards this
mobile node. Additionally, such a mobile node could select a higher hop
penalty (or even set it to 255 to disable acting as a router for other
nodes) to make it less desirable, letting other nodes avoid selecting
this mobile node as a router.
Linus Lüssing [Sun, 21 Nov 2010 23:55:54 +0000 (00:55 +0100)]
Staging: batman-adv: Ommit storing struct device in sysfs functions
We actually do not need an extra struct device variable, therefore
replacing them with defines that directly get the bat_priv or
net_device. This further reduces the code size in bat_sysfs.c and
especially shortens some macros.
Linus Lüssing [Sun, 21 Nov 2010 23:55:53 +0000 (00:55 +0100)]
Staging: batman-adv: Wrapper functions for sysfs storing
Sysfs configuration options that just took a boolean value
(enable(d)/disable(d)/0/1) and integer setting basically all had the same
structure.
To avoid even more copy and pasting in the future and to make introducing
new configuration parameters for batman-adv simpler, more generic
wrapper functions are being introduced with this commit. They can deal with
boolean and unsigned integer parameters, storing them in the specified
atomic_t variables.
Linus Lüssing [Sun, 21 Nov 2010 23:55:52 +0000 (00:55 +0100)]
Staging: batman-adv: Unify sysfs file names with their bat_priv atomics
Both sysfs entries and variable names shall be as descriptive as
possible while not exceeding a certain length. This patch renames
bat_priv atomics to be equally descriptive with their according sysfs
entries.
Unifying sysfs and bat_priv atomic names also makes it easier to find
each others pendant.
The reduced ("type"-)information which was previously indicated with a
_enabled for booleans got substituted by a comment in bat_priv.
This patch has also been done in regards for the future BAT_ATTR_*
macros (they only need one name argument instead of a file and variable
name).
Signed-off-by: Linus Lüssing <linus.luessing@web.de> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Marek Lindner [Sun, 21 Nov 2010 23:55:51 +0000 (00:55 +0100)]
Staging: batman-adv: softif bridge loop avoidance
By connecting multiple batman-adv mesh nodes to the same ethernet
segment a loop can be created when the soft-interface is bridged
into that ethernet segment. A simple visualization of the loop
involving the most common case - a LAN as ethernet segment:
Packets from the LAN (e.g. ARP broadcasts) will circle forever from
node1 or node2 over the mesh back into the LAN.
This patch adds the functionality to detect other batman-adv nodes
connected to the LAN and select a 'gateway' to talk to the
non-batman-adv devices on this LAN. All traffic from and to the mesh
will be handled by this gateway to avoid the loop. OGMs received via
the soft-interface are interpreted as 'port announcements' to locate
potential batman-adv nodes. The patch can also deal with vlans on
top of batX and offers a list of LAN neighbors via debugfs.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
[sven.eckelmann@gmx.de: Rework on top of current version] Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Andreas Langer [Sun, 21 Nov 2010 23:55:45 +0000 (00:55 +0100)]
Staging: batman-adv: restructure fragmentation to handle batman unicast packets
The unicast_frag_send_skb() function expected 'raw' packets (without any
batman-adv header) to fragment them. This needs to be changed, so that
this function is able to fragment packets that already traveled inside
the mesh but need to be fragmented now.
Signed-off-by: Andreas Langer <an.langer@gmx.de> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Sven Eckelmann [Sun, 21 Nov 2010 23:55:42 +0000 (00:55 +0100)]
Staging: batman-adv: Don't remove interface with spinlock held
We call a lot of the netdevice code when holding if_list_lock which will
spin the whole time. This is not necessary because we only want to
protect the access to the list to be serialized. An extra queue can be
used which hold all interfaces which should be removed and then use that
queue without any locks for netdevice cleanup.
Marek Lindner [Sun, 21 Nov 2010 23:55:40 +0000 (00:55 +0100)]
Staging: batman-adv: ensure that eth_type_trans gets linear memory
eth_type_trans tries to pull data with the length of the ethernet header
from the skb. We only ensured that enough data for the first ethernet
header and the batman header is available in non-paged memory of the skb
and not for the ethernet after the batman header.
eth_type_trans would fail sometimes with drivers which don't ensure that
all there data is perfectly linearised.
Reported-by: Rafal Lesniak <lesniak@eresi-project.org> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de> Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Mon, 22 Nov 2010 23:31:16 +0000 (23:31 +0000)]
staging: iio: documentation rewrite and cleanup of sysfs documetation
Change to capital syntax for documetation e.g. 'inX-inY_raw'
Use multiple 'What:' entries rather than wild cards or options so
as to make the documentation clearer and easier to search.
Some trivial spelling fixes.
Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Jonathan Cameron [Mon, 22 Nov 2010 23:09:48 +0000 (23:09 +0000)]
staging: iio: adis16260 add suppport for adis16255 and adis16250.
Unusual element is addition of 'negate' and 'axis' platform data
to ensure we support all the functionality of the adis16255 driver
currently in staging.
Vinod Koul [Fri, 19 Nov 2010 15:06:31 +0000 (15:06 +0000)]
sst: Change the SST driver PCM interface
The PCM interface in SST driver is cmds only, this patch changes the interface to open, close and cmd interface.
This allows SST driver to keep easy track of handles open
Mark Allyn [Wed, 17 Nov 2010 23:45:36 +0000 (15:45 -0800)]
Staging: sep: Introduce sep driver
This driver is for the Security Processor, a dedicated encryption
and decryption driver that is used on the Intel mobile platform.
This has been checked with checkpatch and there are four
warnings for lines over 80 charactors.
There is one compile warning. This is for a function that is
only used if the rar register driver is needed. There is an
ifdef in a header file that stubs out the rar register driver
if the rar register is not configured.
This driver does add a configuration, which is CONFIG_DX_SEP.
Signed-off-by: Mark Allyn <mark.a.allyn@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Randy Dunlap [Wed, 17 Nov 2010 23:38:46 +0000 (15:38 -0800)]
staging: clearpad_tm1217 depends on INPUT
clearpad_tm1217 driver uses many input_() interfaces, so it should
depend on INPUT.
clearpad_tm1217.c:(.text+0xf19ac): undefined reference to `input_unregister_device'
clearpad_tm1217.c:(.text+0xf1b19): undefined reference to `input_event'
clearpad_tm1217.c:(.text+0xf1b31): undefined reference to `input_event'
clearpad_tm1217.c:(.text+0xf1bb4): undefined reference to `input_event'
clearpad_tm1217.c:(.text+0xf1bf2): undefined reference to `input_event'
drivers/built-in.o:clearpad_tm1217.c:(.text+0xf1c08): more undefined references to `input_event' follow
clearpad_tm1217.c:(.text+0xf1df3): undefined reference to `input_allocate_device'
clearpad_tm1217.c:(.text+0xf1eac): undefined reference to `input_set_abs_params'
clearpad_tm1217.c:(.text+0xf1ed1): undefined reference to `input_set_abs_params'
clearpad_tm1217.c:(.text+0xf1ed8): undefined reference to `input_register_device'
clearpad_tm1217.c:(.text+0xf2040): undefined reference to `input_unregister_device'
clearpad_tm1217.c:(.text+0xf204b): undefined reference to `input_free_device'
Marek Belisko [Thu, 18 Nov 2010 08:49:09 +0000 (09:49 +0100)]
staging: ft1000: Fix compilation warning.
This patch fix following warning:
drivers/staging/ft1000/ft1000-usb/ft1000_usb.c:67:22:
warning: ‘pft1000info’ may be used uninitialized in this function
Signed-off-by: Marek Belisko <marek.belisko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Yong Wang [Wed, 17 Nov 2010 14:09:54 +0000 (22:09 +0800)]
staging: spectra: asynchronous init
The spectra nand driver takes quite some time to initialize because
it needs to scan the whole nand disk to find the latest block table.
This patch initializes the spectra nand driver asynchronously so that
other things in the kernel can initialize in parallel to the scanning
operation.
Signed-off-by: Yong Wang <yong.y.wang@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Yong Wang [Wed, 17 Nov 2010 14:08:28 +0000 (22:08 +0800)]
staging: spectra: move all init logic into nand_pci_probe
Currently there are some driver initialization logic that
is not part of nand_pci_probe function. This will result in
that part of driver initialization code executing even on
platforms without the corresponding hardware which is always
dangerous.
Brett Rudley [Tue, 16 Nov 2010 23:45:48 +0000 (15:45 -0800)]
staging: brcm80211: s/osl_t/struct osl_info/g
Do the substitution (and then fix all the dang lines that were pushed past 80 columns.)
Some of the touched lines triggered checkpatch warnings for completely unrelated
reasons that were already there. Those will have to be addressed later.
Dan Carpenter [Sat, 13 Nov 2010 04:37:49 +0000 (07:37 +0300)]
Staging: bcm: signedness bug in StoreSFParam()
wrm() returns negative error codes so "ret" needs to be signed here.
There was place where wrm() returned positive EACCES instead of
negative -EACCES so I fixed that as well. Also a few checkpatch.pl
issues.
Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Dan Carpenter [Sat, 13 Nov 2010 09:05:32 +0000 (12:05 +0300)]
Staging: iio/dds: double locking bugs
This is a static checker patch and I don't have this hardware.
This code is unusual because while I've often seen a double lock, this
is the first time I've seen code that takes a lock 11 times in a row. I
feel like I must have missed something. But I've looked very carefully
I don't see any way the original code is correct. Does spi_sync()
somehow release the lock in a way that I can't see? Even if it does,
the locking would still be wrong.
Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Michael Hennerich <michael.hennerich@analog.com> Acked-by: Cliff Cai <cliff.cai@analog.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Randy Dunlap [Thu, 11 Nov 2010 18:44:22 +0000 (10:44 -0800)]
staging/easycap: make module params private/static, fix build
The easycap driver has module parameters (bars, gain, & debug)
with global scope that intrude on the kernel namespace and cause
build problems. Change the names of them to be driver-specific
and make 2 of them static.
drivers/built-in.o:(.bss+0x97c00): multiple definition of `debug'
ld: Warning: size of symbol `debug' changed from 58 in arch/x86/built-in.o to 4 in drivers/built-in.o
Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com> Cc: Mike Thomas <rmthomas@sciolus.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
The appended fixes it by returning the appropriate error code in module_init
whenever something goes wrong, thus cancelling the insertion of the module.
Steven Rostedt [Thu, 11 Nov 2010 16:29:25 +0000 (11:29 -0500)]
staging: ft1000: Copy from user into correct data
While doing a ktest.pl I used a MIN_CONFIG that had STAGING enabled, and
a randconfig with CONFIG_DEBUG_STRICT_USER_COPY_CHECKS enabled caught
the following bug:
In file included from /home/rostedt/work/autotest/nobackup/linux-test.git/arch/x86/include/asm/uaccess.h:571:0,
from /home/rostedt/work/autotest/nobackup/linux-test.git/include/linux/poll.h:14,
from /home/rostedt/work/autotest/nobackup/linux-test.git/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c:32:
In function 'copy_from_user',
inlined from 'ft1000_ChIoctl' at /home/rostedt/work/autotest/nobackup/linux-test.git/drivers/staging/ft1000/ft1000-usb/ft1000_chdev.c:702:36:
/home/rostedt/work/autotest/nobackup/linux-test.git/arch/x86/include/asm/uaccess_32.h:212:26: error: call to 'copy_from_user_overflow' declared with attribute error: copy_from_user() buffer size is not provably correct
Looking at the code it was obvious what the problem was. The pointer
dpram_data was being allocated but the address was being written to.
Looking at the comment above the code shows that it use to write into an
element of that pointer where the '&' is appropriate. But now that it
writes to the pointer itself, we need to remove the '&' otherwise we
write over the pointer and not into the data it points to.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Cc: Marek Belisko <marek.belisko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This was necessary in order to resolve some conflicts that happened
between -rc1 and -rc2 with the following files:
drivers/staging/bcm/Bcmchar.c
drivers/staging/intel_sst/intel_sst_app_interface.c
Eric Paris [Mon, 15 Nov 2010 23:36:29 +0000 (18:36 -0500)]
capabilities/syslog: open code cap_syslog logic to fix build failure
The addition of CONFIG_SECURITY_DMESG_RESTRICT resulted in a build
failure when CONFIG_PRINTK=n. This is because the capabilities code
which used the new option was built even though the variable in question
didn't exist.
The patch here fixes this by moving the capabilities checks out of the
LSM and into the caller. All (known) LSMs should have been calling the
capabilities hook already so it actually makes the code organization
better to eliminate the hook altogether.
Signed-off-by: Eric Paris <eparis@redhat.com> Acked-by: James Morris <jmorris@namei.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Linus Torvalds [Mon, 15 Nov 2010 22:06:11 +0000 (14:06 -0800)]
Merge branch 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6
* 'omap-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tmlind/linux-omap-2.6:
arm: omap1: devices: need to return with a value
OMAP1: camera.h: add missing include
omap: dma: Add read-back to DMA interrupt handler to avoid spuriousinterrupts
OMAP2: Devkit8000: Fix mmc regulator failure
Linus Torvalds [Mon, 15 Nov 2010 22:05:44 +0000 (14:05 -0800)]
Merge branch 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging
* 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
hwmon: (w83795) Check for BEEP pin availability
hwmon: (w83795) Clear intrusion alarm immediately
hwmon: (w83795) Read the intrusion state properly
hwmon: (w83795) Print the actual temperature channels as sources
hwmon: (w83795) List all usable temperature sources
hwmon: (w83795) Expose fan control method
hwmon: (w83795) Fix fan control mode attributes
hwmon: (lm95241) Check validity of input values
hwmon: Change mail address of Hans J. Koch
Linus Torvalds [Mon, 15 Nov 2010 22:01:33 +0000 (14:01 -0800)]
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
PCI: sysfs: fix printk warnings
PCI: fix pci_bus_alloc_resource() hang, prefer positive decode
PCI: read current power state at enable time
PCI: fix size checks for mmap() on /proc/bus/pci files
x86/PCI: coalesce overlapping host bridge windows
PCI hotplug: ibmphp: Add check to prevent reading beyond mapped area