From nobody Sun Feb 8 02:55:46 2026 Received: from mail-wm1-f54.google.com (mail-wm1-f54.google.com [209.85.128.54]) (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 8EAAC397AB4 for ; Wed, 14 Jan 2026 12:35:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.54 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768394138; cv=none; b=aSMDE07mA8cXGfUpE4X/5G/nz+ZBddcQl78rDVsPs01k5JafSlU23gwcRmGIDA71e4zffjilX+r0BCflxVu6E97tNNo91MQXNoMuuJ9MtmNBTResc9DsEz7kayVlSSAKobH90Ma9p0Gi8v0vTwCzQWtV/zk8vRvfnK3QyGDML0Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768394138; c=relaxed/simple; bh=KmF+mxZXBd5usLx31jYbFUdpVv319xRsw1z4NwmBaGQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NP3Vfw+JJKtv1WH0vrY1/lzMNzrjGqRCkmtWpbtVqwAP1sWQNSJWnKlEhEY+e8CyTGqpSvRY98zQgrLS72Cfr7+AXLmhuVF6eQDnl1aalqbRn3AmNBSL2nHI49odqFdCk/68QJpVRC27yXBCgp/a1eKzUbyFaY+KorVyXlvNqf8= 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=nBYs7tW/; arc=none smtp.client-ip=209.85.128.54 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="nBYs7tW/" Received: by mail-wm1-f54.google.com with SMTP id 5b1f17b1804b1-47ee47ff24aso732575e9.1 for ; Wed, 14 Jan 2026 04:35:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1768394133; x=1768998933; 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=Q5TjDcxLgtKvSQq5PqYHcBcWFoLtkmVts7uy/aHfmR4=; b=nBYs7tW/3x7wwMyV/lFnZERQJItyCnKQ5to8w5AZmiRmO90Kcin8Y0brIt7szpX39I BI60JrLyXSuoVA5KooU9McRuS4qCKGutHAIe4hiccudblpMQFmIJQFDEXGdeqpVuiu9v dsbNbBj9pV6KuO2X2SAy9pzYEups4x+1Zgg6tWsDHN2jLRaj2HcyactOyah/piwFt3ma zi7meHwS0BOSOoxvyobOv7YIxHuk0qpvOT4Sql05l+umlbihuFaUqQ2sa7MimFbVygBo E7uROKwuw1nPWkbUL5+ir/zd3bBFhDXrMKR5dN7OPbAsrgdVsWYQDPoPJNVOKUpVSvmp zT9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768394133; x=1768998933; 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=Q5TjDcxLgtKvSQq5PqYHcBcWFoLtkmVts7uy/aHfmR4=; b=DGXzAj/AK3EC+8Qc1/kh/hiJpdjVY7g1TNZvAFclXYTcNtlJBfHcGCqN2iYAovgP+4 iS7UxjDSIzWc34yihVWX3k38OweDByaOh3/8Avd0EH622aYEEl4q1YLY79NjPsw4ayO6 z+L9EM4sa8gKt43+XmN60IrU5ditgluMMYfg4KEyyJO+OupSfMCNtuyG3tyLe6U8+563 Zxwiz9L4XbOlh5h6ppxhaPIyHCBCOWYgsTm9AEbpZaR9Jxl+O1/YHsxz8+SrJbvYvMBZ D7a3CVBmy2nzNUmuBEP8Z988vd9RD3sSlx65NMQShmNFlTn1DIb8rNlZgt3T2OnI3bGi JtJg== X-Forwarded-Encrypted: i=1; AJvYcCXJ/VJNW5JfRljTJLMrpZQgWYc6AbctyONFwvalBqsOJHXv6Jkt1n+zT8xVe0OAbah9MLFC9RdzDOyBdYA=@vger.kernel.org X-Gm-Message-State: AOJu0YzCy8xoC+pWrdngZT+6IdUvpSe39XYJ7w0BItY41AL2Rx+20CVv 62NSBWUqTME27Ehu5qFSgYEULs4v/9WPfPLL45wmsru7Dzf0X2vFTvYT X-Gm-Gg: AY/fxX5q7MvSctn5xDsv4AkxKHOd5HmBQ5bElT01DvIjE+TdykcRyGw2ADcjwkwT4hu QekeOtweUNOu7FvPnL3aM9brNphIoJdJtYFfKh1PpcQI/IlswREXM++ko50wBDY8BPYa6UUPruM yJLXOo44uN3bCIf80NN/VCb6+mLqqo8CaW8demCO+XJ8lDXsWj86+LF3JTsMRtCDbVHqwH78Bwr TmogmUEpOYIrVo2jnagU7sQEw1YKrI81sC6Mkg4W6530Irs4mSLRCsadzM5koxk7en2wtgUzumK GacPV/5p6/MGqxHpa0ZZjK6Y0XfHrYfLCPF0I7SkL0d1ollor9S1LeBCz7LVggcjImJCWYPe7Zz dxGiWxqCg6VbR1YLmQHSRkVBH8yZyZxk3qvUidREcK/EzSVUSGIo3Hw1t0KuT+IUoxNH6hcVjkI 6lWv980CzZtX+LbCS+X+amvz8Do/2IVo/HNNNet81jj6VdIHORCym8r93GAFvFh9rzFtqKcMu2W c0s9o1Tu8Oh X-Received: by 2002:a05:600c:8816:b0:477:5ca6:4d51 with SMTP id 5b1f17b1804b1-47ee33918a4mr10348685e9.3.1768394132893; Wed, 14 Jan 2026 04:35:32 -0800 (PST) Received: from thomas-precision3591.paris.inria.fr (wifi-eduroam-85-139.paris.inria.fr. [128.93.85.139]) by smtp.googlemail.com with ESMTPSA id ffacd0b85a97d-432bd5ede7esm51037635f8f.32.2026.01.14.04.35.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jan 2026 04:35:32 -0800 (PST) From: Thomas Fourier To: Cc: Thomas Fourier , stable@vger.kernel.org, Sunil Goutham , Geetha sowjanya , Subbaraya Sundeep , hariprasad , Bharat Bhushan , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] octeontx2: Fix otx2_dma_map_page() error return code Date: Wed, 14 Jan 2026 13:31:06 +0100 Message-ID: <20260114123107.42387-2-fourier.thomas@gmail.com> X-Mailer: git-send-email 2.43.0 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" 0 is a valid DMA address [1] so using it as the error value can lead to errors. The error value of dma_map_XXX() functions is DMA_MAPPING_ERROR which is ~0. The callers of otx2_dma_map_page() use dma_mapping_error() to test the return value of otx2_dma_map_page(). This means that they would not detect an error in otx2_dma_map_page(). Make otx2_dma_map_page() return the raw value of dma_map_page_attrs(). [1] https://lore.kernel.org/all/f977f68b-cec5-4ab7-b4bd-2cf6aca46267@intel.= com Fixes: caa2da34fd25 ("octeontx2-pf: Initialize and config queues") Cc: Signed-off-by: Thomas Fourier --- drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h b/dri= vers/net/ethernet/marvell/octeontx2/nic/otx2_common.h index e616a727a3a9..8cdfc36d79d2 100644 --- a/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h +++ b/drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.h @@ -940,13 +940,8 @@ static inline dma_addr_t otx2_dma_map_page(struct otx2= _nic *pfvf, size_t offset, size_t size, enum dma_data_direction dir) { - dma_addr_t iova; - - iova =3D dma_map_page_attrs(pfvf->dev, page, + return dma_map_page_attrs(pfvf->dev, page, offset, size, dir, DMA_ATTR_SKIP_CPU_SYNC); - if (unlikely(dma_mapping_error(pfvf->dev, iova))) - return (dma_addr_t)NULL; - return iova; } =20 static inline void otx2_dma_unmap_page(struct otx2_nic *pfvf, --=20 2.43.0