Article View: linux.kernel.netdev
Article #26857Re: [PATCH net-next 1/3] dmaengine: qcom: bam_dma: report residue for completed RX transfers
From: Stephan Gerhold
Date: Fri, 04 Dec 2026 10:10
Date: Fri, 04 Dec 2026 10:10
33 lines
12975 bytes
12975 bytes
On Thu, Dec 03, 2026 at 09:40:52PM +0530, Vishnu Santhosh wrote: > For device-to-memory transfers, the BAM writes the number of bytes it > transferred back into the size field of each completed descriptor in the > FIFO. The driver ignores this and always reports a residue of zero, so > clients cannot tell how much data was received. > > BAM-DMUX needs this, because the modem can send packets whose length is > only given by the size of the transfer. > > Read the written-back sizes when a transfer completes, and report the > unused part of the buffers as residue through callback_result. If the > BAM reports more bytes than were queued, mark the transfer as > DMA_TRANS_WRITE_FAILED. If a descriptor other than the last one is > short, the received data is not contiguous and cannot be described by a > residue, so mark the transfer as DMA_TRANS_ABORTED. > > All existing users set the plain callback, which does not receive the > result, so they are not affected. > > Co-developed-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com> > Signed-off-by: Deepak Kumar Singh <deepak.singh@oss.qualcomm.com> > Signed-off-by: Vishnu Santhosh <vishnu.santhosh@oss.qualcomm.com> I think you should coordinate this patch with Nickolay, there is a similar patch already on the list. (I haven't checked if any of the patches is preferable, I suggest you both cross-review/test and pick your favorite for Vinod to apply). :-) https://lore.kernel.org/r/20261116-qcom-bam-dma-metadata-v2-1-aade3a42fcb4@mainlining.org/ Thanks, Stephan
Technical Details
Message-ID:
<axKRmSq4vQwAlrgM@linaro.org>Path:
mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377235-linux-kernel-netdev=dewy.ruReferences:
<20261203-qcom-bam-dmux-qmap-v1-0-abc2e80a03af@oss.qualcomm.com> <20261203-qcom-bam-dmux-qmap-v1-1-abc2e80a03af@oss.qualcomm.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!feed-us-txt.newsdeef.eu!feed-us-ny.newsdeef.eu!srv.newsdeef.eu!news.mb-net.net!open-news-network.org!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-377235-linux-kernel-netdev=dewy.ru
From: stephan.gerhold@linaro.org (Stephan Gerhold)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net-next 1/3] dmaengine: qcom: bam_dma: report residue
for completed RX transfers
Date: Fri, 4 Dec 2026 11:10:33 +0100
Organization: Usenet Network
Message-ID: <axKRmSq4vQwAlrgM@linaro.org>
References: <20261203-qcom-bam-dmux-qmap-v1-0-abc2e80a03af@oss.qualcomm.com>
<20261203-qcom-bam-dmux-qmap-v1-1-abc2e80a03af@oss.qualcomm.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Injection-Info: usenet.network;
logging-data="2734486"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Ps3DjDQ9inVtESBq8nMqXmj0/fY= sha256:hAblyg6SlhbKfGXTkCARMLcbS2B4idq8uKInHsgJGI8=
sha1:TB/QB3d7tB7b5pxgJWcTKCa5abs= sha256:o738Fm6cm9FowsKWL1GLZtd1BSGNfUqb2FLSjG0rFDg=
Content-Disposition: inline
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 257ED117B91; Fri, 4 Dec 2026 13:10:58 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -3.298
X-Spam-Status: No, score=-3.298 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1,
DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.001,
MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=linaro.org
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id ibSNcfNMMinM;
Fri, 4 Dec 2026 13:10:55 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-377235-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=linaro.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id A8654117B8E; Fri, 4 Dec 2026 13:10:46 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
by sea.lore.kernel.org (Postfix) with ESMTP id 6B23728D74; Fri, 4 Dec 2026 10:10:42 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
t=1796379041;
b=UT//f3Krhtn7IdHs+8/xjwA7iAab4FtsO804/MQJGK82nQzQ8VoqHfYA1OhMIhZSA6W1
SzfqcAQyh01VOhE1jVu6a2M1Nko/gxuQKIzqo2zHpjgG8fKOOzw0FAWopHxvKkkvVbz1m
McP5XgSylVzWzWa3+Ati3ym6zS5BrW0ApoB0JmRp6Rb2ljx54rBgb1rjmEX2LZ350L2eU
W0q0SR62P8rrK/ZnAPj4jI2W0L9CuC9f3vUXYKg0Og3RGYCeDEUYA8HXNS6wIrekL8C/q
2+EXqWTxep7QebdAkoH/Sm/E+M4y2GqE3U2K1IYE/3lL4Kzmzut6uKftcKuVZOjLwuA==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796379041;
h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
X-Google-DKIM-Signature:X-Forwarded-Encrypted:X-Gm-Message-State:
X-Gm-Gg:X-Received:Received:Date:From:To:Cc:Subject:Message-ID:
References:X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
List-Unsubscribe:List-Owner:Precedence:MIME-Version:Content-Type:
Content-Disposition:In-Reply-To;
bh=3jUkcF9Zg2I514iUqCt5bIwjtEUp0tmYLJk9X8WBAHQ=;
b=a2XNzXKZ8atGXHh4yaExIQTCTt+Sx1J5oUjDemPO3Rl45eEwl21uSCgOvh129e7us7IT
Acu7AzkoD/sAX2sCQRzPfMrpDrIKv966s16oyr/Jpf/m904mjKGlALV2e/3gJRgSF4zmv
fqNTuM9dE4f1/5DpQWhX1S+baMBn/+YmAy8wxq1jU85qMcMWNoWkGdwcuYbCtohQ7PexP
TkGTsrd3Q+oB7KZIN6HIjQwndZQoc28Md3F4eXFrwun6FKzn7rQM0S25PWJIcCslcnCj7
R+VrIwO3z37/Z51MmIHFEAZAYzRRV+kJZ9ww58uKqNw4a6eargqSQFtCMObhZIJjzWg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org;
dkim=pass header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=MCwiQLmP;
dmarc=pass header.from=linaro.org;
spf=pass smtp.mailfrom=linaro.org;
arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 5F205606A686;
Fri, 4 Dec 2026 10:10:41 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=MCwiQLmP
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.42
X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none;
t=1796379040;
b=Fy/tuUmvOcYyKu1h29NRiC9FWM1r8pzVq+Svj9KLd2xscN+0OTHDuO/7I9V5Vh1tG0oS
iTyHAXHXKwpS5s89CDxX8DIw7zbcZ8yFJAva2aoYx6V1bSV4Np1Y+HBfMQLgsA2tFUOv5
uAK7nVVpP1E7VcRks1RqroazpKsQ0/E08lvlKcEgfPDgnB7YVrbJm2JAHC5sUvLZjpfH+
irNov44pusMGp0uGrrujyu8b7Tuh1zBflFh/Q5FQE64scHUZVECxmG394iceuGWFhH5kK
UGq4dO6bMVIQV7ZpgRU9RenF0rLq6FUuf9SZnGVVUPmslMmrG2oIq4ghacOluh3Qnlg==
X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015;
a=rsa-sha256; c=relaxed/relaxed; t=1796379040;
h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received:
Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:
Content-Type:Content-Disposition:In-Reply-To;
bh=3jUkcF9Zg2I514iUqCt5bIwjtEUp0tmYLJk9X8WBAHQ=;
b=fG7oTbQf5473Ogmnew+1d66kbwWBWbh1/tSFCSPrAJ01MR8e+w9UJeTs7uLgnha7Yjhu
2JPUX3L6LnvjXbtbErSV/wAPJnpwOYhf+rqCeOoeqP6Nw5QY4HWbWrM4xRcHTYhINqzFj
jMVD9r07SPZvylSfyF7kMyIVfdSqrOwjtqYdqPpTYKWS5RzpwWKyVM14q+J1vXAVfJPNL
j4yw+d8JJ3r78oPc/ckbHK6WSUZvXmXgsCJPdSD/WvLXrn7Q7uIQDi/so61zoPI+sjCXx
tY8zwbzlsbuMQT3tsaVjrsKgxF+TvuxHf/JlNjUzMWC1oVtzjDeTVea7Qwzzv1JgnCw==
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org;
dmarc=pass header.from=linaro.org;
spf=pass smtp.mailfrom=linaro.org;
dkim=pass header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=MCwiQLmP;
arc=none smtp.remote-ip=209.85.128.42
X-Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42])
(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
(No client certificate requested)
by smtp.subspace.kernel.org (Postfix) with ESMTPS id 32917606A334
for <netdev@vger.kernel.org>; Fri, 4 Dec 2026 10:10:40 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 32917606A334
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org
X-Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4bbd2c5931bso4696625e9.2
for <netdev@vger.kernel.org>; Fri, 04 Dec 2026 02:10:40 -0800 (PST)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=linaro.org; s=google; t=1796379039; x=1796983839; darn=vger.kernel.org;
h=in-reply-to:content-disposition:content-type:mime-version
:references:message-id:subject:cc:to:from:date:from:to:cc:subject
:date:message-id:reply-to:content-type;
bh=3jUkcF9Zg2I514iUqCt5bIwjtEUp0tmYLJk9X8WBAHQ=;
b=MCwiQLmPluwvQMn+6OKhChnR2iIlU9zU+QfoFCXKOB8MDtccjSzSSwD07NrMrVv4+9
4Hf6yTdAtVM2oZUyUV8s9tFUqqAE14omQABLJtf5zfAR7ikCq5LpZ8Nk9V2nMico7dxw
FiTXfkhMk08G/imK4Y8+me9lP3Cye7LgizZlwbj8wvGJpIcmy1pJXzBW5BLSbvFA2khu
VnakuZOs4CiavFA3AzmDXzwTZrgealTd2uOCWJtfsuM5/xncaKimXKWv7ipeaVI+Z0Mz
4cK08NwvokzAMmgKvTyDTT6Lh563spAq1p06prLglmQ1cHpuJiNCUAhBV/j4in4TZ01B
QdEQ==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20260707; t=1796379039; x=1796983839;
h=in-reply-to:content-disposition:content-type:mime-version
:references:message-id:subject:cc:to:from:date:x-gm-gg
:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to
:content-type;
bh=3jUkcF9Zg2I514iUqCt5bIwjtEUp0tmYLJk9X8WBAHQ=;
b=yeitneOoLfp6v3u8Jsvv9zqoyn//giewnwP+qHlk6LYDqp+OTlo02qjiRYPcQ8Wnqt
QQ5SrsRlhtTXpWAlc+5Zuc96BpJy0Ba+k++jm9ediHqSZbyPDD10LvECOyYc8DdiJtBE
YiugaQoh/y83ubjfgHKDQN5soKXXS+wuSyDA+2r7MaRp8IcZnHHHM/LFq7Zjh+RUPOYd
BZtyr6LctiWPC8Be9rKcoNysBZCdjy4GpPgAQVnMClZxGfzP19eEH1jZSPHk64KFcTrN
N5hfBBo0MDLS0IBnFDbxJ45mZ6dHekt7idoQD5RgHEJOq9ayPq7SjvPOYzlGomh0IEDf
LgEg==
X-Forwarded-Encrypted: i=1; AL+hErHhXR7ULRvpO02nKGPV5YkQi6AydIgnnw/cSNy+3NHIdMazebB/pbWlth6jR/Poce8O8257THQ=@vger.kernel.org
X-Gm-Message-State: APuU4Z8y8ukw4uCPPC5+FElTD6eomavDQf46orjMtoHdjPI5DEcaXXZn
7xdj5JDdfkJKtgMrKFA4X9EgIPjG+zpPWAh3XgkCnQPN3JAkvSxpR7x96FCCC74q8XGUg3jGiJ2
63z91YB0=
X-Gm-Gg: AZFdTZdM2+uV8zoS5ZZrjH7dCXcICopoSB56yt8x6D9L3Js5zCjyZKmOB0E0vhnG12/
vLXdhL1sii18ALSOPJ1I6SqHk0YA+grxxM0KJz5abIwqKvM1k3gXMukopTmnSd3AMe/WGTfcmB8
ynmQCEGlGMNd5shfz5PTVEA/d1JcA4klOO/IPO5YfU+IMplY0E7jkpLWWdKoBpddpjPZxeTTUEQ
PUro7/QauNWWiJxHI3qGsS9eU7mRc04U2YarNu+eY/kTFOV+x6cEBldQmbL49fFwcUm6XEELpEI
Fu5WNRvKWr9LubGjjviLBO5uLsR/Fp3RqDHODAYXvHR1ZZ4bB5CDLMr32agdzmlCujNeK1Dk/ja
4596DRQ71Q5WBgV7zv0/IXlrvwvl0chaDYWEMDJr5kOp9QzVsd59eXPH8vPLHHkjoT+FHe6rpYK
kG/KUWZBwYJA29NQFx8E+fu/3rLMGBYZHLh4AKIELAIobOlIwLm4BYpFRFumuvVPDDTQmS99aW8
qETJTY9yKceMGB9pXvb41jsIISv3iWmTPywrgTXGuujcD8/due6QgKaSgkceDt/MeAW3UCpATqo
3EBPaCLUaMLjuN1D7/MXgCrXrK7PfBFnywTXgZc=
X-Received: by 2002:a05:600c:3ba6:b0:4bb:7bee:5496 with SMTP id 5b1f17b1804b1-4bbeb8997ffmr33011925e9.13.1796379038597;
Fri, 04 Dec 2026 02:10:38 -0800 (PST)
X-Received: from linaro.org ([2a02:2454:ff25:4f10:9821:14d4:1c0d:e790])
by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bbe003108asm137727505e9.1.2026.12.04.02.10.37
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Fri, 04 Dec 2026 02:10:38 -0800 (PST)
X-Cc: Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
Stephan Gerhold <stephan@gerhold.net>,
Loic Poulain <loic.poulain@oss.qualcomm.com>,
Sergey Ryazanov <ryazanov.s.a@gmail.com>,
Johannes Berg <johannes@sipsolutions.net>,
Andrew Lunn <andrew+netdev@lunn.ch>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@kernel.org>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Deepak Kumar Singh <deepak.singh@oss.qualcomm.com>
X-Mailing-List: netdev@vger.kernel.org
X-List-Post: <mailto:netdev@vger.kernel.org>
X-List-Help: <mailto:netdev+help@vger.kernel.org>
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:netdev+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <20261203-qcom-bam-dmux-qmap-v1-1-abc2e80a03af@oss.qualcomm.com>