From patchwork Mon Jun 10 21:02:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692435 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 509BCC27C5F for ; Mon, 10 Jun 2024 21:03:15 +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=HmiRwxrWqJD4RQoKSW+5qkE+OvpyhFW9kjF+fRyJNVQ=; b=XVAT9XUr7d9Lc8 q4eJE+msQwIvKWOFvfC2WxRtMtiY8Tdtw9xjauFzc5LDRkiq9jgBJsqQp+DXjrSXWynDCMa+/gcd1 RVCL4nKY6cExGjabPnTSj/emUUA+2gAMMyprnHBCDU+wzZTK8LaEBlpvP+a4ziJhx+HZkAw8tMQqF SuCQhpvHW0PBm68T3BN4ZHk98bpTzQtcoVhnKitGtMbJ/nBiWGQavHfMbUWM1+g9u2afZj31pOX34 eXNhvqf3zNobwg5rh87/o4GwJ+KRmyD04A1QtOCZviPkyWgr+HXO08SB7JctwoSfzGvfLAaHIk0kX AhZb6n5ArN+0CDIKOgBg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAO-00000006Tw0-08WR; Mon, 10 Jun 2024 21:03:00 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006Tlp-1n4l for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053362; x=1718658162; i=wahrenst@gmx.net; bh=CX0elZU1BOrD+3JnM1h8kBLVGBem/ip5vLma+2ZQpus=; 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=lE7EfIUpWjPKrcwoS2Cu6aFDj4ef/rdaKgQlOsRvfQgKTtkkn+jbaGrj4HQy8+Il jiD5PW7Jr7Tb/dMm0a/UT7jyZCZDbbniJgdFO7qKdY137GxOCZu0DflB6BcTgpUpz D46OBGf50a2bRCiyBJPlLjl1QpYsFkTpVP4l1vYHpotRSK00JP1GjH+VCVHTet1t8 9Dmar2X/XNQVR/OIO0tT1m+y7kr0RqKyoCBow27HdW+fQReSEJRJcjvoA9QVdjqJC lgGgalOfeqKzZUdOgR2K1qzpEVKM1FDyVf7MNH2ayR+lDmalz2zvjgza673cLnX/a rf86BD6ZtT7bNkgPnA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MTzf6-1rpj5H3XWs-00OH5w; Mon, 10 Jun 2024 23:02:41 +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 V2 01/10] staging: vchiq_arm: Unify return code variable Date: Mon, 10 Jun 2024 23:02:11 +0200 Message-Id: <20240610210220.95524-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:geLROGqz9EK4LFNdfD9gOq9Of66dYum1RMMTY+lNGEWfakarZ+v 86K4LwQDc7hvrmDKoQ7owHr/YR3IGu6J3f7bi2MA8U1LaGJr8cKvDMcvtrehz9jYFMblCLf W7kJ4LScxVKse+cHgIwxCAI3D2kCwCkDYdUCdnBLDxuCvPQA+NVN0DlyMYyNjARIpB114U9 4WPXkiG1iESbxRNnhJsxw== UI-OutboundReport: notjunk:1;M01:P0:ROW5y6iz2/Y=;6TqedBrg3U3cFVRV/4OXaSm3vox qxDgCLy6L2IPfrldR38ED0jOmKnZWfoOkAMFRF+yqgSJS2LSi6IAV0HXXPRUrFGZw05mvloP1 oiQpFtbMzvEXieEDady4YdLUscz9O/GYyNAZ+H9UG52N+4z61VT8iySlmtBrPTSIlC8O44j0C nAvFCweapUso4YWkjU4+41uiOjXyIFJVOtvEeYHAqb7+qwY8/roiJpdyau2KjG42WDs+i+Hcb WItOYHGf+F81thCHbEczUblnrEn3vgOnIZpG+5KcYRvWjgQJd17Mx0h9pypPuG++4yosgZk8C I8lLoI9Cx45Q66a+4HPhMP56URIoiIQtNVOPfrwzhSVgVa+bSabdxEvW3EVDSQMReEaJ5wOup q2OrSq9IYN8PJprAyoo2hFMdZpRQB8IlisDP1b9x7omBGUjnp0+RWIYXEQCHV7l2e2w7V7lei AN0GRZOTZchwXkuSFot1JBiF9CDAuGWjDbuayQYAu0DbU3VFk1jeQsYGZfv7sryBr46f2Ps3E oIRxBw/crZ1/iDU0M9fPY26llu1+ghbt4VOjbNr7DXltwdbyFNkd6ElMhIrJRM1SuWij1x6d+ fW2ZaFpQOKp/wA3kSC7rpcJIdnOR78ftAn2FK8u4Otz13JMq2E/6+BUAWhLsMrrkCWYmrHGs0 qlonYxfm06t8pYe3R+jxHYOpRD4N9Mpolk2fNx3ws0c7sFdqpCYlt67R52oymFQ7MO0+jbiVE WLMaKjmdnpscNRo0pN7U83anAS0nT+NPszxQByIgHrgmHiVzsyfj72W10Lt+HY/t0244iSggL IRpQuAYa/vDdcfZw1kh2jj4fzQkGzearaszMUQO3ft3Nk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140247_960411_33EC0BF4 X-CRM114-Status: GOOD ( 17.77 ) 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 file vchiq_arm uses a wild mixture of variable names for return codes. Unify them by using the common name "ret". Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart --- .../interface/vchiq_arm/vchiq_arm.c | 141 +++++++++--------- 1 file changed, 69 insertions(+), 72 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..f3815101e1c4 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -758,8 +758,8 @@ void free_bulk_waiter(struct vchiq_instance *instance) int vchiq_shutdown(struct vchiq_instance *instance) { - int status = 0; struct vchiq_state *state = instance->state; + int ret = 0; if (mutex_lock_killable(&state->mutex)) return -EAGAIN; @@ -769,12 +769,12 @@ int vchiq_shutdown(struct vchiq_instance *instance) mutex_unlock(&state->mutex); - dev_dbg(state->dev, "core: (%p): returning %d\n", instance, status); + dev_dbg(state->dev, "core: (%p): returning %d\n", instance, ret); free_bulk_waiter(instance); kfree(instance); - return status; + return ret; } EXPORT_SYMBOL(vchiq_shutdown); @@ -785,26 +785,26 @@ static int vchiq_is_connected(struct vchiq_instance *instance) int vchiq_connect(struct vchiq_instance *instance) { - int status; struct vchiq_state *state = instance->state; + int ret; if (mutex_lock_killable(&state->mutex)) { dev_dbg(state->dev, "core: call to mutex_lock failed\n"); - status = -EAGAIN; + ret = -EAGAIN; goto failed; } - status = vchiq_connect_internal(state, instance); + ret = vchiq_connect_internal(state, instance); - if (!status) + if (!ret) instance->connected = 1; mutex_unlock(&state->mutex); failed: - dev_dbg(state->dev, "core: (%p): returning %d\n", instance, status); + dev_dbg(state->dev, "core: (%p): returning %d\n", instance, ret); - return status; + return ret; } EXPORT_SYMBOL(vchiq_connect); @@ -813,10 +813,9 @@ vchiq_add_service(struct vchiq_instance *instance, const struct vchiq_service_params_kernel *params, unsigned int *phandle) { - int status; struct vchiq_state *state = instance->state; struct vchiq_service *service = NULL; - int srvstate; + int srvstate, ret; *phandle = VCHIQ_SERVICE_HANDLE_INVALID; @@ -828,14 +827,14 @@ vchiq_add_service(struct vchiq_instance *instance, if (service) { *phandle = service->handle; - status = 0; + ret = 0; } else { - status = -EINVAL; + ret = -EINVAL; } - dev_dbg(state->dev, "core: (%p): returning %d\n", instance, status); + dev_dbg(state->dev, "core: (%p): returning %d\n", instance, ret); - return status; + return ret; } int @@ -843,9 +842,9 @@ vchiq_open_service(struct vchiq_instance *instance, const struct vchiq_service_params_kernel *params, unsigned int *phandle) { - int status = -EINVAL; struct vchiq_state *state = instance->state; struct vchiq_service *service = NULL; + int ret = -EINVAL; *phandle = VCHIQ_SERVICE_HANDLE_INVALID; @@ -856,17 +855,17 @@ vchiq_open_service(struct vchiq_instance *instance, if (service) { *phandle = service->handle; - status = vchiq_open_service_internal(service, current->pid); - if (status) { + ret = vchiq_open_service_internal(service, current->pid); + if (ret) { vchiq_remove_service(instance, service->handle); *phandle = VCHIQ_SERVICE_HANDLE_INVALID; } } failed: - dev_dbg(state->dev, "core: (%p): returning %d\n", instance, status); + dev_dbg(state->dev, "core: (%p): returning %d\n", instance, ret); - return status; + return ret; } EXPORT_SYMBOL(vchiq_open_service); @@ -874,20 +873,20 @@ int vchiq_bulk_transmit(struct vchiq_instance *instance, unsigned int handle, const void *data, unsigned int size, void *userdata, enum vchiq_bulk_mode mode) { - int status; + int ret; while (1) { switch (mode) { case VCHIQ_BULK_MODE_NOCALLBACK: case VCHIQ_BULK_MODE_CALLBACK: - status = vchiq_bulk_transfer(instance, handle, - (void *)data, NULL, - size, userdata, mode, - VCHIQ_BULK_TRANSMIT); + ret = vchiq_bulk_transfer(instance, handle, + (void *)data, NULL, + size, userdata, mode, + VCHIQ_BULK_TRANSMIT); break; case VCHIQ_BULK_MODE_BLOCKING: - status = vchiq_blocking_bulk_transfer(instance, handle, (void *)data, size, - VCHIQ_BULK_TRANSMIT); + ret = vchiq_blocking_bulk_transfer(instance, handle, (void *)data, size, + VCHIQ_BULK_TRANSMIT); break; default: return -EINVAL; @@ -898,13 +897,13 @@ vchiq_bulk_transmit(struct vchiq_instance *instance, unsigned int handle, const * to implement a retry mechanism since this function is * supposed to block until queued */ - if (status != -EAGAIN) + if (ret != -EAGAIN) break; msleep(1); } - return status; + return ret; } EXPORT_SYMBOL(vchiq_bulk_transmit); @@ -912,19 +911,19 @@ int vchiq_bulk_receive(struct vchiq_instance *instance, unsigned int handle, void *data, unsigned int size, void *userdata, enum vchiq_bulk_mode mode) { - int status; + int ret; while (1) { switch (mode) { case VCHIQ_BULK_MODE_NOCALLBACK: case VCHIQ_BULK_MODE_CALLBACK: - status = vchiq_bulk_transfer(instance, handle, data, NULL, - size, userdata, - mode, VCHIQ_BULK_RECEIVE); + ret = vchiq_bulk_transfer(instance, handle, data, NULL, + size, userdata, + mode, VCHIQ_BULK_RECEIVE); break; case VCHIQ_BULK_MODE_BLOCKING: - status = vchiq_blocking_bulk_transfer(instance, handle, (void *)data, size, - VCHIQ_BULK_RECEIVE); + ret = vchiq_blocking_bulk_transfer(instance, handle, (void *)data, size, + VCHIQ_BULK_RECEIVE); break; default: return -EINVAL; @@ -935,13 +934,13 @@ int vchiq_bulk_receive(struct vchiq_instance *instance, unsigned int handle, * to implement a retry mechanism since this function is * supposed to block until queued */ - if (status != -EAGAIN) + if (ret != -EAGAIN) break; msleep(1); } - return status; + return ret; } EXPORT_SYMBOL(vchiq_bulk_receive); @@ -950,8 +949,8 @@ vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handl unsigned int size, enum vchiq_bulk_dir dir) { struct vchiq_service *service; - int status; struct bulk_waiter_node *waiter = NULL, *iter; + int ret; service = find_service_by_handle(instance, handle); if (!service) @@ -991,10 +990,10 @@ vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handl return -ENOMEM; } - status = vchiq_bulk_transfer(instance, handle, data, NULL, size, - &waiter->bulk_waiter, - VCHIQ_BULK_MODE_BLOCKING, dir); - if ((status != -EAGAIN) || fatal_signal_pending(current) || !waiter->bulk_waiter.bulk) { + ret = vchiq_bulk_transfer(instance, handle, data, NULL, size, + &waiter->bulk_waiter, + VCHIQ_BULK_MODE_BLOCKING, dir); + if ((ret != -EAGAIN) || fatal_signal_pending(current) || !waiter->bulk_waiter.bulk) { struct vchiq_bulk *bulk = waiter->bulk_waiter.bulk; if (bulk) { @@ -1013,7 +1012,7 @@ vchiq_blocking_bulk_transfer(struct vchiq_instance *instance, unsigned int handl waiter, current->pid); } - return status; + return ret; } static int @@ -1137,17 +1136,17 @@ service_callback(struct vchiq_instance *instance, enum vchiq_reason reason, */ if ((user_service->message_available_pos - instance->completion_remove) < 0) { - int status; + int ret; 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) { + ret = add_completion(instance, reason, NULL, user_service, + bulk_userdata); + if (ret) { DEBUG_TRACE(SERVICE_CALLBACK_LINE); vchiq_service_put(service); - return status; + return ret; } } @@ -1294,8 +1293,6 @@ vchiq_keepalive_thread_func(void *v) { struct vchiq_state *state = (struct vchiq_state *)v; struct vchiq_arm_state *arm_state = vchiq_platform_get_arm_state(state); - - int status; struct vchiq_instance *instance; unsigned int ka_handle; int ret; @@ -1313,16 +1310,16 @@ vchiq_keepalive_thread_func(void *v) goto exit; } - status = vchiq_connect(instance); - if (status) { - dev_err(state->dev, "suspend: %s: vchiq_connect failed %d\n", __func__, status); + ret = vchiq_connect(instance); + if (ret) { + dev_err(state->dev, "suspend: %s: vchiq_connect failed %d\n", __func__, ret); goto shutdown; } - status = vchiq_add_service(instance, ¶ms, &ka_handle); - if (status) { + ret = vchiq_add_service(instance, ¶ms, &ka_handle); + if (ret) { dev_err(state->dev, "suspend: %s: vchiq_open_service failed %d\n", - __func__, status); + __func__, ret); goto shutdown; } @@ -1348,17 +1345,17 @@ vchiq_keepalive_thread_func(void *v) */ while (uc--) { atomic_inc(&arm_state->ka_use_ack_count); - status = vchiq_use_service(instance, ka_handle); - if (status) { + ret = vchiq_use_service(instance, ka_handle); + if (ret) { dev_err(state->dev, "suspend: %s: vchiq_use_service error %d\n", - __func__, status); + __func__, ret); } } while (rc--) { - status = vchiq_release_service(instance, ka_handle); - if (status) { + ret = vchiq_release_service(instance, ka_handle); + if (ret) { dev_err(state->dev, "suspend: %s: vchiq_release_service error %d\n", - __func__, status); + __func__, ret); } } } @@ -1408,13 +1405,13 @@ vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, write_unlock_bh(&arm_state->susp_res_lock); if (!ret) { - int status = 0; + int ret = 0; long ack_cnt = atomic_xchg(&arm_state->ka_use_ack_count, 0); - while (ack_cnt && !status) { + while (ack_cnt && !ret) { /* Send the use notify to videocore */ - status = vchiq_send_remote_use_active(state); - if (!status) + ret = vchiq_send_remote_use_active(state); + if (!ret) ack_cnt--; else atomic_add(ack_cnt, &arm_state->ka_use_ack_count); @@ -1730,7 +1727,7 @@ static int vchiq_probe(struct platform_device *pdev) struct device_node *fw_node; const struct vchiq_platform_info *info; struct vchiq_drv_mgmt *mgmt; - int err; + int ret; info = of_device_get_match_data(&pdev->dev); if (!info) @@ -1755,8 +1752,8 @@ static int vchiq_probe(struct platform_device *pdev) mgmt->info = info; platform_set_drvdata(pdev, mgmt); - err = vchiq_platform_init(pdev, &mgmt->state); - if (err) + ret = vchiq_platform_init(pdev, &mgmt->state); + if (ret) goto failed_platform_init; vchiq_debugfs_init(&mgmt->state); @@ -1768,8 +1765,8 @@ static int vchiq_probe(struct platform_device *pdev) * Simply exit on error since the function handles cleanup in * cases of failure. */ - err = vchiq_register_chrdev(&pdev->dev); - if (err) { + ret = vchiq_register_chrdev(&pdev->dev); + if (ret) { dev_err(&pdev->dev, "arm: Failed to initialize vchiq cdev\n"); goto error_exit; } @@ -1782,7 +1779,7 @@ static int vchiq_probe(struct platform_device *pdev) failed_platform_init: dev_err(&pdev->dev, "arm: Could not initialize vchiq platform\n"); error_exit: - return err; + return ret; } static void vchiq_remove(struct platform_device *pdev) From patchwork Mon Jun 10 21:02:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692439 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 9E235C27C55 for ; Mon, 10 Jun 2024 21:03:24 +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=barTC5KN5RSVR1NWgcKvjkkOPME6kX/0ApVwtqURd/k=; b=oCPuibM/focIuv sAiDAELLusWufVxGvjbnMnD/JxclUd55krxlXZj1Gm+ZDA5bcNcOe4cCvxIDpn2gwdkfyYScHSr3y yW+aAUJviz97G0yPx9348FH7zt2w6pBzIq/Rq4DdpJhpxEOLYMP/DrJ8c+uiOSKdPRvOVBhCPZrGo HxfkD+63pbUidImTiefY8lkxOmpZwE1wwEpvvvg/zI8hokMAW/q3U2F7mxapaa64bzjbxOsJd5Pe6 kKA1gYq0OGO/B6X/2dz5gAIgznwvt0qzqN0NwU5KoBS5QkjpH/CRfJBsSD9GqEHsX8Clzj1vSSd2x O+qZMM7G3GmSGni/ZgGg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAZ-00000006U3V-1BqS; Mon, 10 Jun 2024 21:03:11 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006Tm1-1orc for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053362; x=1718658162; i=wahrenst@gmx.net; bh=7q8HbYwAcDjZpLq+HqBScyCmUIe2XBV25YY5hn+VnG8=; 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=X5R+Vy5lapZtjRaSGR5b2g+jinJqSQPaAR1T+s6syYhWYR/+GYbeaHs8+zw1CsnW M30AH2OoRNnFwL/TO22PPB6kpSvW8X5dBpj/MrKjFAiz2cljYOJyG4rz6qCXQSTZU LgPJkgijVhr8XG6SDBk8tmvKhIBLFfkQO45kNegnCqQeB1Sz7HqgWoP9hymwEjrX3 2zyqEpKr+AKIgSG07oU1UWJw7ydU3rZwx6IrNep6gFCKnVRfdgajEJYdu97wK7Whz AnVvajWAk886+oSdSIw84pop4nC7Ms7qFaaHH8nwxoarcZc/U1Tp6vFqBK2d5cmf8 js7bWMo2qIxB3PaKdw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MNbkv-1s4tNR0lVT-00QoBh; Mon, 10 Jun 2024 23:02:42 +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 V2 02/10] staging: vchiq_arm: Drop obsolete comment Date: Mon, 10 Jun 2024 23:02:12 +0200 Message-Id: <20240610210220.95524-3-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:UTKrEXKfXQdb+d12EIblwVKA1mOfnQqcLQ9KzwvViAZX7QkUt4j QZ1s295lswb0oTEeWnmekhwv7SpWcYEL1hnbxiIHVUx//u2XMbNpYgswx9QhXJ3hhA9herq AVkn1JXMESRu1nWQcrc9a0XYy7JjQBA2MXihP62KJE6tiDb49pEggbxe2BdpL5eNcmmFct9 3eBfqqssrBBBLF+5O21EQ== UI-OutboundReport: notjunk:1;M01:P0:uIJb8c2uGqE=;6cOpXyrOb4YDWL8nPvXqrU1RCr5 VV5ZeuUU4Dpg4IHBf0n43O9je9qERsb3abZtEFdzI2cjDsmo+YHeFCQhQkeh5lss+eZg7qrKb 0l2WkTv8t4lu0UwG4RIV5NN5ehNje5qEMIXWDJcGmaOxnOd/n7HE2GhBktp7i0qt1v9pyrkUx WzGlXu4aqZ+Hjq1c23nxWmfY5s6DmPR0f9oTN8Brx8ykUgo0J+oMy0tmgoM6+9IGtS8evWADZ NRlJ7zkhqJX0GWIXiIMJyj3ZG6DBgCwzoEuvyrLv1TqTgmWSz3hNwrqZv3YipC1PsUrWC0EdU APhJLcXsNVYMBZCgUa0OQh5BoR0zC5CP2Ahm9c9GHJmjlKLoJGZ4Uur83q0if7ii0DQB70cGD kK7qUwGHMsA9h+lSRQF/Ziw691YisbpOsfXuqwS6ZdrOIDQeOkkOG9fWL54+Sd5mvw4PTjdI8 o1RBciaSKRdag4MO/459OsQvXeg6oNdxx8LQEl3kVvR5rv6jKDhe7ycAtwJXwL6FGNMwue2yZ 1HeI9qR4N7YyD0na3GC2Y92wtQYT1s3XKRk2r5ttxvTURXluvpPrT25xmxcEskU4rNymVl9sZ /n4y58HBB3H//H93IrTKR0YqRQoB82ah49LjQLHWSMtuls4o0n5wlQ+X7EQJDzNAT8TyzTn2c UKoP1ZbLqhsx8gmPgTE5vpt1j7pvSA62x64XTWu4LKcideBFJ0J4u1pwrpTyVzXw2W+6Pq4bm ELfdtpqVpyt13+GtvsCk84nSDVyqC1VhSWUx89Fe5x93z0zTbsesjqWQJnQCbff9BvnCo3dYY XPOo+RxjYOSEmttlrYB/axCMGdDxD8Ia249ojuhZXz2Bc= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140248_280129_F345ED9F X-CRM114-Status: UNSURE ( 9.55 ) 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 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 f3815101e1c4..094ba1aea8f6 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1448,7 +1448,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 Mon Jun 10 21:02:13 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692440 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 9A654C27C55 for ; Mon, 10 Jun 2024 21:03:33 +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=AoXon8kuDRu/ULZCo4tPCTY+HHY0kKB9XijO//2kRmI=; b=Wuf7VUPpG/CsTR NjXpQa+r9Lwklem+8Lp76uEQ+wLIM3DYmOs2NyWtOZwhQ2+2pt4Hjo9XGT35pLDHhDyKlYcqcE7ri 1S3TcTa0OT8ccC6bUIPhnShJhhmEszTB8u9Y0YYCimzNoZ3TtSatMC962ZWHDcwPnNHewk3RWkJwd No9TTJqfO/NvlHLWYTZEXQA/Rf7dKueDVfu2MlcdN+YgqNjHPfO6dsH/YDjCx6LXrhroTv/bxPqVN IaSOHOHbFph4fDoxWf9q2F80MaIoSPQHM0QSGPcbm+vFOu1TkpEf9dZyBdagkuBMmCcYGXmey+pxc q1PrVoTmxNz/DYbWQXyg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAd-00000006U6p-3L8N; Mon, 10 Jun 2024 21:03:17 +0000 Received: from mout.gmx.net ([212.227.15.19]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006TmG-1oju for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053362; x=1718658162; i=wahrenst@gmx.net; bh=7VFCSssTtDO9xPluI9MgXHm4u5tAO4VmwCyLKgp0fVg=; 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=okinB0J6qTxtzLlAWf6hBGZg6WBLQ8V2aWnnObjLSLoSfafaI4+V7t4679rdpiSr GMrc20M028YLgQqicy4NGG3dPaU53043saTGhm31Qp8Nlkg3zhT/NkGeHboGx6CRI UBKqnDA23eUwCmiVfqOBuLEQGMjTc0YWUmElQJXeOZqyO7Ooz5gfR0XD9eaTpbfft h5UAlcWtf19O7/IG5z7LHgg1y4yD6LgbclyjNAIgzTJJoLn5B2jk78Tv8UUOH0WWb tw9r9nI1TZwUS12OlO1inN7C0mfOLQEJ+SqujSngKGuv1Kc30KzXtylfq4RzsBd2f To+Iu0TzS+ewUxRbzQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MF3He-1sEYA628PQ-000a4c; Mon, 10 Jun 2024 23:02:42 +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 V2 03/10] staging: vchiq_core: Drop non-functional struct members Date: Mon, 10 Jun 2024 23:02:13 +0200 Message-Id: <20240610210220.95524-4-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:gw7OvOhS4diir/o5m0oPbmDYNpBA4Iajuo+XcZ6xPzqpcZ9EZT5 p6LyaqMoYHR+oY7VbxzyiXCVL861HOgHHSVqvBTwQ/MoEJZ9+PNdOypJ2UAGsRWaWTx0tRO 9yA81mhI9gMAbQAijKBvrP+/u7qzYz+WVnzcUcjxHl/9gi6pFIsBKIW78+nUDp1uixphQzB uJKV0qfeaxwb/c5imFPow== UI-OutboundReport: notjunk:1;M01:P0:Spd8uZmX7HQ=;WomSKYpAWGv1dxvXf3x7L4roMBu Z4Ynk+Eiw7Pwc5AcIMnvq2hcCdAjjs9VXrsKnxXgwZwHS8CDEOqQ5SGHvH+n0Zjy1yTUhHxmo C9JmdfrywZCpB0e0DZEv6TWMznmgK/3z2+ScWW6038euYEDDBgqCdUfO68vQ56qw42SuOD5Md oyc6sr0kvZbcWBLGXcb9JptAEQwwuW+wSf8PnP91Q61orTY5YqFZ1/WQwrqX9F2KV+8ocoPp/ ceYvGBY8xNXFUuzI3pEkIORSUYDwSHFk7TRmRZshOEFnQKbg3ZEa3g7cwNNBvlkS3kfUFNlXK F05w9bYNMhYJtekxtcnl7fLmRRephyoM7Uh1b6MrYZrBX/rgZknMl7ohkl9OeJ1EldxPEeKuR 7O5aLI/lpSDXZvfRBG6GcNymA4g9xqOGqE2Nr0G+A0Vm0kIzYupgjpBTVtB5hQl7w6sa0F8IN xp8dqzb72tc00gNqQ8yDnXHklX45wTta0GSXRXMoevGrajWLpujI/UVXVV2zE0JlxBBh1WaQI B8ia/1r2vzqa4X0BLAJgFTgO2q/Y6OhfOmMWVxpQ7MCEVzWn2Yj+QEMyJMlewWlWluif70tzM RauN9cifSRB3Tj6wqZEXM467H8efXgF0QFr350dfgkpbIZaNITaV66/hVJdRQG2tmo0dOs0sz vc/ibTVJDCLzhINN0+kD7bugQ/fm0bsDY1R7csflMHZBCUJEihA9AgOodTt/oY6iFFQfw7obF HvXikGeKsy+6sn8zMZE5vZx58aPTil7nSOF3vV6ZY7fLHGsqNtaSSj6MkbZGHT/6UzFeGnRJ4 7CUzggz98HHFlBqjVVZVzgtbI14VyVN+ElyYQ1O+DEEOg= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140248_299320_2D1DB695 X-CRM114-Status: GOOD ( 10.44 ) 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 Mon Jun 10 21:02:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692436 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 CF493C27C55 for ; Mon, 10 Jun 2024 21:03:17 +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=s8PjEvLKsMIoDCH/C3rfstC43Q/PG0Ii+zH/CeRNssE=; b=cG8J9cLh8u2IGL eDykg5RQ5McoWsFREA6PyH+HfOJ/D0eLLw3NjLM1Ri9HwsKlrFYOnePxQ2dyeGTmHFgSQc/8SGCtW bZM1khJBa0N2EtHtl4ey5FV4MbCMjlIo0AIbJoVy+5F2wlUOkDcQJp5gGDYR/5nX52eTZnG3xZNEY ttywpU6ZEyGkCiJJwK/VRfjiHTnypXYRjhAcfjm8v1hlPaH3v4oVtuMYUEGZfQ6HQXl3f41mpI80O IBxJNH6yum1Mw3j9wRBcGXqxEv5FY6V+m1AgXAlw3dCSuSrAxhBwTDNBttxjd+MuILnvKqecj9KGi 4rNZJr3arkBFGmP6Vegw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAR-00000006Ty2-28ZX; Mon, 10 Jun 2024 21:03:03 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006TmA-1obk for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053363; x=1718658163; i=wahrenst@gmx.net; bh=RIZLK4Mq6tf/0k1hA0SAyjoUPxlZbtYJq1exf8ZpY+M=; 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=Q5ELSIzesj9XN/my8QD2PGUJOUpDBp3cLEBQmtAgy6oYpZi3S/mxWKBAGhuyVB6R dZq7Pw5nUrdZGt453Naen3EGU3aozxQyqT/s9KRmp5mbNOzgQrnd3xtbt9pNrcm/Z 3KQVU7wwcAJd3e7fMl1b++h3RlawLKtJ85PkG7LNXPeRbwzc8jStFHLDXRCTfW9qI rFFBtN4BbZ+XCxoS40OmXY/aVxwt0dJ3xNFxvCw4LV35VRL77FGJkeobt+288Jg0M lbQ+T1OrZAQ8S/FQumnyOjhz6hpjtysBDelVip1odBTkO/XMViLl4nYOq548fk/TX i7oJxeVUVXmRp1bUTg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MBUmD-1s8DJF3Jb5-005mjx; Mon, 10 Jun 2024 23:02:42 +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 V2 04/10] staging: vchiq_arm: Drop unnecessary declarations Date: Mon, 10 Jun 2024 23:02:14 +0200 Message-Id: <20240610210220.95524-5-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:c9mHqwgPaF2/adxzfeyM4WwC9J3jHXOEVGEILGXs42V20UP3NHP IMiVI3QahObV4kZxr3Z2FETtpn19k0OLPMJacGe08YBbnJvd9/+1Yh3nu6/DKfu2bzAlg06 FtvJbs6XTD1OBd6swcQCeKM8ZYuuh5rMFwW1IncTJiVXH9kziYZimuX2drklEMENnDQpjjF ccU2/gWJpLBky8SCDi5VQ== UI-OutboundReport: notjunk:1;M01:P0:iYr/5F7vlU0=;F1/+lN0DDzFimFx46/nTmIiY7El qNsyY9TEW1744MhDoF+PAneawD/SfOXZLIcL/7Zh9AdIZxlPwm+WLTNjFBrjsbxf870VxhoUm VyAmPrLHpf7lXC4bykgI2D4hITgloStNlSSRcyBDTbeZAYKdg+3rrzaUwIePQlBNwURBF+lL4 Xp+J1JZzXBiZ0HLsyizLOQGZQLkHsSCcyD8VrtVi2S0bHSfRBkzVJf0ZM+wOwWs/wp/zIXweL bRUMDOA7m1iXMGkxBeW5RoWMKEz3tOQGX7rHJEwfHTKBER6hKUVT1rdaCy1+/MkUWk4UIuQIe FaX2LCz7D2DdAUiLQI9BfYa1Hl3l4e//3SNuhUMWzjhKwt8GXmt8MysRUOKQtBAG0DjYVPnRA NThtSh2GVOqu/bSeOwEDuP+CvgHT6zD3O0O3wQQcRgJOZmhFTiRgdA+62/U/YQH512IKjV99f nEpvShs6bVMZTR/ZkbjjeRQGA/USr1XzatCbhzFAKfSNS97r2qDGcLnUALMdjtktrK1C7j3sn zL6UTW8v4nJJJ6yHokymAGWC6TDACe5JMTDasOZyeabw5eDjJl43FDxtArfpZCcZ4y7sL2hj9 1lkhQ/1qSyQJBGIhDmpEwlPuxKzNvjN5n6bvTar/39CrxTuf+AKR77gi2rKWJWYze18dcaACy H0puXPN0NP4vJMr+HWIuXCBPFu71SbPESL61HppaMMQ8F/z6uMwZLnjV4igt9+Hn9OkW0OSQv J5R23jdOMrGT3KClj9IjLPZStdBdMFDgn+Ws0xl+/hCC4xWqjLz1QESgKwuTe27e++h2FGWxH l2qiU+0Qou9bfnKhQEL20SBoziKoKxRAJ2/OTHRFfAjfU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140248_202414_BFA0AC4B X-CRM114-Status: UNSURE ( 8.89 ) 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 Mon Jun 10 21:02:15 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692434 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 B5340C27C55 for ; Mon, 10 Jun 2024 21:03: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: 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=02DJt35H80GyyAOtKZx+M9E3Li+OLLfaD8kfDA7yvCg=; b=YmXGyR6mAry488 eEWkwJ6sUumltjDrgQdG+Ch+V4WDMJxSyrBScuRdcAXZQ2Cb+9TPXQuVNHvbFcRPd7MjJfSz011OA sOWskE4Z8ghAZ9HyWxAVRVLBEjRCzj1Cy+ETkKkAiR0w1ARtw0CYeT0IVRwp8mqJEKbMUmSTSvKLi XIlKM9FEXmaFOWNA8rK7+fxVMcDBPolSp3MDsegCTJnInJwSUw3/BSY3/2lIaDlmL4+cI39UZ8yKo 9j3hYZmE/xBfGfj2rxnS+CpqLY9N7s+KfSn+K2h843siwu0kfDwz1hTB25ZGE5esA/2MziWFPVe+p sPqpvMDb9sg5lepB3VjQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAP-00000006Twt-2LcC; Mon, 10 Jun 2024 21:03:01 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006TmD-1oHz for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:51 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053363; x=1718658163; i=wahrenst@gmx.net; bh=t7gpFqb4SdLrYI3z+nSsyk29RTJgE7SHfUpRcltmtsg=; 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=RcXraUxovVTfZ+Eg0pFwTEPS40qXtxjS7EOxzB72K99VuksD56m3Wg98z2pvkXL7 Scc7tgZqe63rw+5pLYDXfpSRCEjazMeP/JMGeQ168hB3OIuhvA214DUBDN8o3LeMX Hya5z4jDceCtlXRYEw2ziMqVj6GfG91dR1B751DAjVrkFoTY8Zd3V1SM9n6RK5mxO /9c8ziSh/iUdxUa9MF15ZsBPH0D9s/pKHbC3RVX6HfzOG9wdtmg6BKNHDMwGy6Hk4 dBiszBcL6gQWA5VIGZkFOheooE3fAcosasf9uTHnPQmAxB5Ru3/I/Uej0J9BkW4uJ bVsj2VquGC01ikF++w== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MYNNo-1ru8vZ0QT4-00JtNE; Mon, 10 Jun 2024 23:02:43 +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 V2 05/10] staging: vchiq_arm: Get the rid off struct vchiq_2835_state Date: Mon, 10 Jun 2024 23:02:15 +0200 Message-Id: <20240610210220.95524-6-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:OrJhS9YN58hIG60M/gX0F7JV+hQ5syPBKWbfb/q9Un9VkhW6oxS OxIUtsERnHD4lSnmjFy2mHna/C5oTdS3OVCDHymJ02hlqZx4L7iuq/4DGePCfVgqIed5kk6 Qw4l4GOtmOZYZyoqjV9M6TuW5v1XulwH2Am0qNuYpYFd5NUhYkOm+rSMNkDurUX5DvxovPh vqEg9SE6cEzwT/PUZfvtQ== UI-OutboundReport: notjunk:1;M01:P0:Em2A8KvPtIA=;v8rmYcm/HzHJTFmA4E2OQQJ1XnF WHi5Ygxf7VGEK88lkX4t8cRZqxWLqHuOwnoEMkvcevtT04W+6gByHvWtKvQmfaUBEuxo4HL26 Pico9GYSvFjocCIq3nVzWurZO/TY2TZd7QbMvPOiFq52D3ZNHLJJj/k1IpI6KBSQct+M9qVCt yVhFmUPCbq6qKlWxxfZwmRpXBh0jK1Z9f5metCPOBTK7t2eul8YEq2Ta9Xt4ypeZZC70yp/TR ecSgfoZGcU22qFr4eDE2L7hSekx6Exstm42C69zkDSDsnUXINxH1FtoVO/9djyYjvRqf/KLqb sqTlFwrtDEx1lw6HrnHy2AkC4ZuY2pFjTrb0NsAIi1KWbixL/+6yviW9WrtTAyg0roaEeH1fJ 2pKLUkVwYClS/i13cd8cZ5+BFKOuQfaLYsDOEOwPIEv0xONaQBwL81VyYpzRB0idB/7Soyik7 bcAhY9kpzgXUjF+gFAv59mdOAE62rFvAUkkZotBKNFDaTEx+i8+c4UnR8x57By7XqSOQPC4FY giSE/oF/3O4w7n5gj2vI5zrWEf2/4IbcGI6QsMS4FvQYPGSHVh9AnX0qdzUih/JZVHRLLlq2j +huMdwKX+fXcD0EQRchSD9Svf5FgW7I+TS/oUTeibPYaBmy3dDRyHh0sVkhsnOQkDb7mi0BfO MuGYbB08JCq2lJ/OSDXnpstPM/BKoFDUJshA5Pf5NNf2MIbhcfY+nLMoAGukX8rvYY0cIYYuV 2d3mgQc7w0RHd7puua13MyG6BHg2QkKuxCxCmpeOEIf9p9qN1MPx9Cjz5uMSVYYlKMdK3KZS7 0vkboEMPLBxMhMnq3YdVwMMnVTaYkSj9E3Jucbkc8c7vU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140248_089931_0451A0BB X-CRM114-Status: GOOD ( 12.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 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. 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 094ba1aea8f6..6ef4cf702c78 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 Mon Jun 10 21:02:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692433 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 8F62BC27C55 for ; Mon, 10 Jun 2024 21:03:10 +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=RlqTlUHK/o9EVoTK6lRW6Vyq5nxREW2O885acP5NIsM=; b=N7wSbu0gxqExAT okD05T43rCfoj6sqMUIrpYrqLPjGBIGLOD/sTOin9Kbr5w6VEVIGLOud2ITfLyvOCwRlkTr4Ci8yS /85g4YlHQJWE65cDcmbha9Ul7OoLu4DRByH0bz/eqfJJ2ELgm2hPNKIohGf4tsXaGCFv7rluC8a4z 3Z2gdk87L8hhcx+V+nQPJT7/wtaDD8arvRpY3VZLtF/o/mYWXkuh4y/8HWHbz/Bw9VSQdZoK8rbzY ugUVbh6PJj5ZUyOmp9Gqh9kz3CNdNde7psmUtO2QkFEsM8NlMGeI5leoLGL1xrzt94G4MdvhgHVfy n5zTfvXTRuF3oGjX1ZXQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAN-00000006Tv8-0LLS; Mon, 10 Jun 2024 21:02:59 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006TmK-1oAA for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:50 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053363; x=1718658163; i=wahrenst@gmx.net; bh=ar1NLPxF4FZyTBWrDAr+cKjNP/7T4hUOU0PPMGPmEf8=; 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=ll2J9zVlZCgGmXbpbtoe9F6RblFGi+/+3G6KfjXkkGz9sRPUydNY63bYjCGLbF6Q fl1dtgF6R9tK0mXOT0JyHZYFk/tL42scsP15Ylg6bgdIv4NXl4kEnsy5AAfCeGhGx cHamhVg6Qy0BlwenHentdjm2Xa8MDkXk9BZbKNGsTqX+vkponVfPeCRrNbVBYV7RL 30jnJCDh3mxxexFFc44f6x8iq8XuKrm624MrsioV5PTOWP6VQH0yxgXT4FbclYfzJ 3oUMjbPNSs+wrVbRq2+8qNqq/YnHX4fnGczCHGF6aSMeBGSqK+t2iwsxYUfXM95NA Qp7FRW59HIx/79sumQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1McpNo-1spYwr1eew-00om7o; Mon, 10 Jun 2024 23:02:43 +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 V2 06/10] staging: vchiq_arm: Drop vchiq_arm_init_state Date: Mon, 10 Jun 2024 23:02:16 +0200 Message-Id: <20240610210220.95524-7-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:8VtTvGmjyY52zusCmOdbftJqeWV9KvMZBiXUHU9nm5Hp3KM1Kul TDjhkJKsftWxyUrsfPv7EZVTcSeldfW6Vmru3uBPCl9xgU75ftccxN9PEWAOhftV+F7rXxg T4JeMRRrR6KHY0ianRd1iO9n+7SXBEtGA68Cb2wGgCpLuFEQOzOXlJEWk4BnUgsiH7JoGqy e1Gs+FTmZKCpC1KzDDmhQ== UI-OutboundReport: notjunk:1;M01:P0:CCDkiY1a3is=;5ad24nRpgTfEV8OFCfuQwi4W5WJ JmKk6y+hxhFgL0ihZBGbNmW4640EIdj1PXjE5eQFwHgDN0nWsnQ8RubPntr6s75hwwUbarVU5 Y0YueQTzETco85MhrtijyRnl6MRbgOA8263phLWVaoi/4ko3FtiIDUiOCEWE85DwB1NDxe8nJ qOIxnFGOfgkwyTPDQo17dndJBpuXhKRLhygcwA/JwNTzMl7nyhFcbbKVMnnZEKZYnF9VGhNTK eVZI5i04o8E2VwCDhuDyTBdD4tvhE0hXn7d6fO02DCC2M8MSc1AVFVcIKgYE4YR7Gl1GXGxlN aeRmcRD4UIe6kqIsmhn+lRmDZM3wUDlbpJA28GWHuNPpcO5oa02q0tywzF1DxNLl03CbGZarq IvFQchhVsFWLWXGMsZdae5mpqjl35QK8151/yaSJWUXoISBxz5dNxIoz2IstIyTyoaU19O0mz CTGAZhCVKLvgzRT1bjfPbk9mDrDs7+yfMmciQzxC/xlVcEmRR7YusVWuf9TSr8QXoM23Ne7/f Bu3cnjbSbgG4W/dk8nVuIquxwO6uarZhw6Sh8yP8srMRvYmFJNEfAtyQuFgc7cQLr8/XaOXcP Bl8Azn+YTnChXZLKllEr9m+Gux+tL1tGsT9zrrTC6Z1qps0/S2VE6ZMe1m1QkvSkVijF5aSSG jx3ZwHJB1BrO1bk1Saq5NexsU2zeQ41q1CK11BAsfmp9TYLc4YosnnS1qYucuEmWRvfGil0cT 4kPQKJFJAptqeqeJWKu1nRLsGCxECEwLp0tq4QTd0TVrpggfKytabE/TMKeKQoUdkkuHQd/vO VJ5Ox+mrXIt/tMsvqeqK6nBy48CB7lJXOikUF4zuZyEIk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140247_973456_64EE0AE4 X-CRM114-Status: GOOD ( 10.42 ) 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 6ef4cf702c78..0ba52c9d8bc3 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 Mon Jun 10 21:02:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692443 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 8B909C27C5E for ; Mon, 10 Jun 2024 21:03:45 +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=AKk+OCaZGIdGRPhOljdRKsqfNJBlqQAZMXeK1G/Dlcs=; b=uf2ll8k16Fq78H nOkH0zATYzbwYfMELvSOSccF74eZwjN4XHBKgUevv0MiH1qrcxUpaWKZ30NAZdZRtDHGoKkDxex8g zmz2+fb9PbdsuGCld9UD3srBcxZU3sk1MEpfbtRn5Pq3866fptj6O0z3mSDOVjvRQUrr9Rd3gL93W rYf+fR2k2IckqpBMhuq4PUSRyqMZvjOnhkTEloTmcIt0k2IclKOgNqm5qleE/VPLFGBagtNySxYbh ttrctckVs8rw9yQV6IJHQ7qyytkZTow+sibeXjUEjt8/coAAm9zcp3rn9Mnv76/K7SSHUIV7lBprc w96Gn2f2dYuKR0uSbGzw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAt-00000006UIp-3Q5j; Mon, 10 Jun 2024 21:03:31 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAC-00000006Tme-1rUb for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053363; x=1718658163; i=wahrenst@gmx.net; bh=T7//eBxmN7USTV8D4FLEnPWuKhDOM+u9egkPUDbGcOw=; 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=CaVxv85ftsGkhRCF9k/mcpI9dmaRAgZscydX3iu8UtRLBvRFCDxhPO9ez6P+QGZ9 VbaQewLMMl7dICrCl1qoMrwb+scxN0q35NT5Mtv7AhFEQMVQfXdjSPkO+oIqbY64S c08KymBvVseOKCdFeYOjOtPcrDBmms7whal7mEuDTqia+Uou8/MBY+sGXoWFf672J Nxu3rf4YMDQCynpuIAB6gXRN0UXegrmUzXN15wwxzLJaAB7/7U9RAcQSfmPF9iOSH L8LRkcsw1GjNKWGccrtDBXeP30AwYDXu2Z6h77NyZ4LE93OTWADOl9MCmd3xSD5KT zpnrP2C6S23RNROBqQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MowKi-1smF1J2xvK-00aSmu; Mon, 10 Jun 2024 23:02:43 +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 V2 07/10] staging: vchiq_arm: Reduce indentation of service_callback Date: Mon, 10 Jun 2024 23:02:17 +0200 Message-Id: <20240610210220.95524-8-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:5IELyVZF69ncOBP23krFvMXQiE6plIS7FcZFkRWgKh+4YeTdtL3 iRo1vSZ7eGsZtA+KmQbp3jJae4vm343cBSlFSEmH8kSpJ6jGHtW5y3Q/K8ID/chM5TCVt09 6zEy9JvAbvw9xaaV3fh2mOfYdQCX5GyFLmq2Dw9dWXTlrFQvTGG+V+DOqQpzv0SpNhsL+GN XzKKNPfqDAxC2ci5TBqEA== UI-OutboundReport: notjunk:1;M01:P0:A0GmSEpGVqU=;axIg5ICDU53Oo3upXbI80fksFjy gz073sDaPETkIgGdd/1fQ550HtqDUXNpJJOddrxdMoHT9NhL2SaPolQBC5zI0vCFlz6WzDMoE 7f33Z3uma6lXdLvz1TShblLRn4AByoDpFdk1hZTHPPMuT7Mxp+M4npLExHZ4CJYXojLYmflsP zEw78x+hEgNPc2p2gWx9Otid/WonX1Oxyeg3yFlxyoTMULJVk3QvI+0PyvNCrIU1/I5Y2fuot XoR8WWsuuCGzmNP8Fpdri7YokO+uQUpMye/zVb95vMzgMiPxvBZ7KvEspaSI99H20RIxBhTS3 8qBmSC67kkwYa8EeuvUCHJ/+vTGXyB+Dvw0Q28Nx3oJmf/UamEKsE7KxTlUfuCowkI4XQT9gy H3xmvLj7rAZMDw/51JVpFv48k49R0HTN8/qwxbtA9epEfs/v9WwfhExKvbeDPokIPe/jkQiqb TDezeWqGtOJ86PjyXGEihSfe6ZrJeagHFv648W+jEMnOZun+WRrh8bPCfIFIxWcIunDL8ZgnN 9ebDYZnsWIPidRoBCkD8/Z1kK85raZZekt0Njm7/9lTI/o7MdNKtucmf+Owri7Juzi1LZo2Ev oOOWZd2jUSlhWJ7ZgpfBGE6izUfooNmjN9/+nGbB2i9jkKTxEC+UIXo5zmxYkVMPBtq5C3sdC Xumyzg13ejQsayaHslcohgz6nem9hrX1z4ywxxXtlPssYqeHkCXFSPkrL6XqgdasR1ry7F71o ZwtE1w4/3gvHQkVu/nrJiQWrBEtDni6SDShDYELBiVC4N1m1InK4v18Fdb2zI4OPLZRff1aVE Gz+INu+dbU9qvv56kzCZ/WjAlhsa0F2s7i9tNJByW9a4Q= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140249_090179_9A34F740 X-CRM114-Status: GOOD ( 15.14 ) 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 splitting the code in a new function service_single_message() as suggested by Laurent Pinchart. Signed-off-by: Stefan Wahren --- .../interface/vchiq_arm/vchiq_arm.c | 68 +++++++++++-------- 1 file changed, 39 insertions(+), 29 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 0ba52c9d8bc3..706bfc7a0b90 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -1055,6 +1055,39 @@ add_completion(struct vchiq_instance *instance, enum vchiq_reason reason, return 0; } +static int +service_single_message(struct vchiq_instance *instance, + enum vchiq_reason reason, + struct vchiq_service *service, void *bulk_userdata) +{ + struct user_service *user_service; + + user_service = (struct user_service *)service->base.userdata; + + 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) { + dev_dbg(instance->state->dev, + "arm: Inserting extra MESSAGE_AVAILABLE\n"); + return add_completion(instance, reason, NULL, user_service, + bulk_userdata); + } + + if (wait_for_completion_interruptible(&user_service->remove_event)) { + dev_dbg(instance->state->dev, "arm: interrupted\n"); + return -EAGAIN; + } else if (instance->closing) { + dev_dbg(instance->state->dev, "arm: closing\n"); + return -EINVAL; + } + + return 0; +} + int service_callback(struct vchiq_instance *instance, enum vchiq_reason reason, struct vchiq_header *header, unsigned int handle, void *bulk_userdata) @@ -1104,41 +1137,18 @@ service_callback(struct vchiq_instance *instance, enum vchiq_reason reason, spin_lock(&service->state->msg_queue_spinlock); while (user_service->msg_insert == (user_service->msg_remove + MSG_QUEUE_SIZE)) { + int ret; + 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 ret; - - dev_dbg(instance->state->dev, - "arm: Inserting extra MESSAGE_AVAILABLE\n"); - DEBUG_TRACE(SERVICE_CALLBACK_LINE); - ret = add_completion(instance, reason, NULL, user_service, - bulk_userdata); - if (ret) { - DEBUG_TRACE(SERVICE_CALLBACK_LINE); - vchiq_service_put(service); - return ret; - } - } - 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"); + ret = service_single_message(instance, reason, + service, bulk_userdata); + if (ret) { DEBUG_TRACE(SERVICE_CALLBACK_LINE); vchiq_service_put(service); - return -EINVAL; + return ret; } DEBUG_TRACE(SERVICE_CALLBACK_LINE); spin_lock(&service->state->msg_queue_spinlock); From patchwork Mon Jun 10 21:02:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692437 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 03189C27C65 for ; Mon, 10 Jun 2024 21:03:18 +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=BkDAX0Iyp45+4lwjOJDr4gQ0WnijnqYrNrmC7HD2Y7s=; b=iUjzuE4Z80RLze SFdRU6sy9BA18LI2Y7R/2D+I/BAuxMN+woGjjoWQmpkUdtz87L2SxWMWvaewGivYXYp56ZvMkbBxv GdkhfttLXRyMQB2R8vHORnbdTKlnxKEotIPYbGntPv6GhMWhM3FXnOPNBhV9HArz3VD/xf7uHaJMN OFaePrjpJBVEuQTqQRDB44HfIsU61vsBHs1HZwSva9jRT0Y/cbJWXosIA63JFlReUhyz2aIz07EW3 Dq0iT2oJJXY3uoQrdlNKac+7/ekLTWRXwfc4cQwjrRz8nVLmYmCpzuKDMslB6Sug2hSbbNIRYA7Ue 55ex4ugdG3p2auiuq4Ag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAS-00000006TzL-3e3l; Mon, 10 Jun 2024 21:03:04 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006TmX-1o1z for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053364; x=1718658164; i=wahrenst@gmx.net; bh=uX+rS5G3W7Xd5WyDA9MnftLeq1vdmexAme+rSO6wfwE=; 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=CiMaZlggEI1ID+F1arwj5TyrGB7YeHeyhxkCW+/91fyAO3RjDsDl5b475vUTGhRQ AMFikK1yFDEIdJA7nfkuvmhYIPs2gfnLruetghxLVCkJ4NNqpkvh2JTFbsB9ahoUg zbvwv+hSb992LJ6N1r3uruFJ2/wA8aldd2tk1ixBMsSxCZwcx/L6N+cRVJte4Q20F 4CzhVbDFhzZFjciD/bZecbjTXt98OKCt7ybndP0oAOx47u/mJb/wDGzr51H+loZao pzEDgS5NNPdgmCXPRfURI6tCO8XPzdTeUQpk61O/yQr8QwwEZvbx+iD5F5LjsU5Cu AjmbOfoIVXbJzSIKxA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MhU5R-1sthg703dL-00kfO1; Mon, 10 Jun 2024 23:02:44 +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 V2 08/10] staging: vchiq_core: Add hex prefix to debugfs output Date: Mon, 10 Jun 2024 23:02:18 +0200 Message-Id: <20240610210220.95524-9-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:7B7vRjXXi/8U92n6c0z2aO25TjW1C9858voYxu2gVzM30RHzC20 Dzk8X3juqyZMCCyvVjdeea5kNbMQOiBfSWP+IAdoaL+Whd37siozPflMYO/W/JFE5rlI/nJ y1Qma2UKMRl03cFJqrtP1dOs7bOHgRNet8NECRwrTilnctdULjgukph39Glh6cw0uMLB9oF 4htsNVA0mdQ9xPuyNHCHw== UI-OutboundReport: notjunk:1;M01:P0:IfE+h6N/QFo=;5gG5hzUNDBciy4YaMOff3u73qzC 6W/TRDM4CIaqVCvlo3CgOS22lXenRAEstkqGzZr3rde7Y8sjS300XbNitSlblgadBjH3NnP2c aTluQzcQlXTjX1BpL3hDXzsxVPCZ4QF4DE7kDE5RgUxHZ4FEUc4QPpWDtpLFXbVkbqYGrSB/H REm91n6iqRx/+EPeYqDXnW7K2zWqIWVV71V3W7kYD7ZzQa3VnoSJMBDWFr94gv7+CzzbOp5Z5 GmDDdxyoOJaZs2+FkMLZW4fiUxNCLsu8/V6GQ4UB/oTUEmnJrtWym8An0LsgJd+g5DvCmLuIg MJ1ooDR3/1kwdJYTXMA3dhZAZlKxpbPV3e4xyW6zGYbHp2sX8nF9nSBt+2q48imwm6k88Cwvc V5aRECtzrwTQlAFQHW/wXGRP5apmMz+NrG9+jErO9958HyEJCY8YPlB1Sh9TethqR7iPHl0LE 53JqJKcjMSOqg5Llw3zv8LNUzRD6tS2vLTRdJXexYkcr2WtLMpOZHdosjVh06exMtORi2ezMb P057t+2N0tLARA8FbspjyvKlnA1RCHomoPpq1gP1iQQE5J39unH3YaFYhq+E7br4zga/mIe2r TtC7bxUtY4QVG8upNz3R7KxCKjKsNZbVc4zt72Pb6j/qj+JyEOCM8c9VxNQZ7Hj+EOuYlYTjV 0SGjF+kqc2o7hSQi5OcPKq9hrXnd6WIx5cYkWt7HQT3Fn4FqawGfbSkitsjHMLTahPbqEYWJo YOwtNvvhrQKRjcMtFZHwlDEq+8u/iMa8qLdCO/FgPX43UrDlC6ApKdmom+hRWJ+XD5rJAZc/h vqLXHu85w0/sftVdXROqMHfqQTovWqjJBawdOBndwxr5s= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140248_313109_84D5B2C3 X-CRM114-Status: UNSURE ( 9.67 ) 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 Mon Jun 10 21:02:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692438 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 B76A7C41513 for ; Mon, 10 Jun 2024 21:03:24 +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=AiTzKqJP98sikEiNUYeHjQs2GdHj1BlxKM8XRvbPQps=; b=MFSN9CB0352BJt WKFPfjGU/YYM0Q9jKUxicd3oJqAW6yN/AiN79KGZ3qRMRsvrAXW0lN7NWjMQJzjNW6bJ3rCQe3BjB Kg5HEMFeEUUoqw6V82rwrjmVGLMz75fsDpqbcWD4cLyRosbqicvmVtDQKyY5uWJ7C8XxskS0NaOLJ r1/04QVu144npE9/PihTf7jxAQX9sWTveMY3QwimGkhvZE9vF5IQOaxuKiy2cGpHZJfI+Jgnurvxq d+VXdl5S/BLVbhdy0lij9bIBfVfGuW7Fki6kA1dl8c1L+kDiuAGnTSCll6ykBNF9/SN936l9J5MuL T5BhAVo/cb5CQKRbw+/Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAV-00000006U1H-46lB; Mon, 10 Jun 2024 21:03:08 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAB-00000006Tmd-3IUw for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:53 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053364; x=1718658164; i=wahrenst@gmx.net; bh=dz+Ztr+H90QiZfF3gUr2cM0tb7zn20bPsMucWMQkuCY=; 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=QrwY2C0BSTKCjEiavKGw7a9ZqqUCjGLoy3Bjrh+hQW9Vm5qc+AB7hIHPG/phnyWV Eg8FIFfht2tSMqZLWCFTUPREOi41HDSY4l7C8FmuJOCNNLj5moGXzMEfY8bfZii/E kglUdoZ0NZ4bOR/Utd02FirzhqoSP5ElTa5JnJoriyYFj/krMZpGIx9rygFxEm0st YFNOl1mQd1Qmpp0G8wtsgAUDrxrO2jkA3xFx9X5EAGzwjyVbGdx5pzE1z8gzzQ1Ds vmwdnNBAmDEXIPfwv8+QEKg6eEr748qiHgc97bAPRXi7DNw+CEVwAapxGBctOPi1f tGDphvvYPjy3E0wGUw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MtOKi-1sYzTG1DJ8-015Lbc; Mon, 10 Jun 2024 23:02:44 +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 V2 09/10] staging: vchiq_arm: Don't cast scatter-gather elements Date: Mon, 10 Jun 2024 23:02:19 +0200 Message-Id: <20240610210220.95524-10-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:AU1M+rIRn+YXGsOGeaf1U8LDOmKf2Ayj9OTRLgWmnyZM5sErLNo YvwObcWEVuYC+HGUL5EKpr7lwAFMy5jLTNKTxL/xgk1xHmW4WdUU/FW9n6T1aisS6kggUlQ SzAtuj1Jmjq3pLCW1TudkpS874sM1MOxWtpP2CCROyyOI7Yngezxj3Y5GTUk/ySdTyi3FuH +X2qVI6iEh2reaZ4e7YoQ== UI-OutboundReport: notjunk:1;M01:P0:9wxSLz1OYSk=;rsn4us+HhQLrct/dLRbRVGzM48k VYz0gRJRZAeMZnm9uB5IcJyeldXlciiMJc2r2hgPN6R30UjEo+S22on27z0NLNv2rDS46DkHd 1FSbwII8cgTRfaoNar4IZSOIutWGpCfP1YCtO0L7UZifknn2sZCMVrCklQGqs7lCJQ9EySz24 LXSiGNDS06hBDasv//qcJ91dJ15LQPpVNF7qiLANtDBxcgsFh93FI/D+a1QcxnrX2BdSEmwnq CYOY96Oy6ABmdV7U2u+4mvoEQIKBUCghOyiqaGJ5PtrzlYNwPNDV3A4qu8VahkWK0ZZNv6nqF 9k5iJbluiVniYDXok05lwexoO+ORyrhAVBc7JUr7XZHdtIrlv0GhBj6FnDCqCnhWugB1I3lh0 Rb7bbvrJJEEfAidkncZ0jxzjrhGrDRrTYnvPi0tPGaDW8wwUyfTXqVTNa0wa2/UbA0LGspCEt E3TtYjIx9gQ11SACl50lpXyM0V+PUm9qalbFKTwXWNoiEk6QvpV/0L0PvIhc1g0Ml9KtKtm9T lZsqX750g7KKNTOtg1nic1dQhlXbpu4UTje+4E3hvvMAuTrl/kv7mQzm2kFzAI8eaeYPIUm1V qrCXQHq49nykuqyuP5dxjYn+wWfQKsllXwkAANav3sk7nVCpjkWPxYfME8kHy3W/tdJ2VrZBZ eYz9p6cVhP9plUczUAkMJUlozpISYvwlAOE3hUsob6I4KPvnTWwAme2G4BbK/Urug6W95/Mpo KemMslPTxUgs3T7NgfLBypZzW/Yp2PP/j+GID3ekSGkqJYwrFJiULQS7UXrJ67hWsmAOT0rwk BT/eIaQUjyUzoP3vQMNTjM7JlfAPCjEz3RaJouMSgJh+A= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140248_289601_40975D0C X-CRM114-Status: GOOD ( 10.29 ) 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 kernel uses different types for DMA length & address, so better use them. Signed-off-by: Stefan Wahren Reviewed-by: Laurent Pinchart --- .../staging/vc04_services/interface/vchiq_arm/vchiq_arm.c | 6 +++--- 1 file changed, 3 insertions(+), 3 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 706bfc7a0b90..02392073c4aa 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c @@ -162,7 +162,7 @@ cleanup_pagelistinfo(struct vchiq_instance *instance, struct vchiq_pagelist_info } static inline bool -is_adjacent_block(u32 *addrs, u32 addr, unsigned int k) +is_adjacent_block(u32 *addrs, dma_addr_t addr, unsigned int k) { u32 tmp; @@ -377,8 +377,8 @@ create_pagelist(struct vchiq_instance *instance, char *buf, char __user *ubuf, /* Combine adjacent blocks for performance */ k = 0; for_each_sg(scatterlist, sg, dma_buffers, i) { - u32 len = sg_dma_len(sg); - u32 addr = sg_dma_address(sg); + unsigned int len = sg_dma_len(sg); + dma_addr_t addr = sg_dma_address(sg); /* Note: addrs is the address + page_count - 1 * The firmware expects blocks after the first to be page- From patchwork Mon Jun 10 21:02:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13692442 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 5AFB5C27C55 for ; Mon, 10 Jun 2024 21:03:44 +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=gbd/Z8f5j3qEOu e6KjDzbgqYOa4ddQ1Z7R+9z3/KinLIY8yhY1dGNn2h+pNFT/qXNILcF9YaDP4mZYd0OD5WM+3RQjv HnxQk/5FPN0F1KYo1/I7H+i85bgWMNdw0AjgB7g8bVmW1E/AgDhRuRAcKq6ZP8+LCoXWwOmqIZ6bW imH8xSrbGGkBCnVNuDX+zMIDifCylcRM0SHA2ZW3VQZ2pUMzus+HSvQqFV8T4VGtXcsCy7WiFgBj+ gy7yP6coDMPdyqO8xeJibY7/YC7fT1w+bmfsCxmWl/J39gDK+HdeiY2mp0R4fDR/Lj8kR3NZuMQtI B/i7ySg8Wf8/yX2S6lOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAp-00000006UFg-1Ra4; Mon, 10 Jun 2024 21:03:27 +0000 Received: from mout.gmx.net ([212.227.15.15]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sGmAC-00000006Tmq-0Y4J for linux-arm-kernel@lists.infradead.org; Mon, 10 Jun 2024 21:02:56 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718053364; x=1718658164; 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=h1HYhK1StnuyRrhfn2F5rJHBhKN1HNuxIepDhUVYC8M9L1fb/WruDZztqDUYhzp+ nnRThcE8q/iFtif7gCrTgCnyczIhhtKaXTRAf3sRe0IqAqoEXCSRxZHkspt5wJ82X mLkJQCPFYsEAWd+srplXKQH9NU1yzDrg5z0NctPbqvL4KjEJ5VahkH4U4NAA/VXwl MS//lf5l0briAE6fK8RTPyveBvlSpoydiCj9CQAjeiuWtrta1RIJqGqHKwWT7zbpB fPSiFcE71t1KLlq6VOKl/Xhn8T3VLDu5JI4DhPiZwkidSkOv/FKLdA+9q6u3ZpK2h wCphLVlzUQKfIZAK+g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MMofW-1ry0p62O84-00Ykfy; Mon, 10 Jun 2024 23:02:44 +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 V2 10/10] staging: vc04_services: Update testing instructions Date: Mon, 10 Jun 2024 23:02:20 +0200 Message-Id: <20240610210220.95524-11-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240610210220.95524-1-wahrenst@gmx.net> References: <20240610210220.95524-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:rLh9H3EhgXg4+LJs9Pw7IOuMco8Uqivr4bgbVHXsEqbanKNWcGb AFvvUlWfpC7mx/R/M5Zl4ThuuzSwLYj4Efp3Lz5pw5NPuiNO1Db/iqJ/WDf2MxQr2dvCICr O9z7u6FmXyfqNmOeXxYFa37tTlNGU6nEMBup+ViSjCw1mf42ntBNJpafsf8xMKuMzTuzR75 5dZ0TnFjMIdieo5mVdkdQ== UI-OutboundReport: notjunk:1;M01:P0:LXMyQZCt5pY=;hkpM1m+t/1KaaHKHrN5L4ZDSk3u po20UBEQWzqnHnYTSenJfGCcca+XV/2g5LCLKD5CHAo+1HZJoww6vppmQphmbvo8hALCwKKbi adPjSSDXWFJ66REpuDiuF76/OGjWbw8dJ/vOYUxqEpb2qIEdZ6nVLbQ3vyfiPO7O4FiLil0MW 3W5rUEKbnUF9SEtjUJQVrDJoOIL01KaWFfeomD5lOCANGj4rP6rkensW58Q+c9xyvY5Lbxbhr soj8bcVvxxDq7IskN5N99eqeCTEv4xr3ehWRMOxYYUim/9oAfzOe9VbDfE3vCEhOTGlU9023J 3226V2r0jewaQpgMTWEGqYuL3VbZKTkjCqVSKhE4aPaI5r6ZbiA5hEzyLtKaPp1yZRk1yKZU/ /1P/LUX4l0Dek0AdQvI2tk00Sa7NQ6K0OwD8E/mTlYDId7/CW2dWa2tvh4bEd0WFcHdWnstHD JUtqL1ANCnRZXlx6CZCXoEMLTh15hvHc9YQQOyUDOXRj8GqckTqY6v7pFr/X14SfNnnSPD0kk UAVATK0J48HI1Ld/9IHOXcdWWlSGRLgR17qYr4biysc7gWeaRW3+qrpOECyGQpfH10PIFRVCX xR92kI5EbepIJCitpnQN/5Xy2X4Dd7tTh9W/xTpWtg3hXdG9TvjayvV6NbXuDcgRKUyhaPF9V YfzmgC9FE1RlTk1udKrCNNoPxOWJgl3T4j/VNcjQWCO/QKL0JXPgc5bLl3uhbhmDuhKXL/AbI wHbCsvJz/lfWjgCHoB6X5dQnU4p9ucMTwn7QkUSUkM7M7PUVkWbuFtKg6pyJHvXXX6mvCQAFe JmquOXCHirrpxCF3GNiNNunGpXu3dKASCMooNNewmW5is= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240610_140248_867735_08830A52 X-CRM114-Status: GOOD ( 10.37 ) 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