summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2014-12-11Disable CPU migration during USDPAA CleanupRoy Pledge
CPU specific variables are used during USDPAA cleanup. Disabling CPU migration is needed to avoid the cleanup process from being moved to another CPU (especially when using the RT preemption models) Change-Id: If0133117fcec82f69e6123cb4da3167363b0dad3 Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/24105 Reviewed-by: Roy Pledge <roy.pledge@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11crypto: caam: change function definition to return voidCristian Stoica
The function definition is changed to match dma_unmap_sg which is a void function Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Change-Id: I6142f5a56127db1fa103a497489e88d04bbc28e1 Reviewed-on: http://git.am.freescale.net:8181/19809 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11crypto: caam: remove void pointer arithmeticCristian Stoica
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Change-Id: Iff7b2f0929e6274fe9ffc54b4dddd0ef640314d7 Reviewed-on: http://git.am.freescale.net:8181/19798 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11crypto: caam: remove code duplicationCristian Stoica
Duplicated code has already been extracted into an independent function. Replace the code with a function call Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Change-Id: If390831e03de17c0397d3ae11516fae4d1b39164 Reviewed-on: http://git.am.freescale.net:8181/24348 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11crypto: testmgr - remove unused function argumentCristian Stoica
The argument "req" of do_one_async_hash_op is not used by the function. This patch removes this argument and renames the function to match more closely its purpose. Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit d4c85f9bb53f25491524839ab1610b30810ab898) Change-Id: Ibe4a40b69012175f50c4a5c53c299511ec12ee38 Reviewed-on: http://git.am.freescale.net:8181/24224 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11gianfar: Fix compile error for FSL_GIANFAR_1588Matei Pavaluca
| drivers/net/ethernet/freescale/gianfar.c: In function 'gfar_init_bds': | drivers/net/ethernet/freescale/gianfar.c:227:16: error: 'struct gfar' has no member named 'rfbptr0' | rfbptr = &regs->rfbptr0; | ^ | drivers/net/ethernet/freescale/gianfar.c: In function 'gfar_init_rqprm': | drivers/net/ethernet/freescale/gianfar.c:385:15: error: 'struct gfar' has no member named 'rqprm0' | baddr = &regs->rqprm0; | ^ Signed-off-by: Matei Pavaluca <matei.pavaluca@freescale.com> Change-Id: I90b995bdf88d5e6779c3eb2b13cefb37b603bdc7 Reviewed-on: http://git.am.freescale.net:8181/23975 Reviewed-by: Claudiu Manoil <claudiu.manoil@freescale.com> Reviewed-by: Yangbo Lu <yangbo.lu@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11Revert "crypto: testmgr - remove unused function argument"Richard Schmitt
This reverts commit 30bd01a853781c4a6884b5107ce9e190ede21ade. Change-Id: Id669770c1787ec45e2c9ae4278b60ad3392e240d Reviewed-on: http://git.am.freescale.net:8181/24188 Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com> Tested-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11Revert "crypto: caam: remove code duplication"Richard Schmitt
This reverts commit d2dfa8c0cdf585008cdf6a15c337c30e264f045e. Change-Id: Ib5504c1600f99debc2654086781d9bf904e32f63 Reviewed-on: http://git.am.freescale.net:8181/24187 Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com> Tested-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11crypto: caam: remove code duplicationCristian Stoica
Duplicated code has already been extracted into an independent function. Replace the code with a function call Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Change-Id: Ieb70040fe4c13d27b7a5ab4450c7550b9b74f3b3 Reviewed-on: http://git.am.freescale.net:8181/19796 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11crypto: testmgr - remove unused function argumentCristian Stoica
The argument "req" of do_one_async_hash_op is not used by the function. This patch removes this argument and renames the function to match more closely its purpose. Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit d4c85f9bb53f25491524839ab1610b30810ab898) Change-Id: I73e075f32fa3821136753365aee0c2ba7a89d523 Reviewed-on: http://git.am.freescale.net:8181/19766 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11fmd: add support for t1024 featuresMandy Lavi
Change-Id: I37dbffe63e57af8a783b251d0f78087400b09d99 Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/23940 Reviewed-by: Eyal Harari <Eyal.Harari@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Nir Erez <nir.erez@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11crypto: caamalg_qi: remove redundant checks on fast pathCristian Stoica
The function is called with arguments known at compile time. Remove runtime checks for out of bound values. Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Change-Id: I2fe2e3d4bd3c63b81f99065b0db159a009f217e6 Reviewed-on: http://git.am.freescale.net:8181/19806 Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caamhash: fix jr alloc leak on error pathCristian Stoica
Memory allocated for ctx->jrdev is freed in all error paths except when ahash_set_sh_desc(ahash) fails. Add a check for this case and free memory as appropriate. Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Change-Id: I1c4e45a8cfdc6d24d768e90a148bb398b3d09f52 Reviewed-on: http://git.am.freescale.net:8181/19803 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam - fix memleak in caam_jr moduleCristian Stoica
This patch fixes a memory leak that appears when caam_jr module is unloaded. Cc: <stable@vger.kernel.org> # 3.13+ Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit 0378c9a855bfa395f595fbfb049707093e270f69) Change-Id: I65f5e6d3611a007506d9c80c344e9467f6b20c84 Reviewed-on: http://git.am.freescale.net:8181/19794 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11devres: add kernel standard devm_k.alloc functionsJoe Perches
Currently, devm_ managed memory only supports kzalloc. Convert the devm_kzalloc implementation to devm_kmalloc and remove the complete memset to 0 but still set the initial struct devres header and whatever padding before data to 0. Add the other normal alloc variants as static inlines with __GFP_ZERO added to the gfp flag where appropriate: devm_kzalloc devm_kcalloc devm_kmalloc_array Add gfp.h to device.h for the newly added static inlines. akpm: the current API forces us to replace kmalloc() with kzalloc() when performing devm_ conversions. This adds a relatively minor overhead. More significantly, it will defeat kmemcheck used-uninitialized checking, and for a particular driver, losing used-uninitialised checking for their core controlling data structures will significantly degrade kmemcheck usefulness. Signed-off-by: Joe Perches <joe@perches.com> Cc: Tejun Heo <tj@kernel.org> Cc: Sangjung Woo <sangjung.woo@samsung.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> (cherry picked from commit 64c862a839a8db2c02bbaa88b923d13e1208919d) Change-Id: Ifb88e90e65f88dc4a06a0974fec86cbc7771c52a Reviewed-on: http://git.am.freescale.net:8181/19793 Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam - fix mem leak in ahash_setkeyHoria Geanta
In case hash key is bigger than algorithm block size, it is hashed. In this case, memory is allocated to keep this hash in hashed_key. hashed_key has to be freed on the key_dma dma mapping error path. Signed-off-by: Horia Geanta <horia.geanta@freescale.com> Reviewed-by: Marek Vasut <marex@denx.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit 3d67be2761dc4b5b792037f296f3394a29581efc) Change-Id: Ied6b875209839897e144e93f09b77431136c9703 Reviewed-on: http://git.am.freescale.net:8181/19765 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam - remove duplicated sg copy functionsCristian Stoica
Replace equivalent (and partially incorrect) scatter-gather functions with ones from crypto-API. The replacement is motivated by page-faults in sg_copy_part triggered by successive calls to crypto_hash_update. The following fault appears after calling crypto_ahash_update twice, first with 13 and then with 285 bytes: Unable to handle kernel paging request for data at address 0x00000008 Faulting instruction address: 0xf9bf9a8c Oops: Kernel access of bad area, sig: 11 [#1] SMP NR_CPUS=8 CoreNet Generic Modules linked in: tcrypt(+) caamhash caam_jr caam tls CPU: 6 PID: 1497 Comm: cryptomgr_test Not tainted 3.12.19-rt30-QorIQ-SDK-V1.6+g9fda9f2 #75 task: e9308530 ti: e700e000 task.ti: e700e000 NIP: f9bf9a8c LR: f9bfcf28 CTR: c0019ea0 REGS: e700fb80 TRAP: 0300 Not tainted (3.12.19-rt30-QorIQ-SDK-V1.6+g9fda9f2) MSR: 00029002 <CE,EE,ME> CR: 44f92024 XER: 20000000 DEAR: 00000008, ESR: 00000000 GPR00: f9bfcf28 e700fc30 e9308530 e70b1e55 00000000 ffffffdd e70b1e54 0bebf888 GPR08: 902c7ef5 c0e771e2 00000002 00000888 c0019ea0 00000000 00000000 c07a4154 GPR16: c08d0000 e91a8f9c 00000001 e98fb400 00000100 e9c83028 e70b1e08 e70b1d48 GPR24: e992ce10 e70b1dc8 f9bfe4f4 e70b1e55 ffffffdd e70b1ce0 00000000 00000000 NIP [f9bf9a8c] sg_copy+0x1c/0x100 [caamhash] LR [f9bfcf28] ahash_update_no_ctx+0x628/0x660 [caamhash] Call Trace: [e700fc30] [f9bf9c50] sg_copy_part+0xe0/0x160 [caamhash] (unreliable) [e700fc50] [f9bfcf28] ahash_update_no_ctx+0x628/0x660 [caamhash] [e700fcb0] [f954e19c] crypto_tls_genicv+0x13c/0x300 [tls] [e700fd10] [f954e65c] crypto_tls_encrypt+0x5c/0x260 [tls] [e700fd40] [c02250ec] __test_aead.constprop.9+0x2bc/0xb70 [e700fe40] [c02259f0] alg_test_aead+0x50/0xc0 [e700fe60] [c02241e4] alg_test+0x114/0x2e0 [e700fee0] [c022276c] cryptomgr_test+0x4c/0x60 [e700fef0] [c004f658] kthread+0x98/0xa0 [e700ff40] [c000fd04] ret_from_kernel_thread+0x5c/0x64 Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit 307fd543f3d23f8f56850eca1b27b1be2fe71017) Change-Id: I6d5822563f2437231def72c8a6ac37932a5139b8 Reviewed-on: http://git.am.freescale.net:8181/19763 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caamctrl: fix array out of bound accessCristian Stoica
desc_len(desc) returns a result masked by a seven bits mask representing a descriptor length. The maximum length is 64 u32 words but masking allows for larger but incorrect values. This fix adds a bound check to the index of deco.descbuf array (which is smaller than the maximum of 64 words), to avoid invalid memory accesses. (based on commit 05dbe2ed7da7d67cfd8915382c2559db684a0a29) Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Signed-off-by: Matthew Weigel <matthew.weigel@freescale.com> Change-Id: I05dbe2ed7da7d67cfd8915382c2559db684a0a29 Conflicts: drivers/crypto/caam/ctrl.c Reviewed-on: http://git.am.freescale.net:8181/19805 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caamctrl refactoring: remove code duplicationCristian Stoica
Both error and normal paths call clrbits32 before returning. Put this call in a single place to avoid code duplication Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> (cherry picked from commit c75e03a2d47583e39f46c2925abd0ca79a693086) Signed-off-by: Matthew Weigel <Matthew.Weigel@freescale.com> Conflicts: drivers/crypto/caam/ctrl.c Change-Id: I3c2ec1c34215b5d2a1ee036809beaeabf724ac48 Reviewed-on: http://git.am.freescale.net:8181/24179 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam: fix sg_count searching out of boundCristian Stoica
Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Change-Id: I0acac8a5fb22a0095ec1c347e4a100a277ac788f Reviewed-on: http://git.am.freescale.net:8181/19810 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam: fix array out of bound accessCristian Stoica
All arrays in question have six elements but the index is seven bits wide. Make sure the index is bound by ARRAY_SIZE to avoid incorrect memory accesses Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Change-Id: Ic1a65f55e9aa76dc7828021010bac8ebac75b565 Reviewed-on: http://git.am.freescale.net:8181/19802 Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam: fix offset field in hw sg entriesCristian Stoica
The offset field is 13 bits wide; make sure we don't overwrite more than that in the caam hardware scatter gather structure Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Change-Id: Id590d2aa9362d58e6920d9e54076ff6f184f3815 Reviewed-on: http://git.am.freescale.net:8181/19801 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam - fix sg_count searching out of boundHoria Geanta
In case sg_count is provided with a buffer length greater than what is in the scatterlist, it will oops. Stop the count of nents when sg is NULL. Change-Id: I3fffdf901e602d11776e4fe5eb9322d2c186a612 Signed-off-by: Horia Geanta <horia.geanta@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/6467 Reviewed-by: Richard Schmitt <B43082@freescale.com> Tested-by: Richard Schmitt <B43082@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/19787 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam - fix addressing of struct memberCristian Stoica
buf_0 and buf_1 in caam_hash_state are not next to each other. Accessing buf_1 is incorrect from &buf_0 with an offset of only size_of(buf_0). The same issue is also with buflen_0 and buflen_1 Cc: <stable@vger.kernel.org> # 3.13+ Signed-off-by: Cristian Stoica <cristian.stoica@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit 4451d494b1910bf7b7f8381a637d0fe6d2142467) Change-Id: Ibd092659780d8a918424e4cc753f3e83792406f8 Reviewed-on: http://git.am.freescale.net:8181/19764 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Mircea Pop <mircea.pop@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam - enable raw data instead of von Neumann dataAlex Porosanu
The sampling of the oscillator can be done in multiple modes for generating the entropy value. By default, this is set to von Neumann. This patch changes the sampling to raw data, since it has been discovered that the generated entropy has a better 'quality'. Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit e5ffbfc182bc148f44840bdd3970ea4c8bf80c3c) Change-Id: Ib366aa7e0477b2793f648333f2798a5c7b59ec5f Reviewed-on: http://git.am.freescale.net:8181/23839 Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com> Tested-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam - change starting entropy delay valueAlex Porosanu
The entropy delay (the length in system clocks of each entropy sample) for the RNG4 block of CAAM is dependent on the frequency of the SoC. By elaborate methods, it has been determined that a good starting value for all platforms integrating the CAAM IP is 3200. Using a higher value has additional benefit of speeding up the process of instantiating the RNG, since the entropy delay will be increased and instantiation of the RNG state handles will be reattempted by the driver. If the starting value is low, for certain platforms, this can lead to a quite lengthy process. This patch changes the starting value of the length of the entropy sample to 3200 system clocks. In addition to this change, the attempted entropy delay values are now printed on the console upon initialization of the RNG block. While here, a safeguard for yielding the processor was added for ensuring that in very adverse cases, the CPU isn't hogged by the instantiation loop. Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit eeaa1724a2e9c8958a8621b3c10d5ca0667e78fa) Conflicts: drivers/crypto/caam/ctrl.c Change-Id: Ibc271d629cef3cab291ac8e5c8e7b68b0dc7c1e3 Reviewed-on: http://git.am.freescale.net:8181/23840 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11crypto: caam - disable RNG oscillator maximum frequency checkAlex Porosanu
The rtfrqmax & rtfrqmin set the bounds of the expected frequency of the oscillator, when SEC runs at its maximum frequency. For certain platforms (f.i. T2080), the oscillator is very fast and thus if the SEC runs at a lower than normal frequency, the ring oscillator is incorrectly detected as being out of bounds. This patch effectively disables the maximum frequency check, by setting a high enough maximum allowable frequency for the oscillator. The reasoning behind this is that usually a broken oscillator will run too slow (i.e. not run at all) rather than run too fast. Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> (cherry picked from commit b061f3fefcffa0cdcdc61ae2a1123a4e7697d452) Change-Id: I796cf92bf08c66d0499bfe3962dcd67afd51a72e Reviewed-on: http://git.am.freescale.net:8181/23838 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11powerpc/corenet: use the mixed mode of MPIC when enabling CPU hotplugChenhui Zhao
Core reset may cause issue if using the proxy mode of MPIC. Use the mixed mode of MPIC if enabling CPU hotplug. Change-Id: I0e6b9dbd2126f0fb0af917d25c948266417bb71f Signed-off-by: Chenhui Zhao <chenhui.zhao@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/24102 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Yang Li <LeoLi@freescale.com> Reviewed-by: Dongsheng Wang <dongsheng.wang@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11arm: ls1: provide a workaround for core soft resetZhang Zhuoyu
Due to an erratum, after core soft reset, core state machine registers need to force release manually to avoid cache coherence issue. Signed-off-by: Zhang Zhuoyu <Zhuoyu.Zhang@freescale.com> ---- Fix previous known issue http://git.am.freescale.net:8181/21918 Change-Id: I44a7cf8a315bafe7dc413f73d2af2579da246fbb Reviewed-on: http://git.am.freescale.net:8181/23520 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11arm: ls1: implement ls1 cpu-hotplug by reset coreZhang Zhuoyu
CPU hotplug should always reset core and boots up the same path as a cold boot to be compatible with kexec. Signed-off-by: Zhang Zhuoyu <Zhuoyu.Zhang@freescale.com> ---- Fix previous known issue http://git.am.freescale.net:8181/21918 Patch Sent Upstream http://patchwork.ozlabs.org/patch/393683/ Change-Id: I668b59b4250ef62395a6fd8c22ea64f64af9d106 Reviewed-on: http://git.am.freescale.net:8181/23519 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Yuantian Tang <yuantian.tang@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11drivers:usb:pm: Fix usb wake-up issue in rcpm drvRamneek Mehresh
fsl_set_power_except() checks only for fman node. For all other ips, it doesn't program rcpm register, and goes to err handling code. Hence, a check for usb is put so that fman code only runs for fman ip Signed-off-by: Ramneek Mehresh <ramneek.mehresh@freescale.com> Change-Id: Ia8b2280cbcd16b7935032c72fcc49dadcd2f263c Reviewed-on: http://git.am.freescale.net:8181/23989 Reviewed-by: Nikhil Badola <nikhil.badola@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11qbman: Corrections based on static analysisAhmed Mansour
ioctl_dma_map. String length check Added check to ensure the string copied from user space is within the length allowed for by the buffer and is null terminated. qm_shutdown_fq. Remove deadcode Removed the case statement label for QM_MCR_NP_STATE_OOS since that condition is checked for earlier in the code and in that case the function exits immediately. ioctl_dma_lock. Remove NULL dereference A pointer is made null and then there is an attempt to dereference one of the members of the struct that it points to. This condition is never reached normally, but in error conditions this path of execution may be possible. Added return -EFAULT to exit function safely and unlocked locked resources usdpaa_get_unmapped_area. Arithmetic overflow protection Added a check to ensure that memory length passed in does not result in an invalid size to be passed because of a possible arithmetic overflow that can occur in the subtraction in the macro USDPAA_MEM_ROUNDUP. qman_ceetm_ccg_claim. If condition fix Removed a check against an unsigned int value that checks if it is below zero (negative). The unsigned value cannot be negative and the compare will always fail in reality. qman_create_portal. Add comment to clarify flow Clarified why no check is made to ensure that qm_mr_current() returned successfully. The addition of a redundant check was rejected because it impairs the reader's understanding of the flow by implying the possibility of a physically impossible path. dpa_alloc_new. Fix memory leak in error conditions Previously allocated memory which is passed by reference in success (list_add_tail) is not freed in error conditions that occur in other parts of the function. Added code to free allocated memory in error cases. qman_create_portal. Fix memory leak in error path Added cleanup code that deletes malloced memory in case of function failure after memory is allocated. ioctl_dma_map. Input bound checks on values from USDPAA Check the struct usdpaa_ioctl_dma_map, input, to ensure that values copied from user space are valid input. qman_init. Check init_pcfg return Previously unused assignment is now being used. The return of init_pcfg() was not checked for success. Now we check for success and print an error message in case of failure. There is a similar issue in bman_driver. bman_init. Check init_pcfg return Added check to ensure init_pcfg() is returning successfully. Print an error message and return if in error case. There is a similar issue in qman_driver. Signed-off-by: Ahmed Mansour <Ahmed.Mansour@freescale.com> Change-Id: I230678948c3e8e43aa5738045244c5dac0b5f5f5 Reviewed-on: http://git.am.freescale.net:8181/21381 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11Set affinity for USDPAA IRQsRoy Pledge
Set the affinity of the USDPAA IRQ to match the affinity of the calling process Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I077a48ae5a77fe35a77dfae65c298fa6fa2aecda Reviewed-on: http://git.am.freescale.net:8181/23675 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11powerpc/rcpm: fix compile error with non-SMP modeChenhui Zhao
Add asm/smp.h, and only compile the cluster related code when CPU hotplug is enabled. Change-Id: I264ff297ca1ee29bf8c477b09bce98eeb27140ee Signed-off-by: Chenhui Zhao <chenhui.zhao@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/23752 Reviewed-by: Yang Li <LeoLi@freescale.com> Reviewed-by: Zhuoyu Zhang <Zhuoyu.Zhang@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11t2080/usdpaa/dts: Corrected default rx frame queue idSandeep Singh
Default rx frame queue id should match with usdpaa xml policy file. Policy file is used to set FMAN configuration. Signed-off-by: Sandeep Singh <sandeep@freescale.com> Change-Id: I696d604c0811a8aa0b1ccf4ca6a67a0384eb558d Reviewed-on: http://git.am.freescale.net:8181/23859 Reviewed-by: Vakul Garg <vakul@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11dpa_offload: use SEC API for retrieving JRAlex Porosanu
SEC driver offers a function for geting the handle to an available JR (caam_jr_alloc(...) This is mainly needed for split-key calculation per SA. There's no need to search for the JR in the device tree. This patch removes the unneeded code and replaces it with the proper SEC API call. Change-Id: Ibc8b4b216d5699fe5ec7d3d49b8a3560ab79ede0 Signed-off-by: Alex Porosanu <alexandru.porosanu@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/23860 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Marian-Cornel Chereji <marian.chereji@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11fmd: fix static analysis issuesMandy Lavi
Change-Id: I2d6cead7b62116cd6a264ec91d82f3bdc3a03c10 Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/23939 Reviewed-by: Igal Liberman <Igal.Liberman@freescale.com> Tested-by: Richard Schmitt <richard.schmitt@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11dpa_offload: Relocate dpa_classifier entry in index management listMarian Chereji
For HASH tables sometimes when a user modifies the key of an entry the entry needs to be moved to a different bucket. The index management list is sorted so that indexes are always ascending. When tempering with the position of an entry in the internal Cc nodes for a HASH table, the position of the entry in the index management list must also be updated. Change-Id: If4b48282c407ed248dfd389cc0c8ae856fb7db75 Signed-off-by: Marian Chereji <marian.chereji@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/23700 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Radu-Andrei Bulie <Radu.Bulie@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11mmc: sdio: make sure sdio_irq_thread pointer is not NULL.Qiu Wujie
Signed-off-by: Wujie Qiu <B49553@freescale.com> Change-Id: Icf01605c71a19e0ffa01e85b1ed93eb0704493da Reviewed-on: http://git.am.freescale.net:8181/23831 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Xiaobo Xie <X.Xie@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11usb: dwc3: core: support optional PHYsNikhil Badola
Since PHYs for dwc3 is optional (not all SoCs having PHYs for DWC3 should be programmed), do not return from probe if the USB PHY library returns -ENODEV as that indicates the platform does not have a programmable PHY. While this can be considered as a temporary fix, a long term solution would be to add 'nop' PHY for platforms that does not have programmable PHY. Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com> Reviewed-by: Roger Quadros <rogerq@ti.com> Signed-off-by: Felipe Balbi <balbi@ti.com> --- Backported from open source linux commit 122f06e60f90a43d9b2fb30662af688dfb759379 Change-Id: I69055c21ee4857db5ef941ad6eac20051f0d84fc Reviewed-on: http://git.am.freescale.net:8181/23713 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Ramneek Mehresh <ramneek.mehresh@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11powerpc/smp: fix cluster enter PCL10 issue when SMT disable on e6500Zhang Zhuoyu
When CPU SMT feature disabled on e6500, cluster can't enter PCL10. This patch fix it. Signed-off-by: Zhang Zhuoyu <Zhuoyu.Zhang@freescale.com> Change-Id: I362be661ceefd78e5d8b1d6f36331add4e9ef0af Reviewed-on: http://git.am.freescale.net:8181/23341 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Hongtao Jia <hongtao.jia@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11powerpc/rcpm: Fix cluster mask calculation issue on e6500Zhang Zhuoyu
If all cores of a cluster are disabled in u-boot, the cluster mask we calculate through cpu dts node is unreliable, this patch use hard cored threads number per cluster to fix it. Signed-off-by: Zhang Zhuoyu <Zhuoyu.Zhang@freescale.com> Change-Id: I8c76b4c592bebdacf55dc6c9d50bd65ea0fce89f Reviewed-on: http://git.am.freescale.net:8181/23340 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Yuantian Tang <yuantian.tang@freescale.com> Reviewed-by: Hongtao Jia <hongtao.jia@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11ls1020: Add crypto node alias in device treeRuchika Gupta
U-boot patches up the device tree crypto node for the era property. crypto node alias was missing in the ls1020 device trees. Signed-off-by: Ruchika Gupta <ruchika.gupta@freescale.com> Change-Id: I335cc0765a1f66c72d98bab737aab3012448bf18 Reviewed-on: http://git.am.freescale.net:8181/23508 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11Fix for watchdog expiry when running netperf UDP traffic with ASF enabled in ↵Sahil Malhotra
Linux. This patch is workaround for watchdog expiry problem on running netperf client on DUT with UDP traffic with ASF enabled. Change-Id: Ib9a9c8fd13e5ecb6f9daf30deb8f128b629c002d Signed-off-by: Sahil Malhotra <sahilmalhotra@freescale.com> CR:ENGR00336061 Reviewed-on: http://git.am.freescale.net:8181/23065 Reviewed-by: Sandeep Malik <Sandeep.Malik@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Claudiu Manoil <claudiu.manoil@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11ASF: Placing hooks in gianfar driver for both PPC and ARM platforms.Ganga Negi
Placing required compilation flags and hooks in gianfar driver for both ARM and PowerPC platforms. Signed-off-by: Ganga Negi <ganga.negi@freescale.com> Change-Id: I2f6c8fe40a2223013559bc6909a60e8963aa2a96 CR:ENGR00338962 (cherry picked from commit 509f3236615193c77e07797cde4729ccc8cb2ef5) Reviewed-on: http://git.am.freescale.net:8181/23585 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Claudiu Manoil <claudiu.manoil@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11pdb: Patch to replace flag CPU_BIG_ENDIAN with __BIG_ENDIANAlok Makhariya
Flag CPU_BIG_ENDIAN is not defined in powerpc config file so it is replace with __BIG_ENDIAN flag. Signed-off-by: Alok Makhariya <B46187@freescale.com> Change-Id: I8cf0b83ab53a6dd544de81cf17ad0441ebb08ce5 Reviewed-on: http://git.am.freescale.net:8181/23694 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Horia Ioan Geanta Neag <horia.geanta@freescale.com> Reviewed-by: Richard Schmitt <richard.schmitt@freescale.com>
2014-12-11Revert "fmd: fix static analysis issues"Matthew Weigel
This reverts commit 5e921ed07acbc6f05536aac89b9edc2578663840. Change-Id: Ic4d1166b5ad6419f369e3be278f41ea5764ff6fc Reviewed-on: http://git.am.freescale.net:8181/23784 Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com> Tested-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11fmd: fix static analysis issuesMandy Lavi
Change-Id: I428d24ec05b1e6ef2137ad2ba6385ddfa3a01872 Signed-off-by: Mandy Lavi <mandy.lavi@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/22882 Reviewed-by: Nir Erez <nir.erez@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com> Tested-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11powerpc/defconfig: Enable CONFIG_MTD_SPI_NOR_BASEShengzhou Liu
In order to use the SPI nor framework to detect NOR flash. Signed-off-by: Mingkai.Hu <Mingkai.Hu@freescale.com> Change-Id: I5f7b42316cefb618278d739c212bd7cbd4833e9c Reviewed-on: http://git.am.freescale.net:8181/23450 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Shengzhou Liu <Shengzhou.Liu@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
2014-12-11t10xx: updating config for t10xx platformShengzhou Liu
- enable CONFIG_RTC_DRV_DS1307 to support DS1339 RTC for T1024RDB. - enable CONFIG_I2C_MUX and CONFIG_I2C_MUX_PCA954x for T102x/T104x QDS/RDB. - enable CONFIG_MTD_SPI_NOR_BASE and update compatible to "micron,n25q512ax3" for SPI flash on T102xRDB and T104xRDB. - fix typo for CONFIG_SENSORS_LM90. Signed-off-by: Shengzhou Liu <Shengzhou.Liu@freescale.com> Change-Id: I3506779d51192d2bfaa28a3f863c019b612b6f96 Reviewed-on: http://git.am.freescale.net:8181/23525 Reviewed-by: Shaohui Xie <Shaohui.Xie@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>