summaryrefslogtreecommitdiffstats
path: root/drivers/mcb/mcb-pci.c
Commit message (Collapse)AuthorAgeFilesLines
* mcb: add Altera PCI ID to mcb-pciJohannes Thumshirn2018-03-141-0/+1
| | | | | | | | | | | | | Some older PCI attached MEN FPGAs use an Altera PCI Vendor ID instead of the MEN one. Add it to the PCI ID table so the driver automatically attaches to it. Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de> Reported-by: Ben Turner <ben.turner@21net.com> Tested-by: Ben Turner <ben.turner@21net.com> Cc: Andreas Geißler <andreas.geissler@men.de> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
* mcb: Enable PCI bus mastering by defaultMichael Moese2016-09-271-0/+1
| | | | | | | | | 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>
* mcb: Delete num_cells variable which is not requiredAndreas Werner2016-05-031-3/+1
| | | | | | | | | | 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>
* mcb: Replace ioremap and request_region with the devm versionAndreas Werner2016-05-031-12/+7
| | | | | | | | | 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>
* mcb: Do not return zero on error path in mcb_pci_probe()Alexey Khoroshilov2015-10-291-0/+1
| | | | | | | | | | | 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>
* mcb: Fix error handling in mcb_pci_probe()Alexey Khoroshilov2015-10-051-2/+4
| | | | | | | | | | | | | | 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>
* mcb: request_mem_region() returns NULL on errorDan Carpenter2015-04-031-2/+2
| | | | | | | | 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>
* mcb: Fix error path of mcb_pci_probeJohannes Thumshirn2015-02-031-9/+9
| | | | | | | | | | | | | | 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>
* mcb: mcb-pci: Only remap the 1st 0x200 bytes of BAR 0Johannes Thumshirn2015-01-091-9/+18
| | | | | | | | | | | | | | | | | | | 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>
* mcb: Add support for shared PCI IRQsJohannes Thumshirn2014-05-271-1/+16
| | | | | | | 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>
* mcb: Add PCI carrier for MEN Chameleon BusJohannes Thumshirn2014-02-281-0/+114
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>
OpenPOWER on IntegriCloud