aboutsummaryrefslogtreecommitdiff
path: root/include/linux/mcb.h
AgeCommit message (Collapse)AuthorFilesLines
2023-10-05mcb: remove is_added flag from mcb_device structJorge Sanjuan Garcia1-1/+0
When calling mcb_bus_add_devices(), both mcb devices and the mcb bus will attempt to attach a device to a driver because they share the same bus_type. This causes an issue when trying to cast the container of the device to mcb_device struct using to_mcb_device(), leading to a wrong cast when the mcb_bus is added. A crash occurs when freing the ida resources as the bus numbering of mcb_bus gets confused with the is_added flag on the mcb_device struct. The only reason for this cast was to keep an is_added flag on the mcb_device struct that does not seem necessary. The function device_attach() handles already bound devices and the mcb subsystem does nothing special with this is_added flag so remove it completely. Fixes: 18d288198099 ("mcb: Correctly initialize the bus's device") Cc: stable <[email protected]> Signed-off-by: Jorge Sanjuan Garcia <[email protected]> Co-developed-by: Jose Javier Rodriguez Barbarin <[email protected]> Signed-off-by: Jose Javier Rodriguez Barbarin <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2023-01-27mcb: move to_mcb_device() to use container_of_const()Greg Kroah-Hartman1-4/+1
The driver core is changing to pass some pointers as const, so move to_mcb_device() to use container_of_const() to handle this change. to_mcb_device() now properly keeps the const-ness of the pointer passed into it, while as before it could be lost. Cc: Johannes Thumshirn <[email protected]> Acked-by: Hans de Goede <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-06-15mcb: Remove trailing semicolon in macrosHuilong Deng1-1/+1
Macros should not use a trailing semicolon. Signed-off-by: Huilong Deng <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]> Link: https://lore.kernel.org/r/fe520620eeddaa2ed8c669125f9b673c89d6b5a5.1623768541.git.johannes.thumshirn@wdc.com Signed-off-by: Greg Kroah-Hartman <[email protected]>
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 441Thomas Gleixner1-4/+1
Based on 1 normalized pattern(s): this program is free software you can redistribute it and or modify it under the terms of the gnu general public license as published by the free software foundation version 2 of the license extracted by the scancode license scanner the SPDX license identifier GPL-2.0-only has been chosen to replace the boilerplate/reference in 315 file(s). Signed-off-by: Thomas Gleixner <[email protected]> Reviewed-by: Allison Randal <[email protected]> Reviewed-by: Armijn Hemel <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-08-28mcb: introduce mcb_get_resource()Johannes Thumshirn1-0/+2
Introduce mcb_get_resource() as a common accessor to a mcb device's memory or IRQ resources. Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-09-27mcb: Add a dma_device to mcb_deviceMichael Moese1-0/+1
When performing DMA operations on a MCB device, the device needed for using the DMA API is "mcb_device->bus_carrier". This is rather lengthy, so a shortcut is introduced to struct mcb_device in order to ensure the MCB device driver uses the correct device for DMA operations. Signed-off-by: Michael Moese <[email protected]> Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-08-31mcb: remove sub-device handling codeJohannes Thumshirn1-4/+0
The MEN Chameleon specification states that a chameleon FPGA can include a bridge descriptor, which then opens up a new bus behind this bridge. MCB included subdevice handling code in the core, but no support for bus descriptors in the parser, due to a lack of hardware access. As this is technically dead code, but it gets executed on a device add, I've decided to remove it. Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-08-31mcb: Introduce type safety for to_mcb_*Johannes Thumshirn1-3/+15
The to_mcb_{bus,device,driver}() macros lacked type safety, so convert them to inline functions to enforce compile time type checking. Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-05-03mcb: export bus information via sysfsJohannes Thumshirn1-0/+9
Export information about the bus stored in the FPGA's header to userspace via sysfs, instead of hiding it in pr_debug()s from everyone. Signed-off-by: Johannes Thumshirn <[email protected]> Reviewed-by: Andreas Werner <[email protected]> Tested-by: Andreas Werner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2016-05-03mcb: Correctly initialize the bus's deviceJohannes Thumshirn1-3/+2
The mcb bus' device member wasn't correctly initialized and thus wasn't placed correctly into the driver model. Signed-off-by: Johannes Thumshirn <[email protected]> Reviewed-by: Andreas Werner <[email protected]> Tested-by: Andreas Werner <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-05-27mcb: Add support for shared PCI IRQsJohannes Thumshirn1-1/+5
Add support for shared PCI IRQs to mcb and mcb-pci. Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
2014-02-28drivers: Introduce MEN Chameleon BusJohannes Thumshirn1-0/+119
The MCB (MEN Chameleon Bus) is a Bus specific to MEN Mikroelektronik FPGA based devices. It is used to identify MCB based IP-Cores within an FPGA and provide the necessary framework for instantiating drivers for these devices. Signed-off-by: Johannes Thumshirn <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>