From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 27D6539A075 for ; Fri, 14 Aug 2026 10:57:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786705087; cv=none; b=lHY+MUxJX4+lZ92NV0RApaYGMvSuJIx/31yc9YnTaQOq5Pmb6iRBR3Chbi76PmJ8+Y61jWT1t1MWgfak7FS5agF+Ws91r0G6/4ek1ne7t4CW22USfbZmyTVux4JLtTL6B/u70ODvW4tEFtD5UuUYT/W3Tc9JKMiesEzSgIMZ/ww= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786705087; c=relaxed/simple; bh=/TYIhfOmT8Bb4t2u3FQPduCphwNJftOBmshuMKDdFGs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fqO9320p8ay8WiKbU+qIMKheFvFNdu9QlUTunVxVwE0kN4wvKYq9XQ5yjxgSVcd6mXC3fIBv9Q4GwdYo9ZPC+X0v90gRRezmLzUypjr7n5ZVzL4V9i/IOAwzTqmYDivbzrAomaX1HKgoFzpS/N8aJBUK4JAVSLRaLHSdIkiK5nI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=pMuxA/yF; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=BVa18ySF; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="pMuxA/yF"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="BVa18ySF" Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 67EAb4rP2555611 for ; Fri, 14 Aug 2026 10:57:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= /TYIhfOmT8Bb4t2u3FQPduCphwNJftOBmshuMKDdFGs=; b=pMuxA/yFUdkM4MJv K0VIoROiLJur2rCFAnu78cjniV6U5v3/NEf/CmLTkCU7ymyMhCk9SHCLgNDQ5PX3 2cguS68+KpXst3qnhOkksjLHoqJ+RHcTV2bXWoCe9s418oNzfsG5/mDdzKbnyoI7 gX98bl8VTjsCpwkpS/D1wV5mBwqJvL96uNqeyi5elV1QlxOcDQ/vWuEVGzmCY8Nz 5hcA019liQJvybHv7Tg+fd7E9z+dXCPOpiIGH2o8Fpv37rWAbHR2EQrZJNGz8JHo S7mKmfrj676V3XMeE3ms6SZ1sKybKi6CQuZ7ozyb6ZmZWO/mjsam1Jg2xny6bci1 XShUGg== Received: from mail-pj1-f71.google.com (mail-pj1-f71.google.com [209.85.216.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4g20sj07q8-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 14 Aug 2026 10:57:50 +0000 (GMT) Received: by mail-pj1-f71.google.com with SMTP id 98e67ed59e1d1-38e7b87ce77so1768034a91.0 for ; Fri, 14 Aug 2026 03:57:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1786705069; x=1787309869; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:from:to:cc:subject:date:message-id:reply-to:content-type; bh=/TYIhfOmT8Bb4t2u3FQPduCphwNJftOBmshuMKDdFGs=; b=BVa18ySFOMbUt4axpJruUkHU8jNjlvv5xDxkfrJUjObE86C108rEnIxwZn9JvPqRlE hphLH8Ucrm6Jfnn2xYSoigxKR1tXeQ7baN9jZUBnAYCoQgzmiO8b/zC6cxf/9OGWH8G6 Ec8h05DTB7UIMDIPwXTvLlPVrNs/NxMFMOV8qH+8W7aBuyQAl0tGdAGdsJI89OPWzs6v irQF6rL///ilRMxk0VpJ3Rj9FaISzcrAPT8g+rX/QQEWWkajQxb2STc0KA6ENFTar7dz cD/F2DL+X70OFj+W48tASyzbqhqH2tuXv0qT9iWeG1A+cZJfxV2733+Dcd1gu0hfXaFs qOGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786705069; x=1787309869; h=content-transfer-encoding:content-type:in-reply-to:from:references :cc:to:content-language:subject:user-agent:mime-version:date :message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=/TYIhfOmT8Bb4t2u3FQPduCphwNJftOBmshuMKDdFGs=; b=l8TRrs15tCFrvu3/T/0cxgwdti30xvcOdh7FmYn7dm9U/L+lGxyBhAbv8uZ1rPU8FI Bg0ITbqUiJOtIBvDF6CvAHxGc9aE1DyRum3lVtu+sHCt05mqCl4FWEHdqKKAcVDF1OEe Pr4qcXQ1A5w8J7LouPYXapkG/PfVtkh2WObEDdfId1qh2nkVQLYOr3Si9t3Eo2b3CSY+ HrRVoISS6ES/qx1IwJwjb6i66uo80LyyW5w+OfJ8sQUp8zkM2FvsBLJaxTg1bhXEoSNX k8awO1lxKfmvFp1y85qlIyr6Co0O4jVnRNfkgaZk2n0io7OgsLvWul2IJB98JG4sddJM KKqQ== X-Forwarded-Encrypted: i=1; AHgh+RqPPB8fhNDQgHEXbljXcfN7yLZzF9aIBUcvpLI3Flpjm+Ay2NSy+8nXPF5kChz67CAdV5t1uj4aMBZ8NQE=@vger.kernel.org X-Gm-Message-State: AOJu0YzW1InLkNUDGIrTsWukHsazhidzMeMR81HZBODf+ifTcWeChIhK CPObO4UQ+OC9cFDRkMFTslVHcGoHyuAFxoTlVMUWycxDqUzdoC+WMj1XBf6M6sB7SBEo1a0AXum +InOdaYrKjCNBOaH0xQhMi4iU7DQ1vBiRqkxp8Qalh6siZLJAjfcrF6+q3AouUiFmdgw= X-Gm-Gg: AR+sD13AcLkYdu2cL1fw3Y34RhTcMU+qU0gtAqfmvez2d4Z5CCZCb/YXdiaG6BrljtQ kHRnCs/J4bmTr2wxH2rwGDoocPDZDN+fSPmu4OlZSRl3qnfF5vR0sQhSSBUiQmU1R/EHvm+egrI zEo6Q5tLJVR43Y0i1pOfsS/C9VfktF3bB2E40TGSfPZNW8NfLaDCHpFgil4Iztj3mquW5ysV2RP Bue5J4ORKCnjznm0YGNsvyIxn3Oi/0vXUUg/+/jFjznCqD6VRqwqwBNuhimu9I4WdjCSdKYMsbe w1tuYi9Qryu8xdtcO3S6yda0R0zqpk6AFLtQkRPlsRBxwabc0TDqw838m3iqjCYlpM7wshatrXD kgc1ueLGrnggRffdxu9d/JTdBdy+rDBFk X-Received: by 2002:a05:6a21:2d4b:b0:3b2:a809:ffe with SMTP id adf61e73a8af0-3cc71a2d522mr6482128637.14.1786705069483; Fri, 14 Aug 2026 03:57:49 -0700 (PDT) X-Received: by 2002:a05:6a21:2d4b:b0:3b2:a809:ffe with SMTP id adf61e73a8af0-3cc71a2d522mr6482065637.14.1786705069058; Fri, 14 Aug 2026 03:57:49 -0700 (PDT) Received: from [10.206.101.140] ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-320ea2fcfb8sm3392781eec.21.2026.08.14.03.57.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 14 Aug 2026 03:57:48 -0700 (PDT) Message-ID: <25b990fc-558d-d64b-1a5d-e593f4c8d649@oss.qualcomm.com> Date: Fri, 14 Aug 2026 16:27:40 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH 2/4] arm64: dts: qcom: sc7280: Add dma-coherent property into venus node Content-Language: en-US To: Krzysztof Kozlowski Cc: Bryan O'Donoghue , Vikash Garodia , Dikshita Agarwal , Mauro Carvalho Chehab , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Stanimir Varbanov , Mansur Alisha Shaik , Bjorn Andersson , Konrad Dybcio , Abhinav Kumar , Hans Verkuil , Stefan Schmidt , Hans Verkuil , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org References: <20260801-iris-fixes-dma-pseq-fint-v1-0-aba0cb22f6ab@oss.qualcomm.com> <20260801-iris-fixes-dma-pseq-fint-v1-2-aba0cb22f6ab@oss.qualcomm.com> <20260813-frisky-augmented-crow-fd5d3d@quoll> <4b34e718-0878-25cc-a5bd-0d8858df5133@oss.qualcomm.com> <30195e14-0dcb-476d-af0d-f85ee57e2aa5@kernel.org> <26a880b2-5f37-43be-ae8b-2c0c27c777a1@kernel.org> From: Vishnu Reddy In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwODE0MDA4MyBTYWx0ZWRfX4se1z5Zo+agv xivKxMXh/NJXqTRtMfWjtrqiV18jqr9+mMOB+vzcmjbp2JSOnhadhl0zfBl5vr1JAiqhsum3uN0 vf3PAB0kZzEejmL6V81bhS/S7Uik+rsmip5hFejZHn2FLXWmPHgyKOZCPJDfc06yJkroIF5aJ10 k+suB9mjdRXAgTC7yB0RqN0nsS+zJo+Y3BUaJMj2htxUr1n59u9plv7RZFd5d6FMs5lAkzG9WN9 N7KtvEMy2a+xCaA2i7kz3eajt2ePLiyyRb7EGCUTIfFIIUzODVqpKzeoL+vTxOHlNy8LxQnQeOj zLpPLANtgicSASblbaEgb02TMrqKZX3JGUA+GFK9bsTDVDrYwPfugxtLFkt+E4+AclHjxGNeXOO dRPGT9qUF3bjXeudVTzx8OnspvgBVFw7c9bof+t7KcjYucVLk4uSzx17bcJ+hHq8JF7UCAqE9Vp Lpz+0LeiXMgm7y/9y1g== X-Proofpoint-GUID: sjKWkF8ud-AbT4RWSRkeGUSJ4G4G8i4p X-Proofpoint-ORIG-GUID: sjKWkF8ud-AbT4RWSRkeGUSJ4G4G8i4p X-Proofpoint-Spam-Info: AW1haW4tMjYwODE0MDA4MyBTYWx0ZWRfX5xGFjoJ9Vf9h /tZ9Fb0y6M6+I7HNnh7rPANz+GJXoXqlOfntpWG3zMJCSJsZvEUq8sXbu7HrWQEmoTdV8eXxRvx GHCgCmxqLbVQ5zBbXg6Cox5qv8pCm/I= X-Authority-Analysis: v=2.4 cv=cMTQdFeN c=1 sm=1 tr=0 ts=6a7ef4ae cx=c_pps a=UNFcQwm+pnOIJct1K4W+Mw==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=Sv0fKeRqtYgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=eoimf2acIAo5FJnRuUoq:22 a=axlFovWQs4n-uMMd4hsA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=uKXjsCUrEbL0IQVhDsJ9:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-08-14_04,2026-08-12_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 malwarescore=0 spamscore=0 bulkscore=0 impostorscore=0 priorityscore=1501 suspectscore=0 phishscore=0 adultscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2608140083 On 8/14/2026 3:56 PM, Krzysztof Kozlowski wrote: > On 14/08/2026 12:24, Vishnu Reddy wrote: >> On 8/14/2026 3:26 PM, Krzysztof Kozlowski wrote: >>> On 14/08/2026 11:49, Vishnu Reddy wrote: >>>> On 8/14/2026 12:01 PM, Krzysztof Kozlowski wrote: >>>>> On 14/08/2026 07:29, Vishnu Reddy wrote: >>>>>> On 8/13/2026 2:49 PM, Krzysztof Kozlowski wrote: >>>>>>> On Sat, Aug 01, 2026 at 01:07:28PM +0530, Vishnu Reddy wrote: >>>>>>>> While testing with some higher resolution clips, the venus hardware >>>>>>>> triggers a fault due to wrong input data being received. Corruption >>>>>>>> was also observed in the captured output when the client dumped it >>>>>>>> to a file. >>>>>>>> >>>>>>>> On debugging, this was traced to the venus node not declaring >>>>>>>> dma-coherent. As a result, DMA buffers shared between the CPU and the >>>>>>>> venus video hardware/controller are not guaranteed to be I/O coherent: >>>>>>>> CPU writes to an input buffer can remain in CPU caches without being >>>>>>>> visible to the video hardware when it reads the same buffer, so the >>>>>>>> hardware receives input data that does not match what the CPU wrote. >>>>>>>> Likewise, on the capture path, data written by the video hardware to >>>>>>>> the output buffer may not be visible to the CPU, so the client reads >>>>>>>> stale or partial data, resulting in corruption. >>>>>>>> >>>>>>>> Add the dma-coherent property to the venus node so that DMA buffers >>>>>>>> shared between the CPU and the video hardware and controller remain >>>>>>>> coherent. >>>>>>>> >>>>>>>> Fixes: 37613aee2179 ("arm64: dts: qcom: sc7280: Add venus DT node") >>>>>>> Really does not look like a fix. How skipping a cache sync can fix >>>>>>> anything exactly? >>>>>> dma-coherent tells the kernel that this device DMA path is hardware-coherent, >>>>>> so the SMMU maps its buffers as cacheable. That attribute is what causes the >>>>>> coherent interconnect to snoop CPU cache lines on every VPU transaction, so >>>>>> hardware keeps CPU caches and VPU-visible memory in sync — which is why the >>>>>> dma-coherent property lets us skip the unnecessary cache clean/invalidate. >>>>> You just repeated what I wrote. What for? >>>>> >>>>>> If a device doesn't support I/O coherence, its buffers would instead be mapped >>>>>> non-cacheable, no snooping would occur, and the driver would need explicit >>>>>> dma_sync_*() calls at each transition. Venus on SC7280 does support I/O >>>>>> coherence, so dma-coherent describes that existing hardware capability to >>>>>> the DMA subsystem. >>>>> How does this anyhow explain your commit msg? Are you saying driver is >>>>> buggy that it misses sync calls? >>>> No, driver is not buggy here. dma-coherent flag is missed in the dt node. >>> Again, no... or explain why. Missing dma-coherent is not a fix, but >>> rather optimisation, but you claimed it is a fix. Explain why. >> Is the dma-coherent flag only for skipping cache sync? >> I might be repeating here — it enables the hardware level snoop between CPU >> caches and DMA memory. Without dma-coherent, the CPU cache and the memory >> which VPU accesses aren't in sync at the hardware level, which is what > They are in sync, because driver explicitly MUST sync it. No, currently driver is not calling the dma_sync*() explicitly. It won't be in sync. That's why dma-coherent flag added to keep the CPU cache and DMA memory in sync. Will you suggest to sync from the driver explicitly? If we call dma_sync*() in driver, will you recommend to add the dma-coherent flag or not in the dt node? > You cannot have uncoherent accesses without proper DMA cache syncing > operations. > >> caused the corruption. So dma-coherent is the proper fix here, and that's >> why I've mentioned it as a fix. Do you have any opinion on how you'd prefer >> to handle this? Please share. > As I told you, it is not a fix and provide arguments why. > > > Best regards, > Krzysztof >