f6cea719f1a6439215be0a9480d105557e257d31
[openwrt/staging/jow.git] /
1 From 8ab562e10d304fb88a56a748d081dbf8fb07c528 Mon Sep 17 00:00:00 2001
2 From: Dave Stevenson <dave.stevenson@raspberrypi.org>
3 Date: Tue, 22 Jan 2019 12:04:09 +0000
4 Subject: [PATCH] staging: mmal-vchiq: Fix client_component for 64 bit
5 kernel
6
7 The MMAL client_component field is used with the event
8 mechanism to allow the client to identify the component for
9 which the event is generated.
10 The field is only 32bits in size, therefore we can't use a
11 pointer to the component in a 64 bit kernel.
12
13 Component handles are already held in an array per VCHI
14 instance, so use the array index as the client_component handle
15 to avoid having to create a new IDR for this purpose.
16
17 Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
18 ---
19 drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c | 4 ++--
20 1 file changed, 2 insertions(+), 2 deletions(-)
21
22 --- a/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
23 +++ b/drivers/staging/vc04_services/vchiq-mmal/mmal-vchiq.c
24 @@ -457,9 +457,9 @@ buffer_from_host(struct vchiq_mmal_insta
25 static void event_to_host_cb(struct vchiq_mmal_instance *instance,
26 struct mmal_msg *msg, u32 msg_len)
27 {
28 - /* FIXME: Not going to work on 64 bit */
29 + int comp_idx = msg->u.event_to_host.client_component;
30 struct vchiq_mmal_component *component =
31 - (struct vchiq_mmal_component *)msg->u.event_to_host.client_component;
32 + &instance->component[comp_idx];
33 struct vchiq_mmal_port *port = NULL;
34 struct mmal_msg_context *msg_context;
35 u32 port_num = msg->u.event_to_host.port_num;