From patchwork Wed Sep 18 16:30:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Umang Jain X-Patchwork-Id: 13807007 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 B7652CDD548 for ; Wed, 18 Sep 2024 16:32:58 +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: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:In-Reply-To:References:List-Owner; bh=VdAHgTWFSkCMpPehfBwCxAjAyDTmKAOniTsnt5ptKy4=; b=X4oRsGOxXTbfGu3jDKPXQTDHpQ C2AKzfTiIbXLGArLH9p+qzcvYwXlb2/75S6gjRqtM8Aqz+Pw8fhpTO4yM/jSEwdHYNafIBuVFytwM 8AtNxtVtgG1jzC3lRtwiy7v9K6nvYb3aJozHgonkidRgrD9qsUwwdzNzTSoy+QG6gg7gMfoLt3/xW ggy+iOWu5Y+X/YkWtb2Q0ILmIUEBllPwivA0BEARst/vrsxVmHbbtekjJl+rMtqxVOWKc6ObbtA8b v7kSkm1Ptqu94jqo729gvTSDTjayOem+RNnO2QfeBdis36H0tR1pA2YO3ov+obByGIahvdZj8hg9S ezomkshw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1sqxbh-00000008dVK-10eM; Wed, 18 Sep 2024 16:32:45 +0000 Received: from perceval.ideasonboard.com ([213.167.242.64]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1sqxaa-00000008dH2-1VTi; Wed, 18 Sep 2024 16:31:37 +0000 Received: from umang.jain (unknown [IPv6:2405:201:2015:f873:55d7:c02e:b2eb:ee3f]) by perceval.ideasonboard.com (Postfix) with ESMTPSA id 534ACD52; Wed, 18 Sep 2024 18:30:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com; s=mail; t=1726677009; bh=1hYrEkoTY13iEEB+Ygb3JKE62cGhuUL80x7DC7WMJJ0=; h=From:To:Cc:Subject:Date:From; b=UwyHxoSRaXcjblu+MvqINvKJlASxHSrr6fRsUGZFGFy9pBJ4yEOycoEot0qwpT878 b9wo8iiU1reywdc/EBLkrUFSMfHKsOcDgJ2CJoX2rzhwKjbRHgojgl+7ILhAhOAT57 q7rQWmEPKCnS7hXFrH8AQcHfDlSNVv7IZL/t1L08= 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 , Arnd Bergmann , Stefan Wahren , Laurent Pinchart , Nicolas Saenz Julienne , Umang Jain Subject: [PATCH 0/6] staging: vchiq_core: bulk xfer killable() completions Date: Wed, 18 Sep 2024 22:00:54 +0530 Message-ID: <20240918163100.870596-1-umang.jain@ideasonboard.com> X-Mailer: git-send-email 2.45.2 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240918_093136_562512_1303F671 X-CRM114-Status: UNSURE ( 7.74 ) X-CRM114-Notice: Please train this message. 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 This series intends to fix the variations of events completions on bulk transfers and message queuing code paths. Patch 1/6 explains in details how we ended up having wait_for_completion_interruptible() in vchiq_core. A high level sequence of commit changes is explained in the commit message. Each commit/link mentioned is referenced in the commit message, to provide adequate context to the reviewer. Patch 2/6 makes sure we acknowledge and return all errors on queue_message(), instead of just -EAGAIN. Patch 3/6 and 4/6 align the return values on interruption, according to what kernel's mutex_killable() and wait_for_completion_killable() would return (i.e. -EINTR) Patch 5/6 and 6/6 drops the retry loop on -EINTR. Testing: - Tested audio playback with bcm2835-audio (uses vchiq_queue_kernel_message()) - vchiq_test -p (ping test) - vchiq_test -f 10 (functional test) - vchiq_test -b (bulk test) No regressions observed. Umang Jain (6): staging: vchiq_core: Use killable wait completions for bulk transfers staging: vchiq_core: Return on all errors from queue_message() staging: vchiq_core: Return -EINTR in queue_message() on interrupt staging: vchiq_core: Return -EINTR when bulk transfers are interrupted staging: vchiq_arm: Do not retry bulk transfers on -EINTR staging: vchiq_core: Drop retry loop on -EINTR .../interface/vchiq_arm/vchiq_arm.c | 81 +++++--------- .../interface/vchiq_arm/vchiq_core.c | 105 ++++++++---------- .../interface/vchiq_arm/vchiq_core.h | 18 +-- .../interface/vchiq_arm/vchiq_dev.c | 14 +-- 4 files changed, 89 insertions(+), 129 deletions(-)