From patchwork Fri Jun 21 13:19:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13707600 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 D556FC27C4F for ; Fri, 21 Jun 2024 13:20: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=o8GKLwh+nv/Ie+gqmpfYUPt//UHosAXpX+nkpmI0TLA=; b=IOv91PQvjWtixKKYtmBzbaGWg2 I+5FQUfQhNZWlHgzkpGkjzoDZzTzqqT37mHDaZRI7tUVhwA6XYB5r8/fGagcB+2tsK7pCLo7ZTBc+ +TV9+n0CQv1G/CA0tJnl6ckXdMMavQ99NWEUnFjHxnUGHM3+F1VZSEX235qdCvEWocoLnZmHmEE9G ZhWhQjqTlOZ9EcW5aLeR5FZGMObntVt8yL3WskDblZP0Ewo1iFp0St7s37TPXH4lRzXRNrGM39Hdk 7JDlAUXnsh3JMj+VKVb6kmss0xlEM8h4HIZX5+nN3Z2j4NSXi20Df8JPT4PakMNp5H/QQkupQ3Y1K 9cjK3ZTA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeBv-00000009JAZ-1A3D; Fri, 21 Jun 2024 13:20:35 +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 1sKeBh-00000009J1H-14nJ for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976015; x=1719580815; i=wahrenst@gmx.net; bh=o8GKLwh+nv/Ie+gqmpfYUPt//UHosAXpX+nkpmI0TLA=; 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=QkllLSfOMUOyKUpzX3xYrmqAqXlmMWbyT+XsvPvdMJAE1qStlBUUhmC3x6QvdIDS BpvHQtK9WYR8vxEmZjxwwz/5uRe+yYNjrnOcMxDWycG7AuMkVK28Fkm0rXs6MBndI yiC1+OR6PNix/t9YmzIYJVxLlRYrkbUUkVA4qHHj6bCtpaprkQ9//vh+SJUIwLz5A 0eyQbAWqRXMKWUz0wHPL3LlIpUcMkMGWsfZDvws8GQ3tmQcSydbKBmIsuYEeT2Xh1 xKmRea8EguxcTxAMKselbE+iSQzFIvCp2k397t7vldaeOJ9Ix+Gzbqx2Vcqekr1mG RvEHfwBkNNJx4GV+WA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1M1HZo-1sNO0T2cQs-003XHq; Fri, 21 Jun 2024 15:20:15 +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 V3 01/10] staging: vchiq_arm: Unify return code variable Date: Fri, 21 Jun 2024 15:19:49 +0200 Message-Id: <20240621131958.98208-2-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:V9V6Ap4Og4UnlRSyDyXvvxX6yvJdAoS8ckNHB0vEu4LZdKU5ya4 zWysFaOfbTpwdJ2b42LTIgb1r1zwddG4C53a+p972A3O7zd6RRFhiIypREgo1hooMMwUOIe 5hxFed1WD8wyJLufSXz/7sCetcQhW+sJkbk3SZzcHpN9H22SMT5SYKqA3NAhYC1A8pAO3hz cBtPWB74dTzkyVuqDaBxg== UI-OutboundReport: notjunk:1;M01:P0:8Aau/RPmQC4=;zxPbB8GEx75ysvMjDY25hd8XHPa 2Uh3lyXvQ8x9FkXLo1v3ZulRg9dm34ZxqY0Awi3ZDKxpRKcWDSqQkrzxMN+LtcS0EeKJTLkW7 5LxxqB0wa9vQ0WcN1p7M9jW6G16cYzYSmzFkooBP6A83l23IB580NtrKDewhfp/tJcGvIruUG nndSrjEmKUBP4HEeqklk4+bHJsNRirl9GwOI7QxkF1iC7XkWZxY2huvzsR/EaW2e5syWyO/sa R7tds+LvLrUgoxnJQOkMfaKwKYcUg+B83t7ZaFKELbCJI0yKGeb8o+zpqBebt3KRGlTSFSIy5 nmvox+0hNKTGbNd2eYFNQAqEsOFlNC8h4sC8Ttdl4NwQvUp9KJKt5vvKT47emPreSjbLvzLga D6BOJknBjKfykPyZhUg7+f9UFn6dPjQMnayYdLOXF9G19JdHbIuEW8gOCGpw2Yk8bLQrFBxia y1DAvk94QUj5/kEQEC/wkw6VWoaPt83QQ/uVGU6xzowjrUVoogRzbO03fltLYEeDXyV9+Jsfk itzL7uha/BPnnmVFVMfiCE/JGm+TPpNezdlPTAcC0TULmpVMPJ77qbC2grqmkgu9DoEI34CkX YceEV/W12jOHF6r2GbRana+SQ11MR9Tz+LlJ/zPxNVzp9dNM6poZq/DkJwEGG1oOQgh5igTl0 5jKM3xnSouhkoypLrveT/pv2Y9O1SekGH1AO38PvwqWmtOIG7voYNYHn5Xe0RTJDmYdbg60dU fHHChAP2IDDAdDECt2nG8f9iCNU/2g3qzcGQVx9RCSA7oc+PijpTZfB6Db7rqny4molbADMZd Pchj5SgJpEt5MVIGIxr8szgeMM0sv6v+M5sXpM27rIhyg= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062021_662873_C55FEE51 X-CRM114-Status: GOOD ( 17.47 ) 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 5f518e5a9273..2357402f8ab9 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 Fri Jun 21 13:19:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13707594 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 1F047C2BA1A for ; Fri, 21 Jun 2024 13:20:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WGwqd975to9Nc6K92tWIbNW9GhNoaX3gZDD9jZNa8gI=; b=o9K3xpwXSxK3rLikXWD6vEFM9y 8jN9T4I2ODUYmxiydt89hlow8Lq4uCw8aGg8gXzcnrwccfRwxJzEiKy7WWqew3sPX9DqGlDTW3c56 Sk446yUdRKYW9LLh+FD5KjIQHwC6hnu1jjlEAnWQycCcW7541dogli2eVh2AjTBnnvc6PjLBu66zh gPvKzRX/87giRVfv2YZv+ThVGZZ4w2LK7E/dGqqMyOwSxmU/nHcQiT6JExdhwyoBneL0LAjFhtiqE JDFHzgOsxTZIK3f0qwTluq0/QxFZTdowC0gFEjCeTa3vPNLZokKipFScMgdnUnKP2o3jNzuI3G2qn mbO3mfwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeBn-00000009J6y-2j8Q; Fri, 21 Jun 2024 13:20:27 +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 1sKeBh-00000009J1F-14vi for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976016; x=1719580816; i=wahrenst@gmx.net; bh=WGwqd975to9Nc6K92tWIbNW9GhNoaX3gZDD9jZNa8gI=; 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=ns9jXKmHLPYukUOp5ya/7OVOXVA3Qb6IFCv9XWZJlbStb66DLgxPFgGvA3uHxkoO MLExLk+FYpFDwSnlggYYSsdoFvGpdK0Q5oPNtE6cZ7Ab2IZ5bf5TcWhX8D2q+Ph8g brwV66GwEqjdzqLe0jjIhhIIiPaG86bWVlfIai8Pvn8yrJpmEEtMojsO8NW9aW+CC lqFwBBIvlWwnnlWD3aSO8rlxP2V9ZW8G/s5yLsbqVGeX6ljMQBX6vyzWpndgOxhtn hQLNJdG/DMsB02doFRYo0PaX5J3TTW3AzchJSG+Ppu6b7AHa90BW1YRr4sogHrleV hkyIuto8/L8QE0461g== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MQ5rO-1ryYxz3zpQ-00NnBk; Fri, 21 Jun 2024 15:20:16 +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 V3 02/10] staging: vchiq_arm: Drop obsolete comment Date: Fri, 21 Jun 2024 15:19:50 +0200 Message-Id: <20240621131958.98208-3-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:yEdTAysFKPgx1duXtm089Ojkf1CVkI3ARW1c5Zue+KWtHQKkfJI ed8HhV3h54/weFMWYUxLZwXeO4buQBIvnSnBu7L54lPas0uv1Tnh9b4Um6vTiPEj81jzoYh 4Bk4CYAT1sgWS3XBR1nfYwNSJbo8KsuNBRFQKEbbF+G2KswjSlPOQxjRlPs0qVqSuJmlwc5 KOX4//JMVGzHuL7l3qAFg== UI-OutboundReport: notjunk:1;M01:P0:MMcm+CF4pFs=;2DCv13Wi91wJyXr887gncArKqtz Nrwujct9SM+k1yk1Qe3Tz+F67uGwsxEMixnPZPcg2Q/amNo0f9daHQupsn/gSNbUR+O516uIa /PvrudaDl1gDtuiR7rJ19/3HrSJWxonhKjKQMB2IklNcRKHpPExaMw2hZEGWOrbqzWhg9uay3 Mx3DcWGafV6hmHbbCXUdY/lGYr/WfNe4USJyXx8rcvdBHrb2ytLISK1Qre1VtO+NdrcFuxjoM JRP4J/XaG1Pe0MJVdGZh8s6ajwZ8a70kmHWTHfSaoeaW//JpjwbMXJMLFMxXrKCiCBjs0u6ux 19EeHaVLKQPy1XQbsY93n7wJhTVyB1dDVLj2LTal7jwdj6ngQn0M38MXZdK3sgMLBXnQHdkHh OCq2TzukSkzvVbUvoS99OkC5Uc6No7Ue/nqsKSiTqXnkGCu4xUZK4PXNHuKZJ37Cph7Euiia0 183IFYDiqmFocqBGyOke4kZl3VgqNbMQXLFnEy9hinO32sIUaWFrQ1pcRNx7L79UpavHB2C5R NAeD8vwAs5X5aOXiv87/i70ts/zKFsQ8d7bDyBIQn7zd7FzeAgQRBCw1gAUPlbeXEWGLH//I+ 8m321hNbT6Yv4G5lrp8dm2zFovrziLDwMyr2enR0IXhfWJ46sXtmf3WInh8oz+2Y2nWJU62Ij x2V7chqyG3KVJPiMUGZ627BOKRR113MPb1t92EF3vJUyuRHXhpsXkgeG9TBUsUZeNgrBzV0IZ aQZFm1CZW7SbBW0JjBjjpqLI/PNPVd/qDWUwZwXFPqu7ot+GW3WLZ1tNUPneyacYxk67wI+Fw 3InvhBy8uIDZput6Y1DN5vHL+QduPng2KHPw3eGWcnCUU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062021_636979_DD5BE555 X-CRM114-Status: UNSURE ( 9.26 ) 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 2357402f8ab9..6cfc5a769b8a 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 Fri Jun 21 13:19:51 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13707597 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 8E48BC27C4F for ; Fri, 21 Jun 2024 13:20: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ZXwrWBf/rp62OYEuRIGYrUMITYO0P9PC4nNEExUdWpc=; b=RcKekO2eGNBek4HesZym2DoPbK K6yD085lICaRO12+G1ROc2Kpc2ssSAickt4wdGfMxYgtPDCuL+S70BKLl+5E7uX1U7rqfBoiMHAJ9 QNKHx8nnYc73i37cjFNkYOgXjgZlkSVE/445mF8sdFMM05UrlIYojjHSy/84T+uiHCZCt9kcAZuX6 5PH65MCZZ8iBSs7lN8U7A6Vh51p9S2bQrPHRlnsM8pSNrbHhU27OX2jxsUIVePp0fVNmaBE2h1wcN JCqUu8yo0Y/WNQye6Rs6sis8V5rT1YvOXv4Z/0ORNtPnOwdWowd0/qen1Gz1Wb6JHjAtsnkA1C4PM ZWvrWboQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeBr-00000009J8g-1JJZ; Fri, 21 Jun 2024 13:20:31 +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 1sKeBh-00000009J1G-15Co for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976016; x=1719580816; i=wahrenst@gmx.net; bh=ZXwrWBf/rp62OYEuRIGYrUMITYO0P9PC4nNEExUdWpc=; 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=kYH9KBMGG1UxIjV4aFjsEVqfOKzYb+yC57LMqymgbDamJL69ovIPiyK9tkATK52p s6wZQrOoQXHD9Ew61cK7krqD4UeUCz5cWWTHjIL5sqAWLEBfppSw0nBeWX6FyB7Zv KvskyDFi8qFy1X+39Jdc79ZimOHna0MWu+ZpmgcSrxF+LjhABm8C86Fot9P9VpjPf LwnjAviGTyNL3B58NtSZMSBHx9e1/HHPNRSHHpMVbBmu9VDaCAElo7jX9QwuzkdJE 6LiYDuz9o7GbeLcjDDZ8Y8XkI3gqPq1C80gZUVOUpb13N0hPlthfcuRIdCKEAsbf8 gANl7OLM57EyLa1RrQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N5VDE-1sRnuk1AvC-017LH4; Fri, 21 Jun 2024 15:20:16 +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 V3 03/10] staging: vchiq_core: Drop non-functional struct members Date: Fri, 21 Jun 2024 15:19:51 +0200 Message-Id: <20240621131958.98208-4-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:A4erY3WkkQxBrH9sLfavlJbsf+n1s7dr9APBk2FJNUhZAJ2Rfyw 6WxAjbU1+m+41ISlZsdIZV+jgwAU1oX409qdr4PtrTtkZXdad6Yb7VUAuT3925pNyVQenNs 1Yv+/QgiRAMin+bCOkTzyVp7KDiPV1SFEfTid4m2rmxkGEvoKoFLjrVNsDwWbXwylp80ot/ k+rM8U1Bgu5q9tNLFiDLg== UI-OutboundReport: notjunk:1;M01:P0:oyyimTcx9/U=;GywLyvU5Lc/o1y29x5NRqMZqlPp ghMI9raogF60qmERq+hLhg0+pViy2CKfRAnYck3MgqiOz1vbucsj++oBA9E8wPHusPNUGmI1r qRWBiVvJ/5xDnoZKAp1xUCYzQYovLJew4BE/REOOt7XdoNMrnWIhoavFNMPABXVdeJR8YGGpv oDcZWWLMKfoNYjmmLhKJJ6FnfEkkgiWJv2J95w2RfgxDM9Yt/IMzgKsfaz54RbZeFSLZxlG7R +sIWETGjplhhd2pCWi7k4nIH1vnTuogPvEJzZHPtFmwQPg38S/TMHsLmzWoRJRXc8wTDvdMlm iKydD9g4lEbV+ENvi9eUa9xWhHgvXHaVLPuEIts1DwbmQurV1Nh3ghIycnvG2iDzR2U8B/02F /Q+4Ng+cO7jcRintKVbPQgTZPgjVnOQPE/780xpLsi89IBS6cCD/z//haEvpE4SFIiNkAuj7U St8KCffojBqcX9taktDjrETO4ZLxZyAdDjmZSKWwpjP//1uR2rS44RqtHRIh3CpsbJMfhEBHn 4eXJb7S3oKy3kWB9ZC+RnXTk/UaUQUCCJpA3OsI2RSkRXpN0q28GciAn7n8vu6jgInPYRoPxA tSWEVIGbP/WofIlv5eduKpIrDIffksTMjuKFjX5Lnqe+uRUXRFI84S+R5u1Gbt6+qcg5F3cJu mECZI1FNzBjnz4qFHzRkcnua6/l8ZgogFQZCEhzEbYNlOT2poPjwjrjYDJF9ym5Sj0VwPrqCX dpxX3tnyQ8SV86pLIl8Di6ZJk4FGPzywqSWJ2A5SGQ+J0fDF1qmXKODk5pC8699fZT2luoAzd u1c7bYiu06jRedDvptdser2T/kSuR2FyvzSoaJrawt7FU= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062021_674430_6544F2CA X-CRM114-Status: GOOD ( 10.15 ) 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 382ec08f6a14..aac46e2a3b75 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 Fri Jun 21 13:19:52 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13707603 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 CD03DC2BA1A for ; Fri, 21 Jun 2024 13:20:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EiwqwtLbWeIKNfGQut/XomuN7KJlz0oUvJUtt14KeEw=; b=EUpZ03XElqnBSE9NdZO4U8Sfc+ NGkh+MadJ/72Vvitw3TV6HMxYzAS2WCIQfdD1wiKoMh/NodaBfngbrsoGoKY4ZHcHfJIGf6M8TEKe Ko0gJFISOJqY8To9ZC/Xezp7PewDbRQj70VxEnzZyu4dxjaFZZhe0aWYdrecN3h6X9qSTmzT900j1 A7OjhSRICC0Uv80hQwsKU7kjnEXUaUpfoA8wHXhPyuaumt/lxPxW4QdELqQnWIZXiyVYniDBodh5r L7MJ95mdW8nbcs7MgNwew/N9WTa952DIOxjwU8MKYkGOMHRgZ7A9Q/FnHA/1c1nvED56cEGbMlPhQ oUTink3g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeC2-00000009JGJ-2gXG; Fri, 21 Jun 2024 13:20:42 +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 1sKeBh-00000009J1M-2OkB for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976016; x=1719580816; i=wahrenst@gmx.net; bh=EiwqwtLbWeIKNfGQut/XomuN7KJlz0oUvJUtt14KeEw=; 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=FRAf8qoLg2h8RdiRPxOChB7rTrv7visk7HwXdf63J6QVGHYSisWy/pkYiLQMXb6i vLJTzPa6wE8kePvW68xcgWyyW7NaKYri2hwbeFeTRZFNSsXP7O/lAQ+X6XRrl7eFw uyCVze6K61/pIIJy3amt++fPhT1KlxOFCBcBeeY+AXQ5vhKHMtqMqjPf8661kbG2W jQnoMgYdhsvA2ZWSoKNniCG+NoPN56j19nvJK3NCb4MXYLs71LuO1dIAdFJzkZogz QrjpUnBkdJqzgIZzEgacwaQkVulOE3LwOAtOYW4D7AzjCgl/CTM9b0NpKwqbVTSw0 zuHV3SMufwmIbG9VSw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MORAa-1s0CK62KPG-00OLQA; Fri, 21 Jun 2024 15:20:16 +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 V3 04/10] staging: vchiq_arm: Drop unnecessary declarations Date: Fri, 21 Jun 2024 15:19:52 +0200 Message-Id: <20240621131958.98208-5-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:W3CkbwSKaWKtryod3DAduooTZCX4pnHKkiuvlDVQmP1OUBLQsdR yc/Cs/1erl/D3zfca1QZXXmlQ29VncdmHpTCxk8exJ1wykuZ+8Ef0ugpdCe/gTJO10BiWDq +4kwPYb2Xwvi5hRCptWQ1in+rxxYcXSoz5icXRXR3+So/J2Wen5rhCw2+ziClxASaB26+9A K1fGuTQnJiVewZ/5ABaNQ== UI-OutboundReport: notjunk:1;M01:P0:N41LMo44T9s=;rlafzwyQdKyTyziWL72RZ4Y1xUJ YVZmRUTHZcsz+HLOy0JIjFSI5oGtFmRxhRIYSiFeRfvR2avGp0KD0q4hzVfZIeTWKaG6nQidG OxsQ7ZiZ4P1XT5aJ/lnVYaHuSae87C5jMzTH2Gjlezx7TbeCirq1BFgvY7nQ7gSHbzOJBvTE7 skDHP2JL7ZOdACPMPBM1xSqvm37UkwjVvOR6l0oYU/rpDJ8o/S18Ny6FknrPYagSZ3qXSAGrZ vc5D2CuG/Q9d+LgQWYAOJQS77rlQ7CU0lf3ya57amV4/YDCA7AkES//KO9dXuqXDkYwY/iRI3 glp3dlO4i42xiS2V7hfHNc6K45FGSNDBRTb85AE/fVsWqmVm3EMZoE3h6b+kpdsJ7Y4Xs18Wi wv6uUfh5NisNK2G+ZoqiI29cAi6UZ9JtrkpMXUjKz7594sexeKg/FLlsL3cEQfJJC7ft2jl3j CBgayaAvekc44yJ2EFtMiGG271yWWjvslecCs+falw24A6A616fXEnETU1N6SlQzpRWv7ElcU 9MKTyVCZ59TAIcIDvoTi/9jdqgbtcAb2RZ3qjtrGY6r8sZnCVT6zPn6M1HMU1GJAJVmN9J+uu mnWsBD8NYt0WW3vOJt3YDUD8Nf0D+Zm2R+ygkTJyEFmN3FfBqvZHLWmw6OxWcb3ijHe9ELQRV BZBtqw8VKaoVAEgw3zBvdCU0kthsD6DrToLd1167CdFxgLfny3eBBEY5Sc++cLlhmQSsVamdc uUjtn/bYjcS9m9ZwVwsOpcwDepphCzZtFP+R5BkzPbY3dJFjDWPKHoSbcA5y52R1ZB+b8iVdS pg8MUiaIdgl/64xkW6CjlkXLELGQGBKUzG8TfVrsYYcuI= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062021_951373_780215FF X-CRM114-Status: UNSURE ( 8.59 ) 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 aac46e2a3b75..77cc4d7ac077 100644 --- a/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h +++ b/drivers/staging/vc04_services/interface/vchiq_arm/vchiq_core.h @@ -544,8 +544,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 Fri Jun 21 13:19:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13707598 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 C6BBFC2BD09 for ; Fri, 21 Jun 2024 13:20: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=HZF72wZCHfT06Ui1Po5hzq0v74I7NCMeBc9OKZHDPas=; b=hjfR/xIVtrNGzoiR2CB4naIFt9 7SLdtYFsfYVwxBEVjesM9E/9PYya0JCrwGvzWrcY8dLapqQphewqpmb+7Tem+a9rSrUxhSc41udXc lQirNCkTJWVHmLvPhGBMjqihhATDiS/GsLT4ZLBqnujzF6UV4lOc8EVxDdHzNMmnNL3eZKCuRXqq3 X3+09x+F57PytnyYgrTKvfnxQVKGgvxyto41IQezwFvdyHjtRm0r8aE90H/ua7hS19kZQgvTSR/UY nbJcqtIxES4wV6b04gvMOR2a2WHCjPQiNa9iDqPXUKlGV0busi5BUkHR6v8zayuwg3st5/Lx0qPsb 6+a0Zmag==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeBs-00000009J92-42on; Fri, 21 Jun 2024 13:20:32 +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 1sKeBh-00000009J1N-2OxS for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976017; x=1719580817; i=wahrenst@gmx.net; bh=HZF72wZCHfT06Ui1Po5hzq0v74I7NCMeBc9OKZHDPas=; 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=ojlG9BHJspMTyI33pQWOvwOwHet5yxM8ZzL7pBY08IjWf+I8AJwNm14CsQwwHY9i 5Tjiz1OJmz3MwoHCgSVu0GfwAmzGabhNG7t1N+pPyWK2mzfb3Dj96uaBwKZiAP626 8E3Kx3LRKEuaBddfmSXruAyERVXr9T9IgjM3+UuKExhUneYxpZSxE8BYb8A0r4p2f yvZcTt8vzpPo90dS0hg5r1ddXuWRzsylYsbMVZLypdBf1klz84EEsj/GgWelKaJcD G6kVoe0g+/TVcpQW5f1v5A+zaUXhQcxud4R2vsxUjrg/05RvL0eXOi4GmUqtHq7Tr I0PZOJGHFkZLKWQDmg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MsHns-1sf3SE3bcQ-00u7sE; Fri, 21 Jun 2024 15:20:16 +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 V3 05/10] staging: vchiq_arm: Get the rid off struct vchiq_2835_state Date: Fri, 21 Jun 2024 15:19:53 +0200 Message-Id: <20240621131958.98208-6-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:VaW0Wv/AU1cmkBNmovVh0htrgrC+2t8QSwhiadc7cs2/bkDzYW1 Qs2LMtdoOPpFs4FylXNZpoCzP258ZSjxvwbu5RdqtsZ5oo0TFH05J0h99TxILhZMdnfU2Ty rRodj463yLmFxQ/QfTRnb5gG2gpEQYgGotZESvBdIlidnam4AbPwFR+k1Yb4dVpRjEEoRw+ 21hv6tWNbNgru36pcIdSg== UI-OutboundReport: notjunk:1;M01:P0:dH1nFVi41ik=;LrmVJZvfDEYbOYyZ0ztc82//TMR AY4HeAf8YbIBvXmWeDvvhgUlimr39JXhZQ8MF89G3XIltyqD+1ANyxXFc6DE9bFH1FAsZYz+h 6TnS6THHzWbmcnLRRTnRJnlL2ksT61wztayLUHBQq55a9nOVRfuoLBq3+oA3dVmnZpgznt50a KZkAB81todFnQaRTw+9hQpQbGeaXBzLwl0q8noH+PYgFtjlJcVgthdkO7FFE1GDMZuQldVdXx kjprnrbWPZhVegA2bVln61mXa5REpg2frEOhCDF+DrNOUv39MaVRgR9w3vcsXLgNyLFhta57G J/PpK+mhNPNqQ18xcx+/wfWFH1RV1ktznvPC311XIWJb284qZP6hGwxAs0JyHugkBE0UAu+7m zpqv+tCOKJfHmTr6Z4wHu89Xppzhx3xa6i0W43ZfRQNGKqqiyCnrdWaICcvjoxBoX7K71S5PM 53ezT/ApJeYmtI8Q6s+qaXJkzM/MtIo6GyoafRiz+owER5MOZiobfCcIur8g/9JLQRaYrSxiB Fgv49n0kjW1JXmRiDotgL77xbZJCa6F4QksErhpoEfn/H5kds/GvCA93sdpecc8vuMUHCdJn3 rC653wdweXOqlHJn5qlQmfJedylE4vec9vQCbn+RdrdPabDbncH1osYWBVycm/6L3MNm+WCyn EqBnnJTG4BZWf7N5W64I9y27m4MtRQMuZUPKnNDAd2/K7iOo24AlvNYemgXhWaDjwyrKczxJq VRbxmbR4WqcE951ymk075C4B/U+RIoJwLL/gdxAtAaGYs0aUKZAA4AQcdws4DpN/KpV6gRXLa fnGaMEuTknQFe2riFXQy/p7p4MTHyPSCS9ugOdgzsPx98= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062021_973115_9C49B8EC X-CRM114-Status: GOOD ( 12.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 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 6cfc5a769b8a..70baabc08c8a 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 Fri Jun 21 13:19: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: 13707596 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 25920C2BBCA for ; Fri, 21 Jun 2024 13:20:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=IC966Q7RTiSk27CZV+8YMDFXaB95l626V9b3lNakaT0=; b=fa2hqqsM4GRMu8UtwiYqb1lPlO 1KAP5FyD143HrVX957mbdZhhbSBoc2IW4ss6gBCGGW7RBmpeN2d/2LdVCKsg5jLfOJIHdOBRO6wn6 oLdT+eZVV2yQJx8/oCOCnuDto4w9t6/XFRbtCtSsBcCQbVfW9J+ICJDh8zGxsFIvsJBL7PqVHYbu4 2iQcyU+6+1/Is+/vyJ0oKmlS0NbqgKAnpa/EYYdAS3gHFmg8X/TDmCdnjcnbGBz53F8jt9eR3LCAj m88DSWFegzTxa+mgIO/8EdwqqZ7eXAkGbDxK4tjN+wFaXPKMSxDLoC53bNKxc9c7fdCX3OFtK05af pCd21xWA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeBq-00000009J8L-2evE; Fri, 21 Jun 2024 13:20:30 +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 1sKeBh-00000009J1O-154J for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976017; x=1719580817; i=wahrenst@gmx.net; bh=IC966Q7RTiSk27CZV+8YMDFXaB95l626V9b3lNakaT0=; 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=nVREjPYJkW8St8Z6L+pQ3udb8Uj4RXt2J+Yt4jgljahzXxr1e/f5HAwHY4DErIrw xGKE3soaJPx1qK81MCeSiHnaQG7sjzWTk05R+Ro9LnYXtJn6yCcTEccxe9w48/GUV tsvvCXJQhH3DrOeHQw0P2+3KZ2BwtO+ZT8fC7ej/hstklSjl/G2RZu6gyAkkFVzlh ZmbJY2bW8Klem/z+/FfX2E7shHzBoT2PkjdO+dDO06uJVzUb/HxXyKr9pqHA7ZB83 j/X8GrIaa8OVq6AD4CND4z0csrPXWK8Kv2g4WHiIWKl0J9cPb4F4KD75eHlDTLtEa onYEHrTM9qcsU6GeNQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MaJ7v-1roLpM0dO9-00VnWr; Fri, 21 Jun 2024 15:20:17 +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 V3 06/10] staging: vchiq_arm: Drop vchiq_arm_init_state Date: Fri, 21 Jun 2024 15:19:54 +0200 Message-Id: <20240621131958.98208-7-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:NrxSYFbW40Ip2SZDFh3lOoCdh2dAH/1T3mW1u3Udiia/rk4m1oC o8tM9RvHULa5O0vARS8bnqEEBNPe73lEzCxu4DwthvQWQe2dBuyTMkjHvv3+G/ETneZG67Z UttF27+fUtKUzmkmEOeMH1wqOuPCJtyQOEzQjzw0Iy+C/HmRAqqAbIoY4cZZhVDGICv41Dg 9Q92T0s2BjLj/HM8ic/JA== UI-OutboundReport: notjunk:1;M01:P0:wEDUIUyk0p8=;vabIn/2JEk3Dz0RsRcPxSxrE8M1 PhG/zXKSq/QBidu452gi049Li3bAmu+DbMBrTh49r3GIvHja3D4NN/qWWkaxShnlsqybAUHnH KSMHyAnS4EGeso7GOuj2BINmUNTL50+81eM3UA3Zaf4Xy4j0j5Yw7ND5ThxzBKxHJwlHsm3Jv CiTvIHVUX/e6aA0rMdBCC84v8A/OpIGSJYujYNPRv5nmn5/azkJnsKUfXYiYNV6Se+UnugT87 kA1w1i8ZvTuNZsiXLDj7SbbJrhzSx05akVVLqFJnejI9NlPGON+0EVa8AG+vGg9OIXyT2dw9m nVvVYh922zVzvDe/cZilT0fVcekOsJ6kFLy2AgIgjU2UpU+sFkXK9AXviikDCZEx+M6wnRJVw BhdAQrqbNC6J5yl8awY12SPRxwZUgx7yZXhKTC3h8aOFtw8Dz/6SmeVo8AxsRHGlWfrC7itG5 ExrAHkpp41xLAJIl+zEI37JL0i7Krvx8NfjZtn98kbddzxloR7jFGk4lMRKuQQp4Y0IF2kagQ fniwN5S85yfdfVTkt7w9HlC9DE9KPsSzhYRvX11kpysgh8O+W/eTvptkcfQYfE/hDv5/DD6Fh clanaaoDkHcVEUVYJWh9MbOYiyUkgoCNDhwn1b8U4IliCe52v/CPvt7cTn20Of3uFl6wge9cw GakkUVh98SKu50/0nxehRnTAPllX/AkUdyouHJp1rjhYIlG2ySHuwhkKb580PyF0D1XICcCMS EXDB3IjifQwXUDpJoODQMacQV+EV7Sg+lxGXYgDRK0AMMXhqApTvf9zXEhxW6XcyluKguQa0E 8KIGhPvswT0NBLHU+3hgFShgGFJmyHeJZm7QNuBHvxQqA= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062021_667497_38A87811 X-CRM114-Status: GOOD ( 10.13 ) 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 70baabc08c8a..cb37da7d8085 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 Fri Jun 21 13:19: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: 13707602 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 16C3AC27C4F for ; Fri, 21 Jun 2024 13:20: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=s6Qd0JBwNqeO6s8Qewv27s50XwpHo8PayS9pYHQ6hRI=; b=CxsPLngNtTDSJ5//TFmd0pvBHO kd8qBM1qXO4VyJ8/FRCOCjOhs1An/XGGcg+jgb6/JOGxlZb9rfS2rKmZy+AkRuXas2qwgp5vOjf64 +ktPCEeLrjrg9hLXl7agn2Q2devddbDlp6j+Dj4HLFJpe84CJWumRMChhqERLYNuwQQLIaZgi7xZU vhHL91EBOdQWX6eWE7zbU0gp527BxU/pWQ/MoASzaQRRzn3+Xcs7LoMNkgVUcuFBSNb4Zux/9l5J8 FqSFFQQNb142bBrRc3BT7znQ9khW8PFr1jJGN2RXpvKZYgsHSSLfkQZxTPKht74v4nAaNA1bGjBAN qW+XXq2Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeBy-00000009JDA-1CTW; Fri, 21 Jun 2024 13:20:38 +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 1sKeBh-00000009J1P-2Nto for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976017; x=1719580817; i=wahrenst@gmx.net; bh=s6Qd0JBwNqeO6s8Qewv27s50XwpHo8PayS9pYHQ6hRI=; 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=eYzh8RAACH9tym3MALu+lGlrQ45ddpM5BGO3inXvM9Mf4p548q9A5dzG3/HP+Bkx wkvthWp2Z1zjGPIcRNUh90yDJ9vZGBrfHmmwG6g8nL2RJlsBL3Se8e1eepJ9iB5mK ybslRcHV2hsWzn+XmI7sPIbivT71ChQcET9Gnba4BRdQsAdpD4jVCsau6CvV4bjTU cwF3HplrfdSQ3eLA/2udT36HBB38VYDuoNfG/LYP3830hoVJaoxn+R3/ewdNm8eGA N01AkSJxFYo7gD9KZuzHb+qrqWJo24Ttw6QdKC0It3qEr2njT4j+/dpIFSp5v41kc OJThj3mg5pn6qXiiQQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MJmKh-1s4tgm1v1l-00LtW9; Fri, 21 Jun 2024 15:20:17 +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 V3 07/10] staging: vchiq_arm: Reduce indentation of service_callback Date: Fri, 21 Jun 2024 15:19:55 +0200 Message-Id: <20240621131958.98208-8-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:M70WieD8RdT4wTe5a8IcnsIHrr1N5koPOebEp7xzUC1xpgRKw/c ZwAJiOrFF3RMc3w/JZ9+ing9xHaeOki3s8g5KlgryQnr9g2tEyfW+cP6Fz4J83cHBAtnUDy iHt5rDkoqk8L4kQku8+QQ6aOioNAOX6KkY99FA5mqdCUSDqb7YVLxM/pTc2mj7YtVZXFlEC XqDty6PH8jL1areO4Yi9g== UI-OutboundReport: notjunk:1;M01:P0:IPCd3hcT67Q=;Dmjt61wtU7tXNO7GXMPHDSKHySo oMw48qoKSKg/2yMxDzhcPEhc+7OEyjpq6YFHgKP8dUYE/vpbHy3kJY069pWFIZQOmaFJB1DNV 4UNQvVaJdJcR8aBJCpmR90SzPhSZzNIy2+TDAl6UuSq9TCipXtmXfFbYsvAtaisLwAtmIblD8 f/ib7Q2WuTOvO8OXyT4xhHWvr2qY9Hb+0rbF4LJXL098yvK1tsCqEnD44GpVix4228GaEPrtC sMiPFHkzFNiE47DmSej+kgRT6fHh7hU0XVyxnfMV+tGYLSGGzmpi7ye9aChu40jGbKVp+dEZ8 y1sVmjzngK86on5TOmnT9W5ZPms4OGKp8nwTCwLYJBTZ90BytVrQwJJHSerbO2jf3na7woeAk 9G8iHy83vsczSezkMUDGQEqBngOYDcAY8VOh0+xwSxkICiDlFzkA81o5TfgJv/A0mwEgIYqIB Bvonc/TGOk6ClCg91PvBf11gSEKGSdhnTxoKuCVDdn9KE9WLxpvaZWYjc2P1vHtEGx7NrBYw2 NOuowC1RbS9i8Xa+OquZVTght57A0fqz9dosJ8Om/eJG6IL4u5xlAwDQtzt0Po/JaemWAxTJP D7w9c/GDAr0Qq93TvJ2unP/LERqjp0OdQjlUAa7wKQtgsDhx6MuIec3RDopQ86uDjvrlEH80r uh0x8sbTc9MOhwJvRqUutbex/+d6OxPuyPSmL6yDJPTp4fc2CFSKfCkIc1j5Scv2F8dgq8BjZ +qhp0ZJrC1eYeux4U+8CpI6zCbbPr0rt9meZcfXjnWAQB89wfQp32TjI24xDLdiVaO4nBtW2d 5rAGEJ3pDiaDNV6EDJs+U1C5Yt+cl4THEm3mgCtcwGJXg= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062021_924724_DF1E59B6 X-CRM114-Status: GOOD ( 13.88 ) 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 | 72 +++++++++++-------- 1 file changed, 43 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 cb37da7d8085..e3d49d4bdb1d 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,43 @@ 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) { + int ret; + + dev_dbg(instance->state->dev, + "arm: Inserting extra MESSAGE_AVAILABLE\n"); + ret = add_completion(instance, reason, NULL, user_service, + bulk_userdata); + if (ret) + return ret; + } + + 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 +1141,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 Fri Jun 21 13:19: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: 13707599 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 DE50DC41513 for ; Fri, 21 Jun 2024 13:20: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=uX+rS5G3W7Xd5WyDA9MnftLeq1vdmexAme+rSO6wfwE=; b=Om2ubxkCjVQ/1e8IKSfyB05uHt hVBGLi/rYDHCIK+IOyLilmU1nLTHtopwgryDxNBP1ZumAKPMufUEYcjHS8sXk8Fk1z4P8f1ubECnp kp1Nq0zhnyHqbbp+pufJYMN4LzIuZaPGF3Pqec0HM+I/My0AMthei/bjphgxw616Qngo3GoapiN1I WFTPiOyXqXmMaN2yIhrg0LDJB2jIU9L+JcJtMLjiD92ZT2LhOQNg4KN7RTVlpsgP4Ccodd/zSWiZd HbSHbLWEG7JywX3p26/5KA5ZE/beyefsK6GKLz+bl6LuRbAURiM5MPohtg+7R5imwnsPC0IAuQegP SV+5ZSEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeBp-00000009J7r-2qhF; Fri, 21 Jun 2024 13:20:29 +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 1sKeBh-00000009J1Q-1WbI for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976018; x=1719580818; 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=rxeUwKOZh4pzLRTZP/qZtogoYtZBSc8Qo+FlUSTh7C2wPoV09Osl/bfAWJU6S+9D DO6yEAde+mQLm8k+TRtSK750t1FSDkc+Bu2mMC+hsd/V1QAOMx176C/WUYIwlK6g/ gWstfMeOd24f05a45KIF27/Ftbbx9NLqOEaRXHCzukc88uGdMvA9BU5YDV5AvY9w3 SVVjrovHuTaRMVAYQe8MAoJZPUYL7wjHTdSarb5mrH0mCVtVj4pFp+0j+q0Lg0Nme 6VoIzdoNOm80TKPGgfM18u8x5rCVjrLwvyCrXR2SpwXxiqOmF2vyrldcWwtLRJRY3 KdzEqUraDQbEre73Sw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mlw7V-1slQIc3Aln-00jUrn; Fri, 21 Jun 2024 15:20:17 +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 V3 08/10] staging: vchiq_core: Add hex prefix to debugfs output Date: Fri, 21 Jun 2024 15:19:56 +0200 Message-Id: <20240621131958.98208-9-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:p0q/8XrLSg6nLiqJSnB84xq6GIQIkrtFigmv+1MD52yFxufc7QO cudgPhE3IpLZEUsk6T0dGqu6QSU99TmpgLoEkm5QhbaH8RRUrca8gh1qSCj8xM0qg6zkliW /KljRDsIgtePA4GdatY7fpVUxHU+SM6XHnzByxu+zdsX6BoGrdEU/iRkJU/9KlhJreu/OG5 e1pCmfhlzN4VVLaCqplgA== UI-OutboundReport: notjunk:1;M01:P0:bE3w4uPKbg8=;aUeH1NDefhTjPWEh+1pC/szlaI3 3CTFTX/KzHvxLxORm7tQrIvP1hE19hiNHTD3JoStQsYTXqEUJT9Mcim2eIrzg/j8I+cZqntW4 h4+l7BD5l2SxG8qPDm8TuoVu19hScResJ2ea4/AV7ZMVeBkfll+5rbXLy4hSkSwyRddPtHFtQ YRNx0TKRXdOdJzbLTF9R7lQqYxZAAFAKOpGB1/1ZrM8aVeLul2W6qZytvaKAukqrxqZ3DkGk6 lHocTwOnQrb7FKBGwC4c4mzEaJ71FcJ1Cq0V6of329OtprDDRoO9hf6VJ07/6/bH3Q1AEFWeq ccG8gbHCpwSJBnHkvxIlBR1JRFvoh+SAESPJKU470GsRueIyVqZIIUgmhd1ubNi/vBOWmC9/v CsJCHGVlvVq9/Ljc7TQLFvHKR8p02y/K9/drpW+BCD0OtLGneAuPW74E2QBVOZomI76TRmQh9 PK9m9hrcJp3xQvdiI3kTaWA+Ln4h0Ubhjke4h21mER/Se3W19koaBIc3slnI6VLa0+jUKKWZ2 JDqOEbvKCcTiUDCDsk1tqi/1x9l5oDVPgCuPabZIbZZCkhye0nfAtekjsveHoh+szq7qcECP9 aFZPCrf/PSRhsFFq6m8TwJqunsvREuhcnH15aBOvpSKbBM/2VqQMGC9noZB1QT+h/G+Nziq5k cLBRIJfBZ26g2CxuyVfsYo6eyj3dGCs24CZ4GTtRhv1lJxgKzKfbBwAAREBZ9QtFDYiZzsy5f RpDMtCn8UHc0oD2E+xaM2fhJ3qS3yDo0aQ7W/5uyouR08X6UBTsNoUNHzKnizJSXwcFnmHCH3 itBOuABdTZnYqftpwoN6549Kw6ReEOKapWZ3q8VEGzgJk= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062021_786268_AE862903 X-CRM114-Status: UNSURE ( 9.48 ) 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 Fri Jun 21 13:19: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: 13707601 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 743AAC2BBCA for ; Fri, 21 Jun 2024 13:20:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=clkBG9k6stThD9RBx61+zAMxdNQkLd7Uivc4tSeL2Ak=; b=gT2lCcm30KyPcADKzRwkRdRlYi e1EFTcCQeVMtfAefQAIbF886HRnjUB/Y3k87WmPN+89eKpfa/6Tg7CwMe5rFDPmjk6sHP+bgKcr1j Xh1QnaHFgfZcJO4uNE9bZA2gvpd2mE7c7p74eAAHTmrQviPqbP5hCGfDlCp0UEEPUlnccYcJmDGIT VKe0riE5x3vvDTFMz2vVdLzaaanIj0wghPN69GOJhcLzgUJnfTq2R0tIisvY7XKP7AW9W06osNvii 4DvmwLqVkKL6zG6G9OM68i2sdlwkKhrYEN/x7PCBMQ+Wj98naI4K8okNk0oNY/fdgR9P06FUsEoGj 9qMWvMhA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeBt-00000009J9i-3Uee; Fri, 21 Jun 2024 13:20:33 +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 1sKeBh-00000009J1V-3bOK for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:25 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976018; x=1719580818; i=wahrenst@gmx.net; bh=clkBG9k6stThD9RBx61+zAMxdNQkLd7Uivc4tSeL2Ak=; 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=t72FNY3CAXh7zBzUToAWDUW99V2DLjKMycCL9P9m9LLu/jiXgwq0Z7Lq+G28pQjO gkJusI9PG1aNkuW1GTWzp3dYSVV3A89U8XdN8n++1ttOLM5AjlSHA+dDp/FCXm3t6 X2Sp2PwpXqseWtqhljREDyPhSG3veHqQKkn6eA8agI0Rfeui57q3EMpjH3Kec35Vr NG9grTkXDs2NtDPjL4B+iOo3dBl5VpoeS3Ns7gVLTa1jb3t7q5EpQIS/dC6C8r5PC jQ3cnLKfbQFbKQGiG9QXbpV2/ChdiOOE72NrECU26nnMh9LXBMQstyWjnameVREdL LlOJ3zEhhvJkFvi31Q== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1N8XTv-1sOn6h0Npx-015xh7; Fri, 21 Jun 2024 15:20:18 +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 V3 09/10] staging: vchiq_arm: Don't cast scatter-gather elements Date: Fri, 21 Jun 2024 15:19:57 +0200 Message-Id: <20240621131958.98208-10-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:oUg2nHKfmJ0tOdxWjx6vA3BoVLPBJfzUUsVPltIEaY1yaEiW+KA tv3ZBauU9mPeWZNf5E8rDLOndjOA+d6hL062LBtFfMDjH9KuiLBsd+1ChI2sBxF6YBsUY20 Ve1tkJkTOqgzjk6Wse7rv6SQLiQ33LAi2WV8iR6KIgo/L9m/NICriQllIHOJqQVuVZh56xi MRNyijoohR46MijTpf+3g== UI-OutboundReport: notjunk:1;M01:P0:KsbaDeR4UP8=;5QDnxM9sLz+enNdrUt9/JWs3zRh go7VJR/gy0Gz/wmzNsInV2LSedasrPBEfbqYwPhMMJamwTZq3RApNm1DzuqUdsWxGkxMjVquH rl5+0JDpoyxaovkLZoLrOCE95bUh0Mm/IcPTCx4QHP62NKSoWdb+b1xqAR9ZXyjCBJY80CPCl ywf1Ez8MfWZXR9Yl92RQwuqdd7GNMQJQqxSjX0k/ogj9WEaFpeSgaSKunbWx1R1dH7TDxA7aG E6l6vcp1aqH1SFicAOpcjc3Cfsbr0IMBo7JZ3pXTAM99Wu4JmqHC4ydsca+ux2qG82GGZm+c/ ULP8myfK2G7M24oeIGp01TOXwvG0n0rTSGO51Hv2n6NUvMhdibocIc1FbDbsCNVjB2HTgzkmW 8Mua4KZRg1qjaGcgvVlX0v949TmU+7SkPWI9z7COgWvtfI7JUa+t65ajoJ83BbZjhcuk2wvuI 24/uZTn8nUW8mdVETkApbYhU/38nYZHPukZ8JdmA8gfZGP5KHZ8Wk0nmGoIW78bfTvy0N3wws JE3tVEsjLoeXaSRoHY9KyNSwYFrkTgY7IfuSupxMxYwHGFHl0dq3Hm22k6LgRnD9ET2PUo/z0 0O3zprTSZF7/R8WZ1gA3wP2iARr4h0Nct/YXKzF/CHqinlmR5Gq7HtQLYSLAdjy29P+01fyW5 7Oyl/GQF5jZ0395aT2c317O/BY+l5T3Hwl/AN9+gKgNCjGm28wcVg4qKOb/FaqKJDgpqldXqX eZVCnY3MO7eAlS3E4wercRi8/SmtLY81M7L+iZBlJPhpcMm8s0YVD4bAW0VUzbPiDqqgOTkI2 fzckXNDTyowVYRWk9nY+6xuzaxXtWNMiGf7ywsV1lHzTY= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062022_230099_A7C8C68E X-CRM114-Status: GOOD ( 10.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 e3d49d4bdb1d..9e6102c43e00 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 Fri Jun 21 13:19: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: 13707604 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 0927AC27C4F for ; Fri, 21 Jun 2024 13:20:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: Reply-To:Content-Type:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Orjc4i7tUyVoi6f4QE0Sy2YxU1o6Nh1ldyLhIzy/dgA=; b=2jSF/8jY4NO8lte36hDN6XBS3C jCZi8Bnf7flLyA0zMyM+l+m44VZHjrujEUNCku02Y1Z7qkqDXZSUz2vY1PUMn3fWkLWOFh9pgXg+p sJ22TgzkFuodyNL+Lum5H6/RKmkFiKe6zbNdEZzD8TGJkgQ70DIILTaLMXN8mhhIg7sO9Qi8FYul5 N0yMCuOeXNfj6tgVOFLN1YgpBhMqpgSHU2qZpbNc+pNuFd1N5DQ+aWQsJMb3gjB2Fbz7e9gMc7vEi RWSzBqpRUYaDXuHXJS7GgwMcKfvUB1N7jI9t2f7eeLWR/6fkhVaFdAPc+eWyueo1fp2gzcp2b6wNZ KUR9z+1g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sKeC6-00000009JJi-2be2; Fri, 21 Jun 2024 13:20:46 +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 1sKeBi-00000009J1W-09QP for linux-arm-kernel@lists.infradead.org; Fri, 21 Jun 2024 13:20:26 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.net; s=s31663417; t=1718976018; x=1719580818; 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=U/GxEzIB6obsTfL6d3AaH+RAAbwRSyToj/1D1iO4VDG80Cmabjr2ItDq2pIJFnTf twwMLdTVk/sa65I7k8f7c9EQF5hxW3Hb81yYJdjp0FWvfvcouSZ3oSWskOU29PRH8 8oTrZaHro7JREi9coxowXU0EC8Totv8ExYWzeXFWyLwfb3nEH7Ygg5iB7xDwEo3C0 Dh4EDyoZQGwnNpebl81ONLC+4AnxkL6vO9BHSjaGquzsERmml7J+LpH+9fYuorK9d YboWVl4gwUpPTr5HBaWjZJBjWhNP3CIK0RaArnu/4hNdRFXBVYej+UAHZNqo6hdi2 rKWyPvHNsdvGTKQ4YQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mnpns-1sjTI01fwI-00poOE; Fri, 21 Jun 2024 15:20:18 +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 V3 10/10] staging: vc04_services: Update testing instructions Date: Fri, 21 Jun 2024 15:19:58 +0200 Message-Id: <20240621131958.98208-11-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240621131958.98208-1-wahrenst@gmx.net> References: <20240621131958.98208-1-wahrenst@gmx.net> MIME-Version: 1.0 X-Provags-ID: V03:K1:rjYjr7NVw5bQtEQUG/5CcZ4VqDjorYBCz6M2qSOQ9BGi8bO/fs2 UBU2/KlaUckGFqM4ssoxAXpdzMJyzeptMgp3wREOWj76WFgJl3hiJd+o7CRvNQOsU4SJl5g 9o7IgW1Ko9e/sm5XKWpIAwiZccw3agffwBvkKOYjdBD1JQrbFVyHQo5r65S112SJOms3ofk n7gyc2Qomq6Pci8Ji8tYQ== UI-OutboundReport: notjunk:1;M01:P0:DckBwmdH+G0=;zo1Uy7tXJEVnPY02NV128tYTXaA dbQWQ9akiJluDUPBs2mEuKxKY1E01ifoJeDnJYNVrxpbuk2gKBUp3dgSdv9+lbKJBAxlmV8jC 2zBhw3rej9JPtQROqZQWqIoLXHmMi/2gdH5zVYoxJqaAA5NBsulcOG7go6OsWd7WKfBKuivZk +z2z/DyRR6MTV6X9GgaqXyifsDLuKdsvxOf/e3ili8ZKg9tpoTJZ3nJupkSUPV7OM0KR5EoCv exUO27xwjSNh60WYKoAqwpt/PLSVsR/A0bs9BKvrcwXSAcMKn6VUx2Mv07BGacx1STh6i4s6g 09uNB4NA12PYNcEhD0XK0BZBUYrrJ6+K+e0GiQ40uAXot2nZLMzDvVxRHLx7kCSx/WRotWNHG HCJWeWkaOjXc2E0eHQ7S2a8O5zlCqnOXzfSUT4jDaJR/SZjeKlFRm+5wd+OfMqj8ECwbJxBa7 F97iU3CN3vuVKSwVSKMXhHvIYomYBJKGS+GE04FviCgqMB1kGwFIghdS3pizR5vuTvgBz9G+7 D+jPTQcqHbme1dzibRzzpuidKD/nojJEP/XdpsaRjqeMbSdEeMN45WRFVtALVnbQoEcUhXJeU z0puNTUGPMZ9ACgYaIqT3+0pf48x66+4TZkuaTQNZfytabgR6Vjs8X78JrhuxodV4QwqKmWqE w8axobpGOQzsQV2wG3RAScYQQMJ3Hysu0wSNDo/YEjfkYzo0yX0X+JpCfcNTv6JbJt3w9VO+R g9/E3oYsdF3ZOOJX450ECiNXWYHZft0pcND9dbgTw1UI8p1KPjekoVJtGc/jpuBVnoTs9ZX+L aw/EIhqcPIAboplTrQB+7gi42jKMLuUjo+1m2q/ANn6OE= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240621_062022_413253_5CA0241C X-CRM114-Status: GOOD ( 10.08 ) 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