From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.168.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795961973; b=ij1l1GQJXnCZy3lcQ2+YdptfVXtmJWB3fG+KAvwlBeXzxgWkuGtzXQqqSWfgNqJL934R oFcYq/blUsZdZTQzdCad0c3gpGOkfmO2l3Ap04MQJayCMHjKX/Df2CnbRIuQWinZ0Lv1X J4DbpdrMFQPWgU6+xIO6+c6JfTQRyDTsdackt1dZN231fA6t73/agNXCo7Wov+rzC0IuJ 9WghVXUd6jJJWByHSg/QDXjn0YrwyTRs3fzXxoDPbCdyYojdDEfh7a34zPywYCC+v0CTL xY5CdXSdQWCDQJUXvQRj4YL6HyUM5ZbzflT9cXb734K626hZuJ6nj0RyTyL7V3yXd1Q== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795961973; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Proofpoint-GUID:X-Authority-Analysis: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Spam-Info:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=CQDN2m2viyr7Zk3bM4cZYf1mtDU/IvEib8U7xkza+K8=; b=Ow+oTuFoA10y/VOOvNWv0mmQbBa5vstAFH1UqEwi+aGtqVGK6dPbOcCjAftx1N3k2sGO kuYUA7gQWggkMIB1tSTTBjW+ZqG60uedJLhnYB4wPQnB8KWHYws64i3HVUkH2OARwvaoN sQGbkGZ2OA7x4LE23LWmc4CeQGpiJOh8pww6kCNPF8hfdJYKdf0YiVyR7WwXq6VfqYH30 CF+U7FJEklhDBS+NnLH/0jULLc5gVD9vbXFIYYb/keOTPO+rgKGmcyTCextiT0PnGGqJT KaDKnXnN2C+7G4qg7PM9AefSmB8Bs07lA3d3GRWIPWQtqsoZIdSLy7Jlrlt4qLw5qrA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=TcK1aDJd; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=PUomptq7; arc=none smtp.remote-ip=205.220.168.131 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9538F606A329 for ; Sun, 29 Nov 2026 14:19:32 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9538F606A329 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=TcK1aDJd; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=PUomptq7 Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 6ATALLiF3020541 for ; Sun, 29 Nov 2026 14:19:32 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= CQDN2m2viyr7Zk3bM4cZYf1mtDU/IvEib8U7xkza+K8=; b=TcK1aDJdqWLEeW+3 68cdt2bEwpyUk5uC19Sn/pDu3kKF3h/5GsMHieffg3bHlOS8PSkBGnTAPhOy+Asn RLtVRSvy746FoWpqEZGI86BawN9qGYbU4LH6CyrBbVLF98mFuHt+pN+noDlV6qD6 6TfOeVdfeDlZ3MjPq0qzSJkwVn97IscdcsHj8jc0iXiZnrKkgT+ejs3OE6y5Wgvv yzXrS4H92eFsng/Bi0Viz8SsFLnTL1BFUGiCmoNuFGZlAKidpjnHzTutOEYvyhmL arW/lSHmcNjROn1LzipojTmZz5e64G+CXYpex6OgGynTCMt+nvHWf6kkLgZVDXuR lZ7F4Q== Received: from mail-dy1-f197.google.com (mail-dy1-f197.google.com [74.125.82.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4j7qqek10n-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Sun, 29 Nov 2026 14:19:31 +0000 (GMT) Received: by mail-dy1-f197.google.com with SMTP id 5a478bee46e88-341eff9e381so14039700eec.1 for ; Sun, 29 Nov 2026 06:19:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1795961971; x=1796566771; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=CQDN2m2viyr7Zk3bM4cZYf1mtDU/IvEib8U7xkza+K8=; b=PUomptq7wDd4/R3rxl7laHSxdtZivlhlFPTxAF5Q797rGqZSaazZ2dbpgU4lwqzESV jHch1BE4Y2FczwR1cfH2xfn9LXaKvk47w5GUAS2E02+me/oDoOxocSr2lpdbfjYBSnI9 yPR5TkSuwI1uoRp3hyfv9CXOxmLjeXdc/RakTrmzoraIhkwI8bwDTO9EkTu0IYfK8vmg puIVLiApSe2BQy8FxPwJKnhcS/ZAvTeVOpPkdGznD5TZUe9KBOr1lq1/BrdosAxNiPzb EyMefYzxLhAix4RT4CYcURMPhFVdvjiaYgQAEX8qLw9kMplsZDqljpKdKjfj71yGIh74 E4UQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795961971; x=1796566771; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to: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=CQDN2m2viyr7Zk3bM4cZYf1mtDU/IvEib8U7xkza+K8=; b=fWwWgBiYP8vXE2y32MO5N+29WgXBPWvsRV8uxhFC+a2L7pb9K74oyAgvugQAeQp99m q9Hrzvxw6WKnD4+VuFHj2+K74cB6w8HrAhViddiYmoHnb0Qie8geK4+/Hn6OKpYBiQjA nl+K9elPrR7q1k072Je3XmWQQSv1Cet+qDwdlQNjFm+zn5d2BGv8fy1xQ2eDnFx96q1h XrAzsCWinJZgI0Hj1SQkEaj+B+rNEVSpFAR1n+LBa7REx2l6G0mvYOVr1C/pLAq0OiCI BlvRjJGTNsr2IadVc1p2nXMFF/acs8Rc+vKmLa1/lZyJ+dpOE7brd5qo9GIstb3jhhal +e1Q== X-Forwarded-Encrypted: i=1; AL+hErFC/0Q4ILSuBrYOtpo4yXlMGqMPwGCa/RteLsI/zmoVgk1JEUF2WFy/TTRjkasw8mt1GApxFXC7MLgdfmc=@vger.kernel.org X-Gm-Message-State: APuU4Z/FE0Frr9ueyVnbPjbuEBPClSRp8bzGogmOJ6rRxwurblxcJIyw tTnPaRcfut60Kf28F8QQET6oKFiWcqkOvzm3YoRGSEXWG0aB3h3hNCUvnR6FrQifKVI3y67mpkc 3+4psMENWmEg0SyLBDg45vgdxfiYa0o2PFQzpTS8xP3zYETaqQ5HJTJ3zAs75yd2chLA= X-Gm-Gg: AZFdTZcz/9bZf3ZsbaFXbd4lahG1EvErcM8UKmO7zK7jv+EcYAIJah7ZS+0A53Zbtqj 3iIqDMSXbmrAvrsksYVVGTUTjPrbAjg6s0vxU3A4ieCseZm8Hd5Fn06rnRco03bHvsdqCyNfmhi 7CsDRPMTb7ijpS6W/3iZS5WAOm+A5GMmnraVKosxP7HOgV/RroPMS1iv6BTx2RbGdyFcrJd5Ws9 63Ckjx6RWkwxfeaCwCw4OHBDZT/SdgjlVKqUkxAomkJIXS+MXOh7JVqEHE0LTf7Z5W5aAXBPy+Q BZLzGS09FmHdakVQogYKRNq8aE2IsC84e6exx6sNAUC5ofj/dSxF94ZV9T1xhDcahJPsgLsRzX9 0rl45YryIrrPM2kZnW0U8CimLsFzAGMVtM9nGb1lS38/P/jeEvyU6+ZUVKrIe+HNZjQq+fT1mem ZmKit3yYg= X-Received: by 2002:a05:7301:211a:b0:373:5561:8d06 with SMTP id 5a478bee46e88-38570c36e7cmr26930252eec.37.1795961970875; Sun, 29 Nov 2026 06:19:30 -0800 (PST) X-Received: by 2002:a05:7301:211a:b0:373:5561:8d06 with SMTP id 5a478bee46e88-38570c36e7cmr26930211eec.37.1795961970165; Sun, 29 Nov 2026 06:19:30 -0800 (PST) Received: from [192.168.0.172] ([183.83.136.190]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-38567cafec4sm102466079eec.26.2026.11.29.06.19.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 29 Nov 2026 06:19:29 -0800 (PST) Message-ID: <0b76ccad-877d-41b9-a7a6-02266a7bfd56@oss.qualcomm.com> Date: Sun, 29 Nov 2026 19:49:20 +0530 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 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4] media: venus: use dma_iova_size() to check the reserved IOVA size To: Jason Gunthorpe , Bryan O'Donoghue Cc: Marek Szyprowski , iommu@lists.linux.dev, linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Robin Murphy , Joerg Roedel , Will Deacon , Leon Romanovsky , Sibi Sankar , Honglei Huang , prakash.gupta@oss.qualcomm.com, Alex Williamson , Dikshita Agarwal , Abhinav Kumar , Mauro Carvalho Chehab , Hans Verkuil , stable@vger.kernel.org References: <20261127115849.2780625-1-m.szyprowski@samsung.com> <20261127115849.2780625-2-m.szyprowski@samsung.com> <20261127142912.GK114472@nvidia.com> <20261127172626.GQ114472@nvidia.com> Content-Language: en-US From: Vikash Garodia In-Reply-To: <20261127172626.GQ114472@nvidia.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-GUID: fdC82_CH-4mOM4YgANkYmUZmAPJQgssA X-Authority-Analysis: v=2.4 cv=Uv/2pOwB c=1 sm=1 tr=0 ts=6b0c3473 cx=c_pps a=Uww141gWH0fZj/3QKPojxA==:117 a=fjV5My6G2CU5Xc20peYewQ==:17 a=IkcTkHD0fZMA:10 a=zJRp6_cAMcgA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_K5XuSEh1TEqbUxoQ0s3:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=47BFAQx4unGWZVW6scUA:9 a=QEXdDO2ut3YA:10 a=PxkB5W3o20Ba91AHUih5:22 X-Proofpoint-ORIG-GUID: fdC82_CH-4mOM4YgANkYmUZmAPJQgssA X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMTI5MDA1NiBTYWx0ZWRfX14YNmXBC+wHU JmruPw0s5SEeyM7n4okP5YjNI5WpHFDxjUHcE0xK0QEappKFAxqt35nSvvJEOA+vC/chGnmXiiY gtfDmLyXd40OU46+/gstMDvlaZMgy7WuVDkoZkkwi9BhrOOSbnQ7Dodv8Dhp3gwewpWvTQCHCzC rJHM5oHPYotqDV30Sh6A7Lr/WUPJYH3swgCOJOyfFlKI8vbfDR6ZuKKIYoB1YvSz1A8VPOKT2oc v8UdF/1+pYpCc1QbGojUzMJ2fz3UgT21QFzuozV3B4AruUTCrvR+GShDbB8jjUUlcUl1FKx92K8 oABQePK0R2kAtDJ49dXuxh7flp+U9VuCwnsbOIjlYjNKESietrPoAVEKpBPDbYVubqSOVSaPTH4 9dklc+wjCjxqj47WH3W6sN2ZFaKHLsfNIwG1Q3yDE8beyCbUN1JeFT/CsDP/3u4ZxuB2Wq/9ck6 mXz10ZP90m44kxQP6eQ== X-Proofpoint-Spam-Info: AW1haW4tMjYxMTI5MDA1NiBTYWx0ZWRfXyPojdQR+aQKK FnjDIBBpGG+t62tvTbSFmxBx6IDta7lxyiIoaQX5Ii/D7P5DOim92Kozr8xnjdKGLJcHOfaic8P zA2WteITN8WhsMCojO7fiw337ZUyER8= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-11-29_03,2026-11-27_03,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 spamscore=0 clxscore=1015 malwarescore=0 bulkscore=0 phishscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2611290056 On 11/27/2026 10:56 PM, Jason Gunthorpe wrote: > On Fri, Nov 27, 2026 at 05:21:35PM +0000, Bryan O'Donoghue wrote: >> On 27/11/2026 14:29, Jason Gunthorpe wrote: >>> On Fri, Nov 27, 2026 at 12:58:45PM +0100, Marek Szyprowski wrote: >>>> The IOVA reservation code compares dma_iova_state::__size directly with >>>> the requested chunk size. __size is internal to the DMA IOVA API and may >>>> carry flags in its upper bits, so use the dma_iova_size() accessor >>>> instead. >>> >>> WTF is this even doing? >>> >>> Fix this by reserving the 0-600MB range, below the boundary the >>> non-pixel stream cannot address, using dma_iova_try_alloc() so the >>> IOMMU-DMA core never hands that range out to a real DMA mapping. This >>> reserves only IOVA space, it does not allocate any physical memory. >>> >>> That isn't what this API is for, and it isn't how it even works! It is >>> pure luck that the first call to it happens to take out the lower >>> address space. >>> >>> We even had a long discussion about this driver and this need in >>> another thread and this is the hack job you guys merged? >> >> Have to say I wasn't aware of an objection from you, I don't think I was on >> that thread. > > Nobody ever shared this insane thing with us. Seriously, this isn't > even remotely using these APIs for what they are for. Nobody thought > "hey this seems like a creative use of APIs, lets ask someone" ? > Sure, its a miss to add the maintainers of the file which defines the api. Relying on b4 alone was not the right approach. Noted for any future submissions. >> It would be possible to reserve this IOVA range in DT so given what you've >> highlighted I think this and the Iris commit should be reverted and the DT >> constraint implemented. > > That was the other thread, obviously using DT to describe a hardware > issue is the correct choice. But there was some problem where they > also wanted to split the SID space using DT and then the DT mechansim > doesn't work because the whole thing becomes too hacky :\ > We discussed this earlier here[1] and concluded DT as the right place to address this. The DT approach is waiting for the series [2] to land, which should take care of the reservation in a definite way. [1] https://lore.kernel.org/all/c7b956a9-d3e8-4e18-b780-5d08f5cd2ca1@kernel.org/ [2] https://lore.kernel.org/all/20261120-add_iommu_ranges-v8-0-d90486973b73@oss.qualcomm.com/ Regards, Vikash > Jason