summaryrefslogtreecommitdiff
path: root/drivers/staging
diff options
context:
space:
mode:
authorRoy Pledge <Roy.Pledge@freescale.com>2014-11-18 20:34:02 (GMT)
committerMatthew Weigel <Matthew.Weigel@freescale.com>2014-12-11 18:41:14 (GMT)
commit514cf5618c7e12aa3ff9895ef519c6ddcd367889 (patch)
tree1d172e219685c15d4c2484c15669cc88752b6326 /drivers/staging
parent80e92d4b56f2fab7aea1a86d96a0bdbeb999515a (diff)
downloadlinux-fsl-qoriq-514cf5618c7e12aa3ff9895ef519c6ddcd367889.tar.xz
Disable CPU migration during USDPAA Cleanup
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>
Diffstat (limited to 'drivers/staging')
-rw-r--r--drivers/staging/fsl_qbman/fsl_usdpaa.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/staging/fsl_qbman/fsl_usdpaa.c b/drivers/staging/fsl_qbman/fsl_usdpaa.c
index 9965e4a..e5e4fa2 100644
--- a/drivers/staging/fsl_qbman/fsl_usdpaa.c
+++ b/drivers/staging/fsl_qbman/fsl_usdpaa.c
@@ -523,6 +523,10 @@ static int usdpaa_release(struct inode *inode, struct file *filp)
struct qm_portal *portal_array[qman_portal_max];
int portal_count = 0;
+ /* Ensure the release operation cannot be migrated to another
+ CPU as CPU specific variables may be needed during cleanup */
+ migrate_disable();
+
/* The following logic is used to recover resources that were not
correctly released by the process that is closing the FD.
Step 1: syncronize the HW with the qm_portal/bm_portal structures
@@ -558,12 +562,15 @@ static int usdpaa_release(struct inode *inode, struct file *filp)
qm_alloced_portal = qm_get_unused_portal();
if (!qm_alloced_portal) {
pr_crit("No QMan portal avalaible for cleanup\n");
+ migrate_enable();
return -1;
}
qm_cleanup_portal = kmalloc(sizeof(struct qm_portal),
GFP_KERNEL);
- if (!qm_cleanup_portal)
+ if (!qm_cleanup_portal) {
+ migrate_enable();
return -ENOMEM;
+ }
init_qm_portal(qm_alloced_portal, qm_cleanup_portal);
portal_array[portal_count] = qm_cleanup_portal;
++portal_count;
@@ -572,12 +579,15 @@ static int usdpaa_release(struct inode *inode, struct file *filp)
bm_alloced_portal = bm_get_unused_portal();
if (!bm_alloced_portal) {
pr_crit("No BMan portal avalaible for cleanup\n");
+ migrate_enable();
return -1;
}
bm_cleanup_portal = kmalloc(sizeof(struct bm_portal),
GFP_KERNEL);
- if (!bm_cleanup_portal)
+ if (!bm_cleanup_portal) {
+ migrate_enable();
return -ENOMEM;
+ }
init_bm_portal(bm_alloced_portal, bm_cleanup_portal);
}
@@ -653,6 +663,7 @@ static int usdpaa_release(struct inode *inode, struct file *filp)
}
kfree(ctx);
+ migrate_enable();
return 0;
}