From nobody Thu Sep 24 20:37:49 2026 Received: from fout-b6-smtp.messagingengine.com (fout-b6-smtp.messagingengine.com [202.12.124.149]) (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 9C62235C681 for ; Sun, 20 Sep 2026 08:37:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.149 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893427; cv=none; b=bqcStIm/kEuqXkrWqcoHzg9sPmXR13A+shi7H5R/aqnjVugQ3PyvFu/opUzowQOWFD12Q7Irr779WURh1Rm/HkvDNClVBOaoLHuiBoavzOxdDJ5CEPB+XRXh85nyc1fKqViZnTQdVb8wwTcgp/EsPsDJUgiyMva+YqGpUOqKI0g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893427; c=relaxed/simple; bh=VPd00f1P4Erfu42xxT4CpXYqT8BI5IIkq8HQw8leDYU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KXUgMie2Ulia8kpMY12mJzTqAEYpWwvAnkIAMawIA8hNs5Ibjk+9jJKnbbPuKsKJQwXxKhT8ViHEgBwkG1btWv9Hq3/LSEgVPH4mAoyqChBRb5MQ4N/JaPZbaCjTfNfMuYDdtWuMMCyhX8pgDaIbH7MOXxr8U3+TFS1CjH7zkJs= 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=uZcTNK56; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=NCTXEZP8; arc=none smtp.client-ip=202.12.124.149 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="uZcTNK56"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="NCTXEZP8" Received: from phl-compute-07.internal (phl-compute-07.internal [10.202.2.47]) by mailfout.stl.internal (Postfix) with ESMTP id F2D941D00105; Sun, 20 Sep 2026 04:37:04 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-07.internal (MEProxy); Sun, 20 Sep 2026 04:37:05 -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=1789893424; x= 1789979824; bh=b0vHxAf16SZ9iQ6duuWb3PMrm64p7qgPMngjBg8SUyI=; b=u ZcTNK56mjXj9ReyhiCoP/LYehaTWmkCq3WCj4FzZ/5Zm6/EeVBUwY4b9ZRaPZK7r 15nFZiMtDqNvuuvviNrSrcJDTdOvJsMkNp8KWC8NPy8JBAZAWEAQfMVBwbunq/UX kQccMDrpPjP+EzGM6ZKOXiRi1WBL061z75ghXVDZhm6KNJnO0fo97kcJlv8hdZ3b PeNc2Pg98NuiOd9pwB4BMFQkVxU+uy+6YEj4MttAjNP3VpUBNbJWrVG1dRlv/31j GJSB1rBK5KMEjfQisxm5sP8R6N+1RMHh4Ya1xQ/CM3fwlHAtjRlwGeq4eeHQTA7i BZY/q1rrA7xvkuM+bOMBg== 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-sender :x-me-sender:x-sasl-enc; s=fm1; t=1789893424; x=1789979824; bh=b 0vHxAf16SZ9iQ6duuWb3PMrm64p7qgPMngjBg8SUyI=; b=NCTXEZP8zPHDj1W7+ znJmWOSPCtpmcvOnPp+BT/fsguXy+lS1gKxxB7RXSBqz4swnws6WIn/8VHAeeAB1 ZEZAU29jVUgVmx3sLLKuBlM40Zf+37frrBWPJ/xfPDZoHqxI1AAfksgiXO5kiuYS gHuB9avPzUdunW47e/AAcb287ecGlDObx3yOyNSp5HE7u47DlCO/n6BI3qlV2mfv 4xm/wLvA1M58oR1+EePAaU2SrbwrgvdvnQBqFXt1Pz/I1tJ8EI746osqvqgUwg8n e+Ix1tREuylW2X+H8eijvTLtaI60/k1fZD4HgwXtc1cpHQDSKWLTkBMuDdyHcS8P yK5Qw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGDk/LFpyNUjatZXtdF1Ol4AzGXx/XJJ00P2lEzdhwaC2OHMWKjSTTwzDV54eA+X9 hZWqO2Pt/aL/IC2w3tQSr/WTF4eOkuQx9cqr/0YQjP0U9qRxKTeqqjpjHmtjKI87XBl9+k lkd5l3xFN7T6QNoFdRqVZKYZ1HWzIwBUYfdAsZeZatUOA0ZPe1QtaXNtpb/kZMyNG2cCW0 AkYYFkNOpR9jWdo4iKO92TpJWkC9Ldvc/R2dYRYBWP9D0fI6R6CxUwbd23p5Y6XPLXkugf TZapV8K2F20wWYZVer0gd5Qw3eZniou/ncwHg8BB5HxRPprNSXyj1Vu1JJpcJt8AGbY0CG GkYmwH9AZ9PD2mUnLC/dSkNMesIAhf/Fob6F6zeBshOS7vR3yo3IcBt/zk5NHfyuGx1axl QqQWDjct/oXAReqsT8YK8Ged6Bi5epOAIN77E6OVHkXKl9KAC1rcuhBK2XjauswzDn5SBb D3PQCu4pzLDGfIqsW0eBZRuk7v0Ge4SLMDL0O7lUuiVuWMN0gxaTxiAqwegmdgt8s+u0Zp njpa2fWffH4X+SDF+0Rf8HxztQEsC+iPiLEKqaTvGCJ1ygHHphPHRVVEyN2pD4XpAhlqzn AKd6bZF3M5s03aF/wJZWOPOVaYLd6HmIRlt8tdd+k9rTbby5hH9DcjbWE2Cg X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Sep 2026 04:37:03 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/5] firewire: core: fulfill kerneldoc for address handler Date: Sun, 20 Sep 2026 17:36:55 +0900 Message-ID: <20260920083659.191855-2-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260920083659.191855-1-o-takashi@sakamocchi.jp> References: <20260920083659.191855-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 callback for the address handler is now invoked in process context. Update the kerneldoc for the address handler accordingly. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-transaction.c | 8 +++----- include/linux/firewire.h | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-tr= ansaction.c index a2a8d755ad0a..bdd2437c6f7f 100644 --- a/drivers/firewire/core-transaction.c +++ b/drivers/firewire/core-transaction.c @@ -637,16 +637,14 @@ static int put_address_handler(struct fw_address_hand= ler *handler) * * When a request is received that falls within the specified address rang= e, the specified callback * is invoked. The parameters passed to the callback give the details of = the particular request. - * The callback is invoked in the workqueue context in most cases. However= , if the request is - * initiated by the local node, the callback is invoked in the initiator's= context. - * - * To be called in process context. - * Return value: 0 on success, non-zero otherwise. * * The start offset of the handler's address region is determined by * fw_core_add_address_handler() and is returned in handler->offset. * * Address allocations are exclusive, except for the FCP registers. + * + * Context: Process context. + * Returns: 0 on success, non-zero otherwise. */ int fw_core_add_address_handler(struct fw_address_handler *handler, const struct fw_address_region *region) diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 2b065f03565d..4bca5af6793d 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h @@ -298,17 +298,25 @@ union fw_transaction_callback { fw_transaction_callback_with_tstamp_t with_tstamp; }; =20 -/* - * This callback handles an inbound request subaction. If the request suba= ction is initiated from - * the local node (e.g. by unit driver), the execution context depends on = the initiator and is - * unspecified. Otherwise, it runs in workqueue context. +/** + * typedef fw_address_callback_t - Function to handle the request of the a= synchronous transaction. + * @card: the card instance which receives the request + * @request: the request instance. + * @tcode: the transaction code + * @destination: the destination node ID + * @source: the source node ID + * @generation: the bus generation in which the request was sent + * @offset: the destination offset in source node. + * @data: the request content if available. + * @length: the length of data. + * @callback_data: the data registered with this function. * - * The callback should not initiate outbound request subactions directly. - * Otherwise there is a danger of recursion of inbound and outbound - * transactions from and to the local node. + * This callback handles an inbound request subaction. * * The callback is responsible that fw_send_response() is called on the @r= equest, except for FCP * registers for which the core takes care of that. + * + * Context: Process context. */ typedef void (*fw_address_callback_t)(struct fw_card *card, struct fw_request *request, --=20 2.53.0 From nobody Thu Sep 24 20:37:49 2026 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.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 1063B3BBFD8 for ; Sun, 20 Sep 2026 08:37:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893428; cv=none; b=Mg2Tpv262V8mk0+IsmBxwYn+TXsCmdBJCFjs9RjkudmtNfegv1AgE6FNd5kZhYkuJ/i+O/oo5fCkWE+diZqNE6w+DXNDb47cM19w8OL+8jQ24ZPIm4KW6RnUFzc1J0P/GayOMyVMK/CpNMXJ4tcb1Su5lAE5zqfaknOtV9L6a/w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893428; c=relaxed/simple; bh=qk+C6DdEOtOFVsoBZ8UwNfwH8Ny9qDUJK744db+wjDY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ai/aeQXhLc+pF/n3WO74WJprfVjhxk3jDfg82WgkjJ8WrRdocY5/zYYpzcb9G+SxD5O8CS4N/y/HsVSr7Y50TMOUl9U5hDaxbr7fpayWA9d2qZWnIWHDog+hIJKymzs2LsptDg7svEmdQZEtVcfR2nRnAUdk1WkKftMVomtLAv0= 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=eUv6I4sg; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=VKkdsWtR; arc=none smtp.client-ip=202.12.124.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="eUv6I4sg"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="VKkdsWtR" Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.stl.internal (Postfix) with ESMTP id 58DB07A0098; Sun, 20 Sep 2026 04:37:06 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Sun, 20 Sep 2026 04:37:06 -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=1789893426; x= 1789979826; bh=VAy4dxQvBffRSDgtpZCyFUnEL4L5AX1ag2tM7IHI1VA=; b=e Uv6I4sgmc1ex/x3FRIajPpy3URg/V4wDliC1UDqpl9KYOVH8Eou9Dd9J/zUGRDUF jZRsQrqanjXTvve5W32ts7BYWJkqlPNq/vD0dd6xbAnnCKI7jHxAJOGhDPJf9Z5m gyY8NMpf2ezPBzGeoFoTx7zyPap+WSnlXmpPSe8bzqaBqwRR4fbaKNaZrHwmJf2N OLVmYX7/yJiH12PQ7koU8F1Tj42uDFBk6N1EBTXb7449LfLQMZl/1VaWMlqPouEO nvFFKdUFwKgQdfs2sUv0NhOLtDyaH9wT0HVpQuSxRpjF2WpxpFoOdKq+HpHvdcHA o+jUBVajNzYazQnVswLxg== 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-sender :x-me-sender:x-sasl-enc; s=fm1; t=1789893426; x=1789979826; bh=V Ay4dxQvBffRSDgtpZCyFUnEL4L5AX1ag2tM7IHI1VA=; b=VKkdsWtR1XoORQv4Q ZCg+sJRfDvpy3mGBqIWbJa/ZKrIAcuXKhdD99xt7b2WRZiosBOZmrwysf8jbiPoj Yz8Bow0Jk4kmMpre9ToVlQSaRaGukxQtycRhyRAslqGe70MrWQRM5nMofx+pA21F +zeJMKgW+KSA+48jgJ2z/2jaIPSIAHOH9FWsOYirJ3HNVqgAttvthFKGoJ+ib0d9 C2HMWe5BkVHd5I16hpGMtSYysvhcMHCZ8YDDzsj3gBv2Zi4g4S0qlXuqDb8OSwpZ X0ViwdAQCqyM7oBNwpcV+tl3CI31exccMb+dNVDS1s4w0piv0zcEe1ExC4RHEon5 TnREg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGDk/LFpyNUjatZXtdF1Ol4AzGXx/XJJ00P2lEzdhwaC2OHMWKjSTTwzDV54eA+X9 hZWqO2Pt/aL/IC2w3tQSr/WTF4eOkuQx9cqr/0YQjP0U9qRxKTeqqjpjHmtjKI87XBl9+k lkd5l3xFN7T6QNoFdRqVZKYZ1HWzIwBUYfdAsZeZatUOA0ZPe1QtaXNtpb/kZMyNG2cCW0 AkYYFkNOpR9jWdo4iKO92TpJWkC9Ldvc/R2dYRYBWP9D0fI6R6CxUwbd23p5Y6XPLXkugf TZapV8K2F20wWYZVer0gd5Qw3eZniou/ncwHg8BB5HxRPprNSXyj1Vu1JJpcJt8AGbY0hP gWDMCdhsNrmukiD/e932BTXetrlugJfjs0zZeCdx4VVhF/RCW6NH4aZHIB7Nqk7yszoLxG TuGXbMIEkYi2IIdK++bv4d3djFKyxX3eGYCzVUAt+1+hUF9qjdXXP6oOOq3XPO51M4jc7f Nuja5vCX8FQD1JOEAJaWHmZqxTq5v/bUXsKB9Uf2qtVT2oqVibRoj9ck/lQ0XRJaunxxwu 2YN0RSQW6S1zbRQWGZHGa8NVxPUZpeRll69FZZqGPvdjFCrRf4g3C1FGjRJz8EC2KqIViu tPpSgB26djrcKNZXK3E16GtXBaDim+bZ6VlHTk/NQwHEZ/ff+mNhpCERtDzg X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Sep 2026 04:37:05 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 2/5] firewire: cdev: use mutex for phy receiver list Date: Sun, 20 Sep 2026 17:36:56 +0900 Message-ID: <20260920083659.191855-3-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260920083659.191855-1-o-takashi@sakamocchi.jp> References: <20260920083659.191855-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" In the cdev layer, the list of phy packet receivers is currently protected by a spinlock. This requires GFP_ATOMIC for memory allocation when enumerating the list in fw_cdev_handle_phy_packet(). However, the function is guaranteed to be invoked in process context, so GFP_KERNEL can be used by switching from the spinlock to a mutex. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-cdev.c | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 6d91a6e7ad0d..3dd8ea1991b0 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -47,7 +47,7 @@ #define FW_CDEV_VERSION_AUTO_FLUSH_ISO_OVERFLOW 5 #define FW_CDEV_VERSION_EVENT_ASYNC_TSTAMP 6 =20 -static DEFINE_SPINLOCK(phy_receiver_list_lock); +static DEFINE_MUTEX(phy_receiver_list_mutex); static LIST_HEAD(phy_receiver_list); =20 struct client { @@ -1751,9 +1751,7 @@ static int ioctl_receive_phy_packets(struct client *c= lient, union ioctl_arg *arg if (!client->device->is_local) return -ENOSYS; =20 - // NOTE: This can be without irq when we can guarantee that __fw_send_req= uest() for local - // destination never runs in any type of IRQ context. - scoped_guard(spinlock_irq, &phy_receiver_list_lock) + scoped_guard(mutex, &phy_receiver_list_mutex) list_move_tail(&client->phy_receiver_link, &phy_receiver_list); =20 client->phy_receiver_closure =3D a->closure; @@ -1765,18 +1763,14 @@ void fw_cdev_handle_phy_packet(struct fw_card *card= , struct fw_packet *p) { struct client *client; =20 - // NOTE: This can be without irqsave when we can guarantee that __fw_send= _request() for local - // destination never runs in any type of IRQ context. - guard(spinlock_irqsave)(&phy_receiver_list_lock); + guard(mutex)(&phy_receiver_list_mutex); =20 list_for_each_entry(client, &phy_receiver_list, phy_receiver_link) { - struct inbound_phy_packet_event *e; - if (client->device->card !=3D card) continue; =20 - e =3D kmalloc(sizeof(*e) + 8, GFP_ATOMIC); - if (e =3D=3D NULL) + struct inbound_phy_packet_event *e =3D kmalloc(sizeof(*e) + 8, GFP_KERNE= L); + if (!e) break; =20 if (client->version < FW_CDEV_VERSION_EVENT_ASYNC_TSTAMP) { @@ -1943,9 +1937,7 @@ static int fw_device_op_release(struct inode *inode, = struct file *file) struct client_resource *resource; unsigned long index; =20 - // NOTE: This can be without irq when we can guarantee that __fw_send_req= uest() for local - // destination never runs in any type of IRQ context. - scoped_guard(spinlock_irq, &phy_receiver_list_lock) + scoped_guard(mutex, &phy_receiver_list_mutex) list_del(&client->phy_receiver_link); =20 scoped_guard(mutex, &client->device->client_list_mutex) --=20 2.53.0 From nobody Thu Sep 24 20:37:49 2026 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.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 8164E3E8C4C for ; Sun, 20 Sep 2026 08:37:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893429; cv=none; b=AD2TmjUTLTGZIU+kqsIlhpJ6/bW/aD/yeID1jvdJwDRY1p3jf6V8wnfUNkzk4xTRa090JXCrgNJgblZ2ty3extP4r2bnHQ7m8Csly91BjLJujDXhE0r3Ix8gRmtZHAyZ9wq8MBhF9BHY55nNHMsfZ1CcY53xjB17zMGlnVfj/ZA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893429; c=relaxed/simple; bh=OsfgV4jxXGe/NAuZwnKSljG7RJhELVEka4LNpPFVlnQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LEIB+0sguG+HbtrX+qvBnUMq5ZRejmiXGMGFLJ11ZqOOa5KMdL0z5LyEmGha1D03AIyMN1kpUZjpOCUBtqvKuArrvlvONHrKj4GPWg/I7PHAflHeURFnCztpJ4Sq9NI9Y7XVFgB4O8l05JdgLvYNbolLDdlcT2ClzkdzLzWUv9I= 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=gfW4+TpX; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=asyFT8hy; arc=none smtp.client-ip=202.12.124.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="gfW4+TpX"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="asyFT8hy" Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfhigh.stl.internal (Postfix) with ESMTP id CF52E7A00C5; Sun, 20 Sep 2026 04:37:07 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Sun, 20 Sep 2026 04:37:07 -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=1789893427; x= 1789979827; bh=nJ1QZDwHfr5CJTb/SqmjVqviS64f6JXgQnZDwspoS+4=; b=g fW4+TpXgTwtC2Bhlkl7Z7/hAFJHovl537nuHJxlV1SPctbg3iBUSlnWEn5b+Vjaf 5SO+v+2aHbgQVQcGPa9jv1EjH9Qw5MxdzIF40zdI7TYdTIFRQYPgcPF+MWY8r0gi +sijNHOLq7GN5DO//+VWOce67oxlDW/GMUsxb4yqCqe31015cdRdlYQJhI2eWWvE vIWXQlwQBFocUv61n2sTngVLUCx69KjtfiqOLVMVCDegLvXMwR7A8YRQU/NpAjo3 T0F/NKQ0uOli89aMl7sWHnYpN+rEd+i3tS9Kz05hu547m59mW253YOTVp1kCkbSi vqoD5EiCZo0m/1jSva0bg== 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-sender :x-me-sender:x-sasl-enc; s=fm1; t=1789893427; x=1789979827; bh=n J1QZDwHfr5CJTb/SqmjVqviS64f6JXgQnZDwspoS+4=; b=asyFT8hyKbnYyxW7Z FRYpVd8Mw0gC2LL/fBsuAnjSz60nlzQZA0+Z29etYywQlYEEZ2LwgziAhB1WJlmg XhJpuBr3/eO7EbpYeeOA/WvTguk0uvzZZVrmKvHVBN0IMb4pH7fiCmFf7w5Cj73X 13pVKijumjTgQsCNtWHiHAQ/xFw+psU4jnr/1BtxNEtC4QDuBxz/JsAtJkxYBkIK Jwy9GbAsgkm2B0UxH2vPyipvoikMqU9b3/VR5VoVSmfBdRfIYlq7o/cJbEnATYKn 5oUzthnxoGOd/QtLq9N+gkif1DbL95YH6FxcegTJ/pNY2TvvbKnXvWMiLVvU1BQk w6Gtg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGDk/LFpyNUjatZXtdF1Ol4AzGXx/XJJ00P2lEzdhwaC2OHMWKjSTTwzDV54eA+X9 hZWqO2Pt/aL/IC2w3tQSr/WTF4eOkuQx9cqr/0YQjP0U9qRxKTeqqjpjHmtjKI87XBl9+k lkd5l3xFN7T6QNoFdRqVZKYZ1HWzIwBUYfdAsZeZatUOA0ZPe1QtaXNtpb/kZMyNG2cCW0 AkYYFkNOpR9jWdo4iKO92TpJWkC9Ldvc/R2dYRYBWP9D0fI6R6CxUwbd23p5Y6XPLXkugf TZapV8K2F20wWYZVer0gd5Qw3eZniou/ncwHg8BB5HxRPprNSXyj1Vu1JJpcJt8AGbY0Mg vQmYihobsT+/7iCwFjPQVf7Q0R7OP8CmJCTpOBEIeNu5/QU7jLmDeoEhEHFBNRd7cf7Gw0 jco8y4a3butMl7UcQuRBsVXZw3hkS8jniJcMhn0/pwKTJToRi2uQCV9rju4Mn6QjXq76U/ 7rE2LE7a7XAt4xttbZZvK57LSFjcMqN6WiIlH0xC3Qnml6OBRlq54Cf44Q8mM1gY6zMVxQ pkmKN++wUEnes7OxznqBTyTREpoL+wzOr5stAIANluaa7UdbSCHnfYcjmKaVuUkmh6vPTj 21zGtujn3Ovc/okxHYvppicNqu8HQLASEY6opnAmv4IZYFh4u9u8uB9dMR+A X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Sep 2026 04:37:06 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 3/5] firewire: cdev: use GFP_KERNEL in address handler Date: Sun, 20 Sep 2026 17:36:57 +0900 Message-ID: <20260920083659.191855-4-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260920083659.191855-1-o-takashi@sakamocchi.jp> References: <20260920083659.191855-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 callback for the address handler is now guaranteed to be invoked in process context. In the cdev layer, GFP_ATOMIC is still used for memory allocation in the address handler. Use GFP_KERNEL instead. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-cdev.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 3dd8ea1991b0..625792b6ab71 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -777,8 +777,8 @@ static void handle_request(struct fw_card *card, struct= fw_request *request, if (is_fcp) fw_request_get(request); =20 - r =3D kmalloc_obj(*r, GFP_ATOMIC); - e =3D kmalloc_obj(*e, GFP_ATOMIC); + r =3D kmalloc_obj(*r); + e =3D kmalloc_obj(*e); if (r =3D=3D NULL || e =3D=3D NULL) goto failed; =20 @@ -789,7 +789,7 @@ static void handle_request(struct fw_card *card, struct= fw_request *request, r->length =3D length; =20 r->resource.release =3D release_request; - ret =3D add_client_resource(handler->client, &r->resource, GFP_ATOMIC); + ret =3D add_client_resource(handler->client, &r->resource, GFP_KERNEL); if (ret < 0) goto failed; =20 --=20 2.53.0 From nobody Thu Sep 24 20:37:49 2026 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.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 D7EF33EA95F for ; Sun, 20 Sep 2026 08:37:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893431; cv=none; b=qjjq/VAuV2LOzoYHidziVbRw5sd1NxDW00X9YmeUm4mtEL3oqbwd8tJCOD3UVtLl6NL+8o90vXmKPdKXEmpvbvsCum874Y6PZg5RXKiW9985iRk2/zRP3gkKcOyoDZg6jB2WJhuEsgBCMtWgijGJ2WK9vuqsiGnnaLXiyJpmwdw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893431; c=relaxed/simple; bh=8CeiRuUE3FtydE+zSX9+E/c+kLjyfN4rvhsEAqt6c/0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jEd3WvR1YLErBxyVwZxS0WFOMGo43v6MJLkB6PMiPyXRbFveTkzo+Y7+4d+WwKSjs5p+ZNZD1XLw1ZVZydkniwwnfXXHvTe5+aXwtn4Si8tZ0B/jpLylqGd9tMy5Zz+AuBc8l05XaVlc9MvK9sOGznlgkoHnwx2osHlMGDInYLI= 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=68r23A5z; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=mSbFu5Ax; arc=none smtp.client-ip=202.12.124.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="68r23A5z"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="mSbFu5Ax" Received: from phl-compute-08.internal (phl-compute-08.internal [10.202.2.48]) by mailfhigh.stl.internal (Postfix) with ESMTP id 39C007A00E5; Sun, 20 Sep 2026 04:37:09 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Sun, 20 Sep 2026 04:37:09 -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=1789893429; x= 1789979829; bh=6V8530ncLv8BVsoW9DHISr7rI7cVxvWwAxCY4nqRh8E=; b=6 8r23A5zpu3hDiuv4ENl8w+MMVlsSGGWw5iZz4Gp2Bqh3BxQCC/CKdhuPqAZnOtCY p6qRebZ6NDmzboRAm7SwGKHpG5l4szKulCVkFj1AVV+Cc+pou/aRm0CJHSHPy9un OmxHJQZUOt2iiHQrdCvhVsXYJxqtO4DH2V3hRWfJlpCl9FMtH6Vp0bPQ2xoGHD8W pp58bsv7nMkj5AJYbRP5M5TG1cnqdKOUTu0IwyNHz/Hc6CrbfFstPbJHcvT7YwGX bKCL7OVILYQt39Kcze9WE894kxR+JSMDGiw4P+OokydcKg9PDCuLo7g8SA5IahHm zNmqS8L0Vze4zXVQjnGCA== 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-sender :x-me-sender:x-sasl-enc; s=fm1; t=1789893429; x=1789979829; bh=6 V8530ncLv8BVsoW9DHISr7rI7cVxvWwAxCY4nqRh8E=; b=mSbFu5AxRGsAzAKcy 2hJYyPsqMrhk2jmAo2e71Hz797UvJcvBOblNUBLEqH5QxWv1Myx+tRMTuhosFlme XpmoVNXGpiyMrC9vC31HNg926PM4+SITHnQmWKJpV611gwg3OUii2sJrj3UoMJ+6 21m1V8UwuEdvl+/PBnHE5Qc5ybqtErBSQJAevGxlTMAtaqa2gkP3Pi+y0/fbNfg5 DoHb1pYvDbZOc52THba+KYTXhlGEmJ8+NT8NOTQX4A0MLnSW54rxZA8xRtrTyMQC mpSJa1qPYQn2AVaOs/TXvMuNmgw3uCIq3tBJ26n3uh0ok66Iqlg0RT2qI5IAdCmk PmUDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGDk/LFpyNUjatZXtdF1Ol4AzGXx/XJJ00P2lEzdhwaC2OHMWKjSTTwzDV54eA+X9 hZWqO2Pt/aL/IC2w3tQSr/WTF4eOkuQx9cqr/0YQjP0U9qRxKTeqqjpjHmtjKI87XBl9+k lkd5l3xFN7T6QNoFdRqVZKYZ1HWzIwBUYfdAsZeZatUOA0ZPe1QtaXNtpb/kZMyNG2cCW0 AkYYFkNOpR9jWdo4iKO92TpJWkC9Ldvc/R2dYRYBWP9D0fI6R6CxUwbd23p5Y6XPLXkugf TZapV8K2F20wWYZVer0gd5Qw3eZniou/ncwHg8BB5HxRPprNSXyj1Vu1JJpcJt8AGbY0Di 7HWCwVZ3h7On5h8k0dkOsJMVZI5GK2NEbNGV05/H047GkHaYsEFyWRZDj3JhpVaoYKJlhT Z0RWrL12ztlmjNNjcppFi/tmPDoe63hD1VUOYrHbC24D9F/h8q4DlWQ7dZ/ruN+kZvwoB0 CHTFw0v5tgxwBxoRsYu8XKA/y7l+4yWMeqY+pzL6pL4GMkbeuf9g+8lqNwEG6ZRUEJZkDh f9Tz8oyEf9xL98zga6fvzd7gmyubnOMMzg/erk+5IMtmyOPJWv17ceYftm97YoAngnTR0Y HeoCuQ3OB57ORU2Xk6adHbD2anEuuxA1UN7NF67cgnVzJ8T/dRcCAlizhKqA X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Sep 2026 04:37:08 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 4/5] firewire: cdev: refactor add_client_resource() to drop GFP flags argument Date: Sun, 20 Sep 2026 17:36:58 +0900 Message-ID: <20260920083659.191855-5-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260920083659.191855-1-o-takashi@sakamocchi.jp> References: <20260920083659.191855-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 add_client_resource() function has an argument for GFP flags. The argument was originally used to distinguish atomic calls. However, all callers now use GFP_KERNEL. Drop the unused argument and always allocate with GFP_KERNEL. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-cdev.c | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 625792b6ab71..96f3619237f3 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -539,8 +539,7 @@ static int ioctl_get_info(struct client *client, union = ioctl_arg *arg) return 0; } =20 -static int add_client_resource(struct client *client, struct client_resour= ce *resource, - gfp_t gfp_mask) +static int add_client_resource(struct client *client, struct client_resour= ce *resource) { scoped_guard(spinlock_irqsave, &client->lock) { u32 index; @@ -549,13 +548,7 @@ static int add_client_resource(struct client *client, = struct client_resource *re if (client->in_shutdown) return -ECANCELED; =20 - if (gfpflags_allow_blocking(gfp_mask)) { - ret =3D xa_alloc(&client->resource_xa, &index, resource, xa_limit_32b, - GFP_NOWAIT); - } else { - ret =3D xa_alloc_bh(&client->resource_xa, &index, resource, - xa_limit_32b, GFP_NOWAIT); - } + ret =3D xa_alloc(&client->resource_xa, &index, resource, xa_limit_32b, G= FP_KERNEL); if (ret < 0) return ret; =20 @@ -705,7 +698,7 @@ static int init_request(struct client *client, } =20 e->r.resource.release =3D release_transaction; - ret =3D add_client_resource(client, &e->r.resource, GFP_KERNEL); + ret =3D add_client_resource(client, &e->r.resource); if (ret < 0) goto failed; =20 @@ -789,7 +782,7 @@ static void handle_request(struct fw_card *card, struct= fw_request *request, r->length =3D length; =20 r->resource.release =3D release_request; - ret =3D add_client_resource(handler->client, &r->resource, GFP_KERNEL); + ret =3D add_client_resource(handler->client, &r->resource); if (ret < 0) goto failed; =20 @@ -893,7 +886,7 @@ static int ioctl_allocate(struct client *client, union = ioctl_arg *arg) a->offset =3D r->handler.offset; =20 r->resource.release =3D release_address_handler; - ret =3D add_client_resource(client, &r->resource, GFP_KERNEL); + ret =3D add_client_resource(client, &r->resource); if (ret < 0) { release_address_handler(client, &r->resource); return ret; @@ -993,7 +986,7 @@ static int ioctl_add_descriptor(struct client *client, = union ioctl_arg *arg) goto failed; =20 r->resource.release =3D release_descriptor; - ret =3D add_client_resource(client, &r->resource, GFP_KERNEL); + ret =3D add_client_resource(client, &r->resource); if (ret < 0) { fw_core_remove_descriptor(&r->descriptor); goto failed; @@ -1479,7 +1472,7 @@ static int ioctl_allocate_iso_resource(struct client = *client, union ioctl_arg *a e2->iso_resource.type =3D FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED; =20 r->resource.release =3D release_iso_resource_auto; - err =3D add_client_resource(client, &r->resource, GFP_KERNEL); + err =3D add_client_resource(client, &r->resource); if (err < 0) return err; request->handle =3D r->resource.handle; --=20 2.53.0 From nobody Thu Sep 24 20:37:49 2026 Received: from fhigh-b7-smtp.messagingengine.com (fhigh-b7-smtp.messagingengine.com [202.12.124.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 5683C3EB11E for ; Sun, 20 Sep 2026 08:37:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=202.12.124.158 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893432; cv=none; b=mcc200bOJPWidqsA7HxseZGZFkIFMpzwxANnkGfBu7zieb5dSyyq2oOwzhdfbc1vrdw2F/C8YtMnH7ei6G7Ij3SGMD1AfExpJ/oFAZg6vxcSiJlKqil5lYgWiT+R0UEzQp/+JmF91t74He863DWUnKHy7GvVaFVn/hOF4Nrc46Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789893432; c=relaxed/simple; bh=fmQ6ysc7Xbj1vliQBlI58xrobsoFTbCujENj+aYq+34=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JU//t+FMpYpC+q+tikMoW5wG9JoFYJwNCERPHMeBvzuVPUOKzuEFfecdLJDx8Jm/YiIY50MO3NLqTa5wd46OKX8M2W10NEj/Je2jhywcfwif0CMq2Eevs1KMXcU1+3NYTqF6B36E10gkSefPsmUV36T7wNTsdWf7HJPCXlVA7Vo= 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=zIg9uiMe; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=K7TMDB4E; arc=none smtp.client-ip=202.12.124.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="zIg9uiMe"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="K7TMDB4E" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.stl.internal (Postfix) with ESMTP id 9DFCA7A00DB; Sun, 20 Sep 2026 04:37:10 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Sun, 20 Sep 2026 04:37:10 -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=1789893430; x= 1789979830; bh=aXQn+TbFQYfY2jiDrw3I5nfsLGzeJpOmHRGGQvTsGyw=; b=z Ig9uiMeCagDmlW+9D+Ws7C+ed1VTfTaH4tf7M1TLqHqic6enCxydchnIo5wU8ABO 8Yo7f2vfZC+qKkuvkTZwc0vE1vmAwpa2WLD1t6/XxJMiTjvf4oaK/t0OSkMNogg9 /oI7kjK9OrBV9MpPhto2vIAR8r1xlqbaBPZrLfzOog8OZ1uv/CrOBWzfkOYf9xLp frNDbvqEcDo1L5kK99wfs8hjsAZDtBADpjGKDzfu8VPUaubTuWstBqMFyKAB94xe qDY6C0nj30HFPROwHDSPUyWfHTvm3b3o5ixcrJPf9r/mM915mqh3ZJngv3baln9d vvPeUSAOCdhj8oaj0+oCQ== 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-sender :x-me-sender:x-sasl-enc; s=fm1; t=1789893430; x=1789979830; bh=a XQn+TbFQYfY2jiDrw3I5nfsLGzeJpOmHRGGQvTsGyw=; b=K7TMDB4ESIPV+2fMF fvbMwTkvumfocREfeMn7iH1u/6/3pl+lzaKRyK6vxcxOd1lCqGf/Gj85ltCEJstX J+hQih3oAJefQfzFMIrIjvpWUpCaZpqLmeuNELO2jwh3cWp/+DY0BogiMx+9LJTb mpdVQr2OSLzN4vlccl8fsKJaj9HBKJT/LMw1cUerhyUsdNYZhiyNoE9B++r/Mswy IxFycMECWACOqIYeLd0Z3cQhEFVTnVYq6PJVskIGK2WYHzAWhj0T6vSbKduga04f a2pr+wx8wyjc7qeEAjIYNGS03MIdkxPkBRKEvQatA17Ej1m2qIG/+OFNdzgjMMpa u9jDw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTGDk/LFpyNUjatZXtdF1Ol4AzGXx/XJJ00P2lEzdhwaC2OHMWKjSTTwzDV54eA+X9 hZWqO2Pt/aL/IC2w3tQSr/WTF4eOkuQx9cqr/0YQjP0U9qRxKTeqqjpjHmtjKI87XBl9+k lkd5l3xFN7T6QNoFdRqVZKYZ1HWzIwBUYfdAsZeZatUOA0ZPe1QtaXNtpb/kZMyNG2cCW0 AkYYFkNOpR9jWdo4iKO92TpJWkC9Ldvc/R2dYRYBWP9D0fI6R6CxUwbd23p5Y6XPLXkugf TZapV8K2F20wWYZVer0gd5Qw3eZniou/ncwHg8BB5HxRPprNSXyj1Vu1JJpcJt8AGbY0BB iu5xx4ODEyqppim5bOlYBvPB3rpWJNtZITwW5Qq2HfwD6Lq01Fw4YNK2uI+9XtA19DldpT pHSsmyJ3fJ1DmLBf5V2NZk/Yh7DoEq6evD/CEWv8pZhaVuHWOLSRwMFW0HSC6BY9S4Oka4 nuE5Ykf8GXp4NQ4dANfhOrWeI7rfIiXvZDjJwscHKLJihvi7y//OOEDwSrKcqXm3jcLZyI x5LdeCQUcDx3FfmapE3mctNCo/hf+XUwMaLjpXw2c1LerxEb+DFpv1BXcJvm5nu0l8Card itezceOd52tj9QhPbb0wThdEvGp7U8rgLKRuUWKDs6avyurvuq254SbL2Xcw X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 20 Sep 2026 04:37:09 -0400 (EDT) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org Subject: [PATCH 5/5] firewire: cdev: refactor add_client_resource() to have release callback function Date: Sun, 20 Sep 2026 17:36:59 +0900 Message-ID: <20260920083659.191855-6-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260920083659.191855-1-o-takashi@sakamocchi.jp> References: <20260920083659.191855-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 implementation of the client_resource structure now requires a release callback. Add an argument to add_client_resource() for the release callback. Signed-off-by: Takashi Sakamoto --- drivers/firewire/core-cdev.c | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c index 96f3619237f3..9a471307aa5d 100644 --- a/drivers/firewire/core-cdev.c +++ b/drivers/firewire/core-cdev.c @@ -539,7 +539,8 @@ static int ioctl_get_info(struct client *client, union = ioctl_arg *arg) return 0; } =20 -static int add_client_resource(struct client *client, struct client_resour= ce *resource) +static int add_client_resource(struct client *client, struct client_resour= ce *resource, + client_resource_release_fn_t release) { scoped_guard(spinlock_irqsave, &client->lock) { u32 index; @@ -553,6 +554,7 @@ static int add_client_resource(struct client *client, s= truct client_resource *re return ret; =20 resource->handle =3D index; + resource->release =3D release; client_get(client); } =20 @@ -697,8 +699,7 @@ static int init_request(struct client *client, goto failed; } =20 - e->r.resource.release =3D release_transaction; - ret =3D add_client_resource(client, &e->r.resource); + ret =3D add_client_resource(client, &e->r.resource, release_transaction); if (ret < 0) goto failed; =20 @@ -781,8 +782,7 @@ static void handle_request(struct fw_card *card, struct= fw_request *request, r->data =3D payload; r->length =3D length; =20 - r->resource.release =3D release_request; - ret =3D add_client_resource(handler->client, &r->resource); + ret =3D add_client_resource(handler->client, &r->resource, release_reques= t); if (ret < 0) goto failed; =20 @@ -885,8 +885,7 @@ static int ioctl_allocate(struct client *client, union = ioctl_arg *arg) } a->offset =3D r->handler.offset; =20 - r->resource.release =3D release_address_handler; - ret =3D add_client_resource(client, &r->resource); + ret =3D add_client_resource(client, &r->resource, release_address_handler= ); if (ret < 0) { release_address_handler(client, &r->resource); return ret; @@ -985,8 +984,7 @@ static int ioctl_add_descriptor(struct client *client, = union ioctl_arg *arg) if (ret < 0) goto failed; =20 - r->resource.release =3D release_descriptor; - ret =3D add_client_resource(client, &r->resource); + ret =3D add_client_resource(client, &r->resource, release_descriptor); if (ret < 0) { fw_core_remove_descriptor(&r->descriptor); goto failed; @@ -1471,8 +1469,7 @@ static int ioctl_allocate_iso_resource(struct client = *client, union ioctl_arg *a e2->iso_resource.closure =3D request->closure; e2->iso_resource.type =3D FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED; =20 - r->resource.release =3D release_iso_resource_auto; - err =3D add_client_resource(client, &r->resource); + err =3D add_client_resource(client, &r->resource, release_iso_resource_au= to); if (err < 0) return err; request->handle =3D r->resource.handle; --=20 2.53.0