Commit Graph

53 Commits (5dae92a718570e6a942e0b882e53d25cab03b40f)

Author SHA1 Message Date
Konstantin Khlebnikov 9349f8af28 staging: vme_pio2: fix oops on module unloading
This patch forbids loading vme_pio2 module without specifing "num_bus" parameter.
Otherwise on module unloading pio2_exit() calls vme_unregister_driver() for not
registered pio2_driver.

Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Manohar Vanga <manohar.vanga@gmail.com>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2013-01-07 13:56:24 -08:00
Bill Pemberton f21a824764 staging: vme: remove use of __devexit
CONFIG_HOTPLUG is going away as an option so __devexit is no
longer needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Martyn Welch <martyn.welch@ge.com>
Cc: Manohar Vanga <manohar.vanga@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 15:05:12 -08:00
Bill Pemberton d7e530d26b staging: vme: remove use of __devinit
CONFIG_HOTPLUG is going away as an option so __devinit is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Martyn Welch <martyn.welch@ge.com>
Cc: Manohar Vanga <manohar.vanga@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 15:05:00 -08:00
Bill Pemberton 38930755b8 staging: vme: remove use of __devexit_p
CONFIG_HOTPLUG is going away as an option so __devexit_p is no longer
needed.

Signed-off-by: Bill Pemberton <wfp5p@virginia.edu>
Cc: Martyn Welch <martyn.welch@ge.com>
Cc: Manohar Vanga <manohar.vanga@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-21 15:05:00 -08:00
YAMANE Toshiaki 0093e5f8b3 staging/vme: Use dev_ or pr_ printks in devices/vme_user.c
fixed below checkpatch warnings.
- WARNING: Prefer netdev_err(netdev, ... then dev_err(dev, ... then pr_err(...  to printk(KERN_ERR ...
- WARNING: Prefer netdev_info(netdev, ... then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...
- WARNING: Prefer netdev_dbg(netdev, ... then dev_dbg(dev, ... then pr_debug(...  to printk(KERN_DEBUG ...
- WARNING: Prefer netdev_warn(netdev, ... then dev_warn(dev, ... then pr_warn(...  to printk(KERN_WARNING ...

and add pr_fmt.

Signed-off-by: YAMANE Toshiaki <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-11-13 13:13:12 -08:00
Toshiaki Yamane 736f5d0a09 staging/vme: Use pr_ printks in vme_pio2_core.c
The below checkpatch warnings was fixed,

-WARNING: Prefer pr_err(... to printk(KERN_ERR, ...

and added pr_fmt.

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 13:22:48 -07:00
Toshiaki Yamane 538a697ac8 Staging: vme: Fix a white space issue
The below checkpatch error was fixed.

-ERROR: trailing whitespace

Signed-off-by: Toshiaki Yamane <yamanetoshi@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-09-04 13:22:47 -07:00
Justin P. Mattock 9560533299 staging "vme" Fix typos.
Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-08-14 16:46:33 -07:00
Duan Jiong be408d7807 vme_user.c: remove duplicated include
Signed-off-by: Duan Jiong <djduanjiong@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-19 15:39:39 -07:00
Dan Carpenter a7f3943cd0 Staging: vme: silence a Sparse warning
Sparse complains that "arg" is not a __user pointer.  The "argp" and
"arg" variables are equivalent but argp is declared as a __user pointer.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-By: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-07-06 16:23:59 -07:00
Greg Kroah-Hartman d210267741 Merge 3.4-rc5 into staging-next
This resolves the conflict in:
	drivers/staging/vt6656/ioctl.c

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-05-02 11:48:07 -07:00
Greg Kroah-Hartman db3b9e990e Staging: VME: move VME drivers out of staging
This moves the VME core, VME board drivers, and VME bridge drivers out
of the drivers/staging/vme/ area to drivers/vme/.

The VME device drivers have not moved out yet due to some API questions
they are still working through, that should happen soon, hopefully.

Cc: Martyn Welch <martyn.welch@ge.com>
Cc: Manohar Vanga <manohar.vanga@cern.ch>
Cc: Vincent Bossier <vincent.bossier@gmail.com>
Cc: "Emilio G. Cota" <cota@braap.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-26 12:34:58 -07:00
Marcos Paulo de Souza 51d7ff0215 drivers: staging: vme: devices: Remove unneeded include version.h
The output of "make versioncheck" told us that:

drivers/staging/vme/devices/vme_pio2_core.c: 13 linux/version.h not needed.
drivers/staging/vme/devices/vme_pio2_gpio.c: 13 linux/version.h not needed.

If we take a look at these files, we will agree to remove it.

Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: <devel@driverdev.osuosl.org>
Signed-off-by: Marcos Paulo de Souza <marcos.souza.org@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-18 16:58:17 -07:00
Masanari Iida 73e2918990 staging: Fix typo in multiple files
Collect spelling typo in multiple files within staging directory.

Signed-off-by: Masanari Iida <standby24x7@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:31:01 -07:00
Santosh Nayak ecb3b80ff9 Staging: vme: Replace semaphore by mutex.
Replace binary semaphore by mutex for code cleanup.
Mutex also gives better performance than semaphore.

Add 'mutex_destroy()' in 'vme_user_remove()' routine.

Signed-off-by: Santosh Nayak <santoshprasadnayak@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:31:01 -07:00
Gerard Snitselaar eaa004a4ba staging/vme: Fix module parameters
loopback should be declared bool, and variant probably shouldn't be
const.

Signed-off-by: Gerard Snitselaar <dev@snitselaar.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 09:14:39 -07:00
Gerard Snitselaar bf3a85be67 staging: vme: fix section mismatches in linux-next 20120314
pio2_gpio_init() annotated with __init, but called by pio2_probe()
which is annotated __devinit. pio2_gpio_exit() is annotated __exit,
but is called by pio2_probe() and by pio2_remove() which is annotated
__devexit.

Signed-off-by: Gerard Snitselaar <dev@snitselaar.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-03-15 14:04:34 -07:00
Martyn Welch 16772a495a Staging: VME: PIO2: Add GPIOLIB dependancy
The PIO2 driver errors when GPIOLIB, on which it depends, is not enabled.

Add dependancy when selecting the PIO2.

Reported-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Acked-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-12 16:36:03 -08:00
Martyn Welch 6af04b065b Staging: VME: Remove typedefs
The use of typedefs is discouraged, remove them.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-12-01 10:28:00 -08:00
Martyn Welch c1fcc4c9bd Staging: VME: PIO2: Correct irq reset
The loop used to reset the interrupt masks has faulty logic. There are 4
banks of 8 I/O, however each mask is comprised of 2 bits and thus there are
8 sets of registers to clear. Driver was wrongly equating this with 8 banks
leading to a us writing past the end of the "bank" array (used to store mask
configuration as these registers are write only) and thus causing memory
corruption. Clear both registers of masks for each bank and half iterations.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-30 19:37:33 +09:00
Martyn Welch 9dc367bc4c Driver for GE PIO2 VME Card
This patch implements a driver for the GE PIO2 VME Parallel I/O Card.  This
card is a 6U VME Card, implementing 32 solid-state relay switched IO lines,
in 4 groups of 8. Each bank of IO lines is built to function as input,
output or both depending on the variant of the card.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:25:38 -08:00
Manohar Vanga 0a4b6b0279 staging: vme_user: rename USER_BUS_MAX to VME_USER_BUS_MAX
Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Cc: Martyn Welch <martyn.welch@ge.com>
Reviewed-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17 15:43:13 -07:00
Manohar Vanga a916a391d3 staging: vme: get rid of struct vme_device_id and slots
Previously, the device-driver matching mechanism depended on the
vme_device_id structure due to the need for a bind table per driver.
This method of matching is no longer used so this patch merges the
fields of struct vme_device_id into struct vme_dev. Since this also
renders the slot field meaningless, it has also been removed in this
patch.

Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Cc: Martyn Welch <martyn.welch@ge.com>
Reviewed-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17 15:43:13 -07:00
Manohar Vanga 5d6abf379d staging: vme: make match() driver specific to improve non-VME64x support
For jumper based boards (non VME64x), there is no mechanism
for detecting the card that is plugged into a specific slot. This
leads to issues in non-autodiscovery crates/cards when a card is
plugged into a slot that is "claimed" by a different driver. In
reality, there is no problem, but the driver rejects such a
configuration due to its dependence on the concept of slots.

This patch makes the concept of slots less critical and pushes the
driver match() to individual drivers (similar to what happens in the
ISA bus in driver/base/isa.c). This allows drivers to register the
number of devices that they expect without any restrictions. Devices
in this new model are now formatted as $driver_name-$bus_id.$device_id
(as compared to the earlier vme-$bus_id.$slot_number).

This model also makes the device model more logical as devices
are only registered when they actually exist whereas earlier,
a set of devices were being created automatically regardless of
them actually being there.

Another change introduced in this patch is that devices are now created
within the VME driver structure rather than in the VME bridge structure.
This way, things don't go haywire if the bridge driver is removed while
a driver is using it.

Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Cc: Martyn Welch <martyn.welch@ge.com>
Reviewed-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17 15:43:13 -07:00
Manohar Vanga 8f966dc444 staging: vme: add struct vme_dev for VME devices
Instead of using a vanilla 'struct device' for VME devices, add new
'struct vme_dev'. Modifications have been made to the VME framework
API as well as all in-tree VME drivers.

The new vme_dev structure has the following advantages from the
current model used by the driver:

    * Driver functions (probe, remove) now receive a VME device
      instead of a pointer to the bridge device (cleaner design)
    * It's easier to differenciate API calls as bridge-based or
      device-based (ie. cleaner interface).

Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Cc: Martyn Welch <martyn.welch@ge.com>
Reviewed-by: Emilio G. Cota <cota@braap.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-10-17 15:43:13 -07:00
Manohar Vanga 34a678110a staging: vme_user: change kmalloc+memset to kzalloc
Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 15:05:02 -07:00
Vincent Bossier dca2218426 Staging: VME: Introduce IOCTL to generate VME interrupts.
The vme_irq_set is oblviously not needed (a remnant from old tests) and the
IOCTL exchange types have been updated following Greg's comments.

Allow the IOCTL call to generate VME interrupts when called on the vme/ctl
device with the right arguments.

Signed-off-by: Vincent Bossier <vincent.bossier@gmail.com>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:13:05 -07:00
Vincent Bossier 05614fbfc1 Staging: VME: Make vme/ctl device available for IOCTL operations only.
Resurrect the vme/ctl device by allowing to open it even if it has no resources
and make related read/write/llseek operations dummy.

Signed-off-by: Vincent Bossier <vincent.bossier@gmail.com>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:08:34 -07:00
Vincent Bossier 584721cab2 Staging VME: Fix remaining checkpatch.pl errors.
This patch solves all the existing issues reported by checkpatch.pl in the VME
sub-system.

Signed-off-by: Vincent Bossier <vincent.bossier@gmail.com>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-06-28 14:04:53 -07:00
Emilio G. Cota b62c99b17c staging/vme_user: add missing calls to vme_master_free calls in .remove
Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-03 11:51:51 -08:00
Emilio G. Cota 4740a08460 staging/vme/vme_user: use __dev{init, exit} for .probe and .remove
Signed-off-by: Emilio G. Cota <cota@braap.org>
[martyn.welch@ge.com: Fixed checkpatch line length warnings]
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-03 11:51:51 -08:00
Emilio G. Cota 1daa38d379 staging/vme_user: fix usage of the slave resources after they've been freed
buf_unalloc() frees the memory buffers allocated with vme_alloc_consistent.
The associated VME resource is needed in both vme_alloc_consistent and
vme_free_consistent; however the slave VME resources are being freed before
the calls to vme_free_consistent are made, which means the buffers
are never returned.

Fix this by freeing the VME resources only after the consistent buffers have
been returned.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-03 11:51:51 -08:00
Emilio G. Cota 1a85f2073d staging: vme_user: mark user-space buffers with __user
Signed-off-by: Emilio G. Cota <cota@braap.org>
[martyn.welch@ge.com: modified to remove checkpatch warnings]
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 11:40:16 -08:00
Emilio G. Cota 0a81a0f768 staging: vme_user: remove __iomem marking from kern_buf and derivates
kern_buf is not iomem; it comes from kmalloc and is directly
dereferenced.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 11:40:16 -08:00
Emilio G. Cota c949231838 staging: vme_user: use an unsigned int for counting the number of kparams
unsigned int is what struct kparam_array internally uses.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 11:40:16 -08:00
Emilio G. Cota b9cc293486 staging: vme_user: declare private variables as static
Signed-off-by: Emilio G. Cota <cota@braap.org>
[martyn.welch@ge.com: modified to remove checkpatch warnings]
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 11:40:16 -08:00
Emilio G. Cota c0779fd01d staging: vme_user: remove unreachable line
Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 11:40:14 -08:00
Emilio G. Cota 55db50205a staging: vme_user: return the appropriate error code when module_init fails
When init_module fails, 0 is returned anyway; the module is then installed
and oopses when we try to remove it:

[ 3236.368009] WARNING: at drivers/base/driver.c:262 driver_unregister+0x36/0x6f()
[ 3236.368012] Hardware name:
[ 3236.368014] Unexpected driver unregister!
[ 3236.368016] Modules linked in: vme_user(-) vme_tsi148 vme e1000e iTCO_wdt iTCO_vendor_support [last unloaded: vme]
[ 3236.368027] Pid: 16162, comm: rmmod Not tainted 2.6.35 #2
[ 3236.368029] Call Trace:
[ 3236.368037]  [<ffffffff81036ea3>] warn_slowpath_common+0x80/0x98
[ 3236.368044]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
[ 3236.368049]  [<ffffffff81036f4f>] warn_slowpath_fmt+0x41/0x43
[ 3236.368054]  [<ffffffff81060a65>] ? __try_stop_module+0x0/0x58
[ 3236.368059]  [<ffffffff811e8f78>] driver_unregister+0x36/0x6f
[ 3236.368066]  [<ffffffffa004aa44>] vme_unregister_driver+0xd/0xf [vme]
[ 3236.368072]  [<ffffffffa00616c8>] vme_user_exit+0x10/0x1e [vme_user]
[ 3236.368076]  [<ffffffff810612c1>] sys_delete_module+0x1ba/0x226
[ 3236.368082]  [<ffffffff812d6e14>] ? do_page_fault+0x25d/0x28a
[ 3236.368088]  [<ffffffff8100202b>] system_call_fastpath+0x16/0x1b
[ 3236.368092] ---[ end trace cab6d88ebc44c1de ]---

The appended fixes it by returning the appropriate error code in module_init
whenever something goes wrong, thus cancelling the insertion of the module.

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 11:40:14 -08:00
Emilio G. Cota 886953e9b7 staging: vme: style: convert '&(foo)' to '&foo'
done with
find . -name '*.c' | xargs perl -p -i -e 's/&\(([^()]+)\)/&$1/g'

Signed-off-by: Emilio G. Cota <cota@braap.org>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-11-16 11:40:13 -08:00
Thomas Gleixner 0f0800f17a staging: Bulk convert the semaphore mess
init_MUTEX(_LOCKED) and DECLARE_MUTEX are going away. Bulk convert
staging users.

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-09-07 19:31:32 -07:00
Arnd Bergmann 8e2394a981 Staging: autoconvert trivial BKL users to private mutex
All these files use the big kernel lock in a trivial
way to serialize their private file operations,
typically resulting from an earlier semi-automatic
pushdown from VFS.

None of these drivers appears to want to lock against
other code, and they all use the BKL as the top-level
lock in their file operations, meaning that there
is no lock-order inversion problem.

Consequently, we can remove the BKL completely,
replacing it with a per-file mutex in every case.
Using a scripted approach means we can avoid
typos.

file=$1
name=$2
if grep -q lock_kernel ${file} ; then
    if grep -q 'include.*linux.mutex.h' ${file} ; then
            sed -i '/include.*<linux\/smp_lock.h>/d' ${file}
    else
            sed -i 's/include.*<linux\/smp_lock.h>.*$/include <linux\/mutex.h>/g' ${file}
    fi
    sed -i ${file} \
        -e "/^#include.*linux.mutex.h/,$ {
                1,/^\(static\|int\|long\)/ {
                     /^\(static\|int\|long\)/istatic DEFINE_MUTEX(${name}_mutex);

} }"  \
    -e "s/\(un\)*lock_kernel\>[ ]*()/mutex_\1lock(\&${name}_mutex)/g" \
    -e '/[      ]*cycle_kernel_lock();/d'
else
    sed -i -e '/include.*\<smp_lock.h\>/d' ${file}  \
                -e '/cycle_kernel_lock()/d'
fi

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-07-22 11:10:29 -07:00
Nanakos Chrysostomos 45f9f01896 Staging: vme: devices: vme_user.c: Fix checkpatch.pl issues.
Fix resolves checkpatch.pl issues for vme_user.c file.

Signed-off-by: Nanakos Chrysostomos <nanakos@wired-net.gr>
Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-06-18 15:16:20 -07:00
Arnd Bergmann b1f2ac0763 Staging: push down BKL into ioctl functions
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-11 11:35:36 -07:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Arthur Benilov 33e920d9eb 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>
2010-03-03 16:43:02 -08:00
Arthur Benilov 5188d74cc4 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>
2010-03-03 16:43:02 -08:00
Arthur Benilov 877de4b486 Staging: vme: llseek support in user driver
Provide vme_user_llseek() implementation.

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>
2010-03-03 16:43:01 -08:00
Martyn Welch 66bd8db52a Staging: vme: Renaming following split of GE Fanuc joint venture
This patch corrects author email addresses and Copyright notices as a
result of the split up of the GE Fanuc joint venture.

Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:43:00 -08:00
Martyn Welch 51616e2106 Staging: vme: Correct vme_user error message typo
Correction of erroneous error message in vme_user.c.

Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-03-03 16:42:27 -08:00
Martyn Welch beb9ccc635 staging: vme: correct array overflow
Eric Sesterhenn noticed that vme_user is overflowing an array used by
sprintf. Use a bigger array.

CC: Eric Sesterhenn <eric.sesterhenn@lsexperts.de>
Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2009-12-11 12:23:17 -08:00