From patchwork Thu Sep 19 14:21:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13807788 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 19409CF3945 for ; Thu, 19 Sep 2024 14:24:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=NusIctKOBRTya/4G0h5sARPGw0yfA+q/I71Hpg2egHI=; b=YnL4yQMtF46mP+ROQoEzhCs97I 7VVfEhlnoV1BO2epJqHR8h4dXHi/95SlePITzTr6bug6YFdhU3SiqTGLeOBlwaMZliO8b0ParBZjl KlLmSBCCZiFbfsYzNFXN3gy+CdN89scsJDDlFbFLpfKXpYzLNHtw5jjmevDWpPZrx4TPVQ9JXU/SL PlnhiyNMgB9rOKwpIse0kJm0EArDqbwVcMy6SC/4DB1XuHEwh+JEWUVlSMcIDEGTzdGfnLHLPmFjQ F+2MXSkbyAK4l7B7aQRL9DQANOAHHcV8AuK9GG3i885076CBPYIaM11eyXQYfdXqk0YSYCUIji08q +hl1A8cw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1srI4i-0000000AReH-2I3A; Thu, 19 Sep 2024 14:24:04 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1srI2U-0000000ARA1-2pZ6; Thu, 19 Sep 2024 14:21:48 +0000 Received: from umang.jain (unknown [IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 9C80777F; Thu, 19 Sep 2024 16:20:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726755622; bh=yalx1iY3oUr63A3ECojFRU4frdF6VGfKWcHOLLSVRb4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L9rbX6HsQSCs5eTsBYl4j0x16yH8t/ltanwAqe673aZnUzC/KrhKefpr0gZivxdUB 6eIaYJYuAFJmNmmfx7ZuAv0cL2etOCnfXHB2chpi8UAK8XsbjSJqlSY+nqTfI47eyY P81RU6Ww4UaoCugAHu1cZTTwaNdZ3KfuLIwlS1Rs= From: Umang Jain To: Greg Kroah-Hartman , Broadcom internal kernel review list 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 , Stefan Wahren , Umang Jain Subject: [PATCH 1/3] staging: vchiq_core: Move remote_event_signal() vchiq_core Date: Thu, 19 Sep 2024 19:51:28 +0530 Message-ID: <20240919142130.1331495-2-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240919142130.1331495-1-umang.jain@ideasonboard.com> References: <20240919142130.1331495-1-umang.jain@ideasonboard.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240919_072146_876693_6CB67AD4 X-CRM114-Status: GOOD ( 15.87 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 --- .../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 #include #include +#include #include #include #include @@ -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);