From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796379040; b=JYjOdA+pVvHJ1q7aFKWKRFE5MQJsijj5TB3yNLwRukV09EFIAcc+G2E1/BQJ+eimqVZB JBT28ATicQFgaUIZSfWQMkth6ANB3a4YoBxsCTcXjEzsDTfQg2hFykeK6zICUoC6Y35nr Hv4xfKjc77OzO50ae3gL5Ny0sI5pMzKn7VATOuWSbSA6BVmSTtg+hC+cmibfyR4nAvfUf c5G27+6TWEAvMOoD7sZhe80B4Ro/1N98uHZ/YLy+BzPBpCdp3A5lZypTfd1JXNXpCGhqQ Ov7n5I1r0UGIk8+DZNVoG9osnau/N2MGdl9yj7eXkFzROWD5f9TuBZX68YE9TLdEOZw== 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=k19UJ2S1NkOU3RGZoa608PBfZ8RbNM1J4UApAgHNrSTKLteXhQW98aZYgLfBNvHxX/yr rRZnar8MYe3+N8jLj9u+CJY4T4nzqgbxFX+RTytzmavNlfDMFwYO/dir4ff8i/iR9lS5G wblQK/o9BTxkixkRWYo+WsvvsBWzziso6dxb7IEIMcmqFS7rQVu9TQuONmyQmxxMWsDTr rf742gm44PFVfmPq7kn2O4LCna1H65rGgIm+UlNdmhi1iEkuW8bONTDknqz00deXXPAmT 8kgQr1KkHopaUiNUeHLYctTbI05abrKjgfvuM2qhsEi47m4THa46NM6cWXMgboLmDSA== 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.44 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (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 26511606A32F for ; Fri, 4 Dec 2026 10:10:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 26511606A32F 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-f44.google.com with SMTP id 5b1f17b1804b1-4bbd2c5931bso4696645e9.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=e7veZ9Xvnkzuo4C89/0WuZszW4+y6MZsdrPwZK7qIdoJv2IL4fy6USmwdgNOB8PNl2 5qLXR3V2E0rScBlG3aSSwnssaYA1Ti2nPcGAC+Cl+2fcY6SstCIvANqA6y1oODJW0w6q 3/IPVULebcqT312RWTT8dDUZBpWnJCTTUsN6Do6rfQVJ7dXCAp30nMxoV536akMFMhjK J/LnmqXjoiVkBpPgj/Z3K6u2Rlf/E7y/1Anz8TTaJ5ibgswRWJe3MWe4hDcqTQX9xlb1 ndmSUk6TmPQzA7aApxJBs3KF0QIhpJ760wTgO9WZ7n4FIa+N37DQNPIS4wjDFlBa5Yy4 zYhA== X-Forwarded-Encrypted: i=1; AL+hErF74ZVehLL8c46/WUVVv+yXUz6/UtZLFJTfg9YiP5ojJuW5sO41i3ha0IBJ5kefzI/3WXe4uzBn6cWIQfw=@vger.kernel.org X-Gm-Message-State: APuU4Z8Z0IElme7X7V7Rj/ylojXGIA0aAib/IcQnMQhbliydrnLsxnS+ vKIiBfV04py3qrxGoEeJHW+nKaaXOIymBB4opXc4mu3XarbiT5ttZZRZdRhQezqcRkg= X-Gm-Gg: AZFdTZc6cDsX4M7Zv7WsFR0RdJKtFr5ybKDEwk65QXITqljmZl6cWvIDddEaJXWKXJM 7Vv5KfDlQqzyYTWuyFkkeaTVNBKaKk8dtUjxmIRwqxQE2lMXemdsOFtkISirCKWiI9PIU/fwwU+ u74H/dtyP/ohwoN4ASkZniBR/nm4dHPDSdSQvxvSUNXUgVc+/LZkmV7Vx5vWRU2iNp/I45X/5+A vGdOMreheoXm5+G3qpkx4RjIOYRXoXNAv8w+QTkAMkTWtwxfvLuCCU25QCQ5h0ineg1+h8pRJ8r c/SeRdY7pEIWuHcL4Wg3BAd9ZBq5BxrOn6HMejFPTbZzy3OMIqMG/g+qlrTReqMF7DWwC1iX7Id zxyUEFpFxCfu3yaLhFzNXr9aC+eUh8NMkdPaZCbYE/l6s03SS+sYRbvRNxV7iU04amEwxki/Bgj 22zOfglU4FrAnezQ7VIGrVWuQxuJjALglzafaguFCXBpj+UpnKqujh6m58niePWGmFgFERcNI8v GhjnAbsUv9In+iw0ggu4c5Nt/q0aD3tIizKa3QhQfe/6SGnU3IVip05gnCJAVREhLaClNgw588A QALfjLDuXidymBUYa3+AaA3aLo4KwWVC0BYJB+Y= 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-kernel@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