From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fhigh-a4-smtp.messagingengine.com (fhigh-a4-smtp.messagingengine.com [103.168.172.155]) (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 538E025CC79 for ; Fri, 19 Dec 2025 14:17:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.155 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766153823; cv=none; b=Q2FB4VsnQnpbJSn1VqYqBOVu5IAG8e1PKTGsq3TX5MrsBTk1Wd5+Ghoi9bFc7j5hO4GxoztZ2L962BJ5DJJe3c54GICYEVxTvbEDtBovDxSpZLs2iJaNqVN/GlSN51RJPIl9Gwhzx2dirT9GE+MIyJKJ50ojNn1sQSdpIE0vJfA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1766153823; c=relaxed/simple; bh=YeV5dM9vyAG/ez1ui1RwSxIWwno6mStjGZRUfyKxZE4=; h=MIME-Version:Date:From:To:Cc:Message-Id:In-Reply-To:References: Subject:Content-Type; b=DFYgyQLqTt1U+1RkRgWjXmfUh7jiBBJf/H94CDd4zE6fXlfTO1C9FuXLv7ahH3/TZ+yN0ZLRtjlMX1UQIkmBJdcJMujqucmFKN1mBp7zyo4dSU4nGAHLtcOdHSejcif3vn1Adfh3NopApbsdJrzGYJwDVNcM6JAz1cpIcTthNKE= 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=eHQ65buQ; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=SObleORp; arc=none smtp.client-ip=103.168.172.155 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="eHQ65buQ"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="SObleORp" Received: from phl-compute-10.internal (phl-compute-10.internal [10.202.2.50]) by mailfhigh.phl.internal (Postfix) with ESMTP id 5871E14000C0; Fri, 19 Dec 2025 09:16:59 -0500 (EST) Received: from phl-imap-06 ([10.202.2.83]) by phl-compute-10.internal (MEProxy); Fri, 19 Dec 2025 09:16:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sakamocchi.jp; h=cc:cc:content-transfer-encoding:content-type: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=1766153819; x=1766240219; bh=7mQ5O7urY4OAN8MS8OZdVBoWsY2f4uUe niiUVdrvKPw=; b=eHQ65buQf9ofmvMHu1RUg6KK/YUlRCYlHg3IgLJ1WolQwCkV LBDZGU8ODAbiw91LY95xUDg+DvMSqgVh/X2vjNyBzqbKKpo5jYTBwXC1LP+oRk4Q 4vlQtMA4emTBxgkUF8egD/pzTxOptkpCXhPhE4EjLVKTEMdBvopBi51rI3TQz0ZL kSQm5ztkh+YPQ9nOlsSuxe9etbFKL6RT3h+8vUY0y/q/9BIY8/ZYaJFmwxbIKwij AfL2ptm2URtydZ5zdsOtNA/uVfGwekagaFNEOj4syWHgfhyF5CG64Ex2Fn8ETyNd +BgaZ+RHFjolV4KwMTyWKudZGR+j3HuHUWEeMg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type: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=1766153819; x= 1766240219; bh=7mQ5O7urY4OAN8MS8OZdVBoWsY2f4uUeniiUVdrvKPw=; b=S ObleORpPGgGwVHvqmZQASN9RSDl5X6eE63POQJO+kXuyL8/P6RHA4eWBqXdgT4tg UZWlwxancNyJbHp1jiiJ/GwjTVzrAe5+tvpPJsI5+IMQIAPgv3SFYc7ORKAAb9mu NqXj4UK3AYepq0y2Nh12PSnKGC/kc7Eoxv+yQXr8SEwvLnrZYWkIz8VmIZEmp+z2 G85NO+iCBYAeyCHprQE3s1ROKmwbKsixHurBLJXN1o1L8h5fU8Oow2i6WzeE6HII kwNPBdoa+pGfv1/ghQ0yScW5KerNpNQP2zKyZKcpgLzsJzDkz32UsKA2kPAtVJco UHyp2fWeBVFbpLlSyrgEg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdegkeehudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjug hrpefoggffhffvvefkjghfufgtgfesthhqredtredtjeenucfhrhhomhepfdfvrghkrghs hhhiucfurghkrghmohhtohdfuceoohdqthgrkhgrshhhihesshgrkhgrmhhotggthhhird hjpheqnecuggftrfgrthhtvghrnhepkefhtefftdelieekteevfeegkeeivedugedtudek udejvdetvdefffefteduueegnecuffhomhgrihhnpehkvghrnhgvlhdrohhrghenucevlh hushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhppdhnsggprhgtphhtthhopeegpdhmohguvgepsh hmthhpohhuthdprhgtphhtthhopehfohhurhhivghrrdhthhhomhgrshesghhmrghilhdr tghomhdprhgtphhtthhopehlihhnuhigudefleegqdguvghvvghlsehlihhsthhsrdhsoh hurhgtvghfohhrghgvrdhnvghtpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehv ghgvrhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtoheptghhrhhishhtohhphhgvrdhjrg hilhhlvghtseifrghnrgguohhordhfrh X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mailuser.phl.internal (Postfix, from userid 501) id D31F72400098; Fri, 19 Dec 2025 09:16:58 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-ThreadId: AWjw7c8DSKJo Date: Fri, 19 Dec 2025 23:16:37 +0900 From: "Takashi Sakamoto" To: "Christophe JAILLET" , "Thomas Fourier" Cc: linux1394-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org Message-Id: In-Reply-To: <7ffdcfff-0f2f-4563-9051-d398f3c5c6a7@wanadoo.fr> References: <20251216165420.38355-2-fourier.thomas@gmail.com> <7ffdcfff-0f2f-4563-9051-d398f3c5c6a7@wanadoo.fr> Subject: Re: [PATCH] firewire: nosy: Fix dma_free_coherent() size Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I'm sorry to be late for reply, but I'm in travel and could not process = the reviewed patches for my tree. Please wait for the next weekend. It's our misfortune that Christophe's first proposal has been overlooked. (The patch was posted before 2023, when I took over the role...) Let us put it for next merge window to v6.20 kernel. On Wed, Dec 17, 2025, at 02:47, Christophe JAILLET wrote: > Le 16/12/2025 =C3=A0 17:54, Thomas Fourier a =C3=A9crit=C2=A0: >> It looks like the buffer allocated and mapped in add_card() is done >> with size RCV_BUFFER_SIZE which is 16 KB and 4KB. >>=20 >> Fixes: 286468210d83 ("firewire: new driver: nosy - IEEE 1394 traffic = sniffer") >> Signed-off-by: Thomas Fourier > > Reviewed-by: Christophe JAILLET > > And for the records, see [1]. > > CJ > > [1]:=20 > https://lore.kernel.org/lkml/20200625191554.941614-1-christophe.jaille= t@wanadoo.fr/ > >> --- >> drivers/firewire/nosy.c | 10 +++++----- >> 1 file changed, 5 insertions(+), 5 deletions(-) >>=20 >> diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c >> index ea31ac7ac1ca..f562e82e5438 100644 >> --- a/drivers/firewire/nosy.c >> +++ b/drivers/firewire/nosy.c >> @@ -494,6 +494,8 @@ irq_handler(int irq, void *device) >> return IRQ_HANDLED; >> } >> =20 >> +#define RCV_BUFFER_SIZE (16 * 1024) > > Maybe this could be moved at the top of the file when #define are=20 > usually placed. > >> + >> static void >> remove_card(struct pci_dev *dev) >> { >> @@ -517,16 +519,14 @@ remove_card(struct pci_dev *dev) >> lynx->rcv_start_pcl, lynx->rcv_start_pcl_bus); >> dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl), >> lynx->rcv_pcl, lynx->rcv_pcl_bus); >> - dma_free_coherent(&lynx->pci_device->dev, PAGE_SIZE, lynx->rcv_buff= er, >> - lynx->rcv_buffer_bus); >> + dma_free_coherent(&lynx->pci_device->dev, RCV_BUFFER_SIZE, >> + lynx->rcv_buffer, lynx->rcv_buffer_bus); >> =20 >> iounmap(lynx->registers); >> pci_disable_device(dev); >> lynx_put(lynx); >> } >> =20 >> -#define RCV_BUFFER_SIZE (16 * 1024) >> - >> static int >> add_card(struct pci_dev *dev, const struct pci_device_id *unused) >> { >> @@ -680,7 +680,7 @@ add_card(struct pci_dev *dev, const struct pci_de= vice_id *unused) >> dma_free_coherent(&lynx->pci_device->dev, sizeof(struct pcl), >> lynx->rcv_pcl, lynx->rcv_pcl_bus); >> if (lynx->rcv_buffer) >> - dma_free_coherent(&lynx->pci_device->dev, PAGE_SIZE, >> + dma_free_coherent(&lynx->pci_device->dev, RCV_BUFFER_SIZE, >> lynx->rcv_buffer, lynx->rcv_buffer_bus); >> iounmap(lynx->registers); Cheers Takashi Sakamoto