From: Umang Jain <umang.jain@ideasonboard.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Broadcom internal kernel review list
<bcm-kernel-feedback-list@broadcom.com>
Cc: linux-rpi-kernel@lists.infradead.org,
linux-arm-kernel@lists.infradead.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
Kieran Bingham <kieran.bingham@ideasonboard.com>,
Stefan Wahren <wahrenst@gmx.net>,
Umang Jain <umang.jain@ideasonboard.com>
Subject: [PATCH 1/3] staging: vchiq_core: Move remote_event_signal() vchiq_core
Date: Thu, 19 Sep 2024 19:51:28 +0530 [thread overview]
Message-ID: <20240919142130.1331495-2-umang.jain@ideasonboard.com> (raw)
In-Reply-To: <20240919142130.1331495-1-umang.jain@ideasonboard.com>
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>
---
.../interface/vchiq_arm/vchiq_arm.c | 19 ----------------
.../interface/vchiq_arm/vchiq_core.c | 22 +++++++++++++++++++
.../interface/vchiq_arm/vchiq_core.h | 2 --
3 files changed, 22 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
index c44b4dc79c03..8e9a5c67a6de 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c
@@ -48,7 +48,6 @@
#define VCHIQ_PLATFORM_FRAGMENTS_COUNT_IDX 1
#define BELL0 0x00
-#define BELL2 0x08
#define ARM_DS_ACTIVE BIT(2)
@@ -616,24 +615,6 @@ static struct vchiq_arm_state *vchiq_platform_get_arm_state(struct vchiq_state *
return (struct vchiq_arm_state *)state->platform_state;
}
-void
-remote_event_signal(struct vchiq_state *state, struct remote_event *event)
-{
- struct vchiq_drv_mgmt *mgmt = dev_get_drvdata(state->dev);
-
- /*
- * Ensure that all writes to shared data structures have completed
- * before signalling the peer.
- */
- wmb();
-
- event->fired = 1;
-
- dsb(sy); /* data barrier operation */
-
- if (event->armed)
- writel(0, mgmt->regs + BELL2); /* trigger vc interrupt */
-}
int
vchiq_prepare_bulk_data(struct vchiq_instance *instance, struct vchiq_bulk *bulk, void *offset,
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
index 7ad43a3d1bab..88d510c6793a 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c
@@ -5,6 +5,7 @@
#include <linux/completion.h>
#include <linux/mutex.h>
#include <linux/bitops.h>
+#include <linux/io.h>
#include <linux/kthread.h>
#include <linux/wait.h>
#include <linux/delay.h>
@@ -61,6 +62,8 @@
#define MAKE_REMOTE_USE (VCHIQ_MSG_REMOTE_USE << TYPE_SHIFT)
#define MAKE_REMOTE_USE_ACTIVE (VCHIQ_MSG_REMOTE_USE_ACTIVE << TYPE_SHIFT)
+#define BELL2 0x08
+
/* Ensure the fields are wide enough */
static_assert(VCHIQ_MSG_SRCPORT(VCHIQ_MAKE_MSG(0, 0, VCHIQ_PORT_MAX))
== 0);
@@ -526,6 +529,25 @@ remote_event_wait(wait_queue_head_t *wq, struct remote_event *event)
return ret;
}
+static void
+remote_event_signal(struct vchiq_state *state, struct remote_event *event)
+{
+ struct vchiq_drv_mgmt *mgmt = dev_get_drvdata(state->dev);
+
+ /*
+ * Ensure that all writes to shared data structures have completed
+ * before signalling the peer.
+ */
+ wmb();
+
+ event->fired = 1;
+
+ dsb(sy); /* data barrier operation */
+
+ if (event->armed)
+ writel(0, mgmt->regs + BELL2); /* trigger vc interrupt */
+}
+
/*
* Acknowledge that the event has been signalled, and wake any waiters. Usually
* called as a result of the doorbell being rung.
diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
index 5bf543dfc9c7..32b0521aa036 100644
--- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
+++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h
@@ -534,8 +534,6 @@ int vchiq_prepare_bulk_data(struct vchiq_instance *instance, struct vchiq_bulk *
void vchiq_complete_bulk(struct vchiq_instance *instance, struct vchiq_bulk *bulk);
-void remote_event_signal(struct vchiq_state *state, struct remote_event *event);
-
void vchiq_dump_platform_state(struct seq_file *f);
void vchiq_dump_platform_instances(struct vchiq_state *state, struct seq_file *f);
--
2.45.2
next prev parent reply other threads:[~2024-09-19 14:24 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 14:21 [PATCH 0/3] staging: vchiq_core: Consolidate bulk xfer helper Umang Jain
2024-09-19 14:21 ` Umang Jain [this message]
2024-09-19 14:21 ` [PATCH 2/3] staging: vchiq_core: Move bulk data functions in vchiq_core Umang Jain
2024-09-19 14:21 ` [PATCH 3/3] staging: vchiq_core: Drop vchiq_pagelist.h Umang Jain
2024-09-19 14:26 ` [PATCH 0/3] staging: vchiq_core: Consolidate bulk xfer helper Umang Jain
2024-09-25 9:23 ` Dan Carpenter
2024-09-26 4:10 ` Umang Jain
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240919142130.1331495-2-umang.jain@ideasonboard.com \
--to=umang.jain@ideasonboard.com \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=gregkh@linuxfoundation.org \
--cc=kieran.bingham@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rpi-kernel@lists.infradead.org \
--cc=linux-staging@lists.linux.dev \
--cc=wahrenst@gmx.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox