From nobody Fri Jun 19 07:47:12 2026 Received: from mail-qt1-f175.google.com (mail-qt1-f175.google.com [209.85.160.175]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CAF32386C0A for ; Fri, 24 Apr 2026 09:23:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.175 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777022632; cv=none; b=Nkx6/CxJrFccl97UTDTAXasHc5yUtWeP/e5C9xq1e27DlTgtTcKUPB37u/Gx9szwoTASgUatTbwS9ZxElxekTD/fXQr+OH3s9R/4PDLxl5tsMvvuX+YQrfdYdzxjbT8wmC94MCAtGlfVstv59vKFxY2Qfcqi/7yxi9516EHaWVo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777022632; c=relaxed/simple; bh=/SUBSuk+SDC4GASHaWbhSGL6TnOTTOKiHU48wlDRCnE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=Apfh2cdLiVwqkUAyobBdWyZkjZSdFOdohjrXRGvHU6h175wOUlazTdFcAEH4OS5b+98lFMBjg9/ICHTi6hNrv2BGnLCnKSH+TG53GQpUxLSVry2XE7LHevlDcNoFxsLdaaKB+2LGARN3CWUPlWAnYfkYAHWkLY4M4uXyr8OBCMM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PkIk/YIS; arc=none smtp.client-ip=209.85.160.175 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PkIk/YIS" Received: by mail-qt1-f175.google.com with SMTP id d75a77b69052e-50e63771d91so59902171cf.0 for ; Fri, 24 Apr 2026 02:23:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1777022630; x=1777627430; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=ngbszeOkNODL28DsRhILz9Ks1a8MdcqJNW+bjGsrVkE=; b=PkIk/YISyJ/BPwtNb7HGmpqdvPekEK/pQAj7/h2+LqNl+UVFs7PY/P9UUudSt21AwN 2cRJRIn69XfJyvV8DuLtAa1TmqWXo9RRfCLZN2JujMxqKy674xBbm5VqN13D6msVFlaF o0ueYqFvFqJH+Z+d0qHIn7/v1LvwU8RHgICKrzREYbtZCKn4iOp62T18nZjZcGqDNL72 u72rc9owEuaYJPwWrChqJvZ2OOo08qxOsHcdC1PWickrRZfCdqkIMe9wErw6O1X9021I xPgX6rPyfiv1qh8ZOlVE1CB7RTo7EDnrP+arpS0iWaD0T7GlLDHMqAhS+pizW0XMJHbM 7b9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1777022630; x=1777627430; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=ngbszeOkNODL28DsRhILz9Ks1a8MdcqJNW+bjGsrVkE=; b=skuquued4QiVDq20/NtvfuRnVTZo4y1f/NdaQwIPfFhlowJgahSnu59nOc0ntXZMgm eEhkQM2cZG0gW/QUMTxodLHGkGzBdWvWLUOHnUpOptal129UOAuoVqqLPwWLW/bFk43B Or7otiTVM30/P9myk3Ytf/GJHrhyBYCIY/7JAtkHOSe+XX+YchaZ9cSlxRZ8x74NvHy3 G51iX9jHyXeLPwVPZ9DPv+Rj2j6RrvuBwI+Maf+qWIOE7M3Zw3UMGIj1lSo3owQRp5Za 9dun4cO9SXMfgHkU/19YcD8kZ+SwNCvo0D/uhIPuPvk44a5q0JTVxlIZ2MVVQRKeLD1a 2EnA== X-Forwarded-Encrypted: i=1; AFNElJ9jK+IFicWDgAsQSzDnoDABHcpTvFsi+5KcL8NmaKDt4GJCEWQFnzaAQitcPAMGo0hXOy2RRzcVCnypeyc=@vger.kernel.org X-Gm-Message-State: AOJu0YwGc3hZuxxHSn8wF1YRgeX+ws33LM3ziWg59ZIC/NczHwZdIz0O LpkzdRvXFvhmSWHZLrxiBzKLlXcPkb4S1/Tbb44u5RTOFcI++okq+XKc X-Gm-Gg: AeBDieu3skInzfyACBrQ5sqbeJkWR5FkSpq/XoHq1h1xOEgdqWPbeUqWt9RKxx2zZa9 DR47DThOFgkDn92aFXiDvSCeMVPBdyLkkpmJVMJ+5MhPm544YehDLekvyezfhrqCG8wYVfytpfp 57owMEYy60PPb33AWLos7tYHJxFJuEXay5vL5hkFh/EvzC2weMxrvBcCHjP40EEAOEpPqHuzT2K fMNhyia7RjzZCjuJnK4yQPsqTt0vXFbRRHA++nvNS+oEcHHLupjkyR45lWAB7fWYd9aTpu9TfpS IR143Su39V935tmgPctcH2FYMvHbt2NH6OspkqU8vFVFpImjc4Q51XlpCXRL+4UsBBL2cwGoBAi lX0/N42G8Y42Z8ArEpa0EgJTspy0VlYqptUxtS6fMA56pTfGriXlWvj0oX7g/+1fNQZX9on33au oDcx0j6wLJrQfw7vQos/15OAReK+Xg/QNMOIcb X-Received: by 2002:ac8:5e49:0:b0:50f:ca25:fb45 with SMTP id d75a77b69052e-50fca260350mr110587411cf.8.1777022629540; Fri, 24 Apr 2026 02:23:49 -0700 (PDT) Received: from xa-004773.. ([160.22.157.50]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-50e393ff941sm186022941cf.19.2026.04.24.02.23.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2026 02:23:49 -0700 (PDT) From: Xingbang Liu To: jdmason@kudzu.us, dave.jiang@intel.com, allenbh@gmail.com Cc: ntb@lists.linux.dev, linux-kernel@vger.kernel.org, Xingbang Liu Subject: [PATCH v1] ntb_transport: replace wmb() with dma_wmb() in TX paths Date: Fri, 24 Apr 2026 17:23:40 +0800 Message-Id: <20260424092340.3792297-1-liu.airalert@gmail.com> X-Mailer: git-send-email 2.34.1 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 TX paths currently use wmb() after memcpy_toio() to ensure that writes to the peer memory window are visible before subsequent notification. The actual ordering requirement is to ensure that data written to the peer memory is observed before the associated notification or status update. This matches the semantics of dma_wmb(), which orders memory writes with respect to external observers. The peer memory window is mapped with ioremap_wc(), allowing write-combining. On weakly ordered architectures such as arm64, dma_wmb() ensures that prior writes are committed from write-combining buffers and become visible to the peer before subsequent operations. This aligns with common patterns in PCIe-based drivers, where it is used to order descriptor or payload writes before notification, while avoiding the stronger ordering semantics of wmb(). The ordering with respect to peer observation is completed by the subsequent notification mechanism. No functional change is intended. Signed-off-by: Xingbang Liu --- drivers/ntb/ntb_transport.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/ntb/ntb_transport.c b/drivers/ntb/ntb_transport.c index 7cabc82305d6..c8ef46ddcc57 100644 --- a/drivers/ntb/ntb_transport.c +++ b/drivers/ntb/ntb_transport.c @@ -1791,7 +1791,7 @@ static void ntb_memcpy_tx_on_stack(struct ntb_queue_e= ntry *entry, void __iomem * #endif =20 /* Ensure that the data is fully copied out before setting the flags */ - wmb(); + dma_wmb(); =20 ntb_tx_copy_callback(entry, NULL); } --=20 2.34.1