summaryrefslogtreecommitdiffstats
path: root/drivers/staging/fsl-mc/bus
AgeCommit message (Collapse)Author
2016-06-26staging: fsl-mc: convert mc command build/parse to use C structsIoana Radulescu
The layer abstracting the building of commands and extracting responses is currently based on macros that shift and mask the command fields and requires exposing offset/size values as macro parameters and makes the code harder to read. For clarity and maintainability, instead use an implementation based on mapping the MC command definitions to C structures. These structures contain the hardware command fields (which are naturally-aligned) and individual fields are little-endian ordering (the byte ordering of the hardware). As such, there is no need to perform the conversion between core and hardware (LE) endianness in mc_send_command(), but instead each individual field in a command will be converted separately if needed by the function building the command or extracting the response. This patch does not introduce functional changes, both the hardware ABIs and the APIs exposed for the DPAA2 objects remain the same. Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26staging: fsl-mc: properly set hwirq in msi set_descStuart Yoder
For an MSI domain the hwirq is an arbitrary but unique id to identify an interrupt. Previously the hwirq was set to the MSI index of the interrupt, but that only works if there is one DPRC. Additional DPRCs require an expanded namespace. Use both the ICID (which is unique per DPRC) and the MSI index to compose a hwirq value. Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26staging: fsl-mc: dprc: fix ordering problem freeing resources in remove of dprcStuart Yoder
When unbinding a dprc from the dprc driver the cleanup of the resource pools must happen after irq pool cleanup is done. Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26staging: fsl-mc: dprc: add missing irq freeStuart Yoder
add missing free of the Linux irq when tearing down interrupts Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26staging: fsl-mc: fix asymmetry in destroy of mc_ioBharat Bhushan
An mc_io represents a mapped MC portal. Previously, an mc_io was created for the root dprc in fsl_mc_bus_probe() and for child dprcs in dprc_probe(). But the free of that data structure happened in the general bus remove callback. This asymmetry resulted in some bugs due to unwanted destroys of mc_io object in some scenarios (e.g. vfio). Fix this bug by making things symmetric-- mc_io created in fsl_mc_bus_probe() is freed in fsl_mc_bus_remove(). The mc_io created in dprc_probe() is freed in dprc_remove(). Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com> [Stuart: added check for root dprc and reworded commit message] Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26staging: fsl-mc: make fsl_mc_is_root_dprc() globalStuart Yoder
make fsl_mc_is_root_dprc() global so that the dprc driver can use it Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26staging: fsl-mc: export mc_get_versionStuart Yoder
some drivers (built as modules) rely on mc_get_version() Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26staging: fsl-mc: clean up the device id structStuart Yoder
-rename the struct used for fsl-mc device ids to be more consistent with other busses -remove the now obsolete and unused version fields Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26staging: fsl-mc: implement uevent callback and set the modaliasStuart Yoder
Replace placeholder code in the uevent callback to properly set the MODALIAS env variable. Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-06-26staging: fsl-mc: add support for the modalias sysfs attributeStuart Yoder
In order to support uevent based module loading implement modalias support for the fsl-mc bus driver. Aliases are based on vendor and object/device id and are of the form "fsl-mc:vNdN". Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: bus: Drop warningMatthias Brugger
When updating the irq_chip and msi_domain_ops, the code checkes for already present functions. When more then one ITS controller are present in the system, irq_chip and msi_domain_ops got already set and a warning is invoked. This patch deletes the warning, as the funtions are just already set to the needed callbacks. Signed-off-by: Matthias Brugger <mbrugger@suse.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: return -EINVAL for all fsl_mc_portal_allocate() failuresHoria Geantă
There are some error paths that allow for a NULL new_mc_io and err = 0 return code. Return -EINVAL instead. Signed-off-by: Horia Geantă <horia.geanta@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: add dpmcp version checkItai Katz
The dpmcp driver supports dpmcp version 3.0 and above. This patch adds the code to check the version. Signed-off-by: Itai Katz <itai.katz@nxp.com> Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> drivers/staging/fsl-mc/bus/dpmcp-cmd.h | 6 +++--- drivers/staging/fsl-mc/bus/mc-allocator.c | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: add quirk handling for dpseci objects < 4.0Horia Geanta
dpseci objects < 4.0 are not coherent-- in spite of the fact that the MC reports them to be coherent in certain versions. Add a special case to set the no shareability flag for dpseci objects < 4.0. Signed-off-by: Horia Geanta <horia.geanta@nxp.com> (Stuart: reworded commit message, updated comment in patch) Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: add dprc version checkItai Katz
The dprc driver supports dprc version 5.0 and above. This patch adds the code to check the version. Signed-off-by: Itai Katz <itai.katz@nxp.com> (Stuart: resolved merge conflicts, split dpseci quirk into separate patch) Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: get version of root dprc from MC hardwareItai Katz
The root dprc is discovered as a platform device in the device tree. The version of that dprc was previously set using hardcoded values from the API header in the kernel). This patch removes the use of the hardcoded version numbers and instead reads the actual dprc version from the hardware. Signed-off-by: Itai Katz <itai.katz@nxp.com> (Stuart: resolved merge conflict, updated commit subject/log) Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: set cacheable flag for added devices if applicableItai Katz
Some DPAA2 devices have mmio regions that should be mapped as cacheable by drivers. Set IORESOURCE_CACHEABLE in the region's flags if applicable. Signed-off-by: Itai Katz <itai.katz@nxp.com> [Stuart: update subject and commit message] Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: set up coherent dma ops for added devicesStuart Yoder
Unless discovered devices have the no shareability flag set, set up coherent dma ops for them. Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: don't use object versions to make binding decisionsItai Katz
Up until now if the object version expected by a driver (in the API header file) did not match the actual object version in the MC hardware the bus driver refused to bind the object to the driver or printed out WARN_ON dumps. This patch removes those checks, and the responsibility of object version checking should now be done in the object drivers themselves. If the actual version discovered is not supported, the driver's probe function should fail. Drivers should use version checks to support new features and provide backwards compatibility if at all possible. This patch also removes the checks that caused bus driver probing to fail if the overall MC version discovered did not match the firmware version from the API header...this was too strict. The overall MC version is informational like a release number, and continues to be printed in the boot log. Signed-off-by: Itai Katz <itai.katz@nxp.com> (Stuart: reworded commit log) Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: update dprc binary interface to v5.1Stuart Yoder
The meaning of the "status" parameter in dprc_get_irq_status has changed, and this patch updates the flib and caller of the API. Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: update dpbp binary interface to v2.2Stuart Yoder
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: update dpmcp binary interface to v3.0Stuart Yoder
Signed-off-by: Stuart Yoder <stuart.yoder@nxp.com> Acked-by: German Rivera <german.rivera@nxp.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-04-29staging: fsl-mc: get rid of mutex_locked variablesCihangir Akturk
Remove mutex_locked variables which are used to determine whether mutex is locked, instead add another label to unlock mutex on premature exits due to an error. This patch also addresses the folowing warnings reported by coccinelle: drivers/staging/fsl-mc/bus/mc-allocator.c:237:1-7: preceding lock on line 204 drivers/staging/fsl-mc/bus/mc-allocator.c:89:1-7: preceding lock on line 57 drivers/staging/fsl-mc/bus/mc-allocator.c:157:1-7: preceding lock on line 124 Signed-off-by: Cihangir Akturk <cakturk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-22staging: fsl-mc: fix incorrect type passed to dev_err macrosCihangir Akturk
dev_err macros expect const struct device ** as its second argument, but here the argument we are passing is of typ struct device **. This patch fixes this error. Fixes: 454b0ec8bf99 ("Staging: fsl-mc: Replace pr_err with dev_err") Cc: Bhumika Goyal <bhumirks@gmail.com> Reported-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Cihangir Akturk <cakturk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-22staging: fsl-mc: fix incorrect type passed to dev_dbg macrosCihangir Akturk
dev_dbg macros expect const struct device ** as its second argument but here the argument we are passing is of type struct device ** this patch fixes this error. Fixes: de71daf5c839 ("Staging: fsl-mc: Replace pr_debug with dev_dbg") Cc: Bhumika Goyal <bhumirks@gmail.com> Reported-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Cihangir Akturk <cakturk@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11Staging: fsl-mc: Replace pr_err with dev_errBhumika Goyal
This patch replaces pr_err calls with dev_err when the device structure is available as dev_* prints identifying information about the struct device. Done using coccinelle: @r exists@ identifier f, s; identifier x; position p; @@ f(...,struct s *x,...) { <+... when != x == NULL \(pr_err@p\|pr_debug@p\|pr_info\)(...); ...+> } @r2@ identifier fld2; identifier r.s; @@ struct s { ... struct device *fld2; ... }; @@ identifier r.x,r2.fld2; position r.p; @@ ( -pr_err@p +dev_err ( + &x->fld2, ...) | - pr_debug@p + dev_dbg ( + &x->fld2, ...) | - pr_info@p + dev_info ( + &x->fld2, ...) ) Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11Staging: fsl-mc: Replace pr_debug with dev_dbgBhumika Goyal
This patch replaces pr_debug calls with dev_dbg when the device structure is available as dev_* prints identifying information about the struct device. Done using coccinelle: @r exists@ identifier f, s; identifier x; position p; @@ f(...,struct s *x,...) { <+... when != x == NULL \(pr_err@p\|pr_debug@p\|pr_info\)(...); ...+> } @r2@ identifier fld2; identifier r.s; @@ struct s { ... struct device *fld2; ... }; @@ identifier r.x,r2.fld2; position r.p; @@ ( -pr_err@p +dev_err ( + &x->fld2, ...) | - pr_debug@p + dev_dbg ( + &x->fld2, ...) | - pr_info@p + dev_info ( + &x->fld2, ...) ) Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: fsl-mc: bus: Eliminate double function callBhaktipriya Shridhar
A call to irq_find_matching_host was already made and the result has been stored in mc_msi_domain. mc_msi_domain is again reassigned using the same function call which is redundant. irq_find_matching_host returns/locates a domain for a given fwnode. The domain is identified using device node and bus_token(if several domains have same device node but different purposes they can be distinguished using bus-specific token). http://www.bricktou.com/include/linux/irqdomain_irq_find_matching_host_en.html Also, of_property_read_bool finds and reads a boolean from a property device node from which the property value is to be read. It doesn't alter the device node. http://lists.infradead.org/pipermail/linux-arm-kernel/2012-February/083698.html Since, both the function calls have the same device node and bus_token, the return values shall be the same. Hence, the second call has been removed. This was done using Coccinelle: @r@ idexpression *x; identifier f; position p1,p2; @@ x@p1 = f(...) ... when != x ( x@p2 = f(...) ) @script:python@ p1 << r.p1; p2 << r.p2; @@ if (p1[0].line == p2[0].line): cocci.include_match(False) @@ idexpression *x; identifier f; position r.p1,r.p2; @@ *x@p1 = f(...) ... *x@p2 = f(...) Signed-off-by: Bhaktipriya Shridhar <bhaktipriya96@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-03-11staging: fsl-mc: Drop unneeded void pointer castJanani Ravichandran
Void pointers need not be cast to other pointer types. Semantic patch used: @r@ expression x; void *e; type T; identifier f; @@ ( *((T *)e) | ((T *)x) [...] | ((T *)x)->f | - (T *) e ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20staging: fsl-mc: Remove unneeded else following a returnJanani Ravichandran
Remove unnecessary else when there is a return statement in the corresponding if block. Coccinelle patch used: @rule1@ expression e1; @@ if (e1) { ... return ...; } - else{ ... - } @rule2@ expression e2; statement s1; @@ if(e2) { ... return ...; } - else s1 Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-20Staging: fsl-mc: bus: Drop owner assignment from platform_driverBhumika Goyal
For platform_driver, we don't need to set .owner field as is set by platform driver core. The semantic patch used here first checks whether platform_driver struct was actually used in a call to set the .owner field. The coccinelle script that generated the patch can be found here: http://www.spinics.net/lists/kernel/msg2029903.html Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-18staging: fsl-mc: Avoid section mismatchThierry Reding
The fsl_mc_allocator_driver_exit() function is marked __exit, but is called by the error handling code in fsl_mc_allocator_driver_init(). This results in a section mismatch, which in turn could lead to executing random code. Remove the __exit annotation to fix this. Cc: J. German Rivera <German.Rivera@freescale.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-18staging: fsl-mc: Do not allow building as a moduleThierry Reding
This driver uses functionality (MSI IRQ domain) whose symbols aren't exported, and hence the modular build fails. While arguably there might be reasons to make these symbols available to modules, that change would be fairly involved and the set of exported functions should be carefully auditioned. Fix the build failure for now by marking the driver boolean. Cc: J. German Rivera <German.Rivera@freescale.com> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Thierry Reding <treding@nvidia.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-11staging: fsl-mc: Remove unneeded parenthesesJanani Ravichandran
Remove unneeded parentheses on the right hand side of assignment statements. Semantic patch: @@ expression a, b, c; @@ ( a = (b == c) | a = - ( b - ) ) Signed-off-by: Janani Ravichandran <janani.rvchndrn@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fsl-mc: Added MSI support to the MC bus driverJ. German Rivera
Initialize/Cleanup ITS-MSI support for the MC bus driver at driver init/exit time. Associate an MSI domain with each DPAA2 child device. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fsl-mc: Added DPRC interrupt handlerJ. German Rivera
The interrupt handler for DPRC IRQs is added. DPRC IRQs are generated for hot plug events related to DPAA2 objects in a given DPRC. These events include, creating/destroying DPAA2 objects in the DPRC, changing the "plugged" state of DPAA2 objects and moving objects between DPRCs. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fsl-mc: Fixed bug in dprc_probe() error pathJ. German Rivera
Destroy mc_io in error path in dprc_probe() only if the mc_io was created in this function. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fsl-mc: set MSI domain for DPRC objectsJ. German Rivera
THE MSI domain associated with a root DPRC object is obtained form the device tree. Child DPRCs inherit the parent DPRC MSI domain. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fsl-mc: Populate the IRQ pool for an MC bus instanceJ. German Rivera
Scan the corresponding DPRC container to get total count of IRQs needed by all its child DPAA2 objects. Then, preallocate a set of MSI IRQs with the DPRC's ICID (GIT-ITS device Id) to populate the the DPRC's IRQ pool. Each child DPAA2 object in the DPRC and the DPRC object itself will allocate their necessary MSI IRQs from the DPRC's IRQ pool, in their driver probe function. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fsl-mc: Changed DPRC built-in portal's mc_io to be atomicJ. German Rivera
The DPRC built-in portal's mc_io is used to send commands to the MC to program MSIs for MC objects. This is done by the fsl_mc_msi_write_msg() callback, which is invoked by the generic MSI layer with interrupts disabled. As a result, the mc_io used in fsl_mc_msi_write_msg needs to be an atomic mc_io. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fsl-mc: Extended MC bus allocator to include IRQsJ. German Rivera
All the IRQs for DPAA2 objects in the same DPRC must use the ICID of that DPRC, as their device Id in the GIC-ITS. Thus, all these IRQs must share the same ITT table in the GIC. As a result, a pool of IRQs with the same device Id must be preallocated per DPRC (fsl-mc bus instance). So, the fsl-mc bus object allocator is extended to also provide services to allocate IRQs to DPAA2 devices, from their parent fsl-mc bus IRQ pool. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fsl-mc: Added GICv3-ITS support for FSL-MC MSIsJ. German Rivera
Added platform-specific MSI support layer for FSL-MC devices. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-07staging: fsl-mc: Added generic MSI support for FSL-MC devicesJ. German Rivera
Created an MSI domain for the fsl-mc bus-- including functions to create a domain, find a domain, alloc/free domain irqs, and bus specific overrides for domain and irq_chip ops. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-27staging: fsl-mc: section mismatch bug fixLijun Pan
WARNING: drivers/staging/built-in.o(.init.text+0xdc): Section mismatch in reference from the function fsl_mc_bus_driver_init() to the function .exit.text:dprc_driver_exit() The function __init fsl_mc_bus_driver_init() references a function __exit dprc_driver_exit(). This is often seen when error handling in the init function uses functionality in the exit path. The fix is often to remove the __exit annotation of dprc_driver_exit() so it may be used outside an exit section. Signed-off-by: Lijun Pan <Lijun.Pan@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: fsl-mc: Added serialization to mc_send_command()J. German Rivera
When the same portal is used to call mc_send_command() from two different threads or a thread and an interrupt handler, serialization is required, as the MC only supports one outstanding command per MC portal. Thus, a new command should not be sent to the MC until the last command sent has been responded by the MC. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: fsl-mc:Added support for atomic portalsJ. German Rivera
Refactored mc_send_command() to support two flavors of polling: - preemptible (for non-atomic portals), which was already supported. It calls usleep_range() between polling iterations. - non-preemptible (for atomic portals), which is needed when mc_send_command() is called with interrupts disabled. It calls udelay() between polling iterations. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: fsl-mc: refactored mc_send_command()J. German Rivera
Moved wait logic in mc_send_command() to its own function Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: fsl-mc: changed timeout units for MC cmd completionJ. German Rivera
Changed units for the timeout to wait for completion of MC command, from jiffies to milliseconds. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: fsl-mc: Added missing initializer in fsl_mc_bus_driverJ. German Rivera
owner needs to be initialized as THIS_MOUDLE. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-10-17staging: fsl-mc: fixed bug in uninitialized root dprc irq countJ. German Rivera
When initializing the object attributes for the root dprc, the irq_count was uninitialized. Initialize it to 1. Signed-off-by: J. German Rivera <German.Rivera@freescale.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>