From nobody Tue Feb 10 15:28:53 2026 Received: from fhigh-a6-smtp.messagingengine.com (fhigh-a6-smtp.messagingengine.com [103.168.172.157]) (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 65CF623B62B for ; Sat, 10 Jan 2026 01:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.157 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768009176; cv=none; b=fRzb3f4lMBoBeDRJg0sxKQl5f6+UYt/Zruh7z3f7txNOElYv0fYHXaDUMzMFghHuxQOEugeyVHBIEi9L82tXWe+zSAYxPl3qanTRcIshAJ2ab/UhEN+/yw6YAUHoKPkOjOzm18VRtgFS8MBRWhFUSM9GQTE+UN0tH1H4gQDQ9A8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768009176; c=relaxed/simple; bh=jTfpCoUp+JBLFGoYQOTJWb+tIVx3sqr5L5hxyicsQKE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WNEaGCQHHZYpJcALtV29+LjWl24qvxHu2Sq4CQkp6OOyo5CrJuklipi2mYHhqGqnUXwMFmhSe+fX3hC7YezXPFeiS76sfPYHVU9s5gmx7UymurpN8NmYlmLP62aX93Fwe47co3+q4VdEzI+5jFWVCuWAqDgxwZhYvpMzix75jpQ= 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=NAcQgHG4; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=QCPu9agA; arc=none smtp.client-ip=103.168.172.157 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="NAcQgHG4"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="QCPu9agA" Received: from phl-compute-04.internal (phl-compute-04.internal [10.202.2.44]) by mailfhigh.phl.internal (Postfix) with ESMTP id A8C191400100; Fri, 9 Jan 2026 20:39:25 -0500 (EST) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Fri, 09 Jan 2026 20:39:25 -0500 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=fm2; t=1768009165; x= 1768095565; bh=H39eFB7dHZGvrVm7AcOydI1W4i68bG/6Nu3FCkdDSKU=; b=N AcQgHG4+b7E6EH5WyT/6yDWqBb2gSPl4UZRb28gkKAIp2YfObOCrDhN82JK0wBYT 76d3UvC0T+OSFCRoykh1c/2dj1D9uXzn7mdma0r4PhJ/Ugl6WXHqBSAqJoTkOduI vjgofIY7KuJSMGNOYd2+Mxs5SfbUkfdGbZTPZTavIg/0v9gYVEJ/hpUmpkkPYXeQ jyAwNUwNeN9TvkBQC3jjquIdGwOGxuqxf713PCqYy08tJzsKWzMSPNfzPq4t7aZ7 ecUZMUKYTZPfe+1oLZX0rLI6307RzcIk1rtXJJ6PJSatmeBbrncR6nidSTME/v0o 9tUjitpu4e8X8Kq7YoQgQ== 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=fm2; t=1768009165; x=1768095565; bh=H 39eFB7dHZGvrVm7AcOydI1W4i68bG/6Nu3FCkdDSKU=; b=QCPu9agAUfyE7la+/ CMJTpxVd+RjcZhPTEShDbASoMa9c6S50jlQQkqN/RheoBBor/034JJgUq3dUrpvg dX4NnTOUuV1Y7vx470x8DDKnx5ceeNeDw6hbQw7zrmCB4iJR0eXNnPA3fn6oC0V2 pcWFYrSaZCE3B3b3Nm6Nh4VTqCCJ1Onb0zrw+BER1rx9zR+8xHLDTPhuS2GmGvQO 0daX4Wxj8E4IsjpxVv+f2lb1tFPgEsSXrcKUxIRWf3vmi/65GGHO5cJY+eLT069W ysQ8FXn7L/DvuoZArji95OzbPpAZpGbwTXnEWEOxoeeZNgq+Z5mB/lX6OkoiTBBS 25B/A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdduuddtfeelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertd ertddtnecuhfhrohhmpefvrghkrghshhhiucfurghkrghmohhtohcuoehoqdhtrghkrghs hhhisehsrghkrghmohgttghhihdrjhhpqeenucggtffrrghtthgvrhhnpedvjefgjeeuvd fguddukeelveetgfdtvefhtdfffeeigfevueetffeivdffkedvtdenucevlhhushhtvghr ufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehoqdhtrghkrghshhhisehsrg hkrghmohgttghhihdrjhhppdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhu thdprhgtphhtthhopehlihhnuhigudefleegqdguvghvvghlsehlihhsthhsrdhsohhurh gtvghfohhrghgvrdhnvghtpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgv rhdrkhgvrhhnvghlrdhorhhgpdhrtghpthhtohepjhhgghesnhhvihguihgrrdgtohhm X-ME-Proxy: Feedback-ID: ie8e14432:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Fri, 9 Jan 2026 20:39:24 -0500 (EST) From: Takashi Sakamoto To: linux1394-devel@lists.sourceforge.net Cc: linux-kernel@vger.kernel.org, jgg@nvidia.com Subject: [PATCH 8/8] firewire: ohci: stop using page private to store DMA mapping address Date: Sat, 10 Jan 2026 10:39:11 +0900 Message-ID: <20260110013911.19160-9-o-takashi@sakamocchi.jp> X-Mailer: git-send-email 2.51.0 In-Reply-To: <20260110013911.19160-1-o-takashi@sakamocchi.jp> References: <20260110013911.19160-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 long discussion about the use of private field in page structure between Linux kernel developers. This commit stop using page private to store DMA mapping address for AR context, to prepare for mm future change. Signed-off-by: Takashi Sakamoto --- drivers/firewire/ohci.c | 39 ++++++++++++++++----------------------- 1 file changed, 16 insertions(+), 23 deletions(-) diff --git a/drivers/firewire/ohci.c b/drivers/firewire/ohci.c index e34965acb925..a43fe680d508 100644 --- a/drivers/firewire/ohci.c +++ b/drivers/firewire/ohci.c @@ -96,6 +96,7 @@ struct ar_context { struct fw_ohci *ohci; struct page *pages[AR_BUFFERS]; void *buffer; + dma_addr_t dma_addrs[AR_BUFFERS]; struct descriptor *descriptors; dma_addr_t descriptors_bus; void *pointer; @@ -513,11 +514,6 @@ static int ohci_update_phy_reg(struct fw_card *card, i= nt addr, return update_phy_reg(ohci, addr, clear_bits, set_bits); } =20 -static inline dma_addr_t ar_buffer_bus(struct ar_context *ctx, unsigned in= t i) -{ - return page_private(ctx->pages[i]); -} - static void ar_context_link_page(struct ar_context *ctx, unsigned int inde= x) { struct descriptor *d; @@ -544,11 +540,11 @@ static void ar_context_release(struct ar_context *ctx) return; =20 for (int i =3D 0; i < AR_BUFFERS; ++i) { - dma_addr_t dma_addr =3D page_private(ctx->pages[i]); - - dma_unmap_page(dev, dma_addr, PAGE_SIZE, DMA_FROM_DEVICE); - set_page_private(ctx->pages[i], 0); + dma_addr_t dma_addr =3D ctx->dma_addrs[i]; + if (dma_addr) + dma_unmap_page(dev, dma_addr, PAGE_SIZE, DMA_FROM_DEVICE); } + memset(ctx->dma_addrs, 0, sizeof(ctx->dma_addrs)); =20 vunmap(ctx->buffer); ctx->buffer =3D NULL; @@ -647,14 +643,12 @@ static void ar_sync_buffers_for_cpu(struct ar_context= *ctx, =20 i =3D ar_first_buffer_index(ctx); while (i !=3D end_buffer_index) { - dma_sync_single_for_cpu(ctx->ohci->card.device, - ar_buffer_bus(ctx, i), - PAGE_SIZE, DMA_FROM_DEVICE); + dma_sync_single_for_cpu(ctx->ohci->card.device, ctx->dma_addrs[i], PAGE_= SIZE, + DMA_FROM_DEVICE); i =3D ar_next_buffer_index(i); } if (end_buffer_offset > 0) - dma_sync_single_for_cpu(ctx->ohci->card.device, - ar_buffer_bus(ctx, i), + dma_sync_single_for_cpu(ctx->ohci->card.device, ctx->dma_addrs[i], end_buffer_offset, DMA_FROM_DEVICE); } =20 @@ -795,9 +789,8 @@ static void ar_recycle_buffers(struct ar_context *ctx, = unsigned int end_buffer) =20 i =3D ar_first_buffer_index(ctx); while (i !=3D end_buffer) { - dma_sync_single_for_device(ctx->ohci->card.device, - ar_buffer_bus(ctx, i), - PAGE_SIZE, DMA_FROM_DEVICE); + dma_sync_single_for_device(ctx->ohci->card.device, ctx->dma_addrs[i], PA= GE_SIZE, + DMA_FROM_DEVICE); ar_context_link_page(ctx, i); i =3D ar_next_buffer_index(i); } @@ -850,6 +843,7 @@ static int ar_context_init(struct ar_context *ctx, stru= ct fw_ohci *ohci, struct device *dev =3D ohci->card.device; unsigned int i; struct page *pages[AR_BUFFERS + AR_WRAPAROUND_PAGES]; + dma_addr_t dma_addrs[AR_BUFFERS]; void *vaddr; struct descriptor *d; =20 @@ -885,19 +879,18 @@ static int ar_context_init(struct ar_context *ctx, st= ruct fw_ohci *ohci, dma_addr_t dma_addr =3D dma_map_page(dev, pages[i], 0, PAGE_SIZE, DMA_FR= OM_DEVICE); if (dma_mapping_error(dev, dma_addr)) break; - set_page_private(pages[i], dma_addr); + dma_addrs[i] =3D dma_addr; dma_sync_single_for_device(dev, dma_addr, PAGE_SIZE, DMA_FROM_DEVICE); } if (i < AR_BUFFERS) { - while (i-- > 0) { - dma_addr_t dma_addr =3D page_private(pages[i]); - dma_unmap_page(dev, dma_addr, PAGE_SIZE, DMA_FROM_DEVICE); - } + while (i-- > 0) + dma_unmap_page(dev, dma_addrs[i], PAGE_SIZE, DMA_FROM_DEVICE); vunmap(vaddr); release_pages(pages, nr_populated); return -ENOMEM; } =20 + memcpy(ctx->dma_addrs, dma_addrs, sizeof(ctx->dma_addrs)); ctx->buffer =3D vaddr; memcpy(ctx->pages, pages, sizeof(ctx->pages)); =20 @@ -910,7 +903,7 @@ static int ar_context_init(struct ar_context *ctx, stru= ct fw_ohci *ohci, d->control =3D cpu_to_le16(DESCRIPTOR_INPUT_MORE | DESCRIPTOR_STATUS | DESCRIPTOR_BRANCH_ALWAYS); - d->data_address =3D cpu_to_le32(ar_buffer_bus(ctx, i)); + d->data_address =3D cpu_to_le32(ctx->dma_addrs[i]); d->branch_address =3D cpu_to_le32(ctx->descriptors_bus + ar_next_buffer_index(i) * sizeof(struct descriptor)); } --=20 2.51.0