From nobody Sat Nov 30 01:46:38 2024 Received: from fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CC73720E3 for ; Thu, 12 Sep 2024 13:30:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147848; cv=none; b=OoXQiV9/o0WIupPE50f2A6ngfzheOFsfmTJqEO1GJy59/kimCcFNaq2IfdGbUsP5/UYFOhiGLclQBGN5STQu0auyEi9+Su0x0zPxdfbY09PynM3S2MCHb84Ue8XDnXyiRCrDUctk7CSOm/czNR3wMi1KGsgdkceNCVpJBDmBOi8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147848; c=relaxed/simple; bh=9x3rmCbI8W50P9KO2ikEU7FhfmqMsJfCwGRXUZz9Y3I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qpkGY/6R4h1Pfl9883DJ/V4/fXllNBASBOEWy/jVb1f7S88Gt2Rct177lByZG9KijuAXuqPLi/aqa6EpoUh9eifMrrNAyhNOyJSboPopjISrYqHntjMjKtsjvIZ0duu/l9z3tggm0iZdnTrxgOgJoGC5SZ7azYVghIQg3hlun9o= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=li2ZfkfZ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=TTxTuZ3D; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="li2ZfkfZ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="TTxTuZ3D" Received: from phl-compute-09.internal (phl-compute-09.phl.internal [10.202.2.49]) by mailfout.phl.internal (Postfix) with ESMTP id CA7951380550; Thu, 12 Sep 2024 09:30:45 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-09.internal (MEProxy); Thu, 12 Sep 2024 09:30:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1726147845; x= 1726234245; bh=MMbGuK3N/1jRODTwbn0Vkonn552Hd2+afxq5dkrI7T4=; b=l i2ZfkfZ9EU4iayMQjq6m133nIerz6kgi5vketw/kwMvhuavZ7po6bJRqvqM2bTr6 A77xMQ4G609+NGZUfwyzNx0PHtDHm8yhUGYriy5tAbFRvtBEJnq5YajAV9ULKAV4 DUo4oBedXknVzTYUgURjUAPa/IV1IG3FqYUfIjFRTfb3V9pUZQK5sbPQGELJ13OI P+pOrSF0z0saue1skSlDlkl1qr22aBRwQ5MlunWzWqf+dBVfk1LLtu3QOlXzH9Au nq9rCLk7DfaGtYqerJW+JJm8108MFpGAFzomNVkx9XhREYdafhy3XKkApGhmVpho k9QSTPP+OS15LRzsV83MA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726147845; x= 1726234245; bh=MMbGuK3N/1jRODTwbn0Vkonn552Hd2+afxq5dkrI7T4=; b=T TxTuZ3D97S4v5JaLa8enNraahmqu1yvTZ7zMpJoBc0ILwa8vKLrF4LpZAKKbm6UG Z0GMu/Y1yvPv3h1Mj/4yittuzXoWMTPw1fBoXtFL2oV+W07JDCUqywwAo6EW1Bpn FviIf3IIL/YxW/79gnOhRwhgZKtnUwqPI7NdIfIMjbEYruIelFzHo/P+g6oyhATS B4Z6yY5eHpn4PLtRPxKTCfnGKmUazOm/EBdFrHKUKgUTS8g33i6hxMnpAqaCzBOb NfShalZhCcK/LSYQ+S/B69iE7TF96jy+WZ8F1eOL7vBJMNdNdQku4O46HiQ4EGip hRh17clZYMCCg3MVIfAXA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejfedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghm ohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrg htthgvrhhnpedvjefgjeeuvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdff kedvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhppdhnsggprhgtphhtthhopedv pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigudefleegqdguvghvvg hlsehlihhsthhsrdhsohhurhgtvghfohhrghgvrdhnvghtpdhrtghpthhtoheplhhinhhu gidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Sep 2024 09:30:44 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/5] Revert "firewire: core: use mutex to coordinate concurrent calls to flush completions" Date: Thu, 12 Sep 2024 22:30:34 +0900 Message-ID: <20240912133038.238786-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912133038.238786-1-o-takashi@sakamocchi.jp> References: <20240912133038.238786-1-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit d9605d67562505e27dcc0f71af418118d3db91e5, since this commit is on the following reverted changes. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-iso.c | 11 ++--------- drivers/firewire/ohci.c | 37 +++++++++++++++++++++++-------------- include/linux/firewire.h | 1 - 3 files changed, 25 insertions(+), 24 deletions(-) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 1405d2e9cb2c..9f41c78878ad 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -157,7 +157,6 @@ struct fw_iso_context *fw_iso_context_create(struct fw_= card *card, ctx->callback.sc =3D callback; ctx->callback_data =3D callback_data; INIT_WORK(&ctx->work, flush_completions_work); - mutex_init(&ctx->flushing_completions_mutex); =20 trace_isoc_outbound_allocate(ctx, channel, speed); trace_isoc_inbound_single_allocate(ctx, channel, header_size); @@ -174,8 +173,6 @@ void fw_iso_context_destroy(struct fw_iso_context *ctx) trace_isoc_inbound_multiple_destroy(ctx); =20 ctx->card->driver->free_iso_context(ctx); - - mutex_destroy(&ctx->flushing_completions_mutex); } EXPORT_SYMBOL(fw_iso_context_destroy); =20 @@ -229,7 +226,7 @@ EXPORT_SYMBOL(fw_iso_context_queue_flush); * to process the context asynchronously, fw_iso_context_schedule_flush_co= mpletions() is available * instead. * - * Context: Process context due to mutex_trylock(). + * Context: Process context. */ int fw_iso_context_flush_completions(struct fw_iso_context *ctx) { @@ -237,11 +234,7 @@ int fw_iso_context_flush_completions(struct fw_iso_con= text *ctx) trace_isoc_inbound_single_flush_completions(ctx); trace_isoc_inbound_multiple_flush_completions(ctx); =20 - scoped_cond_guard(mutex_try, /* nothing to do */, &ctx->flushing_completi= ons_mutex) { - return ctx->card->driver->flush_iso_completions(ctx); - } - - return 0; + return ctx->card->driver->flush_iso_completions(ctx); } EXPORT_SYMBOL(fw_iso_context_flush_completions); =20 diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index b182998a77f4..02ff0363d3ad 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -166,6 +166,7 @@ struct iso_context { struct context context; void *header; size_t header_length; + unsigned long flushing_completions; u32 mc_buffer_bus; u16 mc_completed; u16 last_timestamp; @@ -3578,23 +3579,31 @@ static void ohci_flush_queue_iso(struct fw_iso_cont= ext *base) static int ohci_flush_iso_completions(struct fw_iso_context *base) { struct iso_context *ctx =3D container_of(base, struct iso_context, base); + int ret =3D 0; =20 - // Note that tasklet softIRQ is not used to process isochronous context a= nymore. - context_tasklet((unsigned long)&ctx->context); + if (!test_and_set_bit_lock(0, &ctx->flushing_completions)) { + // Note that tasklet softIRQ is not used to process isochronous context = anymore. + context_tasklet((unsigned long)&ctx->context); =20 - switch (base->type) { - case FW_ISO_CONTEXT_TRANSMIT: - case FW_ISO_CONTEXT_RECEIVE: - if (ctx->header_length !=3D 0) - flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH); - return 0; - case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL: - if (ctx->mc_completed !=3D 0) - flush_ir_buffer_fill(ctx); - return 0; - default: - return -ENOSYS; + switch (base->type) { + case FW_ISO_CONTEXT_TRANSMIT: + case FW_ISO_CONTEXT_RECEIVE: + if (ctx->header_length !=3D 0) + flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH); + break; + case FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL: + if (ctx->mc_completed !=3D 0) + flush_ir_buffer_fill(ctx); + break; + default: + ret =3D -ENOSYS; + } + + clear_bit_unlock(0, &ctx->flushing_completions); + smp_mb__after_atomic(); } + + return ret; } =20 static const struct fw_card_driver ohci_driver =3D { diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 19e8c5f9537c..f815d12deda0 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -512,7 +512,6 @@ union fw_iso_callback { struct fw_iso_context { struct fw_card *card; struct work_struct work; - struct mutex flushing_completions_mutex; int type; int channel; int speed; --=20 2.43.0 From nobody Sat Nov 30 01:46:38 2024 Received: from fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 258E81A0BEE for ; Thu, 12 Sep 2024 13:30:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147850; cv=none; b=dWm9Fv5d4Dj94eoACv97XLSv+ictVAYTWSOz51kgFz00FPgl2KXC5HNTEDkCjhmCB5xzI7XBT6cRQNukVDs03b4VBls1Qkz/J46Q4nkX9Fka/av8zbDpFEh6F+B8J8hLlvOmxy4XIyPmfp7ShfBapf2GxxHkEGdjulU4iNFQoaw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147850; c=relaxed/simple; bh=o6UqXQnfrAI5lPpgHSFkYycMXhQQ1ysYNKfzj0CGNUY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PJodcqHOo+iW4BiY2v/WgtihlMu6zlixLp+D8nnUPTLtXCMoc3aVBy7hAuhXQGzlnKRzeclsOpAiuZCjGwH7Wh/KeacS3Em3Q+yyV65HjL7e5TW8z8Dc4t975rEAMfx7Es9TxWYo+DfAO//Z+qJKw1183qXftfFnhU+3SFb52n4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=rEZRq1ss; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=omVDyfQP; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="rEZRq1ss"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="omVDyfQP" Received: from phl-compute-11.internal (phl-compute-11.phl.internal [10.202.2.51]) by mailfout.phl.internal (Postfix) with ESMTP id 496A5138056D; Thu, 12 Sep 2024 09:30:47 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-11.internal (MEProxy); Thu, 12 Sep 2024 09:30:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1726147847; x= 1726234247; bh=hOL3pXdPLkPf7uAd5iia3Mmqf1qjh1jea0RIAuKN/g0=; b=r EZRq1ss/tDmMaOQ6AbIHQB+Gjh3RC/amDsWQNwyRCUUJkYs8cwd6r9uqRWT3brPI kRBg0f6nwM53Z4VGZwT91I/gMsL8xZkn9GAwYP4Z3CP/8uv+yRyhfONDnlecBDer 8oqWLWvc1O1cQPNwG2KfxzXB7hENIz9H7IaU3IH2BjWdz0/9Vqoty4m9Fj9PqdJs rnygEWeu3gjICME5y0OdKsLt/7TU5Gwzvsc+Z9+bny57+WwpM9ePJRCDgL72wSQG i2qQhsMj0+rDNq+Q+FYaPBuYtMvXYH9rqXzacJRAmiV2L+DpEAUOEZwMAP9wfhuw rnMRy5WztGnL29uJjYBAA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726147847; x= 1726234247; bh=hOL3pXdPLkPf7uAd5iia3Mmqf1qjh1jea0RIAuKN/g0=; b=o mVDyfQPh1PCuoMseNNefo4yI/Ov460TBQAz0Ccpb9bJFPwR+dadqrhmC3cwFP2Og nSpqX+bkR9qzywZP90KC9ucNIWR23LIQGgRLDntbjCCB1H7bd5AoGx4KZcFY8gNV amALtsdEYqOZzU0xqHFzF7E7/HQIzp7ltDYpRBiEaHK50n4Dye7rxHmfpLTDrFoi rW1FBinzI4wzhg8T0UHJDYfr3onehLO9QU06ecDx9zZUn8PWW+PPjF4qWD3EcdL6 x9mLhiTE8JmANi+ohHO0m2eXfUfWE4voOmKGOWEzfV4Xxj/5CNorLAUk0YwKNSQu BUnfrXO1DEJjpGAmGgliA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejfedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghm ohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrg htthgvrhhnpedvjefgjeeuvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdff kedvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhppdhnsggprhgtphhtthhopedv pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigudefleegqdguvghvvg hlsehlihhsthhsrdhsohhurhgtvghfohhrghgvrdhnvghtpdhrtghpthhtoheplhhinhhu gidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Sep 2024 09:30:46 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/5] Revert "firewire: core: move workqueue handler from 1394 OHCI driver to core function" Date: Thu, 12 Sep 2024 22:30:35 +0900 Message-ID: <20240912133038.238786-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912133038.238786-1-o-takashi@sakamocchi.jp> References: <20240912133038.238786-1-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" This reverts commit 767bfb9ef27ebf760290d9f8bc303828b018c312. It appears that the call of ohci_flush_iso_completions() in the work item scheduled by hardIRQ of 1394 OHCI for any isochronous context changes the timing to queue events in the view of user space application. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-iso.c | 26 ++++++++++++--------- drivers/firewire/core.h | 5 +++++ drivers/firewire/ohci.c | 45 +++++++++++++++++++++++++++++++++++-- 3 files changed, 64 insertions(+), 12 deletions(-) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index 9f41c78878ad..f2394f3ed194 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -131,13 +131,6 @@ size_t fw_iso_buffer_lookup(struct fw_iso_buffer *buff= er, dma_addr_t completed) return 0; } =20 -static void flush_completions_work(struct work_struct *work) -{ - struct fw_iso_context *ctx =3D container_of(work, struct fw_iso_context, = work); - - fw_iso_context_flush_completions(ctx); -} - struct fw_iso_context *fw_iso_context_create(struct fw_card *card, int type, int channel, int speed, size_t header_size, fw_iso_callback_t callback, void *callback_data) @@ -156,7 +149,6 @@ struct fw_iso_context *fw_iso_context_create(struct fw_= card *card, ctx->header_size =3D header_size; ctx->callback.sc =3D callback; ctx->callback_data =3D callback_data; - INIT_WORK(&ctx->work, flush_completions_work); =20 trace_isoc_outbound_allocate(ctx, channel, speed); trace_isoc_inbound_single_allocate(ctx, channel, header_size); @@ -226,15 +218,29 @@ EXPORT_SYMBOL(fw_iso_context_queue_flush); * to process the context asynchronously, fw_iso_context_schedule_flush_co= mpletions() is available * instead. * - * Context: Process context. + * Context: Process context. May sleep due to disable_work_sync(). */ int fw_iso_context_flush_completions(struct fw_iso_context *ctx) { + int err; + trace_isoc_outbound_flush_completions(ctx); trace_isoc_inbound_single_flush_completions(ctx); trace_isoc_inbound_multiple_flush_completions(ctx); =20 - return ctx->card->driver->flush_iso_completions(ctx); + might_sleep(); + + // Avoid dead lock due to programming mistake. + if (WARN_ON_ONCE(current_work() =3D=3D &ctx->work)) + return 0; + + disable_work_sync(&ctx->work); + + err =3D ctx->card->driver->flush_iso_completions(ctx); + + enable_work(&ctx->work); + + return err; } EXPORT_SYMBOL(fw_iso_context_flush_completions); =20 diff --git a/drivers/firewire/core.h b/drivers/firewire/core.h index 96ae366889e0..0ae2c84ecafe 100644 --- a/drivers/firewire/core.h +++ b/drivers/firewire/core.h @@ -159,6 +159,11 @@ int fw_iso_buffer_alloc(struct fw_iso_buffer *buffer, = int page_count); int fw_iso_buffer_map_dma(struct fw_iso_buffer *buffer, struct fw_card *ca= rd, enum dma_data_direction direction); =20 +static inline void fw_iso_context_init_work(struct fw_iso_context *ctx, wo= rk_func_t func) +{ + INIT_WORK(&ctx->work, func); +} + =20 /* -topology */ =20 diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 02ff0363d3ad..3a911cfb5ff3 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -1182,6 +1182,47 @@ static void context_tasklet(unsigned long data) } } =20 +static void ohci_isoc_context_work(struct work_struct *work) +{ + struct fw_iso_context *base =3D container_of(work, struct fw_iso_context,= work); + struct iso_context *isoc_ctx =3D container_of(base, struct iso_context, b= ase); + struct context *ctx =3D &isoc_ctx->context; + struct descriptor *d, *last; + u32 address; + int z; + struct descriptor_buffer *desc; + + desc =3D list_entry(ctx->buffer_list.next, struct descriptor_buffer, list= ); + last =3D ctx->last; + while (last->branch_address !=3D 0) { + struct descriptor_buffer *old_desc =3D desc; + + address =3D le32_to_cpu(last->branch_address); + z =3D address & 0xf; + address &=3D ~0xf; + ctx->current_bus =3D address; + + // If the branch address points to a buffer outside of the current buffe= r, advance + // to the next buffer. + if (address < desc->buffer_bus || address >=3D desc->buffer_bus + desc->= used) + desc =3D list_entry(desc->list.next, struct descriptor_buffer, list); + d =3D desc->buffer + (address - desc->buffer_bus) / sizeof(*d); + last =3D find_branch_descriptor(d, z); + + if (!ctx->callback(ctx, d, last)) + break; + + if (old_desc !=3D desc) { + // If we've advanced to the next buffer, move the previous buffer to the + // free list. + old_desc->used =3D 0; + guard(spinlock_irqsave)(&ctx->ohci->lock); + list_move_tail(&old_desc->list, &ctx->buffer_list); + } + ctx->last =3D last; + } +} + /* * Allocate a new buffer and add it to the list of free buffers for this * context. Must be called with ohci->lock held. @@ -3128,6 +3169,7 @@ static struct fw_iso_context *ohci_allocate_iso_conte= xt(struct fw_card *card, ret =3D context_init(&ctx->context, ohci, regs, callback); if (ret < 0) goto out_with_header; + fw_iso_context_init_work(&ctx->base, ohci_isoc_context_work); =20 if (type =3D=3D FW_ISO_CONTEXT_RECEIVE_MULTICHANNEL) { set_multichannel_mask(ohci, 0); @@ -3582,8 +3624,7 @@ static int ohci_flush_iso_completions(struct fw_iso_c= ontext *base) int ret =3D 0; =20 if (!test_and_set_bit_lock(0, &ctx->flushing_completions)) { - // Note that tasklet softIRQ is not used to process isochronous context = anymore. - context_tasklet((unsigned long)&ctx->context); + ohci_isoc_context_work(&base->work); =20 switch (base->type) { case FW_ISO_CONTEXT_TRANSMIT: --=20 2.43.0 From nobody Sat Nov 30 01:46:38 2024 Received: from fhigh7-smtp.messagingengine.com (fhigh7-smtp.messagingengine.com [103.168.172.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9703A1AB6F9 for ; Thu, 12 Sep 2024 13:30:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147851; cv=none; b=n3WriQdGmgPZasRSARbI6iTYZIxsRP6Dj2qc9/9bNU6Giwg+UExqSGXXODkB6zsHXLQ4XZYERk56AfvkT4l9LX+i1KaTkpfM8dhArsaBhirZdbN3vBYnI4vV+QzOq9qe2+AWF+HSzlcehV0/GXeDZ5ojaXASzcPclt2+PouyvaQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147851; c=relaxed/simple; bh=VyCnF/sIxypxemRm/VZAiK93JGvif7eplvK5dBrfKOo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qiGXN31gM6WUTXSS9R3XbrOGkI5aMASqT3mT1/5lpd3WXLs8MAT+whMZwaWOW9h58+DpHvLvwoSx6a7lJhrvYYyz1xk6mUlwYuRawHed4k2Y2FskrVmPzi2bga+khDimLqh91Ayr11pQJCIHlbictRi24+czh1Kr6TfdbLz8v+M= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=VcXEnawU; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=klM+J1Ju; arc=none smtp.client-ip=103.168.172.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="VcXEnawU"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="klM+J1Ju" Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.phl.internal (Postfix) with ESMTP id C29661140502; Thu, 12 Sep 2024 09:30:48 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Thu, 12 Sep 2024 09:30:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1726147848; x= 1726234248; bh=rglo+/zDD6Nc+U+Znu+G2W2jETHltYG2U4iySeRHtms=; b=V cXEnawU6hWxOCfg2MeJrzYLGRwY4mHObAOt4NW9QiUJ9CY8G51aB/iAhQJpFGpC3 Jb7kQTyp48A0NhOuFP6UcMDHmPNNPRk9tvvq/hBz5iXh5KpAKvtDU25tVYzOLajv q+t03gTwscWaX05L4yW03CDlS53XB/x3nEkhv3lnuuqo8vr3DKzDLrDL8+UXNtFC pz8YXXFxxSKPykjknpS8bEQI+vGiGDJ0Irk0SnrRoY5V4ykm/7cnLmXX+TkymGz8 J1YzpKJlDtuPjTZA7PrJTNviEQLC/+Vr7ptNf2lH4PEER3LRcMclSccwHgd5jcBa LNAQZVpLuLzlThe/Y1hyQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726147848; x= 1726234248; bh=rglo+/zDD6Nc+U+Znu+G2W2jETHltYG2U4iySeRHtms=; b=k lM+J1JuGWMvqMOt17zEf3Uf+HighWYqbfzHT/swfZEUflUmY4Vuci+HORf9OIW8O xNqz6piQFR8SXgRC51Wu9sz/d7riTzqGI2JBx1sHEznC3cZiamZ7KOrMhlc1C/ul x+mXIsgLjK/OKi7M7ULWka/1ahYeClZi8NEjJJSJ8U0yr+oA9dWYVpALjPUK2D53 LP4Z6Jx/nZTz7c7IdWeHP3oqCreAk7gi8HjIhnTCl9LGzJU3aM0F9DyFqsHhiim2 b/7RKhEQpBRIZKA15XYPNP2cFineOGzymUPpZb51J+9nGch6mybuFbJU+1jgeAjN SyAcNuYjGNLCSexpGGHEw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejfedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghm ohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrg htthgvrhhnpedvjefgjeeuvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdff kedvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhppdhnsggprhgtphhtthhopedv pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigudefleegqdguvghvvg hlsehlihhsthhsrdhsohhurhgtvghfohhrghgvrdhnvghtpdhrtghpthhtoheplhhinhhu gidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Sep 2024 09:30:47 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 3/5] firewire: core: add helper function to retire descriptors Date: Thu, 12 Sep 2024 22:30:36 +0900 Message-ID: <20240912133038.238786-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912133038.238786-1-o-takashi@sakamocchi.jp> References: <20240912133038.238786-1-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Both IR/IT contexts use the same code to retire completed descriptors as AT context uses. This commit adds a helper function to reduce the duplicated codes. Signed-off-by: Takashi Sakamoto --- drivers/firewire/ohci.c | 45 +++++++++-------------------------------- 1 file changed, 9 insertions(+), 36 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 3a911cfb5ff3..4af4c9af4fe4 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -1141,9 +1141,8 @@ static struct descriptor *find_branch_descriptor(stru= ct descriptor *d, int z) return d + z - 1; } =20 -static void context_tasklet(unsigned long data) +static void context_retire_descriptors(struct context *ctx) { - struct context *ctx =3D (struct context *) data; struct descriptor *d, *last; u32 address; int z; @@ -1182,45 +1181,19 @@ static void context_tasklet(unsigned long data) } } =20 +static void context_tasklet(unsigned long data) +{ + struct context *ctx =3D (struct context *) data; + + context_retire_descriptors(ctx); +} + static void ohci_isoc_context_work(struct work_struct *work) { struct fw_iso_context *base =3D container_of(work, struct fw_iso_context,= work); struct iso_context *isoc_ctx =3D container_of(base, struct iso_context, b= ase); - struct context *ctx =3D &isoc_ctx->context; - struct descriptor *d, *last; - u32 address; - int z; - struct descriptor_buffer *desc; - - desc =3D list_entry(ctx->buffer_list.next, struct descriptor_buffer, list= ); - last =3D ctx->last; - while (last->branch_address !=3D 0) { - struct descriptor_buffer *old_desc =3D desc; - - address =3D le32_to_cpu(last->branch_address); - z =3D address & 0xf; - address &=3D ~0xf; - ctx->current_bus =3D address; - - // If the branch address points to a buffer outside of the current buffe= r, advance - // to the next buffer. - if (address < desc->buffer_bus || address >=3D desc->buffer_bus + desc->= used) - desc =3D list_entry(desc->list.next, struct descriptor_buffer, list); - d =3D desc->buffer + (address - desc->buffer_bus) / sizeof(*d); - last =3D find_branch_descriptor(d, z); - - if (!ctx->callback(ctx, d, last)) - break; =20 - if (old_desc !=3D desc) { - // If we've advanced to the next buffer, move the previous buffer to the - // free list. - old_desc->used =3D 0; - guard(spinlock_irqsave)(&ctx->ohci->lock); - list_move_tail(&old_desc->list, &ctx->buffer_list); - } - ctx->last =3D last; - } + context_retire_descriptors(&isoc_ctx->context); } =20 /* --=20 2.43.0 From nobody Sat Nov 30 01:46:38 2024 Received: from fhigh7-smtp.messagingengine.com (fhigh7-smtp.messagingengine.com [103.168.172.158]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2A4701AD3F6 for ; Thu, 12 Sep 2024 13:30:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147852; cv=none; b=C1WkQ1lxjlEwtd/YcblKOQw22kVohSACE1/EXp7d0fQlEsFMJ9PnrTREBb9aU6cJqc6GtGFItwFu54q8J5KWHnmey9rHaNjALK7v0h3KazkuUZ+JRfOyfR0SbflH2sLe36FIUf7ga18ZZaX2zDfz8P7pitHBevdQaigYiY2Y374= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147852; c=relaxed/simple; bh=UJWYuSjdTApRtaGUCFlq4cdJf6XqCD1vNFrTTn4rvqM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=eDAsBM1tojDgF7g+9o4DxGkj33qUVW1cBblR3d3D/WY+kQMbRBO2s4Ypq5nicP+ruZAcky0EjTQpj06RWrXYfcOlFQYdJY0SnympasHikM03vlhwf01UJMPYXJzQJramAoazixRxwMqe5bao0FSQu8cpzuNoTwtAKYyJws50504= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=fC8rdqIE; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=t0RtQf1x; arc=none smtp.client-ip=103.168.172.158 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="fC8rdqIE"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="t0RtQf1x" Received: from phl-compute-02.internal (phl-compute-02.phl.internal [10.202.2.42]) by mailfhigh.phl.internal (Postfix) with ESMTP id 34E7D11404E6; Thu, 12 Sep 2024 09:30:50 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-02.internal (MEProxy); Thu, 12 Sep 2024 09:30:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1726147850; x= 1726234250; bh=8k4VDzvRIm/u8Ga1uxFz+W+U5caXLxKxCncN23o4gsw=; b=f C8rdqIE7Yjsl1oWxSn2pj2EzbbvZeh9D0j1pXCe5P6EibFgPb0JSRgg8WyJjQJtm IuzxS6HItAOiTk0HxLZ2hXzXpo9JgkyVq5cVEhhS8ThQxNcDTHT1CXAlXyxg60Nf h85pC1OZ0pB0T0+70pes679DL7zadBd26elv+23ze7YDjRCMnoVDtLstNL4w3WZw NT5tXljKuJ/UZe93S6xBplWZSg8b1ETqYjy83pPelDWaR4PThZhxbEQex3RHeKvL 1w2G08N1G0eIdx1q4Tr09yEipWaDGOJT7Zyj99sLhhLxeFg1vYjR0nOTlL9syLkv 1IxoDVLfHUfbI65eqpIiA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726147850; x= 1726234250; bh=8k4VDzvRIm/u8Ga1uxFz+W+U5caXLxKxCncN23o4gsw=; b=t 0RtQf1x7Q7BjHJopAg0IUJtr9Ty/av1aAvJvaGWWeOAF5BMQpuCc3EXW191KUztv YSF6szbKh42Witdyg2fibc7q9tXoX0jzBepYwQlX9fLvVbWjuxYmcQVjtQG1Jgl5 K40BoS2ZxXCIWOYXufExFhnKoyw6KQOimsfcOkZeV3ORUs/Kf92NMfQYdan218gB /fI6Xc4UC68+3S2dnyt/wQSUfBhsBwT6yMVpKHeiS6haLK4eMfJVaqo8ue1GFN/6 hkGFH2QVrNGVhj9o/+C9HYHXSbNiZu5HVa2EfS4pfl9uwoq1NAK9zQE4fU05Rt5O utf2JALPIzwfPzJQ7ypPQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejfedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghm ohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrg htthgvrhhnpedvjefgjeeuvdfguddukeelveetgfdtvefhtdfffeeigfevueetffeivdff kedvtdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhppdhnsggprhgtphhtthhopedv pdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehlihhnuhigudefleegqdguvghvvg hlsehlihhsthhsrdhsohhurhgtvghfohhrghgvrdhnvghtpdhrtghpthhtoheplhhinhhu gidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Sep 2024 09:30:48 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 4/5] firewire: core: update documentation of kernel APIs for flushing completions Date: Thu, 12 Sep 2024 22:30:37 +0900 Message-ID: <20240912133038.238786-5-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912133038.238786-1-o-takashi@sakamocchi.jp> References: <20240912133038.238786-1-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" There is a slight difference between fw_iso_context_flush_completions() and fw_iso_context_schedule_flush_completions(). This commit updates the documentations for them. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-iso.c | 9 ++++++--- include/linux/firewire.h | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/drivers/firewire/core-iso.c b/drivers/firewire/core-iso.c index f2394f3ed194..a67493862c85 100644 --- a/drivers/firewire/core-iso.c +++ b/drivers/firewire/core-iso.c @@ -214,9 +214,12 @@ EXPORT_SYMBOL(fw_iso_context_queue_flush); * @ctx: the isochronous context * * Process the isochronous context in the current process context. The reg= istered callback function - * is called if some packets have been already transferred since the last = time. If it is required - * to process the context asynchronously, fw_iso_context_schedule_flush_co= mpletions() is available - * instead. + * is called when a queued packet buffer with the interrupt flag is comple= ted, either after + * transmission in the IT context or after being filled in the IR context.= Additionally, the + * callback function is also called for the packet buffer completed at las= t. Furthermore, the + * callback function is called as well when the header buffer in the conte= xt becomes full. If it is + * required to process the context asynchronously, fw_iso_context_schedule= _flush_completions() is + * available instead. * * Context: Process context. May sleep due to disable_work_sync(). */ diff --git a/include/linux/firewire.h b/include/linux/firewire.h index f815d12deda0..b632eec3ab52 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -537,9 +537,11 @@ int fw_iso_context_flush_completions(struct fw_iso_con= text *ctx); * @ctx: the isochronous context * * Schedule a work item on workqueue to process the isochronous context. T= he registered callback - * function is called in the worker if some packets have been already tran= sferred since the last - * time. If it is required to process the context in the current context, - * fw_iso_context_flush_completions() is available instead. + * function is called by the worker when a queued packet buffer with the i= nterrupt flag is + * completed, either after transmission in the IT context or after being f= illed in the IR context. + * The callback function is also called when the header buffer in the cont= ext becomes full, If it + * is required to process the context in the current context, fw_iso_conte= xt_flush_completions() is + * available instead. * * Context: Any context. */ --=20 2.43.0 From nobody Sat Nov 30 01:46:38 2024 Received: from fout3-smtp.messagingengine.com (fout3-smtp.messagingengine.com [103.168.172.146]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 81E981B12C4 for ; Thu, 12 Sep 2024 13:30:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.146 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147854; cv=none; b=lJMOPxMadzPAePSx/3/asQLfF66eGTicpBpairnW7blvqtaUTC1uORY4QNA+sDkp/8VOHDQX6bdEla3EZ4Y5mfuFBfiH4AXjRO8pS4ls5/RviW9stVU6LZzoAtTF+DYqPYO7CaMLbjYax9+mtHd2zHJr17N7VCzIg4kscyOrh2A= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1726147854; c=relaxed/simple; bh=HeNBqimDw6W5SWh98mdMsY8h40xjwFnDwyEONhgvAbc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hZPMzDHZ9TvTqwgrOSrL7iR2dJJqWJ53nQCHXEzB7lmWmnio0cM9A5f5Lh9fV8Xqp48BOTFZU63E3Zj5XJItMlx30eC5lbAuSSo2L86PdUPN5dh95/Baf8eRfMTedH6tyv0qU4pxD1D33uxIiymFuEQm4jcyKzS63+tltqFNk1Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp; spf=pass smtp.mailfrom=sakamocchi.jp; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b=g6Y8Jv8t; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=JjALnz9H; arc=none smtp.client-ip=103.168.172.146 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sakamocchi.jp Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sakamocchi.jp header.i=@sakamocchi.jp header.b="g6Y8Jv8t"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="JjALnz9H" Received: from phl-compute-07.internal (phl-compute-07.phl.internal [10.202.2.47]) by mailfout.phl.internal (Postfix) with ESMTP id A4EF91380547; Thu, 12 Sep 2024 09:30:51 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Thu, 12 Sep 2024 09:30:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type:date:date:from :from:in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:subject:subject:to:to; s=fm1; t=1726147851; x= 1726234251; bh=YLAUq3NUe155VrLSf5ng8mFVHvyTPYxEL/05VRMpxfs=; b=g 6Y8Jv8tGA3BehRIpjeAXyiVadHrE0CPW40p8N/wmJ4MxnJzwLfvivR9BGktR6ovE fDrm7fdv3rKj0G+D8ZqEvcO1bpDeHJrR8lZz/Ql9yJ4X0t9SPiPT/SmzI+vdJnPp F/PbcJkZMSoniQ0WO+S1zt8ukw6oXnoIk+t1GmTc9qRI9jh+Istve89IPlqtbO1w 5+/Ir/gjP9HuBGz3yY8RIYSycMaLtiHFsZu0NhndTj+OcEOZDvDMmNqvG15r9wp4 N2rQr2e64Ym7riSxeWT4RaZHQ858F4bgbpMOHV44bgzxDp+J3pEu77FLI9sFfaGH +coweylEhqlnsvseff9fg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc: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:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1726147851; x= 1726234251; bh=YLAUq3NUe155VrLSf5ng8mFVHvyTPYxEL/05VRMpxfs=; b=J jALnz9HRr9yxjKa19LP/ecZBmxa3mQhDxN/TgQwnnQjdxNCJcQNxNsOW/ZnpP2QA lwUIx6ZX5oQKMPBsMF1tZfxTikzpzBh9KWxqOOAEOLQWXDh9ciM7gRtZ+LGiRGJZ FmMz06x2qICFfh3FMSPebnM8IKXVA223WCZRWxPiIPIJDrSwFu6hwSIhYLo21z9N fZdl+yJ5YfDyAwK9sprPM9CxxAG9UtnDVKXNBCbIrlFdD39Bdyml4yI+4IAzopx8 WXGXDoDGIVGJnTbnhoKjKFph3lA8xGo5BVRFNOnAO4V8OEdgi1cgGGsIJvmZcXNa Pj+6FqjYnEKUImqA7YCsQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudejfedgieeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefhvfevuf ffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghm ohhtohcuoehoqdhtrghkrghshhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrg htthgvrhhnpeeulefhkefghfekveevvdefgfekhfeftdduhfegheegffdtudeuvdekffdu hefgveenucffohhmrghinheptggrlhhlsggrtghkrdhmtgenucevlhhushhtvghrufhiii gvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrghkrghm ohgttghhihdrjhhppdhnsggprhgtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprh gtphhtthhopehlihhnuhigudefleegqdguvghvvghlsehlihhsthhsrdhsohhurhgtvghf ohhrghgvrdhnvghtpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkh gvrhhnvghlrdhorhhg X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Sep 2024 09:30:50 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 5/5] firewire: core: rename cause flag of tracepoints event Date: Thu, 12 Sep 2024 22:30:38 +0900 Message-ID: <20240912133038.238786-6-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240912133038.238786-1-o-takashi@sakamocchi.jp> References: <20240912133038.238786-1-o-takashi@sakamocchi.jp> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The flag of FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ directly causes hardIRQ request by 1394 OHCI hardware when the corresponding isochronous packet is transferred, however it is not so directly associated to hardIRQ processing itself. This commit renames the flag so that it relates to interrupt parameter of internal packet data. Signed-off-by: Takashi Sakamoto --- drivers/firewire/ohci.c | 6 +++--- include/trace/events/firewire.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index 4af4c9af4fe4..7ee55c2804de 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -2927,7 +2927,7 @@ static int handle_ir_packet_per_buffer(struct context= *context, copy_iso_headers(ctx, (u32 *) (last + 1)); =20 if (last->control & cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS)) - flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ); + flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_INTERRUPT); =20 return 1; } @@ -2963,7 +2963,7 @@ static int handle_ir_buffer_fill(struct context *cont= ext, =20 if (last->control & cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS)) { trace_isoc_inbound_multiple_completions(&ctx->base, completed, - FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ); + FW_ISO_CONTEXT_COMPLETIONS_CAUSE_INTERRUPT); =20 ctx->base.callback.mc(&ctx->base, buffer_dma + completed, @@ -3059,7 +3059,7 @@ static int handle_it_packet(struct context *context, ctx->header_length +=3D 4; =20 if (last->control & cpu_to_le16(DESCRIPTOR_IRQ_ALWAYS)) - flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ); + flush_iso_completions(ctx, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_INTERRUPT); =20 return 1; } diff --git a/include/trace/events/firewire.h b/include/trace/events/firewir= e.h index b108176deb22..ad0e0cf82b9c 100644 --- a/include/trace/events/firewire.h +++ b/include/trace/events/firewire.h @@ -830,13 +830,13 @@ TRACE_EVENT_CONDITION(isoc_inbound_multiple_queue, #ifndef show_cause enum fw_iso_context_completions_cause { FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH =3D 0, - FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ, + FW_ISO_CONTEXT_COMPLETIONS_CAUSE_INTERRUPT, FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERFLOW, }; #define show_cause(cause) \ __print_symbolic(cause, \ { FW_ISO_CONTEXT_COMPLETIONS_CAUSE_FLUSH, "FLUSH" }, \ - { FW_ISO_CONTEXT_COMPLETIONS_CAUSE_IRQ, "IRQ" }, \ + { FW_ISO_CONTEXT_COMPLETIONS_CAUSE_INTERRUPT, "INTERRUPT" }, \ { FW_ISO_CONTEXT_COMPLETIONS_CAUSE_HEADER_OVERFLOW, "HEADER_OVERFLOW" } \ ) #endif --=20 2.43.0