From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.42 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== 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== 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 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 ; Fri, 4 Dec 2026 10:10:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 32917606A334 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org 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 Received: by mail-wm1-f42.google.com with SMTP id 5b1f17b1804b1-4bbd2c5931bso4696625e9.2 for ; Fri, 04 Dec 2026 02:10:40 -0800 (PST) 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) 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) Date: Fri, 4 Dec 2026 11:10:33 +0100 From: Stephan Gerhold To: Vishnu Santhosh , Nickolay Goppen Cc: Vinod Koul , Frank Li , Stephan Gerhold , Loic Poulain , Sergey Ryazanov , Johannes Berg , Andrew Lunn , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Deepak Kumar Singh Subject: Re: [PATCH net-next 1/3] dmaengine: qcom: bam_dma: report residue for completed RX transfers Message-ID: References: <20261203-qcom-bam-dmux-qmap-v1-0-abc2e80a03af@oss.qualcomm.com> <20261203-qcom-bam-dmux-qmap-v1-1-abc2e80a03af@oss.qualcomm.com> X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20261203-qcom-bam-dmux-qmap-v1-1-abc2e80a03af@oss.qualcomm.com> 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 > Signed-off-by: Deepak Kumar Singh > Signed-off-by: Vishnu Santhosh 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