From nobody Sun Sep 14 10:17:43 2025 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5916C77B7A for ; Mon, 29 May 2023 11:34:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231641AbjE2Lew (ORCPT ); Mon, 29 May 2023 07:34:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231494AbjE2Leq (ORCPT ); Mon, 29 May 2023 07:34:46 -0400 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1AE94FE for ; Mon, 29 May 2023 04:34:28 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 3DC163200929; Mon, 29 May 2023 07:34:27 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Mon, 29 May 2023 07:34:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm1; t=1685360066; x= 1685446466; bh=hCn80S16t5KWMrqhGJtFmBVIPiQ9NKvnaZBu9C4Y5xc=; b=q 3/PXv12ub3R543er7mtSqTG+UOl9z9RizPLl3+jLjcqk5V7W/0HqO8BjbPb5hmll ImZTRuZ+HREPQDUxoS0yCVs4zh2hBcGw8IDobLfre9D4Wbij9YFsJNd19CRuFYqp GjtzNwEgKBMun/4HXcr3Mp1BJsvhR0cQmTtCQnWQ03CKMa5NJnagzJXdBNwSm+Gd vttC3Gg+IJ+pQsd5N/2Pj5nyqP17wU+DU+3pObOUDoQlzvZVHeWQf8c+C311TJfT /KsezunhzL5BpsOh5Ql7ctUnRxPj0a0E7M/vMMzNwTBdcWHssoBO9TKvIHcgW871 rpTEUf4F1i4e8W0mt+8eQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:date:feedback-id:feedback-id:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1685360066; x=1685446466; bh=h Cn80S16t5KWMrqhGJtFmBVIPiQ9NKvnaZBu9C4Y5xc=; b=BTn8MYuwszk8Iw27z MXblbdH/e4Ca9imlzuRm1qKQo6+2rKHcyIIXu1eK7vHR9dMvR537eRidlzctB8sD XzGHo48+GTorW3YpQpJQQuYR8Khuodiu1rpcJCDZvld6pPwQFVyMfnz3diiIBayy nhBOQB8mW1m7mGVCqDGxV8wtylJqL+IKSimuU0AnWuAT3uhFvn20NxtXF8+7AfK5 jxOjpXXQMsZ8YUm1C1XTO5p6/KPBxdd9W3muxqos38PI5oIciOC/9HyGHzZLXR8B F+b93LZEUVkAvRsRrHdFJms9h+TMcGcyoLp8Q/crL1YqGAxFusUdGUnhFMfp53He /hXiA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeekhedggeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgr shhhihesshgrkhgrmhhotggthhhirdhjpheqnecuggftrfgrthhtvghrnhepveefffefke etgfevgeefleehfffhueejtdejveethfekveektdejjedvtdejhfejnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihessh grkhgrmhhotggthhhirdhjph X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 29 May 2023 07:34:25 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v3 07/12] firewire: cdev: code refactoring to operate event of response Date: Mon, 29 May 2023 20:34:01 +0900 Message-Id: <20230529113406.986289-8-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230529113406.986289-1-o-takashi@sakamocchi.jp> References: <20230529113406.986289-1-o-takashi@sakamocchi.jp> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" This commit is a preparation to handle time stamp of asynchronous transaction for user space application. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-cdev.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 5a9446d30447..315ebc8c545d 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -170,7 +170,9 @@ struct outbound_transaction_event { struct event event; struct client *client; struct outbound_transaction_resource r; - struct fw_cdev_event_response response; + union { + struct fw_cdev_event_response without_tstamp; + } rsp; }; =20 struct inbound_transaction_event { @@ -540,7 +542,7 @@ static void complete_transaction(struct fw_card *card, = int rcode, void *payload, size_t length, void *data) { struct outbound_transaction_event *e =3D data; - struct fw_cdev_event_response *rsp =3D &e->response; + struct fw_cdev_event_response *rsp =3D &e->rsp.without_tstamp; struct client *client =3D e->client; unsigned long flags; =20 @@ -581,6 +583,8 @@ static int init_request(struct client *client, int destination_id, int speed) { struct outbound_transaction_event *e; + struct fw_cdev_event_response *rsp; + void *payload; int ret; =20 if (request->tcode !=3D TCODE_STREAM_DATA && @@ -594,14 +598,14 @@ static int init_request(struct client *client, e =3D kmalloc(sizeof(*e) + request->length, GFP_KERNEL); if (e =3D=3D NULL) return -ENOMEM; - e->client =3D client; - e->response.length =3D request->length; - e->response.closure =3D request->closure; =20 - if (request->data && - copy_from_user(e->response.data, - u64_to_uptr(request->data), request->length)) { + rsp =3D &e->rsp.without_tstamp; + rsp->length =3D request->length; + rsp->closure =3D request->closure; + payload =3D rsp->data; + + if (request->data && copy_from_user(payload, u64_to_uptr(request->data), = request->length)) { ret =3D -EFAULT; goto failed; } @@ -611,10 +615,9 @@ static int init_request(struct client *client, if (ret < 0) goto failed; =20 - fw_send_request(client->device->card, &e->r.transaction, - request->tcode, destination_id, request->generation, - speed, request->offset, e->response.data, - request->length, complete_transaction, e); + fw_send_request(client->device->card, &e->r.transaction, request->tcode, = destination_id, + request->generation, speed, request->offset, payload, request->length, + complete_transaction, e); return 0; =20 failed: --=20 2.39.2