From patchwork Fri Aug 23 15:14:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13775408 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 0D026C52D7C for ; Fri, 23 Aug 2024 15:15:35 +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:Cc:To: Content-Transfer-Encoding:Content-Type:MIME-Version:Message-Id:Date:Subject: From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=XnfU8isrsCakvF+5kbaKWHkAoWOfOR0i507SgdeLw64=; b=SE941o8bWRP+ah 9DB/Zdy+mk144km4IWzSjnydWOiEFrqkp4s85ZNaMCoukwg0QVxGti2xmOQboPJYbq3jDl5n09VeE u09qcdamhPy+J+0d9lW6CoNxv46fb4fQhKigGkarNBBHD4hhFm9gJq6b8a4diX/1s0vYx/SCLgR/N 39GxIMZHg5r75p4wH4dtm6mcrqY14YgKHH+xPy5DD7Hm8OpywYAh8voq10Vk6B+EejERuwCaYxCPE PIAR6Q/EbXUfDY7uyxvgogWBIYeei1JNE+Zg+4G0xNm9FhdAUuphtAH0uYQVWeP6nsSka+mz73K7N rnlilpFVlojluV5cOoGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shW0Y-0000000HFxJ-0Bmk; Fri, 23 Aug 2024 15:15:22 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shVzj-0000000HFgu-3BIl; Fri, 23 Aug 2024 15:14:33 +0000 Received: from [192.168.29.25] (unknown [IPv6:2405:201:2015:f873:55f8:639e:8e9f:12ec]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 1458D2D5; Fri, 23 Aug 2024 17:13:20 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1724426003; bh=N/p0U8Dss4OKDiKL37MS5w52w8fjxH1xypK3JJgvE/0=; h=From:Subject:Date:To:Cc:From; b=PkvYxWxJMKxLX6a9u9xzLvCjVlm1JTIE81IutKGr3IO12M6ACZApTa2J7cKyEQtnh RndLlq9rTUK/0x5fHX1tQcbxM3qr28AfltojQTPQywtkLED5ETZmSQ3FcQsyrceDQ9 3KG4q0gbebT4rk9ukItBpStGguSTjWwqgAYW9mI0= From: Umang Jain Subject: [PATCH 0/7] staging: vchiq_core: Refactor vchiq_bulk_transfer() logic Date: Fri, 23 Aug 2024 20:44:20 +0530 Message-Id: <20240823-to_sent2-v1-0-8bc182a0adaf@ideasonboard.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAEynyGYC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDCyNj3ZL8+OLUvBIjXXPTJOMkiySLZENTMyWg8oKi1LTMCrBR0bG1tQC OisOKWgAAAA== To: Florian Fainelli , Broadcom internal kernel review list , Greg Kroah-Hartman Cc: linux-rpi-kernel@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org, Dan Carpenter , Laurent Pinchart , Kieran Bingham , Arnd Bergmann , Stefan Wahren , Dave Stevenson , Phil Elwell , Umang Jain X-Mailer: b4 0.13.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1724426064; l=2910; i=umang.jain@ideasonboard.com; s=20240731; h=from:subject:message-id; bh=N/p0U8Dss4OKDiKL37MS5w52w8fjxH1xypK3JJgvE/0=; b=H4xcZ8Pf7HBWxh3pgc6dwiB/I9GLi0ReSXwwpR0rPXI+II1W0aFk+WzA3ea9+7k9lTx1i1fwL 9QommX3+8CvA8/SQxlLgyiYnjQjg8YxOu3Gb2Ayzz/m11oe3yO7dSwV X-Developer-Key: i=umang.jain@ideasonboard.com; a=ed25519; pk=7pvnIBNsDpFUMiph0Vlhrr01+rAn5fSIn/QtDeLeXL0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240823_081431_972552_BCC6F22C X-CRM114-Status: GOOD ( 12.00 ) 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 Series mostly refactors vchiq_bulk_transfer() code according to Arnd's review comment from [1]: > You can also wrap vchiq_bulk_transfer() in order to have > four separate functions based on the different 'mode' > values and have them only take the arguments they actually > need. I didn't wrap vchiq_bulk_transfer(), instead created four differnet function, one for each mode. This will pave the way to address his second comment: > Ideally this should be cleaned up in a way that completely > avoids passing both user and kernel data at the same time. which is not part of this series and will be done on top as arguments shuffling will have to fix the sparse warnings that exists currently. Patch 1/7 first moves the VCHIQ_BULK_MODE_WAITING logic out of vchiq_bulk_transfer Patch 2/7 then moves the core logic to vchiq_bulk_transfer() which can be shared in subsequent patches Patch 3/7 and 4/7 refactors remaining bulk transfer modes Patch 5/7 finally drops the vchiq_bulk_transfer() as not needed patch 6/7 and 7/7 are drive by patches, noticed during development. [1]: https://lore.kernel.org/linux-staging/3d3b7368-93b2-4c0d-845e-4099c2de9dc1@app.fastmail.com/ To: Florian Fainelli To: Broadcom internal kernel review list To: Greg Kroah-Hartman Cc: linux-rpi-kernel@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org Cc: linux-staging@lists.linux.dev Cc: linux-kernel@vger.kernel.org Cc: Dan Carpenter Cc: Laurent Pinchart Cc: Kieran Bingham Cc: Arnd Bergmann Cc: Stefan Wahren Cc: Dave Stevenson Cc: Phil Elwell Signed-off-by: Umang Jain --- Umang Jain (7): staging: vchiq: Factor out bulk transfer for VCHIQ_BULK_MODE_WAITING staging: vchiq_core: Simplify vchiq_bulk_transfer() staging: vchiq_core: Factor out bulk transfer for blocking mode staging: vchiq_core: Factor out bulk transfer for (no/)callback mode staging: vchiq_core: Drop vchiq_bulk_transfer() staging: vchiq_core: Remove unused function argument staging: vchiq_core: Pass enumerated flag instead of int .../vc04_services/interface/vchiq_arm/vchiq_arm.c | 20 +- .../vc04_services/interface/vchiq_arm/vchiq_core.c | 324 +++++++++++++-------- .../vc04_services/interface/vchiq_arm/vchiq_core.h | 16 +- .../vc04_services/interface/vchiq_arm/vchiq_dev.c | 13 +- 4 files changed, 236 insertions(+), 137 deletions(-) --- base-commit: 3676d01bda1ed48ff15fcf9534897dc4640ec826 change-id: 20240823-to_sent2-75b3b8b8c156 Best regards,