Commit Graph

276 Commits

Author SHA1 Message Date
Ioana Ciornei 5b04cedeca bus: fsl-mc: change mc_command in fsl_mc_command
The "struct mc_command" is a very generic name for a global
kernel structure. Change its name in "struct fsl_mc_command".

Signed-off-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-23 15:52:48 +01:00
Bogdan Purcareata 70ae9cf015 staging: fsl-mc: Move DPCON out of staging
Move the source files out of staging into their final locations:
- dpcon.c goes to drivers/bus/fsl-mc/, next to the core infrastructure
- dpcon-cmd.h gets merged into drivers/bus/fsl-mc/fsl-mc-private.h, next
  to the other internally used APIs
- dpcon.h gets merged into include/linux/fsl/mc.h, exposing the public
  API

Update references in the dpaa2-eth staging driver.

DPCON stands for Data Path Concentrator - an interface between DPIO
(Data Path IO) and its users (e.g. dpaa2-eth). You can read more about
DPIO in Documentation/networking/dpaa2/overview.rst

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-14 13:18:42 +01:00
Bogdan Purcareata 9c692d5ae7 staging: fsl-mc: Move DPBP out of staging
Move the source files out of staging into their final locations:
- dpbp.c goes to drivers/bus/fsl-mc/, next to the core infrastructure
- dpbp-cmd.h gets merged into drivers/bus/fsl-mc/fsl-mc-private.h, next
  to the other internally used APIs
- dpbp.h gets merged into include/linux/fsl/mc.h, exposing the public
  API

Update references in the dpaa2-eth staging driver.

DPBP stands for Data Path Buffer Pool - you can read more about the
object in Documentation/networking/dpaa2/overview.rst

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-14 13:18:42 +01:00
Roy Pledge 0922a464a6 staging: fsl-mc/dpio: Add missing argument identifier
When running checkpatch over the DPIO code the following warning
is reported:

WARNING: function definition argument 'struct dpaa2_io_notification_ctx *' should also have an identifier name

Add the missing identifier.

Signed-off-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-08 09:58:42 -08:00
Ioana Radulescu c5f370c767 staging: fsl-mc/dpio: Fix incorrect masking
In qbman_swp_alt_fq_state(), we need to mask the fqid value
before converting it to little endian, otherwise we write a
wrong value to hardware when running in big endian mode.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-08 09:57:37 -08:00
Ioana Radulescu 6d02512fa8 staging: fsl-mc/dpio: Use __leXX types where needed
Structures that are mapped to hardware registers should explicitly
specify the expected endianness for fields larger than 1 byte.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-08 09:57:37 -08:00
Ioana Radulescu 0f4e601467 staging: fsl-mc/dpio: Fix cast truncate warning
Sparse reports the following warning:
drivers/staging/fsl-mc/include/dpaa2-fd.h:421:30:
warning: cast truncates bits from constant value (ffff7fff becomes 7fff)

Fix this by explicitly masking the value with 0xffff.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-08 09:57:37 -08:00
Ioana Radulescu c674f4aab4 staging: fsl-mc/dpio: Fix incorrect cast
Move the cast in dpaa2_sg_get_addr() to the right place.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-08 09:56:15 -08:00
Anders Roxell 8bae455e57 staging: fsl-mc/dpio: remove unused function
gcc warns that function 'qbman_pull_desc_set_token' is not used.

drivers/staging/fsl-mc/bus/dpio/qbman-portal.c:525:13: warning: ‘qbman_pull_desc_set_token’ defined but not used [-Wunused-function]

In the current code we remove that function.

