summaryrefslogtreecommitdiffstats
path: root/drivers/staging/vme/devices
Commit message (Collapse)AuthorAgeFilesLines
* Staging: VME: PIO2: Add GPIOLIB dependancyMartyn Welch2011-12-121-0/+1
| | | | | | | | | | | 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>
* Staging: VME: Remove typedefsMartyn Welch2011-12-011-5/+5
| | | | | | | 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>
* Staging: VME: PIO2: Correct irq resetMartyn Welch2011-11-301-2/+7
| | | | | | | | | | | | | 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>
* Driver for GE PIO2 VME CardMartyn Welch2011-11-266-0/+1086
| | | | | | | | | | 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>
* staging: vme_user: rename USER_BUS_MAX to VME_USER_BUS_MAXManohar Vanga2011-10-172-6/+6
| | | | | | | 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>
* staging: vme: get rid of struct vme_device_id and slotsManohar Vanga2011-10-171-1/+1
| | | | | | | | | | | | | | 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>
* staging: vme: make match() driver specific to improve non-VME64x supportManohar Vanga2011-10-171-29/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* staging: vme: add struct vme_dev for VME devicesManohar Vanga2011-10-171-8/+6
| | | | | | | | | | | | | | | | | | | 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>
* staging: vme_user: change kmalloc+memset to kzallocManohar Vanga2011-08-231-3/+1
| | | | | | 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>
* Staging: VME: Introduce IOCTL to generate VME interrupts.Vincent Bossier2011-06-282-0/+22
| | | | | | | | | | | | 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>
* Staging: VME: Make vme/ctl device available for IOCTL operations only.Vincent Bossier2011-06-281-2/+11
| | | | | | | | | 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>
* Staging VME: Fix remaining checkpatch.pl errors.Vincent Bossier2011-06-281-12/+12
| | | | | | | | | 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>
* staging/vme_user: add missing calls to vme_master_free calls in .removeEmilio G. Cota2010-12-031-1/+3
| | | | | | 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>
* staging/vme/vme_user: use __dev{init, exit} for .probe and .removeEmilio G. Cota2010-12-031-5/+7
| | | | | | | 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>
* staging/vme_user: fix usage of the slave resources after they've been freedEmilio G. Cota2010-12-031-2/+2
| | | | | | | | | | | | | | | 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>
* staging: vme_user: mark user-space buffers with __userEmilio G. Cota2010-11-161-13/+13
| | | | | | | 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>
* staging: vme_user: remove __iomem marking from kern_buf and derivatesEmilio G. Cota2010-11-161-3/+3
| | | | | | | | | 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>
* staging: vme_user: use an unsigned int for counting the number of kparamsEmilio G. Cota2010-11-161-1/+1
| | | | | | | | 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>
* staging: vme_user: declare private variables as staticEmilio G. Cota2010-11-161-3/+3
| | | | | | | 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>
* staging: vme_user: remove unreachable lineEmilio G. Cota2010-11-161-1/+0
| | | | | | 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>
* staging: vme_user: return the appropriate error code when module_init failsEmilio G. Cota2010-11-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* staging: vme: style: convert '&(foo)' to '&foo'Emilio G. Cota2010-11-161-8/+8
| | | | | | | | | 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>
* staging: Bulk convert the semaphore messThomas Gleixner2010-09-071-1/+1
| | | | | | | | 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>
* Staging: autoconvert trivial BKL users to private mutexArnd Bergmann2010-07-221-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Staging: vme: devices: vme_user.c: Fix checkpatch.pl issues.Nanakos Chrysostomos2010-06-181-47/+45
| | | | | | | | 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>
* Staging: push down BKL into ioctl functionsArnd Bergmann2010-05-111-3/+15
| | | | | | Signed-off-by: Arnd Bergmann <arnd@arndb.de> Cc: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* include cleanup: Update gfp.h and slab.h includes to prepare for breaking ↵Tejun Heo2010-03-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Staging: vme: Allocate memory buffers for master windowsArthur Benilov2010-03-031-0/+14
| | | | | | | | | | | | 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>
* Staging: vme: Use A24 when requesting slave resourceArthur Benilov2010-03-031-1/+5
| | | | | | | | | | | | | 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>
* Staging: vme: llseek support in user driverArthur Benilov2010-03-031-2/+33
| | | | | | | | | | 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>
* Staging: vme: Renaming following split of GE Fanuc joint ventureMartyn Welch2010-03-031-3/+3
| | | | | | | | | 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>
* Staging: vme: Correct vme_user error message typoMartyn Welch2010-03-031-2/+2
| | | | | | | 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>
* staging: vme: correct array overflowMartyn Welch2009-12-111-1/+1
| | | | | | | | | | 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>
* Staging: vme: remove unused #include <linux/version.h>Huang Weiyi2009-12-111-1/+0
| | | | | | | | | | | | | Remove unused #include <linux/version.h>('s) in drivers/staging/vme/bridges/vme_ca91cx42.c drivers/staging/vme/bridges/vme_tsi148.c drivers/staging/vme/devices/vme_user.c drivers/staging/vme/vme.c Signed-off-by: Huang Weiyi <weiyi.huang@gmail.com> Acked-by: Martyn Welch <martyn.welch@gefanuc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: Update VME vme_user moduleMartyn Welch2009-09-152-148/+212
| | | | | | | | | | | * Add ifdef wrapper to vme_user.h * Correct Initialisation routine * Add remove routine to correct probe routine * Remove old test routines Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* Staging: vme: add VME userspace driverMartyn Welch2009-09-154-0/+827
Adds a VME userspace access driver Signed-off-by: Martyn Welch <martyn.welch@gefanuc.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
OpenPOWER on IntegriCloud