Skip to content

Commit ce64433

Browse files
Umang Jaingregkh
authored andcommitted
staging: vchiq_core: Move remote_event_signal() vchiq_core
The function remote_event_signal() is declared in vchiq_core.h while defined in vchiq_arm.c and used only in vchiq_core.c. Move the definition to vchiq_core.c as it is only used in this file. Also convert it to static and drop the function signature from vchiq_core.h header. BELL2 doorbell macro is also moved from vchiq_arm to vchiq_core as part of this change. No functional changes intended in this patch. Signed-off-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/20240919142130.1331495-2-umang.jain@ideasonboard.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent f813dac commit ce64433

File tree

3 files changed

+22
-21
lines changed

3 files changed

+22
-21
lines changed

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

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,6 @@
4848
#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX 1
4949

5050
#define BELL0 0x00
51-
#define BELL2 0x08
5251

5352
#define ARM_DS_ACTIVE BIT(2)
5453

@@ -616,24 +615,6 @@ static struct vchiq_arm_state *vchiq_platform_get_arm_state(struct vchiq_state *
616615
return (struct vchiq_arm_state *)state->platform_state;
617616
}
618617

619-
void
620-
remote_event_signal(struct vchiq_state *state, struct remote_event *event)
621-
{
622-
struct vchiq_drv_mgmt *mgmt = dev_get_drvdata(state->dev);
623-
624-
/*
625-
* Ensure that all writes to shared data structures have completed
626-
* before signalling the peer.
627-
*/
628-
wmb();
629-
630-
event->fired = 1;
631-
632-
dsb(sy); /* data barrier operation */
633-
634-
if (event->armed)
635-
writel(0, mgmt->regs + BELL2); /* trigger vc interrupt */
636-
}
637618

638619
int
639620
vchiq_prepare_bulk_data(struct vchiq_instance *instance, struct vchiq_bulk *bulk, void *offset,

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include <linux/completion.h>
66
#include <linux/mutex.h>
77
#include <linux/bitops.h>
8+
#include <linux/io.h>
89
#include <linux/kthread.h>
910
#include <linux/wait.h>
1011
#include <linux/delay.h>
@@ -61,6 +62,8 @@
6162
#define MAKE_REMOTE_USE (VCHIQ_MSG_REMOTE_USE << TYPE_SHIFT)
6263
#define MAKE_REMOTE_USE_ACTIVE (VCHIQ_MSG_REMOTE_USE_ACTIVE << TYPE_SHIFT)
6364

65+
#define BELL2 0x08
66+
6467
/* Ensure the fields are wide enough */
6568
static_assert(VCHIQ_MSG_SRCPORT(VCHIQ_MAKE_MSG(0, 0, VCHIQ_PORT_MAX))
6669
== 0);
@@ -526,6 +529,25 @@ remote_event_wait(wait_queue_head_t *wq, struct remote_event *event)
526529
return ret;
527530
}
528531

532+
static void
533+
remote_event_signal(struct vchiq_state *state, struct remote_event *event)
534+
{
535+
struct vchiq_drv_mgmt *mgmt = dev_get_drvdata(state->dev);
536+
537+
/*
538+
* Ensure that all writes to shared data structures have completed
539+
* before signalling the peer.
540+
*/
541+
wmb();
542+
543+
event->fired = 1;
544+
545+
dsb(sy); /* data barrier operation */
546+
547+
if (event->armed)
548+
writel(0, mgmt->regs + BELL2); /* trigger vc interrupt */
549+
}
550+
529551
/*
530552
* Acknowledge that the event has been signalled, and wake any waiters. Usually
531553
* called as a result of the doorbell being rung.

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -534,8 +534,6 @@ int vchiq_prepare_bulk_data(struct vchiq_instance *instance, struct vchiq_bulk *
534534

535535
void vchiq_complete_bulk(struct vchiq_instance *instance, struct vchiq_bulk *bulk);
536536

537-
void remote_event_signal(struct vchiq_state *state, struct remote_event *event);
538-
539537
void vchiq_dump_platform_state(struct seq_file *f);
540538

541539
void vchiq_dump_platform_instances(struct vchiq_state *state, struct seq_file *f);

0 commit comments

Comments
 (0)