Skip to content

Commit 89a18e6

Browse files
Terminus-IMRCpopcornmix
authored andcommitted
vcsm: Add no-op cache operation constant
Signed-off-by: Sugizaki Yukimasa <[email protected]>
1 parent 5041519 commit 89a18e6

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

drivers/char/broadcom/vc_sm/vmcs_sm.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1269,6 +1269,8 @@ static int clean_invalid_mem_2d(const void __user *addr,
12691269
}
12701270

12711271
switch (cache_op) {
1272+
case VCSM_CACHE_OP_NOP:
1273+
return 0;
12721274
case VCSM_CACHE_OP_INV:
12731275
op_fn = dmac_inv_range;
12741276
break;
@@ -1312,6 +1314,8 @@ static int clean_invalid_resource(const void __user *addr, const size_t size,
13121314
return 0;
13131315

13141316
switch (cache_op) {
1317+
case VCSM_CACHE_OP_NOP:
1318+
return 0;
13151319
case VCSM_CACHE_OP_INV:
13161320
stat_attempt = INVALID;
13171321
stat_failure = INVALID_FAIL;
@@ -2936,6 +2940,9 @@ static long vc_sm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
29362940
goto out;
29372941
}
29382942
for (i = 0; i < sizeof(ioparam.s) / sizeof(*ioparam.s); i++) {
2943+
if (ioparam.s[i].cmd == VCSM_CACHE_OP_NOP)
2944+
break;
2945+
29392946
/* Locate resource from GUID. */
29402947
resource =
29412948
vmcs_sm_acquire_resource(file_data, ioparam.s[i].handle);
@@ -2989,6 +2996,9 @@ static long vc_sm_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
29892996
ret = clean_invalid_mem_2d((void __user*) op->start_address,
29902997
op->block_count, op->block_size,
29912998
op->inter_block_stride, op->invalidate_mode);
2999+
if (op->invalidate_mode == VCSM_CACHE_OP_NOP)
3000+
continue;
3001+
29923002
if (ret)
29933003
break;
29943004
}

include/linux/broadcom/vmcs_sm_ioctl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ struct vmcs_sm_ioctl_cache {
172172
* Cache functions to be set to struct vmcs_sm_ioctl_clean_invalid cmd and
173173
* vmcs_sm_ioctl_clean_invalid2 invalidate_mode.
174174
*/
175+
#define VCSM_CACHE_OP_NOP 0x00
175176
#define VCSM_CACHE_OP_INV 0x01
176177
#define VCSM_CACHE_OP_CLEAN 0x02
177178
#define VCSM_CACHE_OP_FLUSH 0x03

0 commit comments

Comments
 (0)