1 From 068cfca9e8c54902c45b8c35b49191c766d346c9 Mon Sep 17 00:00:00 2001
2 From: Sugizaki Yukimasa <i.can.speak.c.and.basic@gmail.com>
3 Date: Wed, 10 Jan 2018 04:32:20 +0900
4 Subject: [PATCH 155/454] vcsm: Add no-op cache operation constant
6 Signed-off-by: Sugizaki Yukimasa <i.can.speak.c.and.basic@gmail.com>
8 drivers/char/broadcom/vc_sm/vmcs_sm.c | 10 ++++++++++
9 include/linux/broadcom/vmcs_sm_ioctl.h | 1 +
10 2 files changed, 11 insertions(+)
12 --- a/drivers/char/broadcom/vc_sm/vmcs_sm.c
13 +++ b/drivers/char/broadcom/vc_sm/vmcs_sm.c
14 @@ -1269,6 +1269,8 @@ static int clean_invalid_mem_2d(const vo
18 + case VCSM_CACHE_OP_NOP:
20 case VCSM_CACHE_OP_INV:
21 op_fn = dmac_inv_range;
23 @@ -1312,6 +1314,8 @@ static int clean_invalid_resource(const
27 + case VCSM_CACHE_OP_NOP:
29 case VCSM_CACHE_OP_INV:
30 stat_attempt = INVALID;
31 stat_failure = INVALID_FAIL;
32 @@ -2936,6 +2940,9 @@ static long vc_sm_ioctl(struct file *fil
35 for (i = 0; i < sizeof(ioparam.s) / sizeof(*ioparam.s); i++) {
36 + if (ioparam.s[i].cmd == VCSM_CACHE_OP_NOP)
39 /* Locate resource from GUID. */
41 vmcs_sm_acquire_resource(file_data, ioparam.s[i].handle);
42 @@ -2989,6 +2996,9 @@ static long vc_sm_ioctl(struct file *fil
43 ret = clean_invalid_mem_2d((void __user*) op->start_address,
44 op->block_count, op->block_size,
45 op->inter_block_stride, op->invalidate_mode);
46 + if (op->invalidate_mode == VCSM_CACHE_OP_NOP)
52 --- a/include/linux/broadcom/vmcs_sm_ioctl.h
53 +++ b/include/linux/broadcom/vmcs_sm_ioctl.h
54 @@ -172,6 +172,7 @@ struct vmcs_sm_ioctl_cache {
55 * Cache functions to be set to struct vmcs_sm_ioctl_clean_invalid cmd and
56 * vmcs_sm_ioctl_clean_invalid2 invalidate_mode.
58 +#define VCSM_CACHE_OP_NOP 0x00
59 #define VCSM_CACHE_OP_INV 0x01
60 #define VCSM_CACHE_OP_CLEAN 0x02
61 #define VCSM_CACHE_OP_FLUSH 0x03