Skip to content

Commit 14dd37f

Browse files
anholtgregkh
authored andcommitted
staging: vc04_services: Remove cache-line-size property (v3)
It's been tempting to replace this with (L1) cache_line_size(), but that's really not what the value is about. It's about coordinating the condition for the pagelist fragment behavior between the two sides. However, the property was not accepted for the upstream DT binding, so we have to use the firmware's fallback value. Signed-off-by: Eric Anholt <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 8b02179 commit 14dd37f

File tree

2 files changed

+11
-10
lines changed

2 files changed

+11
-10
lines changed

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,17 @@ struct vchiq_pagelist_info {
7777
};
7878

7979
static void __iomem *g_regs;
80-
static unsigned int g_cache_line_size = sizeof(CACHE_LINE_SIZE);
80+
/* This value is the size of the L2 cache lines as understood by the
81+
* VPU firmware, which determines the required alignment of the
82+
* offsets/sizes in pagelists.
83+
*
84+
* Modern VPU firmware looks for a DT "cache-line-size" property in
85+
* the VCHIQ node and will overwrite it with the actual L2 cache size,
86+
* which the kernel must then respect. That property was rejected
87+
* upstream, so we have to use the VPU firmware's compatibility value
88+
* of 32.
89+
*/
90+
static unsigned int g_cache_line_size = 32;
8191
static unsigned int g_fragments_size;
8292
static char *g_fragments_base;
8393
static char *g_free_fragments;
@@ -117,14 +127,6 @@ int vchiq_platform_init(struct platform_device *pdev, VCHIQ_STATE_T *state)
117127
if (err < 0)
118128
return err;
119129

120-
err = of_property_read_u32(dev->of_node, "cache-line-size",
121-
&g_cache_line_size);
122-
123-
if (err) {
124-
dev_err(dev, "Missing cache-line-size property\n");
125-
return -ENODEV;
126-
}
127-
128130
g_fragments_size = 2 * g_cache_line_size;
129131

130132
/* Allocate space for the channels in coherent memory */

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_pagelist.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434
#ifndef VCHIQ_PAGELIST_H
3535
#define VCHIQ_PAGELIST_H
3636

37-
#define CACHE_LINE_SIZE 32
3837
#define PAGELIST_WRITE 0
3938
#define PAGELIST_READ 1
4039
#define PAGELIST_READ_WITH_FRAGMENTS 2

0 commit comments

Comments
 (0)