Fixes: 321eecb06b ("bus: fsl-mc: dpio: add QBMan portal APIs for DPAA2")
Signed-off-by: Anders Roxell <anders.roxell@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-06 04:14:49 -08:00
Bogdan Purcareata d8c85d238d staging: fsl-mc: Cleanup dpbp and dpcon API
Some functions and associated structures are not used by current code,
so remove them.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01 19:40:31 +01:00
Fengguang Wu 7c979b4731 staging: fsl-mc/dpio: qbman_pull_desc_set_token() can be static
Fixes: 1628e2e4dc76 ("staging: fsl-mc/dpio: allow the driver to compile multi-arch")
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01 17:30:53 +01:00
Ioana Radulescu 43c3c14d70 staging: fsl-mc/dpio: allow the driver to compile multi-arch
Drop dependency on ARCH_LAYERSCAPE (which in turn depends on ARM64),
thus allowing this driver to compile on all architectures supported
by the fsl-mc bus driver.

This was compile tested on:
 - powerpc (corenet_basic_defconfig, ppc64_defconfig)
 - x86 (i386_defconfig, x86_64_defconfig, needs CONFIG_OF)
 - arm64 (defconfig)

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01 17:30:53 +01:00
Greg Kroah-Hartman 0540bccdb5 staging: fsl-mc: dpio: remove foolish -Werror Makefile addtion
With the zillion different compilers out there, never use -Werror,
otherwise your code will end up breaking the build for odd reasons.

