summaryrefslogtreecommitdiff
path: root/drivers/mcb/mcb-pci.c
AgeCommit message (Collapse)Author
2016-09-27mcb: Enable PCI bus mastering by defaultMichael Moese
In order to successfully perform DMA operations on PCI devices, it is necessary to enble PCI bus mastering, so enable it by default. Signed-off-by: Michael Moese <michael.moese@men.de> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03mcb: Delete num_cells variable which is not requiredAndreas Werner
The num_cells variable is only used in the dev_dbg print, but we can directly use the ret variable which also includes the same value. Signed-off-by: Andreas Werner <andreas.werner@men.de> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-05-03mcb: Replace ioremap and request_region with the devm versionAndreas Werner
Replaced ioremap with devm_ioremap and request_mem_region with devm_request_mem_region. This makes the code much more cleaner. Signed-off-by: Andreas Werner <andreas.werner@men.de> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-29mcb: Do not return zero on error path in mcb_pci_probe()Alexey Khoroshilov
There is an error path in mcb_pci_probe() where it returns zero instead of error code. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-05mcb: Fix error handling in mcb_pci_probe()Alexey Khoroshilov
If a MCB PCI Carrier device is IO mapped insted of memory-mapped, the memory of the PCI device is still not unmapped. Also the patch adds deallocation of the bus if chameleon_parse_cells() fails. Found by Linux Driver Verification project (linuxtesting.org). Signed-off-by: Alexey Khoroshilov <khoroshilov@ispras.ru> Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-04-03mcb: request_mem_region() returns NULL on errorDan Carpenter
The code here is checking for IS_ERR() when request_mem_region() only returns NULL on error and never an ERR_PTR. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-02-03mcb: Fix error path of mcb_pci_probeJohannes Thumshirn
If a MCB PCI Carrier device is IO mapped insted of memory-mapped (which is currently unsupported by the upstream driver) the probe function bails out with -ENOTSUPP. In this case the memory of the PCI device was not unmapped. Also rename error label to reflect what will happen at the destination (suggested by Julia Lawall <julia.lawall@lip6.fr>. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> Reported-by: kbuild test robot <fengguang.wu@intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-01-09mcb: mcb-pci: Only remap the 1st 0x200 bytes of BAR 0Johannes Thumshirn
Currently it is not possible to have a kernel with built-in MCB attached devices. This results out of the fact that mcb-pci requests PCI BAR 0, then parses the chameleon table and calls the driver's probe function before releasing BAR 0 again. When building the kernel with modules this is not a problem (and therefore it wasn't detected by my tests yet). A solution is to only remap the 1st 0x200 bytes of a Chameleon PCI device. 0x200 bytes is the maximum size of a Chameleon v2 Table. Also this patch stops disabling the PCI device on successful registration of MCB devices. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> Suggested-by: Bjorn Helgaas <bhelgaas@google.com> Reviewed-by: Bjorn Helgaas <bhelgaas@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-05-27mcb: Add support for shared PCI IRQsJohannes Thumshirn
Add support for shared PCI IRQs to mcb and mcb-pci. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2014-02-28mcb: Add PCI carrier for MEN Chameleon BusJohannes Thumshirn
Add support for MCB over PCI devices. Both PCI attached on-board Chameleon FPGAs as well as CompactPCI based MCB carrier cards are supported with this driver. Signed-off-by: Johannes Thumshirn <johannes.thumshirn@men.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>