From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.43 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796379041; b=r8UnFA2gN2Uyc1BvOrkCenLUsILasdtiCJuuy76p6Y7UG/qLOMTbZr/5Yd9QvdKCjdx2 J3JsViNoG3V6EW7dMOcy0ls8m5afaOYyU7bd6uJL9/jDonrxnZnmC+QJf237+vG+a6hCR dRAoyrCStJ5mnlUsQruUwxvy6cPZsnGAstGb+HkfK63+nHS1Al7HreVPFdJ5Z2PPrcADi Vyg/qXcJl8vI7yrjZusTm9Gj1w9GO3osBIOpLM3jCjmsWeLwz5gmpGqXdX2wTqMrwe8T5 I2x7ILK2Nq3icqHNzFpM2nnPc184stc7vQphWLs0V3g9w86bb71Ug0Y7GeIWZQ7tyTw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796379041; 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=U2NB0IX+gFDp7BIlGJgF+VW3uBSmrSGTc2Fkv30RPmP2mUV8Qg2MktZFsOPxiWzvovyy ZcChPcx0xSpOvGOsylM6BVDqCbOnzoCDnRuGcNN+EA7phvW0U3hNFtRkLhG5YfdM8s7kb 6rHxivWGbbr4Fgag0DWIOTHqzbb/XSU4UbfcAjugu33NCIjmYYhwnG6mxIxLPlCQC9+jO fv8ILjHUelhFllZE6H2Kc7RJP0CwqyorSM8kV3R40IGq7Zt3rkT8cwK4MvmRXtXOKP/rq oECh3v4THrzEOK0X9n6Zj+AbFSy27T9UeUAYv2tvPuJAeUpBJqHjHmxKCHh2Rx3WXBA== 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.43 Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) (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 1EEBB606A32D for ; Fri, 4 Dec 2026 10:10:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1EEBB606A32D 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-f43.google.com with SMTP id 5b1f17b1804b1-4bb6adaf0f1so5387435e9.0 for ; Fri, 04 Dec 2026 02:10:39 -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=hrE/lc7UcEIfpaNQETjEm+74mfxXaBVMCiVeXWcGxHjaLPTcGsQkKWuGLeSxMTDfTC XU0Z4sfQ1aCXsnzRZiNnAEcLb0nFu5ftHmGTyqfatA7ldzLWFAevBD/hXRx1ovR3qDkl MbaQx54Ft4jwuEiOIKfTjpdi5PG1RgiSu8M2DpF9Tm5kan/tjpMqG1EAH3Hh0UgLQrRc Ng7TzcVjzMqH23y+GbaIlAvU40QerWP7G4V2ddyqckoPCOfi9+cgu4lmg3yCA+mIJzdL qayFtIQ/YIjsqfmunDCVvbGEjrPQX+4e0rE9utkUZr/o4FmjYXHRssH90AoFfdwPSAHD LbZQ== X-Forwarded-Encrypted: i=1; AL+hErF12jycAf3RbMotxYDzZoZyxABE3x+QKOkCnVDtT+AWNsGqIth+LlGu3tWpB6xNZMryeOC3pQ4IZE5LzCaX@vger.kernel.org X-Gm-Message-State: APuU4Z9ttJxqNOUKuF3p88LZVfxwWbSzvWMu4AZ2nJ9DA6X/aN4nLJ30 0ityR1rpkUZ12O+v2epbX/Z1bhM+q86+21SKUe/3pc2agimoc8vcNzaUB6e7yi1eXi8= X-Gm-Gg: AZFdTZeQXbImUaH33piN8mHoeR60rHPDQdvGHWkG5B3AaQCv/8mHFM2qCqCmG8wW1xr DbwE2Wejx6jTV03PPfPPX3jhjc0SWcLstL/uSfXvypQx8QsVm9/R6VA62A2Ap9T1upsoEQAl0Qp P7yjudOR0E9WaSzurjsaIv2kGYu+Etk7XOUlAhOUTO4gK6KBSdEeKzvshPlcshT/KC76Q39Y19a VYsc0oNLlJ6AvmXehOulAFULUmcu7nF0w9Yy08R9Pw01Halr+Scgyts3lB37tQ+oRS/owWmRNgk gxQeiD3kCO7D01dE+OohxNzYqVLw6x0sxVs+cYgcaIdIpdBIJM+my+koEWvujMfCaBK9hDkj8Tv 7A4fMlHiX1EWgvMKe/Dq9VpFTK4qv2lfesdk/6vCYKSinMkpptf18rrcpmMNLkdrwk884gK/Hb1 0dNMSq8Cj7VZIuCIayZ+gpRLgGvCYkpSWNzCd6wX9SpJVFYqEoqTPKrsIr9wiDmBQO0MBk/9In3 O/qDGdPTnyhXIynE/urrD8s7/1Jwl8k1wZUig8DVfMQu5ZeB93+SDCfXweh7PMr1Y9Hn0yW35wc On90YEAma2SYyB8JaQULWXj+4LU8h9jV8kz5ONE= 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: linux-arm-msm@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