From nobody Mon Feb 23 11:18:28 2026 X-Original-To: bugs@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4fKJJ44QJMz6T90C for ; Mon, 23 Feb 2026 11:18:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R12" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4fKJJ43sl3z4Dvm for ; Mon, 23 Feb 2026 11:18:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771845508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rf5I6mJElhxsIaztFPgPq9u70lOdTDFdtCkduTr4cVM=; b=A0x42m8D2A7WZAsyDP8ERpwLaUWYUPRjhubqo9Y43VmKqi0CMZl3zdgMeCFb4SAhvLzCHg NP4TI0p6kK44CxFd9SJ2bd5xd3U6WcKp9z+rL0odGPpd5qmF21Exyar4ZSnOnS+klMzaZS Sw/dCcQdOxKD0okC+KerKxObI0EGHoFQJYr5zWif/zdWmOeuDKCKQL6R/I6eM2C7dwA2gl tj/7cDSRdXkpikuhnFGQ144iO4KYKnSExGRcti7p8CVpISDFC3t52XgX0Bbuyvs/VlOLDx lNJFljSwo7Uxt/SBWIiwrOXpYpUiif4dYXf70alMmxpB4yBO3stp7cc502xzrg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1771845508; a=rsa-sha256; cv=none; b=IUChZi9bX9j8HGgDT+OJRm6zGj2IuP6FMSzRWpAUAslsAI3GUiuBUNkMei8xJ9u5N4KToo Fuin9GIDwQ5XhYKVryEqE9D9HZ6TJ+lnBE6QB6LUDSzaXILU8ZQYUZ9nnHdr7efbDSW9Lm AVmsVa2GzmlCtv6X9YNPUVCBVaP+kEMk0KlV0FPxnNm4Tf35WDZBj31ar8PTS9bNyS3MnV i+mxaMtetEFfTXBwMZ1E7tbJCT7irnsh0z8aH1JDeosTmLA4oi/bmX1uapJyORa/SDUYxB ME8t3SbygZqJTZ6UY7VAau/4/CK2Fya698hguz/cEsYIEf8/hK279GhK/Ds08Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1771845508; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rf5I6mJElhxsIaztFPgPq9u70lOdTDFdtCkduTr4cVM=; b=isqyfkammL+NOi63StKJkfiDan2k9uMtT3UVYpFTmC9oAWxmiTpXI7xg/vLVjsTGiU4MqV z4Gp1p4Q5/HirNDJpqKmBhIXrsam+7F6mTjhTSnE0hb8wwBrZRvVrKSHr5mABilnM8cupD 85COd7DbBF5REhoLk2VfuHulVYNihJ4LYFuPEACStzeGNii4w45lOl2HG9Y+97ki3L0KZL okNaqDP/M5+OE3puEtLRZZNxdh50T85238ZaGgw1goQPq/iLY04N42Su7lGE8WIeElJfaH 8WWOX22rZota+PEdiMXU0fZ3MEm2667GJzfLKzwqxsRXibEYgWk7Pl1H/wZjsw== Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4fKJJ42td4zCDf for ; Mon, 23 Feb 2026 11:18:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 61NBISPT050029 for ; Mon, 23 Feb 2026 11:18:28 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 61NBISNs050028 for bugs@FreeBSD.org; Mon, 23 Feb 2026 11:18:28 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: bugs@FreeBSD.org Subject: [Bug 293381] linuxkpi: Possible incorrect bus_dmasync_op_t mapping for DMA_BIDIRECTIONAL Date: Mon, 23 Feb 2026 11:18:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 15.0-CURRENT X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Some People X-Bugzilla-Who: zishun.yi.dev@gmail.com X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: bugs@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter cc attachments.created Message-ID: Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated List-Id: Bug reports List-Archive: https://lists.freebsd.org/archives/freebsd-bugs List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-bugs@FreeBSD.org MIME-Version: 1.0 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D293381 Bug ID: 293381 Summary: linuxkpi: Possible incorrect bus_dmasync_op_t mapping for DMA_BIDIRECTIONAL Product: Base System Version: 15.0-CURRENT Hardware: Any OS: Any Status: New Severity: Affects Some People Priority: --- Component: kern Assignee: bugs@FreeBSD.org Reporter: zishun.yi.dev@gmail.com CC: bz@FreeBSD.org Created attachment 268296 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D268296&action= =3Dedit Illustrative patch In dma_sync_single_for_cpu(), for DMA_BIDIRECTIONAL, the code currently performs BUS_DMASYNC_POSTREAD followed by BUS_DMASYNC_PREREAD. I suspect it should simply be BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE. Reason: dma_sync_single_for_cpu() transfers the ownership of the DMA area to the CPU. Since DMA_BIDIRECTIONAL indicates the area can be used for both De= vice -> Main Memory and Main Memory -> Device transfers, we must assume the prev= ious device's access was bidirectional. Because the device might have both read = from and written to this area, both POST operations are necessary before the CPU accesses it. Furthermore, since the ownership of the DMA area is being transferred to the CPU, the device will no longer access it. Therefore, I believe the PREREAD operation is unnecessary. PREREAD should instead be used when ownership is transferred back to the device. So, for dma_sync_single_for_device(), I suspect it should use BUS_DMASYNC_PREREAD | BUS_DMASYNC_PREWRITE to prepare the buffer for potent= ial bidirectional access by the hardware. PS: I noticed this logic was introduced in https://reviews.freebsd.org/D322= 55. this DR conclusion seemed a bit unclear, and the current mapping was ultima= tely adopted. Given that context, I just wanted to bring this up to see if it mi= ght be an oversight. Please kindly correct me if my understanding is wrong. --=20 You are receiving this mail because: You are the assignee for the bug.=