brcm2708: update to latest patches from the RPi foundation
[openwrt/staging/lynxis.git] / target / linux / brcm2708 / patches-4.14 / 950-0155-vcsm-Add-no-op-cache-operation-constant.patch
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
5
6 Signed-off-by: Sugizaki Yukimasa <i.can.speak.c.and.basic@gmail.com>
7 ---
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(+)
11
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
15 }
16
17 switch (cache_op) {
18 + case VCSM_CACHE_OP_NOP:
19 + return 0;
20 case VCSM_CACHE_OP_INV:
21 op_fn = dmac_inv_range;
22 break;
23 @@ -1312,6 +1314,8 @@ static int clean_invalid_resource(const
24 return 0;
25
26 switch (cache_op) {
27 + case VCSM_CACHE_OP_NOP:
28 + return 0;
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
33 goto out;
34 }
35 for (i = 0; i < sizeof(ioparam.s) / sizeof(*ioparam.s); i++) {
36 + if (ioparam.s[i].cmd == VCSM_CACHE_OP_NOP)
37 + break;
38 +
39 /* Locate resource from GUID. */
40 resource =
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)
47 + continue;
48 +
49 if (ret)
50 break;
51 }
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.
57 */
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