From nobody Tue Feb 10 07:22:39 2026 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 5BC25C77B7E for ; Thu, 25 May 2023 10:18:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240981AbjEYKR7 (ORCPT ); Thu, 25 May 2023 06:17:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240912AbjEYKRE (ORCPT ); Thu, 25 May 2023 06:17:04 -0400 Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F21661B5 for ; Thu, 25 May 2023 03:16:39 -0700 (PDT) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 67BD85C01A2; Thu, 25 May 2023 06:16:39 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Thu, 25 May 2023 06:16:39 -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=1685009799; x= 1685096199; bh=hCn80S16t5KWMrqhGJtFmBVIPiQ9NKvnaZBu9C4Y5xc=; b=S pX+U/7bbNrznA7H2rB6zu/T594d7BHGsU1A5ERwF0Xgu9TYlHw1XjggBptgpLH/x jF/EHY+ykLsMS3bSZVw2WcED+vJtDDVh3K5lphxGcy5QyVNG5p7MrYPbqbaiRnM+ mCDh9M3xkAjKR0mSgl97bAvDqWsWr65H6IjExxTbd/ZC4nlixOWdu7bC8iH3IVaO XMBefErDfgizeI09MXW8HlnkcQLxTSSV4XGbQTaycND9ZHhm7XItdStXJ5TKyEpX EuitHfReSaucXfZjoRX7tv0XzRRNqOkXD6IneJM5BCoVL4l6WiwRXioRGb2WCGkN BhOl15iPWZmfEThmHNMrQ== 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=1685009799; x=1685096199; bh=h Cn80S16t5KWMrqhGJtFmBVIPiQ9NKvnaZBu9C4Y5xc=; b=ygaLTXeBUT6MZMicC 7rM0fte9LEZe6X/8daKcUvK1/RTt132TipqEhhdaUzWKXhnDBScr3rIixUCvkmkH 2Mgmq8NC9VloOvPo88+fCco4P0uoLUpAgBScWq+tpqSkg5FxHZbFSdFAxUR2BPmJ J0RCpPyzeBHokygzF2iWFYan+p5wm7pG3a6+Zoz/EySqsMEy4g9DlQdSNIU/lO2g jVL4jwSBG2ybzws89yb2rjQ1PtihB/411JkJoMRxqG24EpIWsBk1md+jNaFwa96x bVX7r7dnEl1B9adPu+w3l0bc+P60Uhn9ql0PqWAHhyGYslphrvG5mWvuhuxLIMtQ kse5w== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrfeejjedgvdehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefhvffufffkofgjfhgggfestdekre dtredttdenucfhrhhomhepvfgrkhgrshhhihcuufgrkhgrmhhothhouceoohdqthgrkhgr shhhihesshgrkhgrmhhotggthhhirdhjpheqnecuggftrfgrthhtvghrnhepveefffefke etgfevgeefleehfffhueejtdejveethfekveektdejjedvtdejhfejnecuvehluhhsthgv rhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepohdqthgrkhgrshhhihessh grkhgrmhhotggthhhirdhjph X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 25 May 2023 06:16:38 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Subject: [PATCH v2 07/12] firewire: cdev: code refactoring to operate event of response Date: Thu, 25 May 2023 19:16:20 +0900 Message-Id: <20230525101625.888906-8-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230525101625.888906-1-o-takashi@sakamocchi.jp> References: <20230525101625.888906-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