Like now, if this driver is enabled, it breaks the build due to a
function that could be marked static.  So it's obvious no one is even
paying attention to this driver :(

Cc: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01 17:27:50 +01:00
Ioana Radulescu a4c4f36031 staging: fsl-mc/dpio: Fix incorrect casts
The DPIO driver incorrectly assumes virtual addresses are always
64b long, which causes compiler errors when building for a 32b
platform.

Fix this by using explicit casts to uintptr_t where necessary.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-03-01 17:27:18 +01:00
Bogdan Purcareata 7afe031c1a staging: fsl-mc: Move irqchip code out of staging
Now that the fsl-mc bus core infrastructure is out of staging, the
remaining irqchip glue code used (irq-gic-v3-its-fsl-mc-msi.c) goes
to drivers/irqchip.

Create new Kconfig option for irqchip code that depends on
FSL_MC_BUS and ARM_GIC_V3_ITS. This ensures irqchip code only
gets built on ARM64 platforms. We can now remove #ifdef
GENERIC_MSI_DOMAIN_OPS as it was only needed for x86.

Signed-off-by: Stuart Yoder <stuyoder@gmail.com>
[rebased, add dpaa2_eth and dpio #include updates]
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
[rebased, split irqchip to separate patch]
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
[add Kconfig dependency on ARM_GIC_V3_ITS]
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22 15:11:30 +01:00
Bogdan Purcareata 6bd067c48e staging: fsl-mc: Move core bus out of staging
Move the source files out of staging into their final locations:
  -mc.h include file in drivers/staging/fsl-mc/include go to include/linux/fsl
  -source files in drivers/staging/fsl-mc/bus go to drivers/bus/fsl-mc
  -overview.rst, providing an overview of DPAA2, goes to
   Documentation/networking/dpaa2/overview.rst

Update or delete other remaining staging files -- Makefile, Kconfig, TODO.
Update dpaa2_eth and dpio staging drivers.
Add integration bits for the documentation build system.

Signed-off-by: Stuart Yoder <stuyoder@gmail.com>
[rebased, add dpaa2_eth and dpio #include updates]
Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
[rebased, split irqchip to separate patch]
Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Jason Cooper <jason@lakedaemon.net>
Cc: Marc Zyngier <marc.zyngier@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-22 15:10:50 +01:00
Bogdan Purcareata 203e2de32b staging: fsl-mc: Add SPDX license identifiers
The fsl-mc bus and dpio driver files use a combination of GPL-2.0 and
GPL-2.0+ OR BSD-3-Clause licenses. Add SPDX tags and delete the full
license text, keeping the existing license for each file. Add GPL-2.0
for Kconfig / Makefile, where not present.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-22 11:45:21 +01:00
Colin Ian King a535929f46 staging: fsl-mc: make function its_fsl_mc_msi_init static
The function its_fsl_mc_msi_init is local to the source and does
not need to be in global scope, so make it static.

Cleans up sparse warning:
symbol 'its_fsl_mc_msi_init' was not declared. Should it be static?

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-17 15:05:46 +01:00
Ioana Radulescu 60b91319a3 staging: fsl-mc: Convert documentation to rst format
Update the doc file to comply with the rst format.

It's not integrated into the documentation build structure yet,
since it's still located in drivers/staging.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-17 15:05:02 +01:00
Ioana Radulescu 2abce12ebf staging: fsl-mc: README cleanup
Minor cosmetic changes to the DPAA2 overview documentation file.
Add a reference to the mc-bus driver sysfs documentation.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-16 16:14:40 +01:00
Ioana Radulescu 1df5d23d57 staging: fsl-mc: Update include header
With the declarations of its_fsl_mc_msi_init/cleanup() now removed
from fsl-mc-private.h, irq-gic-v3-its-fsl-mc-msi.c only needs a
couple of definitions from mc.h, so include that header directly.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-16 16:14:40 +01:00
Ioana Radulescu 1d11d5566c staging: fsl-mc: Remove unnecessary dependency
The function that enables fsl-mc msi interrupts doesn't need
to be explicitly called from the fsl-mc bus driver initialization
routine.

Mark it to be independently called at system init; this is in line
with how things are handled by other GICv3 irqchip users.

Due to this change we now have an unused cleanup function, so
remove it.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-16 16:14:39 +01:00
Ioana Radulescu 880f6ed5a6 staging: fsl-mc: Remove dead code
Remove one unused function from irq-gic-v3-its-fsl-mc-msi.c

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-16 16:14:39 +01:00
Bogdan Purcareata 39d14e4e61 staging: fsl-mc: Consolidate bus core header files
The DPAA2 objects involved (DPMNG, DPMCP, DPRC) are used by the fsl-mc
bus infrastructure only, so group the APIs and structs into
fsl-mc-private.h.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-16 16:14:39 +01:00
Bogdan Purcareata f69aed492e staging: fsl-mc: Cleanup dprc and dpmcp header files
A lot of API and associated structures are not used by current code, so
remove them.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Reviewed-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-16 16:14:39 +01:00
Ioana Radulescu 1f4953836a staging: fsl-mc/dpio: Add dpaa2_io_service_select() API
All DPIO service API functions receive a dpaa2_io service pointer
as parameter (NULL meaning any service will do) which indicates
the hardware resource to be used to execute the specified command.

There isn't however any available API for obtaining such a service
reference that could be used further, effectively forcing the users
to always request a random service for DPIO operations.
(The DPIO driver holds internally an array mapping services to cpus,
and affine services can be indirectly requested by a couple of API
functions: dpaa2_io_service_register and dpaa2_io_service_rearm
use the cpu id provided by the user to select the corresponding
service)

This patch adds a function for selecting a DPIO service based on
the specified cpu id. If the user provides a "don't care" value
for the cpu, we revert to the default behavior and return the next
DPIO, taken in a round-robin fashion from a list of available
services.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Acked-by: Roy Pledge <roy.pledge@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-01-08 16:47:23 +01:00
Nipun Gupta 9c70dbd085 staging: fsl-mc: do not print error in case of defer probe error
Devices on MC bus can be deferred because of dependencies on other modules
(such as IOMMU). Those are not the actual errors; as probing is again
done by the kernel at later stages. So this patch avoids the error print
in such case.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13 12:40:41 +01:00
Nipun Gupta d5c9df800b staging: fsl-mc: Allocate IRQ's before scanning DPRC objects
Following is the current scenario when the devices are probed:

  FSL_MC Bus probe ---> dprc probe ---> dprc devices scan --->
    probe devices in DPRC container ---> allocate IRQ's

In case the devices being probed in the DPRC container need the IRQ's;
probing of that device will fail.

In current scenario the devices which need IRQ's such as DPIO gets
deferred because they aren't registered when first time the probing
of these devices is done in the dprc scan.
So they are probed once IRQ's have been allocated.

In case where DPRC probing itself gets deferred, which does in case
IOMMU is enabled; all the devices in DPRC container gets probed before
IRQ's are allocated. This causes devices using IRQ's (such as DPIO)
to fail.

So having IRQ's allocated before any of the devices in the DPRC container
are probed is more legitimate.

After this patch following is the flow of execution:

  FSL_MC Bus probe ---> dprc probe ---> dprc devices scan --->
    allocate IRQ's ---> probe of devices in DPRC container.

Signed-off-by: Nipun Gupta <nipun.gupta@nxp.com>
Reviewed-by: Bharat Bhushan <bharat.bhushan@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-12-13 12:40:40 +01:00
Bharat Bhushan 612b5bac4e staging: fsl-mc: use 32bits to support 64K size mc-portals
As per APIs each mc-portal is of 64K size while currently
16bits (type u16) is used to store size of mc-portal.
In these cases upper bit of portal size gets truncated.

Signed-off-by: Bharat Bhushan <Bharat.Bhushan@nxp.com>
Acked-By: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-28 13:58:31 +01:00
Greg Kroah-Hartman fb17be96ee staging: fsl-mc-bus: fix build warning
error could be unitialized when it is used as a return value in
fsl_mc_device_add().  So fix up the warning by properly setting it.

Cc: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Reported-by: kbuild test robot <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:28:34 +01:00
Laurentiu Tudor 19e2be77f3 staging: fsl-mc: use device_type instead of strcmp()
Replace strcmp() based device type checks with the standard device
model type.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:41 +01:00
Laurentiu Tudor 47433b630b staging: fsl-mc: add support for device type
The MC bus has different types of devices and this is supported by
device model. This patch adds initial support for device types
(defines them, adds helpers and sets the device type).

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:41 +01:00
Laurentiu Tudor a385dd7b37 staging: fsl-mc: remove debug WARN_ONs doubling error checks
A lot of error checks are doubled by debug WARN_ONs. Given that the
driver was thoroughly debugged and is in a stable state, it's time to
drop them.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:41 +01:00
Laurentiu Tudor d8e026a449 staging: fsl-mc: remove some superfluous WARN_ONs
These WARN_ONs shouldn't trigger unless something went very wrong.
Since the driver is in a stable state let's remove these debug
WARN_ONs.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:41 +01:00
Laurentiu Tudor 53639c64c6 staging: fsl-mc/dpio: change to use EXPORT_SYMBOL_GPL()
No need to use EXPORT_SYMBOL() so switch to the GPL variant.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:41 +01:00
Laurentiu Tudor c9d57ea0b6 staging: fsl-mc: consistently use EXPORT_SYMBOL_GPL()
The bus driver is mixing EXPORT_SYMBOL()/EXPORT_SYMBOL_GPL() usage.
Change it to consistently use EXPORT_SYMBOL_GPL().

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:41 +01:00
Laurentiu Tudor a211c8170b staging: fsl-mc/dpio: remove couple of unused functions
These couple of functions are not yet used so lets remove them
for now and add them back when/if needed.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:41 +01:00
Laurentiu Tudor 9e04d0e20c staging: fsl-mc/dpio: drop EXPORT_SYMBOL() for a few functions
These functions are only used within this driver so no need for
EXPORT_SYMBOL().

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Laurentiu Tudor 2b0ff43ae5 staging: fsl-mc/dpio: remove incomplete refcount implementation
There's an unfinished implementation of reference counting for dpaa2_io
structure using atomics. Since it's unused lets remove it for now and,
if needed at a later time, make use of krefs instead of rolling our
own refcounting.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Laurentiu Tudor 8ba6b44a5a staging: fsl-mc: drop unused dpcon APIs
Couple of API functions are not used so lets drop them together with
the associated structures and defines.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-11-27 09:20:40 +01:00
Ioana Radulescu 8dabf52ffb staging: fsl-mc/dpio: Fix incorrect comparison
For some dpio functions, a cpu id parameter value of -1 is
valid and means "any". But when trying to validate this param
value against an upper limit, in this case num_possible_cpus(),
we risk obtaining the wrong result due to an implicit cast.

Avoid an incorrect check result by explicitly comparing the
cpu id with the "any" value before verifying the upper bound.

Signed-off-by: Ioana Radulescu <ruxandra.radulescu@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-10-03 18:34:56 +02:00
Keerthi Reddy 37c64b7489 Staging: fsl-mc: remove unnecessary parenthesis
Remove unnecessary parenthesis

Signed-off-by: Keerthi Reddy <keerthigd4990@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-29 15:22:51 +02:00
Greg Kroah-Hartman 8439a69e72 Merge 4.13-rc7 into staging-next
We want the staging and iio fixes in here to handle the merge issues.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-28 15:26:48 +02:00
Laurentiu Tudor 19dfd88107 staging: fsl-mc: be consistent when checking strcmp() returns
Throughout the driver we use == 0 / != 0 to check strcmp() returns except
this place, so fix it.

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-23 16:22:32 -07:00
Colin Ian King 47f078339b Revert "staging: fsl-mc: be consistent when checking strcmp() return"
The previous fix removed the equal to zero comparisons by the strcmps and
now the function always returns true. Revert this change to restore the
original correctly functioning code.

Detected by CoverityScan, CID#1452267 ("Constant expression result")

This reverts commit b93ad9a067.

Fixes: b93ad9a067 ("staging: fsl-mc: be consistent when checking strcmp() return")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-16 11:12:06 -07:00
Laurentiu Tudor 0116ced91d staging: fsl-mc: add explicit dependencies for compile-tested arches
The driver makes use of GENERIC_MSI_IRQ_DOMAIN which requires arch
support so, on architectures that don't have it, the kernel will fail
to build. Add explicit dependency on architectures that were
compile-tested, thus fixing compilation for the ones that don't
implement GENERIC_MSI_IRQ_DOMAIN.

Fixes: 0327485027 ("staging: fsl-mc: allow the driver compile multi-arch")

Signed-off-by: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-14 15:18:25 -07:00
Cihangir Akturk a2730bc735 staging: fsl-mc: fix resource_size.cocci warnings
Use resource_size() function on resource objects instead of
explicit computation.

This patch fixes the following coccinelle warning:

drivers/staging/fsl-mc/bus/dprc-driver.c:620:35-38: ERROR: Missing
resource_size with mc_dev -> regions

Signed-off-by: Cihangir Akturk <cakturk@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-08-14 15:18:25 -07:00
Arnd Bergmann 06ead06dde staging: fsl-mc: include irqreturn.h as needed
The recent reshuffling of header files left one type definition
missing in some configurations:

In file included from drivers/staging/fsl-dpaa2/ethernet/dpaa2-eth.h:39:0,
                 from drivers/staging/fsl-dpaa2/ethernet/dpaa2-ethtool.c:34:
drivers/staging/fsl-dpaa2/ethernet/../../fsl-mc/include/dpaa2-io.h:86:1: error: unknown type name 'irqreturn_t'; did you mean 'irq_count'?
 irqreturn_t dpaa2_io_irq(struct dpaa2_io *obj);

I have not bisected this to the exact patch that introduced the problem,
but the solution is obvious, we just need to include the header that
contains the type.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30 08:25:04 -07:00
Bogdan Purcareata 2584f3857f staging: fsl-mc/dpio: Skip endianness conversion in portal config
Writing to the register using writel does the CPU to LE conversion down the
line, so it's not required here. Doing it breaks portal configuration on
big endian kernels.

Signed-off-by: Bogdan Purcareata <bogdan.purcareata@nxp.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30 08:25:04 -07:00
Julia Lawall 5be271ff96 staging: fsl-mc: fix resource_size.cocci warnings
Use resource_size function on resource object
 instead of explicit computation.

Generated by: scripts/coccinelle/api/resource_size.cocci

Fixes: a037b7ec2eb7 ("staging: fsl-mc: allow the driver compile multi-arch")
CC: Laurentiu Tudor <laurentiu.tudor@nxp.com>
Signed-off-by: Julia Lawall <julia.lawall@lip6.fr>
Signed-off-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-30 08:25:03 -07:00