Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: sep: Add interfaces for the new functions

[This is picked out of the differences between the upstream driver and
the staging driver. I'm resolving the differences as a series of updates -AC]

Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Mark A. Allyn and committed by
Greg Kroah-Hartman
6ab80c26 aca58ec8

+49 -11
+49 -11
drivers/staging/sep/sep_main.c
··· 3067 3067 3068 3068 switch (cmd) { 3069 3069 case SEP_IOCSENDSEPCOMMAND: 3070 + dev_dbg(&sep->pdev->dev, 3071 + "[PID%d] SEP_IOCSENDSEPCOMMAND start\n", 3072 + current->pid); 3070 3073 if (1 == test_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET, 3071 3074 &call_status->status)) { 3072 - dev_dbg(&sep->pdev->dev, "[PID%d] send msg already done\n", 3075 + dev_warn(&sep->pdev->dev, 3076 + "[PID%d] send msg already done\n", 3073 3077 current->pid); 3074 3078 error = -EPROTO; 3075 3079 goto end_function; ··· 3083 3079 if (!error) 3084 3080 set_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET, 3085 3081 &call_status->status); 3086 - dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCSENDSEPCOMMAND end\n", 3082 + dev_dbg(&sep->pdev->dev, 3083 + "[PID%d] SEP_IOCSENDSEPCOMMAND end\n", 3087 3084 current->pid); 3088 3085 break; 3089 3086 case SEP_IOCENDTRANSACTION: 3087 + dev_dbg(&sep->pdev->dev, 3088 + "[PID%d] SEP_IOCENDTRANSACTION start\n", 3089 + current->pid); 3090 3090 error = sep_end_transaction_handler(sep, dma_ctx, call_status, 3091 - my_queue_elem); 3092 - dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCENDTRANSACTION end\n", 3091 + my_queue_elem); 3092 + dev_dbg(&sep->pdev->dev, 3093 + "[PID%d] SEP_IOCENDTRANSACTION end\n", 3093 3094 current->pid); 3094 3095 break; 3095 3096 case SEP_IOCPREPAREDCB: 3097 + dev_dbg(&sep->pdev->dev, 3098 + "[PID%d] SEP_IOCPREPAREDCB start\n", 3099 + current->pid); 3100 + case SEP_IOCPREPAREDCB_SECURE_DMA: 3101 + dev_dbg(&sep->pdev->dev, 3102 + "[PID%d] SEP_IOCPREPAREDCB_SECURE_DMA start\n", 3103 + current->pid); 3096 3104 if (1 == test_bit(SEP_LEGACY_SENDMSG_DONE_OFFSET, 3097 3105 &call_status->status)) { 3098 - dev_dbg(&sep->pdev->dev, 3099 - "[PID%d] dcb preparation needed before send msg\n", 3106 + dev_warn(&sep->pdev->dev, 3107 + "[PID%d] dcb prep needed before send msg\n", 3100 3108 current->pid); 3101 3109 error = -EPROTO; 3102 3110 goto end_function; 3103 3111 } 3104 3112 3105 3113 if (!arg) { 3106 - dev_dbg(&sep->pdev->dev, 3107 - "[PID%d] dcb prep null arg\n", current->pid); 3108 - error = -EINVAL; 3114 + dev_warn(&sep->pdev->dev, 3115 + "[PID%d] dcb null arg\n", current->pid); 3116 + error = EINVAL; 3109 3117 goto end_function; 3110 3118 } 3111 3119 3112 - error = sep_prepare_dcb_handler(sep, arg, false, dma_ctx); 3113 - dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCPREPAREDCB end\n", 3120 + if (cmd == SEP_IOCPREPAREDCB) { 3121 + /* No secure dma */ 3122 + dev_dbg(&sep->pdev->dev, 3123 + "[PID%d] SEP_IOCPREPAREDCB (no secure_dma)\n", 3124 + current->pid); 3125 + 3126 + error = sep_prepare_dcb_handler(sep, arg, false, 3127 + dma_ctx); 3128 + } else { 3129 + /* Secure dma */ 3130 + dev_dbg(&sep->pdev->dev, 3131 + "[PID%d] SEP_IOC_POC (with secure_dma)\n", 3132 + current->pid); 3133 + 3134 + error = sep_prepare_dcb_handler(sep, arg, true, 3135 + dma_ctx); 3136 + } 3137 + dev_dbg(&sep->pdev->dev, "[PID%d] dcb's end\n", 3114 3138 current->pid); 3115 3139 break; 3116 3140 case SEP_IOCFREEDCB: 3141 + dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCFREEDCB start\n", 3142 + current->pid); 3143 + case SEP_IOCFREEDCB_SECURE_DMA: 3144 + dev_dbg(&sep->pdev->dev, 3145 + "[PID%d] SEP_IOCFREEDCB_SECURE_DMA start\n", 3146 + current->pid); 3117 3147 error = sep_free_dcb_handler(sep, dma_ctx); 3118 3148 dev_dbg(&sep->pdev->dev, "[PID%d] SEP_IOCFREEDCB end\n", 3119 3149 current->pid);