Commit graph

131 commits

Author SHA1 Message Date
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
Greg Kroah-Hartman
25958ce32c staging: vme: vme.c: fix minor coding style issues
Fix up some broken printk strings that were spanning multiple lines,
making it hard to search for them.

Cc: Manohar Vanga <manohar.vanga@cern.ch>
Cc: Martyn Welch <martyn.welch@ge.com>
Cc: "Emilio G. Cota" <cota@braap.org>
Cc: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-25 11:25:46 -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
Martyn Welch
ac1a4f2caf Staging: VME: Ensure TSI148 link list descriptors are written big endian
The DMA functionality fails to work on little endian processors, such as
found on x86 based platforms. The DMA engine copies the link list
descriptors from memory into big endian registers. On little endian systems
this results in the values being byte swapped. This patch uses standard
kernel functionality to ensure that the descriptors are stored in big
endian format.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:37:06 -07:00
Martyn Welch
3abc48ae35 Staging: VME: Convert TSI148 to use dma_map_single
The DMA functionality fails to work on some Intel based platforms. Some
recent Intel platforms have an IOMMU. Transferring the DMA descriptors,
which were mapped using virt_to_phys(), failed. This patch updates the
driver to use dma_map_single().

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-04-10 10:37:06 -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
Sam Hansen
77974a30b9 staging: vme: code convention fix
Fixed a code convention violation in vme.h

Signed-off-by: Sam Hansen <solid.se7en@gmail.com>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2012-02-09 09:16:52 -08:00
Rusty Russell
90ab5ee941 module_param: make bool parameters really bool (drivers & misc)
module_param(bool) used to counter-intuitively take an int.  In
fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy
trick.

It's time to remove the int/unsigned int option.  For this version
it'll simply give a warning, but it'll break next kernel version.

Acked-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2012-01-13 09:32:20 +10:30
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
8cdc081913 staging: vme: fix comment for struct vme_dev
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-11-26 17:25:38 -08:00
Manohar Vanga
5b93c2a2f1 staging: vme: remove vme_add_bus() and vme_remove_bus()
The functions vme_add_bus() and vme_remove_bus() were only being used
in the vme_register_bridge() and vme_unregister_bridge() functions
respectively. This patch gets rid of them and moves their code to
vme_register_bridge() and vme_unregister_bridge().

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-11-26 17:25:38 -08:00
Manohar Vanga
c26f611299 staging: vme: fix comment in __vme_register_driver()
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-11-26 17:25:38 -08:00
Martyn Welch
3fe0a87f8f Staging: VME: Update TODO file
Contents of TODO file has become more of a feature wish-list rather than issues
which should stop the VME driver being merged into the mainline kernel.

Update the TODO list with issues that need to be resolved before it can be
migrated to mainline.

Signed-off-by: Martyn Welch <martyn.welch@ge.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:23:57 -08:00
Manohar Vanga
b91a9363bb staging: vme: fix address cast warnings for 64 bit architectures
Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-11-26 17:23:57 -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
f6c39d4f2d staging: vme: change static device array to pointers
Change the static array of 'struct device''s in struct vme_bridge
to instead use an array of pointers. This is in accordance with the
requirement that all kobjects be dynamically allocated (see
Documentation/kobject.txt) and never be statically allocated.

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-09-09 13:26:32 -07:00
Manohar Vanga
733e3ef0d3 staging: vme: keep track of registered buses
This patch adds a list which keeps track of all registered VME
buses. This is required for adding refcounting later to bridge
modules, something that is not currently implemented.

This is based on the changes introduced by Emilio G. Cota in the
patch:

    https://lkml.org/lkml/2010/10/25/486

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:10:50 -07:00
Manohar Vanga
7f58f0255a staging: vme: make [alloc|free]_consistent bridge specific
Make PCI dependent functions ([alloc|free]_consistent() in
'vme.c') bridge specific. By removing the dependency of the
VME bridge framework on PCI, this patch allows for addition of
non-PCI based VME bridges.

Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Acked-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-08-23 15:08:09 -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
54b4a779c9 Staging: VME: Fix ca91cx42 VME interrupt generation.
The wait_event_interruptible call requires a condition as second argument that
needs to be true sometimes, which is obviously not the case with '0'. The new
logic is inspired from the tsi148 driver and takes into account Universe II chip
specifics.

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
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
56fc508186 Staging: VME: Fix Universe II int ack logic.
The driver must acknowledge the interrupts that have been actually serviced, not
the ones active. The current code could acknowledge an interrupt that has not
been serviced at all.

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:06:12 -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
Lucas De Marchi
25985edced Fix common misspellings
Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>
2011-03-31 11:26:23 -03:00
Ilia Mirkin
794a8946ba staging: vme: Remove NULL check before kfree
This patch was generated by the following semantic patch:
// <smpl>
@@ expression E; @@
- if (E != NULL) { kfree(E); }
+ kfree(E);

@@ expression E; @@
- if (E != NULL) { kfree(E); E = NULL; }
+ kfree(E);
+ E = NULL;
// </smpl>

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-03-14 11:57:37 -07:00
Manohar Vanga
5bfcf90bfb staging: vme: remove unreachable code
Remove some more unreachable code found in bridges/vme_ca91cx42.c
and bridges/vme_tsi148.c

Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28 13:30:07 -08:00
Manohar Vanga
b004646779 staging: vme: remove unreachable code
Remove some unreachable code (kfree calls) from vme.c

Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-28 13:30:07 -08:00
Manohar Vanga
da1bbd1d85 staging: vme: fix loop condition
Fix loop condition in vme_register_bridge that results in an infinite
loop in the event that device_register fails.

Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Acked-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-23 14:41:29 -08:00
Manohar Vanga
6012795b13 staging: vme: remove unreachable code
Removed some unreachable code from vme_register_bridge

Signed-off-by: Manohar Vanga <manohar.vanga@cern.ch>
Acked-by: Martyn Welch <martyn.welch@ge.com>
Acked-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2011-02-23 14:41:28 -08:00
Jeff Garzik
5f92acc896 Delete zero-length drivers/staging/vme/bridges/Module.symvers
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
2011-01-28 03:23:42 -05:00
Namhyung Kim
270b64bb4c Staging: vme_tsi148: use DEFINE_PCI_DEVICE_TABLE
Convert 'const struct pci_device_id xxx[]' to 'DEFINE_PCI_DEVICE_TABLE(xxx)'.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-09 16:29:47 -08:00
Namhyung Kim
2cea0cf284 Staging: vme_ca91cx42: use DEFINE_PCI_DEVICE_TABLE
Convert 'const struct pci_device_id xxx[]' to 'DEFINE_PCI_DEVICE_TABLE(xxx)'.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-12-09 16:29:47 -08: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
e08e02faff staging: vme: ca91cx42: mark the registers' base address pointer as __iomem
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:17 -08:00
Emilio G. Cota
e20cbcf199 staging: vme: tsi148: mark the registers' base address pointer as __iomem
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:17 -08:00