From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.41 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796379040; b=oaixA0CGYEXUdCaQHfQItKdW6C9/j+CHVMhOcR6b7dNitqlfxM6DlTBMwMX2IcxSjgvK 9R4D2TTjC9hQ15KPoE6xtqg7GBwzycs3vlDNcutQAipgRhiJ6j6S40uQALZ8iMV3g9Iwe JWaXIjeD6ymtTyqHEMV8zplFylFGyo6UTG6BfLCe4Q+XYe5GnfQ2bLDkpBVL5+1sSfHE1 gWlQ8mte3Pq5zjEfGrNQmJRmErXuhWQ6g9nCaFODWoz91LcbV7laTZWhoqpX1Z2kskl/4 6RL2DoigZwCrg4i/S2NJ6/+dmxPR03x7iacz6rUpiXNy9ULy+PteP+V7RguVzOfRhzA== 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=CNvmHe8PP/BbmEZWJXRBV4jSu/bOAHCFrqgW7B4hwL/WG9ftZZ57POiShI0Tjefd47hm gnF3h5o2U/DFFcV1eEu02RBN+NfSm8iHPuFTxow+uyYvQ72wEJASf1EGRddxFSSomIuDO CQWtiWKv0Rd2NhsJdo+BE4InICkYfIm/yQq3rEmK+RcDMMNqmj6/HFUf7a0S2ZY+aml5g M09fBreAJoMZjsUsRAUGz67cAjNTkOdKlF6TZVpGAobO/2TZTUpdTOUlF30Jq79ecrRG0 /eobObBaXchqYjStPEWdZqt0Rx477rrZHOVTQeuWbdpGK27VoFfybMCCKRQ1/Wz6LOg== 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.41 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) (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 285D1606A333 for ; Fri, 4 Dec 2026 10:10:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 285D1606A333 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-f41.google.com with SMTP id 5b1f17b1804b1-4bbd2c5931bso4696615e9.2 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=e2Gm1E5Kp92/MiDUsNTTUF9QeVMW75/hb6EDmAt21ebOolUig/OPk2xnwcGhMYnJCo xNzXpTu3ez+M9V7G+AWXhGGhisdfaDXNMEOBM0ah4bILG2qhUbs6rtFKuDiVlN74fGs7 kxPdmvl5c9BYzwSMLszsyahuIgcW73PIGKswijeGsPhB6H8Avqw/o4/YTm6+UnzdycrM jbt5b+xmZzEBxSxOhTfv4bBGJzmLQ4NjUc8RlQ4YHVH2wIyPfN7K+zWKhpUPIplLyAU+ E/b9YxXASk3yH7fYWQ7Hza+fmXwErjNncnps2Yo+EHMpiqXLTbLD2qEMR/0kCbvJ+rX5 bUuA== X-Forwarded-Encrypted: i=1; AL+hErEYXZX2lRPfzAWXEzt8l6FCWu6ICKgWCoYCVpD34r+d4K3GmAs3aZbgiFQKCPDX13mTVMP4VqjKg0g=@vger.kernel.org X-Gm-Message-State: APuU4Z9B4+RsmZqU+uHVQzP1/3N6rOBHbA3yai06gfCdhXCbgesJE15S RLY5NOudKriFUq9j2F/oMou/Pfpdu7x4jYAinneiP+XqC+W4iKGxoYf6IzwenFYsUDE= X-Gm-Gg: AZFdTZcXZne9346gDWAGPG5rASo1zGWcu2GR80hV5xHBDrEHlfk9BbB8q3r/4rnSxJC 04a7fIzh2qhi83QqFuxmU9K+heFGkxSl1u+2+HXAcfOZMaLCU0fS6XbF7gFiV8IgQXVcJL4+EZa MYeNS8URfSvzBoRoidHjrpGQGizon255FRS4/ZJi1ezY8VO5pQ/nxAtWZN19/VF/21PMrIDhdtk 84JkHMMJX4Lej7dIKf2xt962Mbk54k+tGXmIfzZDXmKt7zAQakCUhWtUD2c6BNrqKfcKTePyawR 2t0ReTIcpGOcm61/j1i6mfH01MLmzhKidPkJe8XlrY0OSjz0kffW2Lrk9wolgLcuUCVXJeKXxHw Wftff9vJBbd4MhHJf0i3scqJJhgxacx7tn92oPAzWCa82vWrO3zqjNITIwn/vvGIL4T4aUapfz5 KkIKLYPjI0z+hFxZOjHKD/vA181urns1mwleiRli44PPM6FVuD7lOKasonVIZjra9OsmEgUI9s1 sUTjNSQz6ADz4bur/+xv91clb6USSrCiAgMYjHNEKPYl++mg9hVHD+kH5/F45iDr67h/nTcPqGq u4F4xpjt0jt6IkPxByP6x8tz7wXUWr0MmqQShuA= 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: dmaengine@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