summaryrefslogtreecommitdiff
path: root/drivers/staging/fsl_qbman/fsl_usdpaa.c
AgeCommit message (Collapse)Author
2015-06-05fsl_usdpaa: Ensure map name is initialized and clearedRoy Pledge
Make sure that map name is null terminated when a memory map is split and is cleared when a map is destroyed Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: If779b54817b9c2d49d6e18106b333a51ca2b2dcf Reviewed-on: http://git.am.freescale.net:8181/37436 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
2015-06-04fsl_usdpaa: Fix mem_create behaviorAhmed Mansour
Remove check added in previous patch to disallow size zero to be passed from user space in dma_mem_create(). Size zero is deemed valid if the memory region is already created and a second user wishes to get a mapping to the existent memory. Corrected values copied back to the user to include the length of the memory and the flags. This is important to reflect a memory size correction when the user passes size zero. The user can check the new size using dma_mem_params() Added a warning message if the user attempts to map to an existing area in memory, but specifies a non-zero size that does not match the original memory mapping. In the future this case will trigger an error and the mapping will fail. Currently the behavior is to print a warning message and the kernel passes back to user space the corrected size. Signed-off-by: Ahmed Mansour <Ahmed.Mansour@freescale.com> Change-Id: Ib8535ada6f0fb616986bce3c52eae65f3bf583da Reviewed-on: http://git.am.freescale.net:8181/37365 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Roy Pledge <roy.pledge@freescale.com> Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
2015-05-21fsl_usdpaa: Protect against truncationAhmed Mansour
is_power_of_2 is a Linux function that takes unsigned long. it was used by our new function is_power_of_4 which takes u64. Trucation is possible because unsigned long is 32 bits wide in 32 bit applications. This patch removes the dependancy on is_power_of_2 to solve this issue Signed-off-by: Ahmed Mansour <Ahmed.Mansour@freescale.com> Change-Id: I5939e7e6457e07e9355ba54fef80a7bc71c3a64b Reviewed-on: http://git.am.freescale.net:8181/36609 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Mahammad Ismayilzada <mahammad.ismayilzada@freescale.com> Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
2015-03-26qbman: Add Exception handling - static analysisAhmed Mansour
Catch exceptions and return from functions safely in qbman. Exception handling holes were found in static analysis review Signed-off-by: Ahmed Mansour <Ahmed.Mansour@freescale.com> Change-Id: Ie1e2feadffd2c5c968164d0c569af147ab7929fb Reviewed-on: http://git.am.freescale.net:8181/25568 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Honghua Yin <Hong-Hua.Yin@freescale.com>
2014-12-11Reserve proper length in processes VMA when mapping USDPAA memoryRoy Pledge
USDPAA memory mapping were not properly reserving the entire length of the memory area when perfoming mapping of not power of 4 regions. This causes issues if the choosen address overlapped with an existing memory area. Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I078d12279a43ddf3fc7c5de4b9e4a932d588832e Reviewed-on: http://git.am.freescale.net:8181/25329 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Matthew Weigel <Matthew.Weigel@freescale.com>
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-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-05-07Clean portals before releasing them back into the alloctorRoy Pledge
During USDPAA cleanup ERNs may be produced to any portal the process was using. The cleanup code will service those portals until the FQs reach the retired state. This patch makes sure the portals are reinitialize to a clean state before returning them to the allocation pool Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: Ib4589b816d3259682f16ebacb5932194bc85e053 Reviewed-on: http://git.am.freescale.net:8181/6769 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Thomas Trefny <Tom.Trefny@freescale.com> (cherry picked from commit ebe5afa136e096ed78d4ce94b5dad8327fdd134c) Reviewed-on: http://git.am.freescale.net:8181/11730 Reviewed-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-05-01Fix USDPAA DMA memory compress_frags() logicRoy Pledge
The algorithm for joining DMA memory fragments could incorrecly join fragments such that they were no longer power of 4 sized. This patch reworks the compress_frags() logic so that can no longer occur. Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: Ifdc0b357dbb8e83e2b45275e28c3eee5741d629c Reviewed-on: http://git.am.freescale.net:8181/11685 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-04-25Properly align USDPAA DMA memoryRoy Pledge
DMA memory must be aligned to the page boundary when mapped into the processes virtual address space Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: Ibc6320991d8e5317b8724fc2cfdc23ce47faaaf4 Reviewed-on: http://git.am.freescale.net:8181/11409 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-04-25Fix issue where shared mapping was only partialy mappedRoy Pledge
USDPAA DMA memory mappings can consist of multiple segments to avoid power of 4 restrictions imposed by TLB1 hardware. The total size of the mapping must be tracked so that a shared mapping will cover all pages when it is mapped by another process Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I9f55f3f876e0ca8fc8aa7eb81ec461414eebea27 Reviewed-on: http://git.am.freescale.net:8181/11408 Reviewed-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-04-25Allow a shared DMA maps to be mapped into a process many timesRoy Pledge
Add reference counting to the USDPAA DMA mapping logic so that dma_mem_create() can be called multiple times on the same shared region by a process. Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I7419fd60b3f823764d367018d08f4e620ae09899 Reviewed-on: http://git.am.freescale.net:8181/11407 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-04-07fsl_qbman: set stash attr window before setting attributeVakul Garg
This additional parameter (window number) is required based on the latest update of pamu driver. Signed-off-by: Vakul Garg <vakul@freescale.com> Change-Id: I14a4d61c6f6790aa87ce5924bb9893d9170e8a76 Reviewed-on: http://git.am.freescale.net:8181/10719 Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-04-01Reduce reference count of DMA memory fragments during unmapRoy Pledge
If a process explictly unmapped DMA fragments the reference count of each fragement wasn't properly decremented causing a leak. This would only occur if the proccess explicitly umapped the memory, exiting the process did correctly adjust the reference counts Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: Ia9adfccd5249d17d5506796b1fe71c32f46cab30 Reviewed-on: http://git.am.freescale.net:8181/10527 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-03-31Fix USDPAA DMA Mem freespace calculationRoy Pledge
The USDPAA DMA freespace calculation should only count segments with a reference count of zero as free Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: Ib8752f8ad6cb4179b371b6480f47e84033260efe Reviewed-on: http://git.am.freescale.net:8181/10526 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-03-26Remove mapping from DMA map list during unmapRoy Pledge
The DMA mapping record was not being removed from a processes DMA map when dma_mem_destroy() is called. This made it impossible to remap the same named segment without restarting the process Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I2b92a022e6cb7815056567487688c39774a5008f Reviewed-on: http://git.am.freescale.net:8181/10180 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-03-26qbman: Added DQRR cleanup when portal is not in cdc modeVakul Garg
To acknowledge a DQRR entry, the portal should be preserved in same mode as it was when the DQRR entry was created. Function qm_dqrr_init() is invoked when a raw portal is released back. The raw portal could be either in one of cci or cci or cdc modes. So while cleaning up a portal using qm_dqrr_init(), the dqrr consumption mode should be read and accordingly approriate DQRR consumption routine should be invoked. Signed-off-by: Vakul Garg <vakul@freescale.com> Change-Id: I07b412915cd483060147a845cfe935d0bd7f2024 Reviewed-on: http://git.am.freescale.net:8181/9634 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Roy Pledge <roy.pledge@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-03-06Only initalize fragment owner when fragement is first createdRoy Pledge
When a USDPAA memory fragment is mapped into a user space process the owner should only be initialized if the fragment has just been created. Failure to do this will cause an error if another process is using the fragment when the mapping is done. Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I0fdeb195f5d1910ec70f6f56d772dd2b8cedab4c Reviewed-on: http://git.am.freescale.net:8181/9427 Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-03-05Add support for raw portal allocationRoy Pledge
Add support for allocation of raw (unconfigured) portals to the USDPAA kernel driver. This allows a USDPAA process to allocate a portal on behalf of another user. Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I5764ff1f8e46c8d22cb28367a70ce5a83a8ede85 Reviewed-on: http://git.am.freescale.net:8181/9381 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Vakul Garg <vakul@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-02-22Fix fragment list ordering in USDPAA DMA memoryRoy Pledge
In certain cases the order of the fragment list in the USDPAA DMA system could become misorded leading incorrect mapping addresses being returned. This ensures that the ordering is correct Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I99fe5fbd4b7f31e45277aa9bc3840c1cd0b7d1fc Reviewed-on: http://git.am.freescale.net:8181/8940 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-01-22fsl_qman: Use GFP_ATOMIC inside lockEmil Medve
This fixes the following coccinelle warning: ERROR: function split_frag called ... inside lock ... but uses GFP_KERNEL Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Change-Id: I62291f0e12714c7ed58f818cdd16f2ff1ed4f7d6 Reviewed-on: http://git.am.freescale.net:8181/8109 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Emilian Medve <Emilian.Medve@freescale.com>
2014-01-22fsl_qbman: Replace memcpy with struct assignmentEmil Medve
This fixes the following coccinelle warning: Replace memcpy with struct assignment Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Change-Id: I38f3bf57b18f8fbb8e295ae7b46a187e52491d20 Reviewed-on: http://git.am.freescale.net:8181/8106 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Emilian Medve <Emilian.Medve@freescale.com>
2014-01-10fsl_qbman: Fix the checkpatch warning type LONG_LINEEmil Medve
WARNING:LONG_LINE: line over 80 characters Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Change-Id: I2437493f24859184397a666b7e7375749c639229 Reviewed-on: http://git.am.freescale.net:8181/7784 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Emilian Medve <Emilian.Medve@freescale.com>
2014-01-10fsl_qbman: Fix the checkpatch warning type STORAGE_CLASSEmil Medve
WARNING:STORAGE_CLASS: storage class should be at the beginning of the declaration Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Change-Id: I1fe009e7a44bbb4125e1b200265f4f8d8eb24565 Reviewed-on: http://git.am.freescale.net:8181/7783 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Emilian Medve <Emilian.Medve@freescale.com>
2014-01-10fsl_qbman: Fix the checkpatch error type SPACINGEmil Medve
ERROR:SPACING: space required before the open parenthesis '(' ERROR:SPACING: space prohibited before that close parenthesis ')' ERROR:SPACING: space required after that ',' (ctx:VxV) Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Change-Id: Ifa798bf9edbe187fe9ce21a6c96b70ba58598888 Reviewed-on: http://git.am.freescale.net:8181/7773 Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Emilian Medve <Emilian.Medve@freescale.com> Tested-by: Emilian Medve <Emilian.Medve@freescale.com>
2014-01-10fsl_qbman: Fix the checkpatch error type TRAILING_WHITESPACEEmil Medve
ERROR:TRAILING_WHITESPACE: trailing whitespace Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Change-Id: I4d2a46862edc2066a9aabf236cb22e71bfa0e375 Reviewed-on: http://git.am.freescale.net:8181/7769 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Reviewed-by: Emilian Medve <Emilian.Medve@freescale.com>
2014-01-08fsl_qbman: fix a few spelling errorsMadalin Bucur
Fix some spelling errors reported by codespell. Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com> Change-Id: I4c2f89d218389b0019ae4ff80206e05b94d715e4 Reviewed-on: http://git.am.freescale.net:8181/7707 Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Jose Rivera <German.Rivera@freescale.com>
2014-01-03fsl_qman: minimal changes required to buildMadalin Bucur
Introduced the minimal changes required for the driver to build. Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com> Change-Id: Id21e0ad56d0fa339d24c6cb5dc9b8c29b4e209a2 Reviewed-on: http://git.am.freescale.net:8181/7586 Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Scott Wood <scottwood@freescale.com>
2013-10-24Prevent kernel panic if USDPAA mem cannot be allocatedRoy Pledge
USDPAA DMA memory is allocated very early in the boot process using the memblock_alloc functions. The old function would call panic() in cases that the allocation would fail, but no indication would be given on the console since the drivers were not loaded yet. This patch changes the function called so that the panic will not occur and debug info can be seen in the boot log Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I8ebe9eb826973ea8ef6d16ba6fc73512b779ab77 Reviewed-on: http://git.am.freescale.net:8181/5953 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Haiying Wang <Haiying.Wang@freescale.com> Reviewed-by: Thorpe Geoff-R01361 <Geoff.Thorpe@freescale.com> Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
2013-10-17fsl_qman: fix two compilation warningsHaiying Wang
drivers/staging/fsl_qbman/qman_high.c: In function 'qman_shutdown_fq': drivers/staging/fsl_qbman/qman_high.c:4834:1: warning: control reaches end of non-void function [-Wreturn-type] drivers/staging/fsl_qbman/fsl_usdpaa.c: In function 'dump_frags': drivers/staging/fsl_qbman/fsl_usdpaa.c:230:3: warning: format '%llx' expects argument of type 'long long unsigned int', but argument 4 has type 'long unsigned int' [-Wformat] Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com> Change-Id: Ia61d1b303f033b777658131e517f5f10b16bf6b0 Reviewed-on: http://git.am.freescale.net:8181/5632 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Thorpe Geoff-R01361 <Geoff.Thorpe@freescale.com> Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
2013-10-09Fix 2 errors in USDPAA cleanup processingRoy Pledge
The USPDAA cleanup processing wasn't properly merging DMA memory fragments. Also if a new portal needed to be allocated for Frame Queue cleanup it wasn't properly assigned to the array of cleanup portals Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I616d4bdbf1dd356267231e6b642cce112487ed1b Reviewed-on: http://git.am.freescale.net:8181/5140 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Vakul Garg <vakul@freescale.com> Reviewed-by: Wang Haiying-R54964 <Haiying.Wang@freescale.com> Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
2013-09-18Merge branch 'sdk-v1.4.x' into sdk-kernel-3.8J. German Rivera
2013-09-17Merge branch 'b4860rev2' into sdk-v1.4.xJ. German Rivera
2013-09-16Fix USDPAA dma_mem allocator when blocks needed to be splitRoy Pledge
Also rework the fragment management to eliminate fragmentation Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: Ieb1aaf3b7d7e3d42b78efe2411952f10bbd2803d Reviewed-on: http://git.am.freescale.net:8181/4774 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Wang Haiying-R54964 <Haiying.Wang@freescale.com> Reviewed-by: Thorpe Geoff-R01361 <Geoff.Thorpe@freescale.com> Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
2013-09-10fsl_qman: move use_eqcr_ci_stashing in high level portal structureHaiying Wang
It was wrongly put into low level structure in commit aa57f7af3c9857ba40c8e1dd8dbefd5f0aa67d94 Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com> Signed-off-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Change-Id: Ib0c8355750bc4195c71799f559f75979b50fca31 Reviewed-on: http://git.am.freescale.net:8181/4583 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Rivera Jose-B46482 <German.Rivera@freescale.com>
2013-09-03Merge branch 'sdk-v1.4.x' into sdk-kernel-3.8J. German Rivera
2013-09-03Removed dump_frag() duplicate definitionJ. German Rivera
2013-08-27Merge branch 'sdk-v1.4.x' into sdk-kernel-3.8J. German Rivera
2013-08-27Merge branch 'b4860rev2' into sdk-v1.4.xJ. German Rivera
2013-08-26Modify USDPAA DMA mapping code to allow non power of 4 mappingsRoy Pledge
This patch modifies the USDPAA code to allow non power of 4 DMA maps. The code will use multiple TLB1 entries if needed. DMA maps are still phyically and virually contiguous. Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I42942067059a3c06f0b0d031d266d228295c7c45 Reviewed-on: http://git.am.freescale.net:8181/3857 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Wang Haiying-R54964 <Haiying.Wang@freescale.com> Reviewed-by: Rivera Jose-B46482 <Jose.G.Rivera@freescale.com>
2013-08-26Add API to allocate specific portals based on index. This allows an ↵Roy Pledge
application to get back the exact portal it was previously using by specifing the portals index value. Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I8233816f0519731eb65b3671d68a01266eee42dd Reviewed-on: http://git.am.freescale.net:8181/4002 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Ladouceur Jeffrey-R11498 <Jeffrey.Ladouceur@freescale.com> Reviewed-by: Wang Haiying-R54964 <Haiying.Wang@freescale.com> Reviewed-by: Rivera Jose-B46482 <Jose.G.Rivera@freescale.com>
2013-08-15Modify USDPAA DMA mapping code to allow non power of 4 mappingsRoy Pledge
This patch modifies the USDPAA code to allow non power of 4 DMA maps. The code will use multiple TLB1 entries if needed. DMA maps are still phyically and virually contiguous. Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I42942067059a3c06f0b0d031d266d228295c7c45 Reviewed-on: http://git.am.freescale.net:8181/3857 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Wang Haiying-R54964 <Haiying.Wang@freescale.com> Reviewed-by: Rivera Jose-B46482 <Jose.G.Rivera@freescale.com>
2013-08-15Add API to allocate specific portals based on index.Roy Pledge
This allows an application to get back the exact portal it was previously using by specifing the portals index value. Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I8233816f0519731eb65b3671d68a01266eee42dd Reviewed-on: http://git.am.freescale.net:8181/4002 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Ladouceur Jeffrey-R11498 <Jeffrey.Ladouceur@freescale.com> Reviewed-by: Wang Haiying-R54964 <Haiying.Wang@freescale.com> Reviewed-by: Rivera Jose-B46482 <Jose.G.Rivera@freescale.com>
2013-08-10qman: Add CI-stashing support for QMan rev3.0 or laterHaiying Wang
Signed-off-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com> Change-Id: Icda6a8547559ab45ceea7160cde566ca022e92e8 Reviewed-on: http://git.am.freescale.net:8181/3698 Reviewed-by: Schmitt Richard-B43082 <B43082@freescale.com> Tested-by: Schmitt Richard-B43082 <B43082@freescale.com>
2013-07-23Set SDQCR to ensure frame queues can reach the retired stateRoy Pledge
In some situations frame queues may still be on a work queue when a retirement command is sent during cleanup. In order to reach the retired state these frame queues must be scheduled. This patch sets an appropriate SDQCR value to ensure that the Frame Queue is scheduled. Since Frame Queues could be 'locked' to a particular portal if the Hold Active feature is enabled the shutrown routine must service all portals to ensure that the FQ reaches a retired state Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I9faab0039e4bb7f8c740a271154e7756ce014d98 Reviewed-on: http://git.am.freescale.net:8181/3229 Reviewed-by: Wang Haiying-R54964 <Haiying.Wang@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
2013-07-23Set SDQCR to ensure frame queues can reach the retired stateRoy Pledge
In some situations frame queues may still be on a work queue when a retirement command is sent during cleanup. In order to reach the retired state these frame queues must be scheduled. This patch sets an appropriate SDQCR value to ensure that the Frame Queue is scheduled. Since Frame Queues could be 'locked' to a particular portal if the Hold Active feature is enabled the shutrown routine must service all portals to ensure that the FQ reaches a retired state Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I97f79d35c62f179f21b6bd11c23bc0150e54ff5f Reviewed-on: http://git.am.freescale.net:8181/3339 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
2013-07-22Fix regression that caused BMan interrupt lookup for USDPAARoy Pledge
to return incorrect information Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Change-Id: I72e62fb6d37f63d13bd1f93029f1a4af24924ba9 Reviewed-on: http://git.am.freescale.net:8181/3336 Reviewed-by: Wang Haiying-R54964 <Haiying.Wang@freescale.com> Reviewed-by: Thorpe Geoff-R01361 <Geoff.Thorpe@freescale.com> Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
2013-07-12fsl_qbman: common portal lookup for usdpaa_irqGeoff Thorpe
The fsl_usdpaa.c code to find the portal that corresponds to a given mapped region already has to differentiate between qman and bman, so localise it there under a single function, rather than having fsl_usdpaa_irq.c distinguish as well and call qman and bman specific functions. Signed-off-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Change-Id: Ib8ac94e04fcaff76240cf7835056538ce67d9701 Reviewed-on: http://git.am.freescale.net:8181/2634 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Pledge Roy-R01356 <roy.pledge@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
2013-07-12fsl_usdpaa: fix warnings and white-spaceGeoff Thorpe
Also, the usdpaa_irq_handler() routine is made static. Signed-off-by: Geoff Thorpe <Geoff.Thorpe@freescale.com> Change-Id: I0bbfd15b0743194ff8fba4fee938f3d703148b1a Reviewed-on: http://git.am.freescale.net:8181/2632 Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com> Reviewed-by: Pledge Roy-R01356 <roy.pledge@freescale.com> Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>
2013-05-15Fix USDPAA IRQ handling to work correctly in 32 bit modeRoy Pledge
Also properly respect the NONBLOCK flag in the read() API Make sure IRQ is properly inhibited in the IRQ handler Create a dependancy between USDPAA and USDPAA_IRQ file pointers Change-Id: Idc0c33c8448a402d5d127e7e4e22e629dbfa5912 Signed-off-by: Roy Pledge <Roy.Pledge@freescale.com> Reviewed-on: http://git.am.freescale.net:8181/2310 Reviewed-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com> Tested-by: Fleming Andrew-AFLEMING <AFLEMING@freescale.com>