From patchwork Tue Jun 4 17:28:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685707 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 03FE4C27C53 for ; Tue, 4 Jun 2024 17:29:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TN+l3fy7Ujl161ff6cC+zAdr9+cTNM5Co/1PwUXap3g=; b=U0Cc8/+ddeHkvY u87mw7G6Rs6IpVvGWr48ZqP8yKMH4N154v2BnDFUqpZjgQQGOPlMj2Zauo41m7NY1Dl3rhBv5AvE5 AJyup+U4Ipc3S++eIt6paqjBB0LyBWyOXe11xiJTgNCTO7pcYdymdSjsD66Mg6r9de4XxD2X7UkvS SJZ0PLP3Avg6t5NTcm3To4BxH3dyknwOKu5bFORkrQvcicnRmpfKAxShK9W4ghBsCkUEH9DhBcQI3 Q7CQ75UDfgCDtRh0LCZDLdbyggM1D0DXMqMPf57URkCWctBP94peHJUsgHCtE2ngsHhgLhPKdql3c YoAAQStb30VhKPVIWrxg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyU-00000003IhP-1Eze; Tue, 04 Jun 2024 17:29:30 +0000 Received: from mout.gmx.net ([212.227.17.21]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyR-00000003IeC-0fMp for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522163; x=1718126963; i=wahrenst@gmx.net; bh=XbOIuODUCUQYgmxgmgv+5Smb6UaSNc/ht77NoSgfhL4=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=hXkOXV4zp12O0pcnlYRUM+awtQ5Yv8x8tp4BQDy8rqSE8yUa874Y+PYt5NVblD9m vE1Cn9TadYBWPq7E1d+hZzUfG8bPYSn7MshA7gpnBVyIXAo5PFxaWR7j4b6gwX1wr usuc39oPYwtKW0Htdci09JCSVM6hkACGhA3S5SvnQlxQayraekQbX8tVGuTt+KWwa pv15Qp5sEf/RwKzvB76xlmi3Ejg9HTB9EeEzK+ULmoK1Nwt0b8Ei3TnFptSNE+h9q AFlyVUdN+5J2QomTpjl6j9GW5fpMhHbPBz1uTYMHwJu6ZmpKjyId1bH9KUsbaui3I R1fWDJS0tYjC8/m8yw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N9MpY-1sZYow3iUO-016ho1; Tue, 04 Jun 2024 19:29:22 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 01/11] staging: vchiq_arm: Replace variable ret with status Date: Tue, 4 Jun 2024 19:28:54 +0200 Message-Id: <20240604172904.61613-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:jz5E/93pwCXh4ZgHQMeQzcO2itT90CBjVQgT7cxpoqNDQjCrZeS TNft9OWaxrGU1TIeb6RKk0viqa5/YFtKJ4ox9xYCn4u04Vrah0TaXqQU9m4nxHf5BAdOTpY X69U78GyOQPIcj2uyKmXZRE4YZ4kWAGsfj3cJ5U2frQuFdcwRK57ljTWrPsjFSXDDU4O67+ sOsQzSJoa0OiV/AY+I7iQ== UI-OutboundReport: notjunk:1;M01:P0:epqMepvIfvo=;FOu7bRMMGhQRBbJ2erHC9lgxyZs 2OrYwVzSbB4JkxBsUBugpOVKoIHOIwq0GVMzi9rvYtVjCotGZzagqTPUd9t/HHgYXEWYI0Jn8 xdEj31sLZMweMVZl2Eq9fkWAyeSwHnziglVJIZQ5WAV+1d0oLhNjItJ8OLRXsGkK4Iz2oVWg3 If8m8J+wAlnFN7ZNhzOtlV3sL9ZIv/a5w9eF+Y5PRozm0A8fK0Q+bb3QjOqrCiw9VASjZ6FDb vrLH2YkWQP1riCI/SYH5fgPGlKTCUUlNYdrXxA/FY4QKZEmiIS15of8Vkocg9Q/WlrIAkodsy JcFNzuUMwpdC6sNHrkPlhvH3yCJZYjP6SXU0D//uzTmcaqapZjAGUPPmlDiNMxZ9DyIGN7grd Zb/cgYcSPpTamt0jFawccwU2kEm7XcfNVP1SG+fBmDfJTcYwtq9bqXJTtSfNEmqGuA8QnAx3k tx1ZGKj8rnHRk0j2IN0OJI4I9j4jtRxcKL17IN5PgSx032rBCEHO6l2fvScImB/ZEaB6Bwtjo 6b84PbfPZDJVXqx583B5/SiWP68y63Yc6vB30A5OYHgW9lQ9YjBdyx5i0Dcr6nSocq/gvPRU4 8YYC//bh3m/cTYU9X9PnpOLVj1WnQI+nrb32s7sao2hjxdu4XVhGINr3rE9GcmKwHpcY0c0AL sTxFr6eFtzn/OgEpmVi82qesmg3mWVhDpXCYhB9Te1SeRs+V55p6te5OIoWRO/IWsjXj/WrZj ic9IUJ8If//pD1o6uK0AhB4OMf4utEVmj+wm1weC23qS4tGru+zoaVdMGlME6nnGxHnmqy1nt btWEccPQujnharGKUggeTHVD7k+NvDNIWU6Np5EOpPPVc= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102927_672443_D25EC2E8 X-CRM114-Status: GOOD ( 11.17 ) 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 variable ret is just storing the result of last function call like the variable status. So replace ret with status and make a consistent use of this variable. Signed-off-by: Stefan Wahren --- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.34.1 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 69daeba974f2..e2f4aa00cb70 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1298,7 +1298,6 @@ vchiq_keepalive_thread_func(void *v) int status; struct vchiq_instance *instance; unsigned int ka_handle; - int ret; struct vchiq_service_params_kernel params = { .fourcc = VCHIQ_MAKE_FOURCC('K', 'E', 'E', 'P'), @@ -1307,9 +1306,10 @@ vchiq_keepalive_thread_func(void *v) .version_min = KEEPALIVE_VER_MIN }; - ret = vchiq_initialise(state, &instance); - if (ret) { - dev_err(state->dev, "suspend: %s: vchiq_initialise failed %d\n", __func__, ret); + status = vchiq_initialise(state, &instance); + if (status) { + dev_err(state->dev, "suspend: %s: vchiq_initialise failed %d\n", + __func__, status); goto exit; } From patchwork Tue Jun 4 17:28:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685708 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 5C2D0C27C52 for ; Tue, 4 Jun 2024 17:29:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=wk4fGbnShDrK/nsYCs8PHNlmJpk5Ou25dvodhWwQcAM=; b=HFQhWLwEpklOtp oDeJHI0SmifsambiPAtUQue/79sbk3/lvaWlpaS2p6+SWjSnXCUjmcB0r2lHohcIg7CuIJwC7QoTM Y9uoRPGZhCEP+7V3cl4sgmReUheElHS3hNetGCeC7/r67RStXO/wHGVHDyKzO59sFPwvLDsER6AXe YOApl58VQuRt7NDXN2lrkZ3cFgUOpROy3y1ltbUKJyZmgRRPwgqmPbVu6FBZaNqQvTva94n4teomB mvZhO/AGQogUZY6SF122quGDQe9eRgggB6nFvvEyP/n8luG9mZMPdlPCPTRNWUfk+661B+nIyXH1T 8x/0Gyi96q6zi4txbbDg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyb-00000003Ikb-3SGj; Tue, 04 Jun 2024 17:29:38 +0000 Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyS-00000003IeD-1UHn for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522163; x=1718126963; i=wahrenst@gmx.net; bh=JtixJ+5R5VvbdeFN7ZhkNpcbzroFRKRp1CgRilsFn2M=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=lv2589fKjyH0+gDE0YdsdH9jygWKya1jkDQIzDMGAHPR1hf7oEGXrGClsyAV0Yla BBrvwRNOkpIBNuwbacocJ/6VQ8+nHIgqhQD26CdwwbiSaYGsEVydJsHniP9h3nPJH 33bWP7X447r1hqqjq6vjlJ3Za2FuyMq0L/HwIyRwWzNfSAudJQnIrubfit72iVfEN AurR/Pi8CiIDUilUhJGyQuArVWqUN8m8xeslmBGRgeYI1Mldv3nMZ1Ot6pav+D4Un 09tpQpMerW0BLb19yI/wRp/manhOQmAVO8zgxN9OjsHTWoNhwkNy2GbS4KrrWkMYN kuXb8Y22PA2h1FAPpg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N79u8-1sXLtn0rsK-014Usb; Tue, 04 Jun 2024 19:29:23 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 02/11] staging: vchiq_arm: Drop obsolete comment Date: Tue, 4 Jun 2024 19:28:55 +0200 Message-Id: <20240604172904.61613-3-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:UiTW8i4Vxx4YciNN+DR/pxONHQX84OJ0/p2PYv0tvzZ+nJDq+Jz 3llboV9XV4JYd8F2b1S+NIHbV1uT5U+jgzDT5RAkGOQ85YE9dXUyNuiTSEZwpBlKn1vc6Fc NhFvoqjzUPMKNKr6A6xH2pWgzJu/YwsMkJf+QbiJQK3sU7KjKTKrsrRgN+ivkgi60F7kcCH RFCklZijdwlZSlnta9BzA== UI-OutboundReport: notjunk:1;M01:P0:k99gOYlTekU=;fQVuznd4pmdhdpmP/ILtZCkQ1DR yJyMQp+7gbputmJmVbV8xTMGC6vSKfcjWUObDFo2lZoxeqTWyPfPjGB1azVT6UtR0gzMoTKVP bdZB+3XE8hpivLU4c776M3qzITGUKYUNqqfHY3K6+qX/uI7FVE6vQBoDVUiSNVs9RTUl0IhuO DIsL2dOV+ApMNAI6WOTeq55mHNgBDmYmraRiiWfLvVOWx2nh/d3DRdblU42fQdF3IbycmmV5/ RKXgnDQsFUf0CEb8YadoURsvdvVuqf3oxLS2yfQdEy1xfoiGQSqBxx8wVN6V2Y1Bo8OxVmmhr TaXTggnKL1toI2KZQQi5GZBt1915iYJaEAS1rejop/QFaNNW0HbosYOF5EYwl3fG/qV0Ko4qt CNSXjEjiICMg0yqVsmsLAddw810CAtODF93Qm77pyhep4r6uwjQZI3FQuDfv5KvrdPNupvdtc deefjXVdDFDMzui9Ov0yve5M6XFx+qUf8G3HS8C+S47OIY6abEPHmItzajRucQjxcybPHV3jg ccO1A/wQET5XZdNaLnmL+lrFdvwzaZfMQyFuQRPkKnqeqXXgk58wMdE9TMi9AlFZPrmp5su4G OkTj47q0PXwLaJOMK+L3yQt/nx7V14G0j18GpSruW+F32M0jSHpO0M1sbrqU1hzgKROvfkosS cMH8xjtXC8ilR2Ydbt0XUw+2hKikhLDyj7n6bfxyCwPLxwiXofbsWY6XNaCdeZDkU+G4FOlZY Z9rQfE05yDqLbMjVyX3qbPVl4JZ9eWLS05PHdOC4biMGNrVa4UYUl1ncQ8QXDjOK8H7diqJBP x5x9FC2jOthr0qWOhIYZUMMDRtgBdRRiJfvbu98XYGZzU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102928_756076_6DF6164C X-CRM114-Status: GOOD ( 10.33 ) 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 BUG_ON has been replaced with WARN_ON. So we can drop the comment. Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 1 - 1 file changed, 1 deletion(-) -- 2.34.1 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 e2f4aa00cb70..515cdcba043d 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1451,7 +1451,6 @@ vchiq_release_internal(struct vchiq_state *state, struct vchiq_service *service) write_lock_bh(&arm_state->susp_res_lock); if (!arm_state->videocore_use_count || !(*entity_uc)) { - /* Don't use BUG_ON - don't allow user thread to crash kernel */ WARN_ON(!arm_state->videocore_use_count); WARN_ON(!(*entity_uc)); ret = -EINVAL; From patchwork Tue Jun 4 17:28:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685706 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 8A594C25B78 for ; Tue, 4 Jun 2024 17:29:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DrUyYyjXoskMICR92O4yPXhWxvMT0io7HKrgJXhb1F0=; b=i9E1qcc9groDly lCQz8pt3NOO8xtda6/Tbh1xE3fgVyBbQZ3J1Fb0uc5xk53YEm2tGSt8VDFFwJsJiTNvN73pEPCIYv lJTW02ZO0lKg774oSjSy32zOR4K7gV2+s8LdYXp6fGUGkmMoHAFAN0emiokT0klG1+u53k/7+uHxM OCtdIWbI4KGfJ04icmcYNB5Rek3u236FXzCxP8J4VXpWQhgjMpxYqbwB8HNy+lUfqtgJR/tMDFx8/ uZI0cWukTYsLcLr0LD5ekutUD8Hz/h4d9WneZisW6Ds43CfXx7dH3zGety8vANZzyABF/dCVijOXl ZM1S9rar+cKK6nS6rwWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyV-00000003Ihm-0JrN; Tue, 04 Jun 2024 17:29:31 +0000 Received: from mout.gmx.net ([212.227.17.21]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyR-00000003IeH-0fVi for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522163; x=1718126963; i=wahrenst@gmx.net; bh=Po6U++Q23uoCniRWMppgIdXReURdSThx57a7W7ynEwg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=Tyc6zGZ7gGZJwmjMuyuxT07BF5p8ValofyWbSE4QyqjXR3TPO990UGNwM4l4MDoN zihXRDRrFHcud+l0k7nUik4Kze4FO523gXvyrCcypfJbST0U4fpzVFECZZz3IA3dG b76Gn5BY+qgt2e91IoriHTZw+BEgKTOT54Xt5td1rI6aG/QLbdaB2r4IydFKXnkEc zf3GPu+rMxnD4Sz9rSt31kdCCL4Q4qNwyb8v6xVwuCqKVPdsDLjJQ88XnRagQ87Cb 5XLYMir5TGh2ZqNG2KAGQL3NH9fWRxXs3xgMOkCubia2UAiLteG2xCQrD8ge5wl51 ycuwnzX2N9krTCqiTA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MAONX-1sKLWa2ACh-00AS9e; Tue, 04 Jun 2024 19:29:23 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 03/11] staging: vchiq_core: Drop non-functional struct members Date: Tue, 4 Jun 2024 19:28:56 +0200 Message-Id: <20240604172904.61613-4-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:RBRK5KPOp3jCpQkYNR79OEei+jfTnwMW9sSLq4MzqYLfzSgybjB Ux+7/l3fHz8usH95/5KoPbnEaEVJXCdKocrbmr5g/zzDP9Fj5tVFa4ND/TtMAfiOX1qwZQw AU3NKD2/bFl7YzG1i3WHfu6lAqszJZMW9wkZPnOhnim8yhsWmTFX10Tb/0nkTsrImtBIywx X8Z0ZP0O95H82EzH57W1Q== UI-OutboundReport: notjunk:1;M01:P0:qS8uns1rHAw=;ztcLJ0O2n/ySw1XxGiOD+2BstlO WDsW6Gq8E9T/6xTeYm2TPHQT3zzKTfP0NV9f9XMGf1TLmJIRh6VgHRoyaWyhYqItYxW+P5LTX LLkvnASOnVlLWmvmey+5rh/mODEy8Yk8kPeEIkGon2O4sdSXO2hfzpb6K9PPpPVvkZHcZ2nlA wKdaJclxJOZZTb7k6MR4o6cYWnZ8IFD7cEaFPDioHeNnZRTC8U30r5a8iYmRgUocZOrqylzBb kz4hVhOSwGEJnZ75CQWPFoGpdpNB96y1M+Ig93dXSqeP15YUj7PqoZM+fRE76lIVOP7cVgE9J 65X58VtQDgyWcPgllSBYVF8IvjCuljK4lIJdHUtN8/vxtJSbTZ9wSP//FOScizpHTBvTotCWM nV1EaEhizfwEaa751Gf5eRhPDgmlxpVoYJXNGHXSySPa5+qr6aVi5xEbEdtbIS7rDPBWPISaT QeU5XfsnvGzTTsHvgxLwCQ2ugHs3BoDzie1R5gb0OsnfVZdJkE7ddLNlBnrkSVM2iCb+Ta7kK cxKoo3OcWCdXHRG7yEL3lQeQ8QfvKgr8hwPa8gpMbF5qCrZty9szFZ/4LkHNUDlo7hfBrcWA5 KxIiLNzliDadhFONov0c+90ObkHj5M8y/MgMHlcDIp5Px9pQJ4F54lw8Nz0H7nSftIengMIkQ 5uU2sBjGKkxyity7a6rqaMegaf8ORDtbcJIBO71FQEzPwKP32Ne/fejADGrX9nT1Xf9pyEXp7 pxHYc+CpkydM28SItM80FgU42cg4PkK8vRrjh5f/d+dhAKjQOe9ZnjAvuFdei2mDqOQzGB1ta uN88pzlmHD8wyCnP4aiiQlJgZ9MRsd9NpZU9xygJtC9IY= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102927_669036_E36505D5 X-CRM114-Status: GOOD ( 10.48 ) 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 There are some struct members, which don't have a real function. So it's safe to drop them. Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart --- .../staging/vc04_services/interface/vchiq_arm/vchiq_core.c | 2 -- .../staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 4 ---- 2 files changed, 6 deletions(-) -- 2.34.1 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 df3af821f218..51cfc366519b 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -2163,14 +2163,12 @@ vchiq_init_state(struct vchiq_state *state, struct vchiq_slot_zero *slot_zero, s mutex_init(&state->slot_mutex); mutex_init(&state->recycle_mutex); mutex_init(&state->sync_mutex); - mutex_init(&state->bulk_transfer_mutex); spin_lock_init(&state->msg_queue_spinlock); spin_lock_init(&state->bulk_waiter_spinlock); spin_lock_init(&state->quota_spinlock); init_completion(&state->slot_available_event); - init_completion(&state->slot_remove_event); init_completion(&state->data_quota_event); state->slot_queue_available = 0; 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 8af209e34fb2..be20abcfad75 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -347,8 +347,6 @@ struct vchiq_state { struct mutex sync_mutex; - struct mutex bulk_transfer_mutex; - spinlock_t msg_queue_spinlock; spinlock_t bulk_waiter_spinlock; @@ -393,8 +391,6 @@ struct vchiq_state { /* Signalled when a free slot becomes available. */ struct completion slot_available_event; - struct completion slot_remove_event; - /* Signalled when a free data slot becomes available. */ struct completion data_quota_event; From patchwork Tue Jun 4 17:28:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685712 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 6A74CC41513 for ; Tue, 4 Jun 2024 17:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pFiQ4340FyhngReZf5Tg9XQ0Zbp9mtqSS6Lme+Ah/po=; b=dzxeec6iLz0NR1 w2scBrrrQf6AIIJyHDsi4Gl/QFmb9nwm8vMTps9YQ1QUZ7QiFKHxWBzvTPILPEZNx0Qs8Md1f0/qe QZYBmH00LVKbvfmzog0I4Obh9oOD64t976UMBTsgPnYzEa3kAK1WDDv33NSMUHtxqZRzxFvh+ppe3 pCuUbT5ed+n7KnIOFvZuFCb9yDs6d1gQ73L1tK0Lxl81cmh+8HzxiIKD3uJR61CXTX2D1iPU5nb/K LNoVFjvrSGDRB0KrZqYyYFuSNjr4+tw0uUBIt/TOhKSHc1q4or1Du4WpQSqMc8BV6f3KsE8mkB21i MLakaTzkG3pe4+vlrXhQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyg-00000003Ina-2wkM; Tue, 04 Jun 2024 17:29:42 +0000 Received: from mout.gmx.net ([212.227.17.20]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyS-00000003IeI-1UBF for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522164; x=1718126964; i=wahrenst@gmx.net; bh=LTurhgqGBCWSBmH7AaC3KDylsswoCMbxqEa1yyg5lJo=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=JpexnhFri5PF/j5P8eZUGD/rLE+wHlsIlzb+tc1/Lk7hljOvM/YHMxCQg+YvkhKt wZc65m7UoZqU+A6BIU71IT2pVJRJ3YKUlWI5bMF0ao0I1dX7PksdFJWA3sALlO7ZY 5y9gP5UXeFVrTUwODxuvll1Sqc/g4C0t/1oYeoralC6HtmrQqjxbb3rRgpTHIXvEy 6YE9gPTRbe8zf4cdUhg5GWcxyKNYT+VagviPpnLhA0YBTFkLv5+fGt6PaEMM0NWhS Fh4dj7+1neBsyjjl3yYx5fO+FgwiLgHt7ErtyBZclP2r/9kmNlBsW+aeWOsBk7jG7 l4ZnxHDcSJHuG+S3Gw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1Md6R1-1sn3Vg3b4F-00dESM; Tue, 04 Jun 2024 19:29:23 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 04/11] staging: vchiq_arm: Drop unnecessary declarations Date: Tue, 4 Jun 2024 19:28:57 +0200 Message-Id: <20240604172904.61613-5-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:+6MBcs2hLQzB6gsoVTK9u6MrzrO9bb3vr8uDoCRVVxtnlBs8Opt bckuv99I1RUHGRtRqV86N1ReO4qLLPrE4Zvn2YC/QlO861pAqm1Nq7RsxJiL2xzcwIqHSmo LYe5wq92NjOGUP6nBLhUDcfflGCE733JH/hy/fa0Jou4hAwoD3k49I/+HygoqBKfpR7Ijj9 YSCyESukDOW/Xkw5XVUwg== UI-OutboundReport: notjunk:1;M01:P0:Gk929ch/ZcE=;Yj2Tn/UPQe1OsCo/sJBz2PEU57X 5psE9OuuA+uzMjI0nD+XUhoL5qpS77bar78ggCcAHvWEfkn4zUevHO7R6aleH2G/u4FE2FYdB k4HOvIPDrFwcS0TIFVttYKFJNxI9+P6JfUX9lYIFxUNCS4iuG1RlNo0ABrF0uqTdv/zFvXhYU rzf/8Lh5qTm2GiEhUrkbZILF7Pf00H4xVWtmuvMc6dtjYdPRkBv2ibeK/NYnvADb1ND3GXYxy 5AQKkEaASDSe/PN0oZLXbgcR5Yg3qgpKt5HFGzFJH3cstuMAdb07pZRWK0wBlcXN8bpB5Z3QQ b3sa83n5jputrRx9VnkXUX1opAngxV3vUV2HHgdHXAi+x3AI7H8DNhlpeLjSYcRFGohCTaQCA ZfFWC9TboSeo+JE0O235/Hr61CXWzRxAL72wgrlEKiy72tkgbbMwAiUmWCW51E07iyXOyCW1s kJ7mUmsD9iY4MBv6m8YJ/R+OC7qbTAZBe0ubi0qdHRmrNPFC8gQGQ68XP4jih+p0iacPai0y/ hNfYVFI4stIDH3g1brvOxflYkjUViyZiplZHQgQsxCNWk8jExSltgBHjtXn1WEFOpilkz+OBo 5zCVPRCCoMV0FO6YDCNzTjaLSpvBsBanlU9EjrMJWCm3bMPIfWSbrIC1Sx5y91W6MtYntfD+V ZA6ReVfxDLqXdqZ41jcUzRB1j4BnhDAgalhyT3O0TuQgnhSwYwUrjsLYZ1IXrjX/1CuK0+I+I Wc7ccI8voHm4wPYEoF6Boov6DjbLwtPP8/jKSZCAmGe6T+ZC/BSTEH5PfF9/lqw3hX5MSxzS+ 3Y4CG9w59bOG+Bt+AHCVStT7avUbHjYjiv0aA8MF7LKZ0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102928_764306_1C6C17AD X-CRM114-Status: UNSURE ( 8.93 ) 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 These declarations are left from cleanups and not necessary anymore. So we can drop them. Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h | 3 --- drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h | 2 -- 2 files changed, 5 deletions(-) -- 2.34.1 diff --git a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h index fd1b9d3555ce..b402aac333d9 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h @@ -109,9 +109,6 @@ vchiq_release_service(struct vchiq_instance *instance, unsigned int handle); extern int vchiq_check_service(struct vchiq_service *service); -extern void -vchiq_dump_platform_use_state(struct vchiq_state *state); - extern void vchiq_dump_service_use_state(struct vchiq_state *state); 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 be20abcfad75..3c7a6838ddba 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -539,8 +539,6 @@ int vchiq_platform_init_state(struct vchiq_state *state); int vchiq_check_service(struct vchiq_service *service); -void vchiq_on_remote_use_active(struct vchiq_state *state); - int vchiq_send_remote_use(struct vchiq_state *state); int vchiq_send_remote_use_active(struct vchiq_state *state); From patchwork Tue Jun 4 17:28:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685713 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 4FFECC27C53 for ; Tue, 4 Jun 2024 17:29:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Kfu2mC7H0W4cEUCl7Vsba9NfOP4nrijJBub4TMVDCwM=; b=rL9lX1P7YxlUyj /xghRaRrjhvZzFrA80DEFxjH6pUvq1HYKHPBtMLYomjRHQor/XNpVcEzQpiuMOsSy1IwNqSY7g+Gq CLVBE/a2Jz2Z6nU/k3nGM3W6n/+9MWxTWgaahZXBxUh7ZPSmURIKJSOaRfGAqbCxK1PKpauvrilNG uBnqwkfLGJpwhqT9b33aIJTSb0NjEZRs6l6YHgDBgjzsn9ZymN1egLEQAZ+qLeUz0lj6G8Eb0zvYj VIDxROJdyr3NRxVzMEZ/M4O/zlh773+eX5S/rBgW9C50pxTRHdtznkeMVqV6g8eTb5gv9hkkI4HjM K5w/1V2T7Ww3ClUxfR4g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyj-00000003IpR-0zyj; Tue, 04 Jun 2024 17:29:45 +0000 Received: from mout.gmx.net ([212.227.17.20]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyS-00000003IeJ-1UYL for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522164; x=1718126964; i=wahrenst@gmx.net; bh=cPi4YOg3++c1NzBOCaXmqdHTfRwQCOT+4zrHxzV2j+c=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=bmfXTvai81PvpmoP8rkg4jrwBW2Kl6rgJmzSJBwTsXvBTdxTmH9411uxjNFcUlIg 9sBVKUUeL+Qc/Ya/e1DYtCK1BQJvZV/kmJWo3WZM0Cj6gOeD4FsKNYpS+oVl/e1QQ h2EGaZWg+/vJUyCFTp0jazJD8Ya6tEgTlDVSo6xMeyf6Fa4aIebgHAvpvqW4jBJY3 fsVBW7ATnA/HwrttOKgEFusqoMBHYP3xL8cBtGTiEC2csD2kWPRNRvyaWqIEmZJZ0 vu98oWuUvUAXZBfsurT6UvGczoziZs2O/ruEXtJjEkB65zLRRQ7bDmmAf3F8KnXTE sHybU2irHDlwu5Ft8Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MXp5Q-1ry1960ieS-00VA3t; Tue, 04 Jun 2024 19:29:24 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 05/11] staging: vchiq_arm: Get the rid off struct vchiq_2835_state Date: Tue, 4 Jun 2024 19:28:58 +0200 Message-Id: <20240604172904.61613-6-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:Y201S/auoNhGuy1Zdhgan48f7+dU9nXqYq/STRvIFilo6dSWN0b IZXbfFXTWwIRurufUh75bEmSJhTXu3/jB+3jNFUstQm743WLqqInIDCwbN2XEK49uVgH6Ik /WVIICPuUI42pbrWlJTikJSxzfaf/pskGHXLM5PwfhUtmKtj72VrWXi+vweGzwi8IFYMHvn jMo1j8JGqEwt2FKygzHQg== UI-OutboundReport: notjunk:1;M01:P0:cp8TfH8WKaE=;3o+TwRnRIoUkhMqvaVvV2peoyY5 0++BRiKOPyWyChPDpJJoKMo5WYKOWbhmm83tjnFzriuFDSmxl71HJB7F9LWM7tNwu5oQYB4/t Qn4+pnLK0roZIfaUBNM3FXo13YfF/4fvRb5KyIqPXzFAHe4cAX+yBlRSi7n8/wG5e5J6cCsLz sa0EPuf6OF/Vsv4GdEgpEj6no1IbUfZPitOwURIznoRVxjzoyWoxegMKSDob+abxMkaADLugi BPtWHpseXvtmQyRt1tIZCN37b1Ukrleeb1vLNDyKUkWskezBTgLLgyEJKyOFWPMH7bATS11YD +dFKFdjFxoz90+WN/Mq61lGw12lCqak2uYMa4LfFcIHm7ocDiGR8Q3HXaDSId4SZwZgb7k08D c4U/s0L+JoobmUtABnYpET+LKZotskhnfucPUzahT/OM8HoTwQBcCcOd/2R2yybOMPdjW6kv7 URu+k3/45z86NOrwqdx2xBdZ3WWnv+zXG6QIdIdoGwGj4v6RceQBGjGUh8DfYXm1GDPeACe3o o5pwbx85ImX3BJLPnaHsU5c+xV22xZiM20Ff49I+usufIiujDPG2VAYI6zu6TSJc7AlAePz1Q pVSYOinYa0VcpNyZu6Zotqbo5C4SSnNHxcoa2faoTRU4BxRs4ZVUQdqpIuqKJErLPmJ5dPBOr waKD2D0ha3Efvoz1s2t7DJuL66yKd1y4lofPT7UjhhGBq1xWhNX1PF1aWNSCc6QYpgqtCETu3 ap2AArZ22uCsQo2T6L8c6Ug7OA43TRdCH1e2Xi/8xBK7v9B/ky8rGXMBALEOqdy03jWeYnEny ODQSvtYrIp/HJjaveCMXLIFsV+wOuBy0tRoSLEbeLux+0= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102928_774255_68AE064A X-CRM114-Status: GOOD ( 12.81 ) 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 whole benefit of this encapsulating struct is questionable. It just stores a flag to signalize the init state of vchiq_arm_state. Beside the fact this flag is set too soon, the access to uninitialized members should be avoided per design. So initialize vchiq_arm_state properly before assign it directly to vchiq_state. Signed-off-by: Stefan Wahren --- .../interface/vchiq_arm/vchiq_arm.c | 25 +++++-------------- 1 file changed, 6 insertions(+), 19 deletions(-) -- 2.34.1 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 515cdcba043d..98a0b2d52af5 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -109,11 +109,6 @@ struct vchiq_arm_state { int first_connect; }; -struct vchiq_2835_state { - int inited; - struct vchiq_arm_state arm_state; -}; - struct vchiq_pagelist_info { struct pagelist *pagelist; size_t pagelist_buffer_size; @@ -613,29 +608,21 @@ vchiq_arm_init_state(struct vchiq_state *state, int vchiq_platform_init_state(struct vchiq_state *state) { - struct vchiq_2835_state *platform_state; + struct vchiq_arm_state *platform_state; - state->platform_state = kzalloc(sizeof(*platform_state), GFP_KERNEL); - if (!state->platform_state) + platform_state = kzalloc(sizeof(*platform_state), GFP_KERNEL); + if (!platform_state) return -ENOMEM; - platform_state = (struct vchiq_2835_state *)state->platform_state; - - platform_state->inited = 1; - vchiq_arm_init_state(state, &platform_state->arm_state); + vchiq_arm_init_state(state, platform_state); + state->platform_state = (struct opaque_platform_state *)platform_state; return 0; } static struct vchiq_arm_state *vchiq_platform_get_arm_state(struct vchiq_state *state) { - struct vchiq_2835_state *platform_state; - - platform_state = (struct vchiq_2835_state *)state->platform_state; - - WARN_ON_ONCE(!platform_state->inited); - - return &platform_state->arm_state; + return (struct vchiq_arm_state *)state->platform_state; } void From patchwork Tue Jun 4 17:28:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685709 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 102A6C25B78 for ; Tue, 4 Jun 2024 17:29:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Sif1m1+2MmtAr676uwN6mXUF6ewZAjW7Rl+YenI4QiI=; b=t3MsJeejQwdR0F aCxiBqxrr9tgK0y80yZMdaMJcqd5wkUi2hblKZkMWGWWmni5uTG8ALckDV42H1mfjy3+/42feQTt5 XPim0P7fmVsLkdnCBTbHf7mOLXwXOG4MrQYxLCTPu5ftEgSc4PWq/zUaZarBvgXo/s+8S0W6iKBeg JuJcby1B0tl/cNDiDzMynuujewfgYwDLmHjm7KMbAdsxJR11tP52sKqFsTVVdka9y6513WBdGVSXO pzsbMeL0kLbDJtaFmSBnlud/zeUw2/GzmTLoLctwfhp8ccAPTdqjRJ5MoUH+8/+9YR0XTBGZ7g0E/ jfO1D3mbHVz73vJIuGTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXya-00000003Ijy-3y6Q; Tue, 04 Jun 2024 17:29:36 +0000 Received: from mout.gmx.net ([212.227.17.21]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyR-00000003IeK-2b7B for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:30 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522164; x=1718126964; i=wahrenst@gmx.net; bh=tyanfsDOlygVC8ytJoEWfA17D5viEBrkrpVolUIqD/I=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=e304O/JE5fkMJCB1X9twnioubyZRwY3Vv3XfLexluOM5JaLOrP4oKvX0KLgYhW58 zncofC2y45kp26V3gu9VCqszJ5TyLhYbc/zK4CFGQZK0b6VQzfBgdbUSGMXd0p6b/ tEoRrBpUHSYVdgg95Q35wZeNfUyJ23Dqx4OA7xzY61/HpOFZV4WbchhgsCE8p8oUx 7o4FtdWdW35EBTUaZCydDNAAjJ8VyTO7SzjW+LCp6S/bwDPxUCz6KUlhj+IQLiM0h /N3/0gcusbaYI1KnI5WnBIzwkbmfznbLRer8ohTLQpS+C9uKdthvc0Ios0WBBRhCz Rlmq8bh8mnMbW8Qdhg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MTRMi-1s2Oro26UW-00QkDZ; Tue, 04 Jun 2024 19:29:24 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 06/11] staging: vchiq_arm: Drop vchiq_arm_init_state Date: Tue, 4 Jun 2024 19:28:59 +0200 Message-Id: <20240604172904.61613-7-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:OmtYHr0D8SmeXLdSboNtmBRM8p36xwQ1R/nIEraYr99BGkiQuyu vnFhjiqw5XN4/b0q1xOYlt9ef8000kXKqdhY8u14HNqffFClSfij0E/nnfyT9MhhfJSLsxA M9n5DPf8kumeVpgBhGWA0lPzlLmwlJQllgXrRwHcrVgwQeeOxZ3eITmu7qNJhTK5+Kj1pVN hEJIGWwgLJ1rRBYJXk6wA== UI-OutboundReport: notjunk:1;M01:P0:Fr3SCDPs9KA=;AotGbbAvX321wlgbXRo8/+EWMql oqD8fRViNzRI+VbLNPsB9VO/GFr/bNosf/8qr4VrPwstFeCjAh772ta5Ww4bcsnkTa02dK4rh boukJg3KCtJr9yPpxxocN519pFkGpWtPHb48OAuJC0v5Gtf7uLaE2xEGBv1ybHr2DRGDRhHmM hvrpjuULn3OfbzrFJsoy9N3BG4UFp8Me21mwyNgpHQWbYaNVZA0UfkkmaY2z8fiRme9dFhSeh fm9vTl6kNlAd9tcOYoDQAFS/kU0ersHVRsWCSY6SV6kqLSQtys7+P+rcKBY0E6ihZroR8Q3es yyRdMcU/m/fQqk5puWorWFe7HE3Jz//d0G45/S93uIMSyKz9QcJsJCGzJhLEnc8GC1IBTY0ip rYLOPX+48mQqglYdMw58evD8LTiYsSAAtwbnqJ3t3fi58BQt7LRYL3UD82Nun6v6snJ+rSQRR /8GVhT4J7+XPAiwkW8FXWhNDP+mBRXHxLa4AATr3jwAVrb63+dJpaSkrW2lUsCVWGKIIe7HTH E7j2WM01ZDVgZGRJuboWKYJ6HrG/M1hCbIP4oF+h48QzIJiRsDZcZpIfItYRkkwiG6Qkhpkbt A23cZkajrx1J/L4mk6W7sA/iccbz/W3ufMkQtdWLS7vnDhsVYfagzrb+v5PBmy14dkZ33KGk0 VPqJO19T75h4gK7xnEanRVl9XrPkGqw/mBsU6q/kuPhBcTUusIOy5gPBm5Xas5Wq9d3ly4H0O nIVEj3h/oSkeVizG/AenNgFRVynTr3XHlK3wAPGYjYtE7ZGMay3McQRnVIqUPCl0NXzTiP5pV r+WLNbROpbFmpxxh2BnHOW1KenBiTKMcX48Wxh2paKtwo= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102928_012763_52E9EA49 X-CRM114-Status: GOOD ( 10.46 ) 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 After removal of struct vchiq_2835_state, the init of vchiq_arm_state can be simplified by doing it directly within vchiq_platform_init_state. Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart --- .../interface/vchiq_arm/vchiq_arm.c | 27 +++++++------------ 1 file changed, 9 insertions(+), 18 deletions(-) -- 2.34.1 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 98a0b2d52af5..45acca670bbd 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -588,23 +588,6 @@ static int vchiq_platform_init(struct platform_device *pdev, struct vchiq_state return 0; } -static void -vchiq_arm_init_state(struct vchiq_state *state, - struct vchiq_arm_state *arm_state) -{ - if (arm_state) { - rwlock_init(&arm_state->susp_res_lock); - - init_completion(&arm_state->ka_evt); - atomic_set(&arm_state->ka_use_count, 0); - atomic_set(&arm_state->ka_use_ack_count, 0); - atomic_set(&arm_state->ka_release_count, 0); - - arm_state->state = state; - arm_state->first_connect = 0; - } -} - int vchiq_platform_init_state(struct vchiq_state *state) { @@ -614,7 +597,15 @@ vchiq_platform_init_state(struct vchiq_state *state) if (!platform_state) return -ENOMEM; - vchiq_arm_init_state(state, platform_state); + rwlock_init(&platform_state->susp_res_lock); + + init_completion(&platform_state->ka_evt); + atomic_set(&platform_state->ka_use_count, 0); + atomic_set(&platform_state->ka_use_ack_count, 0); + atomic_set(&platform_state->ka_release_count, 0); + + platform_state->state = state; + state->platform_state = (struct opaque_platform_state *)platform_state; return 0; From patchwork Tue Jun 4 17:29:00 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685710 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 3CF37C27C53 for ; Tue, 4 Jun 2024 17:29:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=vGS2630HcyYGAB9i/u+necjZDUX2GHvY2+IBfYP22us=; b=FWvMuglnQpe5al HnMFVRehG/mgk4wvOM/dgvOHoN1yGhitIxoZ4mQ9z/0xOZclj4zfU4EknS1KfbV2dGYiHIKPW+0yH 9Q1yqDj+//P7BTZRpbnn8Qdwi8YRt1owvSzi92ixBNvCGGKcS/YwrqYh7CdwqGuGeOOMd9LCA1BNW nppJd9iQ0RkrAgFgBd/kYq9aCQFnKFlW995zCUacaAxMNMkJZ6pguBNSQYfeTG0tHd3uze5vJtxLQ vjwFZcnAtakeG4zkED8xhjqicVo4gz9R5bGimeCaiwZurGdc+R1puwbF+it5M0FoTNiHn+oXwJIh1 6monlpeMlpPho3NMHjsA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyf-00000003ImZ-1myU; Tue, 04 Jun 2024 17:29:41 +0000 Received: from mout.gmx.net ([212.227.17.20]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyS-00000003IeL-1Trt for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:31 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522165; x=1718126965; i=wahrenst@gmx.net; bh=J8u0D/gqYRaWIAY1ZLOXtY9R4hmDlnmeyzUMbLiRoSg=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ZnS87CxvJuTpD2oU8uudhKlVgfMl1DUEpWimVjpwkWbeq20JNdtkjQClBCKGQWhA KL95hxQ4SH2N96H6exvZtDFkM4a4MGm+wyEnxs8WEIGvf6PqVh8hKIhb2oxQQwE+a dgNIDHJ98mgNeSsOyx5IZ5cECeK1gux+3prlUEiO+Ymvt1ctsLBFCFiKWDD1Im92x h9ce60x/lcJpPrUcXJRzwSmuTI2oeCZ2TdsKS7z+4gdSR3sDxeEMrre4KFPMWf3+p 2M59in3gfI7vT+uV6eS3lMfl+v4cVT3DUn4ORe3QlDWn86KjrxJbS/Lnjf7rogHPB EhRE5nlPvn9OxfIGPQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N1fii-1scq563bA0-011BUz; Tue, 04 Jun 2024 19:29:24 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 07/11] staging: vchiq_arm: Reduce indentation of service_callback Date: Tue, 4 Jun 2024 19:29:00 +0200 Message-Id: <20240604172904.61613-8-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:xh3wPN2mIO7wghK1lfDXv0h4oqXgfc66pt2IdguB11S/DgvPseL 2eAJ8Zdefbow5cJ60vG/LeSMDAiI8JxytPcoTYgeZjwWHVMlm9lLWNp5+KCpvbhkCwvy7TZ q08B7nuF9ezypXro/yjIGsYXvU2jOqifBbadsQjVSskoUUmYt9Z6oKsYa39rmFlkMAz5fje GhDaUWfYeKsyAXCtqTaSQ== UI-OutboundReport: notjunk:1;M01:P0:MfG+iriPnb0=;/GwZxITaXWjLak0kr22F4OTZdb+ CJZL2zKwtv+qxR6CXEJ/XNveBOgWKz4zsctVLHRjml8QikVJDd+4Bw3QkI78u4zCu/Yljvw8s FOilxpBpoO2bcHtXziYaogSpibmBLY3+1Nek8OeGfjlL95u8mU3zH7aK/0cjxp039LSI+I946 zLRuWg7jjjJM3qitGi5o2mWXfEIgTWj9DiUegdjRBs7fC+gDLYYCpfv+2KH/UuhacyMaixALA X7zmES3YuZ1Bv+Uka/fbNgN20ZwyhPJz49oOAuadeRzoapDwS1SXkiiSDwlqz4Ax3KaybbBm5 fI3T7BUnjCTi2AY4s8z9w4tYydGNq8WBkSLKd4eIciR6pP6Qel19N2h9B8PbKfFwzQ5YzyKC7 Zf6cIrQB8gen2iwEIBS3rouHj4fj7G9EVjnWP2QHs5BNHHZKmYtKBkZ0Th42RGPO2V3EhQYzK k3maSher2ix/IiE3336yLZtiZzXcjgj1obwkurkZ1/9FOnX/D41ACbyxTBRGnF0ocKJY0umz/ Nzkjg1Ub+rETXpCZBvkozAPN+wEpwDiKqKpQMfpvfuAQ13p+MW0xHZAsuJOfeCjwXFd7DsRA8 NRbiWkbGsiJs3r8yoSqTEYJmyJBTFar8XYmLeEyuTIv6Bq2WbIMzj8v9jDidqztgYpuAj4VOC iq7Y/VqhheA+ZSjC7Ds7pCd4q6jEEqF1E6yRe3oRaqPjlDWNhWfp3jpDNRKhG6+dMKdKH7qbW E0+zXVVscpLseacKZK2eKnsMr8yjX2hJXcenNqviTlevDo8Q/lod0nd6oQFrE6h6LaXmRVnf1 yfd2bEKEopUM2ZYezvN6mKZP6V1sxDfOhNR82Q6vTYMPs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102928_752139_FA34760E X-CRM114-Status: GOOD ( 14.66 ) 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 service_callback has 5 levels of indentation, which makes it hard to read. Reduce this by using a goto for the corner cases (no header or VCHI service). Signed-off-by: Stefan Wahren --- .../interface/vchiq_arm/vchiq_arm.c | 111 +++++++++--------- 1 file changed, 57 insertions(+), 54 deletions(-) -- 2.34.1 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 45acca670bbd..0055c7d7e617 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1101,71 +1101,74 @@ service_callback(struct vchiq_instance *instance, enum vchiq_reason reason, user_service, service->localport, user_service->userdata, reason, header, instance, bulk_userdata); - if (header && user_service->is_vchi) { - spin_lock(&service->state->msg_queue_spinlock); - while (user_service->msg_insert == - (user_service->msg_remove + MSG_QUEUE_SIZE)) { - spin_unlock(&service->state->msg_queue_spinlock); - DEBUG_TRACE(SERVICE_CALLBACK_LINE); - DEBUG_COUNT(MSG_QUEUE_FULL_COUNT); - dev_dbg(service->state->dev, "arm: msg queue full\n"); - /* - * If there is no MESSAGE_AVAILABLE in the completion - * queue, add one - */ - if ((user_service->message_available_pos - - instance->completion_remove) < 0) { - int status; - - dev_dbg(instance->state->dev, - "arm: Inserting extra MESSAGE_AVAILABLE\n"); - DEBUG_TRACE(SERVICE_CALLBACK_LINE); - status = add_completion(instance, reason, NULL, user_service, - bulk_userdata); - if (status) { - DEBUG_TRACE(SERVICE_CALLBACK_LINE); - vchiq_service_put(service); - return status; - } - } + if (!header || !user_service->is_vchi) + goto service_put; + + spin_lock(&service->state->msg_queue_spinlock); + while (user_service->msg_insert == + (user_service->msg_remove + MSG_QUEUE_SIZE)) { + spin_unlock(&service->state->msg_queue_spinlock); + DEBUG_TRACE(SERVICE_CALLBACK_LINE); + DEBUG_COUNT(MSG_QUEUE_FULL_COUNT); + dev_dbg(service->state->dev, "arm: msg queue full\n"); + /* + * If there is no MESSAGE_AVAILABLE in the completion + * queue, add one + */ + if ((user_service->message_available_pos - + instance->completion_remove) < 0) { + int status; + dev_dbg(instance->state->dev, + "arm: Inserting extra MESSAGE_AVAILABLE\n"); DEBUG_TRACE(SERVICE_CALLBACK_LINE); - if (wait_for_completion_interruptible(&user_service->remove_event)) { - dev_dbg(instance->state->dev, "arm: interrupted\n"); - DEBUG_TRACE(SERVICE_CALLBACK_LINE); - vchiq_service_put(service); - return -EAGAIN; - } else if (instance->closing) { - dev_dbg(instance->state->dev, "arm: closing\n"); + status = add_completion(instance, reason, NULL, user_service, + bulk_userdata); + if (status) { DEBUG_TRACE(SERVICE_CALLBACK_LINE); vchiq_service_put(service); - return -EINVAL; + return status; } - DEBUG_TRACE(SERVICE_CALLBACK_LINE); - spin_lock(&service->state->msg_queue_spinlock); } - user_service->msg_queue[user_service->msg_insert & - (MSG_QUEUE_SIZE - 1)] = header; - user_service->msg_insert++; - - /* - * If there is a thread waiting in DEQUEUE_MESSAGE, or if - * there is a MESSAGE_AVAILABLE in the completion queue then - * bypass the completion queue. - */ - if (((user_service->message_available_pos - - instance->completion_remove) >= 0) || - user_service->dequeue_pending) { - user_service->dequeue_pending = 0; - skip_completion = true; + DEBUG_TRACE(SERVICE_CALLBACK_LINE); + if (wait_for_completion_interruptible(&user_service->remove_event)) { + dev_dbg(instance->state->dev, "arm: interrupted\n"); + DEBUG_TRACE(SERVICE_CALLBACK_LINE); + vchiq_service_put(service); + return -EAGAIN; + } else if (instance->closing) { + dev_dbg(instance->state->dev, "arm: closing\n"); + DEBUG_TRACE(SERVICE_CALLBACK_LINE); + vchiq_service_put(service); + return -EINVAL; } + DEBUG_TRACE(SERVICE_CALLBACK_LINE); + spin_lock(&service->state->msg_queue_spinlock); + } - spin_unlock(&service->state->msg_queue_spinlock); - complete(&user_service->insert_event); + user_service->msg_queue[user_service->msg_insert & + (MSG_QUEUE_SIZE - 1)] = header; + user_service->msg_insert++; - header = NULL; + /* + * If there is a thread waiting in DEQUEUE_MESSAGE, or if + * there is a MESSAGE_AVAILABLE in the completion queue then + * bypass the completion queue. + */ + if (((user_service->message_available_pos - + instance->completion_remove) >= 0) || + user_service->dequeue_pending) { + user_service->dequeue_pending = 0; + skip_completion = true; } + + spin_unlock(&service->state->msg_queue_spinlock); + complete(&user_service->insert_event); + + header = NULL; + +service_put: DEBUG_TRACE(SERVICE_CALLBACK_LINE); vchiq_service_put(service); From patchwork Tue Jun 4 17:29:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685714 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 412E7C25B78 for ; Tue, 4 Jun 2024 17:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=1rohCurqi0hZQUIPRCeTXHhVge6iXPLsccGZ79ViMfw=; b=btvFaJNs5yO1jy 5fFJ3LP0Dc7sO7e0u0QnpqPcBVfBR5zxbo6vjbxur5hUQEHsyFwOP5m+HsUJaCdIKJ22h+cM0McQm bdFaVpFOY+JMG+RmA22/FmWt0UpQK7lFQP3vh+vmd9lJuDqFIbgvlLsx1ZrjtZv0x0xJQtyO0zqTz oleHRTmiK3sxK8XNenA22gj2d+O1DyKKIEpEzqVNYTE03MDPntsRyyvFLNUhLxjQ8kKK5eIZP/7hg o6k4dNld/8Wd/CguAYlrO6GRUJznSdjH42uOzbXNW71uer4/E8zetPB47xCCI1hcjE+THQ44tX9yn 6bB90ujfFH16gUtEajzQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyl-00000003IrS-3mmH; Tue, 04 Jun 2024 17:29:47 +0000 Received: from mout.gmx.net ([212.227.17.21]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyS-00000003IeM-2CKf for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522165; x=1718126965; i=wahrenst@gmx.net; bh=Rfry0NXDm1gI1wrMbe/CMHPe2LIMDEs/iZcoJxyMFUI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=cvVlNEDKvi2Q5RqimCm0SkcC+jXYTPm4JPh+RrQqxhspd1YQ0Aq2Xbo3lyy8YEkY Mg9lcdsQIvL+L4R4Aug/ysrLknrvUz0dOmMnEbQOfZ8CBA14qGmZMGgLXZrYmrhV7 4gxZzLyy7KBWvD1HchqmulZt2hB1LRwPuHuRgw5dlv1vZlJetbTF1JBUYxxMmQjHi T3JCAT47TXA09YL8M8M4LU0VwS1ep28k0F0+oLrQOVfUnrMW3QNL+icrRk/eUrPSn ZtURP/ZEb+l/4wSV/WH7ygZvDGeAn4Gk7Dipe/6ScmDNyocASyMr0QNYVPSMB7Scx UbzmvYpag8AQe3NZpg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N7zFj-1sZq4M1M6l-01857O; Tue, 04 Jun 2024 19:29:25 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Phil Elwell , Stefan Wahren Subject: [PATCH 08/11] staging: vchiq_core: Add comments to mutex/spinlocks Date: Tue, 4 Jun 2024 19:29:01 +0200 Message-Id: <20240604172904.61613-9-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:1GYyFfrK1UIOo9UDgccMzFEDbhAkCS6WELbwpYOASjPgzxulI9j AS8NOL7esJnmUBLN4RuNU1kiwH8KUxO5WLW2IXfcR9t+zv/08ws5hF37MBGYZXT+fRX7NVC OmveHThI5j7S/fR6u5mlv4qFR/CcOxgxG+we4Mv8oXrBC+Guu/rc8ZZcGUa8kM/53wH++J6 o81GDmjopDfYn9Vh8whNQ== UI-OutboundReport: notjunk:1;M01:P0:xfwWQuTnG7U=;Bjx5uWH5WBW6qPqLclv0AJ8aWGh b5Q4JVia+tkKrM2fyZV7HKpRgYFy1xsUk/huh9FNDffiOft5ocFJINle1M5uN07SuDYOX938d gnG7ZKqptm/LK8oQ1tA88ZjJZmMGKrMW4sQ3TQG72ISfr7/+SvyFlacBq0Bnv9Pz9Jl5eS6yc zOZqmcDYQiLZPhRWh1lQUDdGECboRrsVIY0r62kP7Hjlkdo4ikJwTPHH951/LG5RSzKLqIl00 9Pm9h6dX4A7238SjSGs/gMTeQdJAhbFAMh8z7+tH0PeXbaTiLNEjjtTut6ZUqUwKOnw0oPmcM RDrkzTOToiDW59uctY0s9NfylCqjwv4OQHH/kTYwQG4GPFompcg4j8dd+QTsOSeR0HAn86vGz 1WLxzuNmTM/6GnfKAJEShcNLvveGwJPie7IpCUQdIv6bsrnw3UmMoB9/G0it56tZFDFmS1qzv DLJPKsyKIGsNYAPN+xNAD1QgaDWk/eNYrNx57IH6UXLWqx600PPOA7G7nbcx1bwFxHXHj9NXm C1vZ9hMr10M3NQ2MKdXP21M27DC44lRmObVPvkUBy+CEl7kpO3iyeoM00irBOkMbx/B6LSyjB NxWrVmDzeUOnb1awlgDSNkLVlL2E9vAkdxqsToIuHs+MjH0SB+lAW8/N8f6UGZGLMF4HSo7tU JP2sH2xRv86S5jR9W3gW+oou2538Rf7mUQ63J4E6ilzdfAJJct0vH8uWrdxabzQUWFPJCwjy2 826IU+DvZGEmkfOZSARbbvVCY2bSoK5N6nNTDjII+775rbgNwrgu8pR5nsyL4gaNVspQNwTDx th89u4/mfIv4tRRyB9pZuTS3y5GPgmIm3E/6lv4B2qcx4= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102928_878455_C6A70D23 X-CRM114-Status: GOOD ( 12.69 ) 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 From: Phil Elwell checkpatch.pl complains about missing comments at mutex/spinlock definitions. So add them accordingly. Link: https://github.com/raspberrypi/linux/pull/6139/ Signed-off-by: Phil Elwell Signed-off-by: Stefan Wahren --- .../vc04_services/interface/vchiq_arm/vchiq_core.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) -- 2.34.1 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 3c7a6838ddba..3abcd6910f25 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -196,6 +196,8 @@ struct vchiq_service { struct completion remove_event; struct completion bulk_remove_event; + + /* Serialise access to the bulk transfer queues */ struct mutex bulk_mutex; struct service_stats_struct { @@ -312,7 +314,7 @@ struct vchiq_state { /* Event indicating connect message received */ struct completion connect; - /* Mutex protecting services */ + /* Mutex protecting service creation */ struct mutex mutex; struct vchiq_instance **instance; @@ -341,16 +343,22 @@ struct vchiq_state { char *rx_data; struct vchiq_slot_info *rx_info; + /* Serialise access to the main message slots */ struct mutex slot_mutex; + /* Serialise slot refcount updates */ struct mutex recycle_mutex; + /* Serialise access to the single synchronous message slot */ struct mutex sync_mutex; + /* Serialise access to the message queues to userspace */ spinlock_t msg_queue_spinlock; + /* Serialise completion of blocking transfers */ spinlock_t bulk_waiter_spinlock; + /* Serialise updates to slot quota data */ spinlock_t quota_spinlock; /* From patchwork Tue Jun 4 17:29:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685716 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 35ACBC27C53 for ; Tue, 4 Jun 2024 17:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=67TsTzWqXqLo1SeN+QIA5cWzIoWdrg2hk5cP1PzGYfA=; b=R3TOx7MuKJT7tk h3RzFkkcO6DS2baiCLgyiYAG8STp6GYV/OBmU1Qw/l1rzKXAI5tA0fiG5l6erXIG02+th519eRD1o /4yVinuckdguL+aFQLa/RipJgnC+FBPqIrFLkgUvcCT7Gxa0Mbw4mrPmlaYV/z8DwvJ7FwcmRRobp a75VVBvMGy241/eXgV5LhkZsZ0ZuX9tiBoraHkKn+m+et5d5MX2tz7EhQpaNygTBJ0eIxU+rcVXVn rs2ZuunHU/14jBVBUzN4rvb/BOl9U5KLzFkCzismMjU/xr2MX5H9N1dpYJZw97bbJS9E5xUIbCngs CBp+Woo9bO9CgOv99UNA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyz-00000003J2B-2xCJ; Tue, 04 Jun 2024 17:30:01 +0000 Received: from mout.gmx.net ([212.227.17.22]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyS-00000003IeN-302d for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522165; x=1718126965; i=wahrenst@gmx.net; bh=3Kyj7xVXKdFABvHEfIxMvuqY1IHrvscZPvjF0mLW0mw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=ae6wwN99zhwo6hS72AGF4dVEhaDBcPnrM/23AQWCGib3Xx3EqnOtL9h731E7mces 67C3mK7QYyyo2NTfSlm3iOQT947IFsEqArRUDhWj+qAnwJD/fWsSPtE4o1eMpBSSI ZcnHUCpL/6e/Sv9PZWS3tfohJiqxBTFPdKON4ilHRATYRnWDMHT0PWoq1NtjEjs6c 77zz4SRme7uu3DB0xyv65cxZcq4YMMFxMCHpg1bwrRN7bFaz/Q9VEnSE6Xh+LGJEg iTV8etuTZVbDx18Encd4M9cdUIJlZea10pFtR3Er+VN8fhRUYPP+XQh46wZ1BbLGC AKSbw0deOHs+DNremg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1M1HZi-1sBmox2gMU-001xpP; Tue, 04 Jun 2024 19:29:25 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 09/11] staging: vchiq: Move struct vchiq_config to vchiq.h Date: Tue, 4 Jun 2024 19:29:02 +0200 Message-Id: <20240604172904.61613-10-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:vaK3EOHY67WOeJOD4rbTv/Z08PFm7iD7mpWenTGCI/Vf+glXYOK Jyqi7zeC6Qu8gGSjmbyV0dFBsl3oz6SS/YKPCzzA1fq48hBfItdAj/OVygA4cECbJzg+tRn lpUiCtME9N1i2STpEuhimQPOYQExITRHNUkasPLdZIhGmtQ4P6v+yP54ILKU85jOfaPeSkY dm5eEVUr94otdkpUbdxZg== UI-OutboundReport: notjunk:1;M01:P0:EzH5oQuZgjM=;2o6JO7Oay7hlhynVIPzZoxByogp y8VoMIXPbtHyPlspP6XlFY7SE7zCHrXhDHt3fuvYAXSCzP373paxCPHXhDx9YiqUvXEEvrO8k URfR6aNm0XCgGsj3y/vwAnC6kMb7mMJ4XkmDpxMNbRzWo7LSzoGRYHv5/wcBNXEpB+Ki9jhfH 8fAnbeMyikCUolzlqE3sLMJBsejKiStbhqye/Ldj3hWN3xVjgFD0N1VyB7EdwTUTdmMEEVjYG wFxMW15L7P1jHnQleNomhen7TzWQbumBkHS2YO3B4RAbKa55ab4Tu3GKOQI/xA6lX/n2JSGj6 61xaPyDFOn9az8ts7jj5+myS7eAcarXjhMXlA44MLAqyYEN2jY8eLz3kB/F+nOwLcUjLgyMNK 6pEzFu/gFOmtP7rfnDOa0mp8SlcrVJALuu4ltMlXxldjfvsNp14C9dSLVvzA3cbsVozArjR7U 0D05hRee7wyIlwSu1dVOtf/Z1seNVV/XuLZ9YT6ykJw0dHwVzQSmh/jm6wuCLdNTy/rANCOxG qRswsdoC0IRWqPjvgMgJqhwvFQtKanBRsTICJWWV/ScL6vJIVlNl23WPsTun5l1YAaIuGQZ3m r8ryjTyKMDsMM0k6K2twFYhtcvDSnHi1ZbpSVoxI9k7pT9YHfQ3TdJx1D+qbYhEi0RWC7Avqd uky8z2qdPNPerFUBA3WYDe4978i/pyWs/m+uQk52DcsXrMo6GdzbQCb+PD1fkyKp+hnWacJsq wiXP529b3XTUnw49NRkI29IyM5E/R2ZhRtYxnptNnVYCDkfwS/4KPtMxh+y6sNKgygfdeqtXx YvdDUF9GC7sAruAtGq9zL3sCYBuTqGY7pLfBf50m7+lgs= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102929_059051_4DFDEF6F X-CRM114-Status: GOOD ( 13.57 ) 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 struct is part of the VCHIQ userspace API, which we don't want to break. So move the struct definition to vchiq.h, which contains the rest of the userspace API. Signed-off-by: Stefan Wahren --- .../vc04_services/include/linux/raspberrypi/vchiq.h | 12 ++++++++++++ .../vc04_services/interface/vchiq_arm/vchiq_core.h | 12 ------------ 2 files changed, 12 insertions(+), 12 deletions(-) -- 2.34.1 diff --git a/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h b/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h index 6c40d8c1dde6..2e34c67966c6 100644 --- a/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h +++ b/drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h @@ -79,6 +79,18 @@ struct vchiq_service_params_kernel { short version_min; /* Update for incompatible changes */ }; +struct vchiq_config { + unsigned int max_msg_size; + unsigned int bulk_threshold; /* The message size above which it + * is better to use a bulk transfer + * (<= max_msg_size) + */ + unsigned int max_outstanding_bulks; + unsigned int max_services; + short version; /* The version of VCHIQ */ + short version_min; /* The minimum compatible version of VCHIQ */ +}; + extern int vchiq_initialise(struct vchiq_state *state, struct vchiq_instance **pinstance); extern int vchiq_shutdown(struct vchiq_instance *instance); 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 3abcd6910f25..a83f9a5d478f 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -423,18 +423,6 @@ struct bulk_waiter { int actual; }; -struct vchiq_config { - unsigned int max_msg_size; - unsigned int bulk_threshold; /* The message size above which it - * is better to use a bulk transfer - * (<= max_msg_size) - */ - unsigned int max_outstanding_bulks; - unsigned int max_services; - short version; /* The version of VCHIQ */ - short version_min; /* The minimum compatible version of VCHIQ */ -}; - extern spinlock_t bulk_waiter_spinlock; extern const char * From patchwork Tue Jun 4 17:29:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685717 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 06103C25B78 for ; Tue, 4 Jun 2024 17:30:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IfwiXUun/PL+MgLKrv0V4XX+s4ZwW+Q123dnGFfcoQ8=; b=XWBF+e9iAEJYdV X9SFVgc8BZgTR8KwVbwXz86gQrjqImGPPZ6c8544lASpqYhJGFXNayPWfzje7UlqaoYWsndrKx+5I pj+D3UV1tQb/O/u3f6WZxcKGQqRH8AYLB1io7qxIsc4Uv1Nl+DUlj0KdNO5k71QovXaZEBQcHzANL Z4bzvP5fHpnZYWnY4hYc4dciXBKjsyMqBhA5FZ4RnBhI4h4coe6hYROT4BQ2FS6yawlFt2LNZnxU/ 9qzDMub0jZEf6CL/hcRejDnbFchxe2EZNjQxI1+d4oIuK97dRcuzop5SYfxSnkhHkB7lZN/V2ecNH fGuPy/RU2HGWchGgyl3w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyv-00000003Iz9-3zN7; Tue, 04 Jun 2024 17:29:58 +0000 Received: from mout.gmx.net ([212.227.17.20]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyS-00000003Iel-49rQ for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522166; x=1718126966; i=wahrenst@gmx.net; bh=oLnUhAfIjQvsBXkFU8uP5t4BlhGnaI3fAL0JXEynWLI=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=VQSrxt5UZeDVUCvvcy3VYT9EdFGXlw/+DuVjx7DJggG6soiMlbPa4Uyc7d2pzmGZ rBmydeCtV5ILIN7V8fjAW2s4rb9yrLRdKmi66Q29DMRrnbbKzNuyJ5bkmGNr5/Juh fevpJ7oQ1Gp+65lByd+UL/T1Vkbqc2jQm2Un3q4zvyLIg25bEzvENuMt73kUW+r9Q wabw0R49CTZIHBjjJswvQ68Rj9tsXwjR4QiY8Vos71wGmIH5QH91tVP0Hg46+9i2g HFTtMs52ja3fpJMVLi+3k3nGEj3oD4oP4CIg6DMAm11jsNsz4otrUJuKcMgpFOa22 ma0ECJbaFsghFbLHHw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MhD2Y-1siwlz43yU-00hvPr; Tue, 04 Jun 2024 19:29:26 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 10/11] staging: vchiq_core: Add hex prefix to debugfs output Date: Tue, 4 Jun 2024 19:29:03 +0200 Message-Id: <20240604172904.61613-11-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:SJfo5yqiDek4L5LZBudYlirCSzraVY5mTAlzRWetPA3So0NPwIw YIuZDmyUFMfPrBjSIDfGbfdfBfS6LqLuJ5Txp7WsDzIEGe/fkQqeOUVqUzVlMlpnDlBsXQd VkhzVIxPfGknyMJyFWf5Oc0aRboqU6i3+EjB+KBtrEltS71IQTguZewhDP4OsyttnxS0JWB W0/ox3fp6RBQqwfsXuw+A== UI-OutboundReport: notjunk:1;M01:P0:/rTqJoJHZAA=;CtAQsnvJsb0yML4lLJP+vzKbNZ9 LSQ6SFLJA2TZOJ/B0EqH0OWFT1MhNDVE7YCeNQTn4916b+wap6KQvQLiJaVkIkFsyQSVwF2Fd 30rpDmwmF1ys2As4ZVpKheT1A6y/yk8/x8XBEx6GvD9YQTobU6HStCVl1P5uIyWAslzQ7+8DT IqSSH10sJxHsgAngBcp0UksdiGbTj83Y52LpH5H9Mr0guhlmYDytu3YfPu0Z2xitpQ4UfiN3Z 4+/q/IG+97539YDbRgpUzSrz1AcsvpHmdmBVZyyHf5kbxNSsMS0BFhCQrwv8RGdI4OqWBkHk7 yHy8pydy14DTwP/DeirTbPfUh1+x864l1IJDGW44iszkbN2eEYBW3SjcVH4NOXUGeeFpLWqJp We+v3VkwaC6kur5v1j+8zClIYLHu/kplYN3bZQISD3N6xElET+c8RRk+bIa90yUQfmB6jY+ar tub+j8rCku2t6IEzoimiw9DQd5gSwIMpDA1Wn7i53RlcFIAQJtHkZ6GNoUdScDjP8MXKkngVE 0lrJ4yoGi5pbdgkAlpmdMNnSzGlesegZUGSqGsSVfR112nPcqlOBlaHNYvH3F3V1OfyUIVqfQ aGs/Z3jM1avx9CQmVtq/pimBFHXj1uO8rRmPCJp2l8SFnitAbbDWPUtBSPio6ti3fvC1J1jtw YRchb6i8eFGpU3PzeTHQIBWoaJWtsE3pcMAnvR9Ov+0P6f3NEKtNMgphOly2AQdIyrZIh0ovs 1bYGt7cy0kaO/j1OYRi5fUclr2dscLipanh9z4ImorznbVVOmGYieOCra9HQgsnYxC4a6T/lq gFN5S0vKpKkX70RnoF5tb5c3l8BfcgAFEnY1uXgLBIFBE= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102929_396739_B58637E6 X-CRM114-Status: UNSURE ( 9.81 ) 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 The number format of VCHIQ debugfs isn't always clear. So let's add a prefix for all hex values, in order to make things clear. Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart --- .../vc04_services/interface/vchiq_arm/vchiq_core.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) -- 2.34.1 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 51cfc366519b..4f65e4021c4d 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.c @@ -3370,7 +3370,7 @@ vchiq_dump_shared_state(struct seq_file *f, struct vchiq_state *state, }; int i; - seq_printf(f, " %s: slots %d-%d tx_pos=%x recycle=%x\n", + seq_printf(f, " %s: slots %d-%d tx_pos=0x%x recycle=0x%x\n", label, shared->slot_first, shared->slot_last, shared->tx_pos, shared->slot_queue_recycle); @@ -3386,7 +3386,7 @@ vchiq_dump_shared_state(struct seq_file *f, struct vchiq_state *state, } for (i = 1; i < shared->debug[DEBUG_ENTRIES]; i++) { - seq_printf(f, " DEBUG: %s = %d(%x)\n", + seq_printf(f, " DEBUG: %s = %d(0x%x)\n", debug_names[i], shared->debug[i], shared->debug[i]); } } @@ -3414,7 +3414,7 @@ vchiq_dump_service_state(struct seq_file *f, struct vchiq_service *service) if (service->public_fourcc != VCHIQ_FOURCC_INVALID) scnprintf(remoteport + len2, sizeof(remoteport) - len2, - " (client %x)", service->client_id); + " (client 0x%x)", service->client_id); } else { strscpy(remoteport, "n/a", sizeof(remoteport)); } @@ -3475,7 +3475,7 @@ void vchiq_dump_state(struct seq_file *f, struct vchiq_state *state) seq_printf(f, "State %d: %s\n", state->id, conn_state_names[state->conn_state]); - seq_printf(f, " tx_pos=%x(@%pK), rx_pos=%x(@%pK)\n", + seq_printf(f, " tx_pos=0x%x(@%pK), rx_pos=0x%x(@%pK)\n", state->local->tx_pos, state->tx_data + (state->local_tx_pos & VCHIQ_SLOT_MASK), state->rx_pos, From patchwork Tue Jun 4 17:29:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13685715 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 85423C41513 for ; Tue, 4 Jun 2024 17:30:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Kw70jh/5I9SZPChS+uNyDVyb3PgGzZTlXGyzIsWn6yE=; b=jEwXl2SWerRqWs gnsGq7jx/6oU4pYxRZdssZ+iQJcbcDL5AZ56AebEwHznIIIRQ3h0BZHCC6UVsNljgvKUN9C+aDn4n 00AmNiM4YdGstZDC+ZZS6Pp2WwcaCDZ7dbMWDv+C52uLZLGy7NeTTKyfO289g0EJruVqTkLXYtUzl MruWZX6H6uW5ekYPxu6ERzyXOLEVDbI8aqOim2sHxD8mMTXUKugW0F6gxjZznJpyoJOZZ174CSI03 1s7KSNnnTQ5NE0UK6wBotY1QyZyiPLhBoKyHzE77UIpgPoza45OlynjnnX8lDnYb62/gJJu5dR4aZ M6BCmIZehoIPa323wwWg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyq-00000003IvX-3N77; Tue, 04 Jun 2024 17:29:52 +0000 Received: from mout.gmx.net ([212.227.17.20]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sEXyT-00000003If7-1Gbz for linux-arm-kernel@lists.infradead.org; Tue, 04 Jun 2024 17:29:32 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1717522166; x=1718126966; i=wahrenst@gmx.net; bh=Orjc4i7tUyVoi6f4QE0Sy2YxU1o6Nh1ldyLhIzy/dgA=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-Id:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=TwgjAnc8pkUecVJ9tRD5OnI/1PwyqCQ39Y0vlMcOLhfDApcfI1DApHU0jjeoH46n SWPDQbXSricJoerZL3uHZwC5Zg2+KjmuAaR7qimdMlKRdocQRzF4haTOYPff//zvu Cdhy7djidtmLcteIWU0ZVR4fbc0ETVHP+6zfaqOGqZU03nyVl09EqaAafrC5qJp4k XSlt9qXBABWA3eZMhNUTgoIdQtM9EuVViuvmVVmzBHqOZPu1uZqZiYFIRJa7XQg7g BJqUL8/5jr1lWbJ39mXmZPQPj4n4hkI1kJDlLYW7j2op596qyVWlq/L2fw/ZJAT3U Xpae86IoyJvRFfFQBw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx104 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N2V4J-1sauPB1FNf-010Lsw; Tue, 04 Jun 2024 19:29:26 +0200 From: Stefan Wahren To: Greg Kroah-Hartman , Florian Fainelli Cc: Umang Jain , Laurent Pinchart , linux-staging@lists.linux.dev, linux-arm-kernel@lists.infradead.org, Stefan Wahren Subject: [PATCH 11/11] staging: vc04_services: Update testing instructions Date: Tue, 4 Jun 2024 19:29:04 +0200 Message-Id: <20240604172904.61613-12-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240604172904.61613-1-wahrenst@gmx.net> References: <20240604172904.61613-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:pUnMKi9W2INB338VLSco5r6Wqsgef9MJOtdssMqJtXuvPTxV+Al pNRzI8zwanmUd+hcg3JxX4Bu5fz6fvp+hoqUOv1Xt/C7nRRCc5k/r7JkLQuDp1faEERT++c azb95ihYqX9bnNs0RupkHkQhvdDbpsPyhJ6dCDViAvQYuiGWxk1GkW8nsCVfyc/5qwALiFF XYle2LSvBALcTaYxaXXcw== UI-OutboundReport: notjunk:1;M01:P0:2BOfyW5LTAE=;0b5RAqeV4D3ufbyzMtCfCtyGw0v sC2ufG7eMT+6dl0sWkvO8B7D88yuhji+IRwHPlNoqcy1vr58vKp103VyI7W+3aBflYjxp7lvr +jg2gQYT1vm4Nef2aSWD1owpp6mXftU7tmYSOokFNZgR5i2OVofytC9Oh6+fqEh0xTyiRBcVx 5Mn+P0KxUedM9hKhpuliD7JpJSwMIWjOcgXt5PsHZ88Ky/kQk2KUuFrq5QfIQ/kb7RptrTviT 0OnsPCauIM7qCBNWRC9PVbUcikLyPCzq1xPdYi8hy09ipdWCHYqoTglewis/pSW+qX+tT3UVx LziSNPgs+xNHwB/DwKL1PCg65YnnQmhRYObHCKe+mRt5zwZJfEy69nHE5GRroU+7EtzQZO2BU gZ68i5G6QE6wbmEtxb8FnSm+PPjh+zs9AhU6lMGcOt28XNrQSdWbeFLV3nCX0KR5RL+WecxXK dXU2rdG5hn6stQ1prf1CON0Vv3BkRpSgfOhGDTl6LJWvRr8vAWnTnUxdktjbxeK9e/fn6nYeo h030Hy9UE8d9wfqJ9Qu5WDmILjhFz/R7RNyIHYghIyLFra37afQLo4I/kePA7TCwag3/6tTcI 00bJ3ENcnmORRSuKIS1cCnRQ6pSjPWKKin7FcXcqbchMKoP/ZE9WYgh5gv8b34XN1wmsYLtyX 8FxTHlaahpyh0UwNpVFdqpzzaao4MHZB0VcpE4n9ST1l7QZXX6k3XF3rEbe0HW6hd1UWFfmsl nxjluxxpFjfUj7G/2mAFvEddex6ED46nlgoASlYkztlHH6gmHtGlTMyLYN4t7oYAf1kIrDnLc djdG0/vRScLGDze2OxuZZZRWVxmEHOxPtJQiOmXxR8VEc= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240604_102929_791852_C9A13221 X-CRM114-Status: GOOD ( 10.41 ) 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 Since the initial version of the testing instructions a few things has changed. So consider the latest arm64/defconfig changes and the new debugfs entry. Signed-off-by: Stefan Wahren --- .../staging/vc04_services/interface/TESTING | 45 ++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) -- 2.34.1 diff --git a/drivers/staging/vc04_services/interface/TESTING b/drivers/staging/vc04_services/interface/TESTING index a6d63efcbcb9..273952dc9d85 100644 --- a/drivers/staging/vc04_services/interface/TESTING +++ b/drivers/staging/vc04_services/interface/TESTING @@ -31,7 +31,7 @@ Here are the most common kernel configurations: 3. BCM2837 target SoC (ARM 64 bit) - Use the defconfig as a base and then enable all VCHIQ options. + Use the defconfig which has most of the VCHIQ options enabled. * Scenarios @@ -80,3 +80,46 @@ Here are the most common kernel configurations: vchi ping (size 0, 100 async, 100 oneway) -> infus vchi ping (size 0, 200 async, 0 oneway) -> infus ... + + * Debugfs test + + Command: cat /sys/kernel/debug/vchiq/state + + Example output: + State 0: CONNECTED + tx_pos=0x1e8(@43b0acda), rx_pos=0x170(@05493af8) + Version: 8 (min 3) + Stats: ctrl_tx_count=7, ctrl_rx_count=7, error_count=0 + Slots: 30 available (29 data), 0 recyclable, 0 stalls (0 data) + Platform: 2835 (VC master) + Local: slots 34-64 tx_pos=0x1e8 recycle=0x1f + Slots claimed: + DEBUG: SLOT_HANDLER_COUNT = 20(0x14) + DEBUG: SLOT_HANDLER_LINE = 1937(0x791) + DEBUG: PARSE_LINE = 1864(0x748) + DEBUG: PARSE_HEADER = -249155224(0xf1263168) + DEBUG: PARSE_MSGID = 67362817(0x403e001) + DEBUG: AWAIT_COMPLETION_LINE = 0(0x0) + DEBUG: DEQUEUE_MESSAGE_LINE = 0(0x0) + DEBUG: SERVICE_CALLBACK_LINE = 0(0x0) + DEBUG: MSG_QUEUE_FULL_COUNT = 0(0x0) + DEBUG: COMPLETION_QUEUE_FULL_COUNT = 0(0x0) + Remote: slots 2-32 tx_pos=0x170 recycle=0x1f + Slots claimed: + 2: 10/9 + DEBUG: SLOT_HANDLER_COUNT = 20(0x14) + DEBUG: SLOT_HANDLER_LINE = 1851(0x73b) + DEBUG: PARSE_LINE = 1827(0x723) + DEBUG: PARSE_HEADER = -150330912(0xf70a21e0) + DEBUG: PARSE_MSGID = 67113022(0x400103e) + DEBUG: AWAIT_COMPLETION_LINE = 0(0x0) + DEBUG: DEQUEUE_MESSAGE_LINE = 0(0x0) + DEBUG: SERVICE_CALLBACK_LINE = 0(0x0) + DEBUG: MSG_QUEUE_FULL_COUNT = 0(0x0) + DEBUG: COMPLETION_QUEUE_FULL_COUNT = 0(0x0) + Service 0: LISTENING (ref 1) 'PEEK little-endian (0x4b454550)' remote n/a (msg use 0/3840, slot use 0/15) + Bulk: tx_pending=0 (size 0), rx_pending=0 (size 0) + Ctrl: tx_count=0, tx_bytes=0, rx_count=0, rx_bytes=0 + Bulk: tx_count=0, tx_bytes=0, rx_count=0, rx_bytes=0 + 0 quota stalls, 0 slot stalls, 0 bulk stalls, 0 aborted, 0 errors + instance b511f60b