From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f178.google.com (mail-qt1-f178.google.com [209.85.160.178]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0D3DA1D61A1 for ; Thu, 6 Feb 2025 21:21:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.178 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876876; cv=none; b=QF/8Zc4HT7D2kTKUf7a3oWKPcOR8W2gi7k16PlInIOUWDlXc+q8jvIh3MBzNI3BvwOWkHFFpOTVDAROl/+BmXPCUq1uQAdqdOA85wCKBFl7HX59ZhZNNGmdg5HjunwH5bMF6PEE1ocuJlPOC2mDi5khj7S5KHbKwV9VKOduFuyc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738876876; c=relaxed/simple; bh=6DxvZdZPg1+c/4MiY+1eFG+nW41sRJmolNY7AFhKpW0=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=BdiRRfbNYfkBmzc16eDgq225eDNCIsgfxOo6mUtFKHFSSf5yl2QKRNZm+GHKKw30SpywQRNgD6Fz9xKTislTfB/Fykh5fIhcpPMvjWWJGZ0QEhqPBcGyoPNwRhWuiJIGN/L27CA88Wo5D7Rmboi3EgLzeHd5PtGkxStzANEdeHM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ndufresne.ca; spf=none smtp.mailfrom=ndufresne.ca; dkim=pass (2048-bit key) header.d=ndufresne-ca.20230601.gappssmtp.com header.i=@ndufresne-ca.20230601.gappssmtp.com header.b=lO9TqSlq; arc=none smtp.client-ip=209.85.160.178 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ndufresne.ca Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=ndufresne.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ndufresne-ca.20230601.gappssmtp.com header.i=@ndufresne-ca.20230601.gappssmtp.com header.b="lO9TqSlq" Received: by mail-qt1-f178.google.com with SMTP id d75a77b69052e-46c7855df10so23714361cf.3 for ; Thu, 06 Feb 2025 13:21:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ndufresne-ca.20230601.gappssmtp.com; s=20230601; t=1738876874; x=1739481674; darn=vger.kernel.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=6DxvZdZPg1+c/4MiY+1eFG+nW41sRJmolNY7AFhKpW0=; b=lO9TqSlqGkUY6SXdNi6SY+0OuQK+K7OSDv1c165UmJ0W9Qqkvm3jB4nx5ysPDZtuxR Rki9hfgaEOAVqdNh4DooAixMFfAPVQkGYknBucNWsFL2WIKSW0klStM6aJ1haVL2cgcU lu8WKc3FT+kytX1G6Ya92eMsiKjDmvAl64T8CLvV/9xpG2sGzDGshwMxKBil6baa4OTj JWlbIdz7tL2lG9RNEjjKezXqWOyfTgow4WNtSKMLScofO63X8YP6F5QHfbP8JaEXKEeW C6bxdM9+CRB7HtqMYSvwuRrlFffeFbKj3SMRRUTfQxQKTk66AOoxlAOUVb4S5UOMqOWl u6Hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738876874; x=1739481674; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=6DxvZdZPg1+c/4MiY+1eFG+nW41sRJmolNY7AFhKpW0=; b=WTxv+EPal3xYlurELpG1P85g3uAX9yqPQGViXNG273Oc/GwVwxnOepuTatU0yJ6N16 tFzGhDEOYMu+p7Szmi5TTzO/8akKc+ZeVHkZ3JrcS4fYh0qu4U0PsdE8JJf5fvCA4E+6 48+5TPYadOncIe6SNxM3ujjhZa6FwVRgB/vje0E7XlPcIAEqKQomjQy2ksd/fq7QTYTz hEIFCEKcyK5tUiZyGn3fKisighaqi5W7Y3XNkPWPZ89BR9O3WNv8E4BaV6JUSyi+EpJ9 jSKrdncTR6XQ09ymECzVHhr+31o8/5hPvY1MItjeoNq/QxbiqXPbzGJ/dqSxN/wTe+hO 2REA== X-Forwarded-Encrypted: i=1; AJvYcCUKNdbIXwGYRwuZRlT5/tqdE6Y4GuHSL+YBtyw8tUFwonmpwNOTMeSKCxOfSFlFBgt+xUXjJv2H8hwUrrk=@vger.kernel.org X-Gm-Message-State: AOJu0YwdjkWg1FoSZBASQrrMiyYOaRImuTo8eutFhm8jzHGSigyyuNmf fj8lFOttD70Ogqhd7ONP4i0hDm5moHSQKISskmiy4PX2tZTlDvUPm7s/ga0ASBM= X-Gm-Gg: ASbGncuCaBaxA9mzebruCGARn22qlBKJLKsOirWZiEhc6YFxjpts7EIOMSNOX3GH/6+ SxvH7pWW1TPMuRA6Q0RAM8pa0dhN1YGsJVO1e41U7O3TGCDN4b5czpANkHJ/hZq3xjwt1A+c/xO jI76uXUFrk+E3fWxhOu+J5movYSsk76itoEEIJrDzwbCaxpI7K3ndba4CBeUHCPOWTMejpcNcLe xjpDPsjCh757lJ+dYj2rOKeaq5hmshWvxN02pEXQx/tbJqYp1XVmMQUygSWR+W8joDyzFsdIQ/y f1zHO5QsHcQgMUrb X-Google-Smtp-Source: AGHT+IHI8yMd/5aYfmfZcfbDFH3h4Fy2Z99LYvivEu182Bj0ddc/CD4GBHcML5OVdc/uP/LZDxsEvA== X-Received: by 2002:a05:622a:5a95:b0:466:a06f:ae0a with SMTP id d75a77b69052e-47167ae29c0mr13578771cf.32.1738876873855; Thu, 06 Feb 2025 13:21:13 -0800 (PST) Received: from nicolas-tpx395.localdomain ([2606:6d00:11:e976::7a9]) by smtp.gmail.com with ESMTPSA id d75a77b69052e-47153bc741asm9168671cf.62.2025.02.06.13.21.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Feb 2025 13:21:12 -0800 (PST) Message-ID: <5e0e2fbb22c2ffb0c5281727cd95d70f5f5ba696.camel@ndufresne.ca> Subject: Re: [RFC PATCH 3/5] dt-bindings: gpu: Add protected heap name to Mali Valhall CSF binding From: Nicolas Dufresne To: Krzysztof Kozlowski , Florent Tomasin , Vinod Koul , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Boris Brezillon , Steven Price , Liviu Dudau , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Sumit Semwal , Benjamin Gaignard , Brian Starkey , John Stultz , "T . J . Mercier" , Christian =?ISO-8859-1?Q?K=F6nig?= , Matthias Brugger , AngeloGioacchino Del Regno , Yong Wu Cc: dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, nd@arm.com, Akash Goel Date: Thu, 06 Feb 2025 16:21:10 -0500 In-Reply-To: References: <36b57dcf20860398ba83985e1c5b6f6958d08ba7.1738228114.git.florent.tomasin@arm.com> <7234f25c-a2aa-4834-931b-aeeb7a49dfa7@kernel.org> <4b9deab1-e330-4c93-8260-75276c2bc9ff@arm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.54.3 (3.54.3-1.fc41) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Le mercredi 05 f=C3=A9vrier 2025 =C3=A0 10:13 +0100, Krzysztof Kozlowski a = =C3=A9crit=C2=A0: > On 03/02/2025 16:31, Florent Tomasin wrote: > > Hi Krzysztof > >=20 > > On 30/01/2025 13:25, Krzysztof Kozlowski wrote: > > > On 30/01/2025 14:08, Florent Tomasin wrote: > > > > Allow mali-valhall-csf driver to retrieve a protected > > > > heap at probe time by passing the name of the heap > > > > as attribute to the device tree GPU node. > > >=20 > > > Please wrap commit message according to Linux coding style / submissi= on > > > process (neither too early nor over the limit): > > > https://elixir.bootlin.com/linux/v6.4-rc1/source/Documentation/proces= s/submitting-patches.rst#L597 > > Apologies, I think I made quite few other mistakes in the style of the > > patches I sent. I will work on improving this aspect, appreciated > >=20 > > > Why this cannot be passed by phandle, just like all reserved regions? > > >=20 > > > From where do you take these protected heaps? Firmware? This would > > > explain why no relation is here (no probe ordering, no device links, > > > nothing connecting separate devices). > >=20 > > The protected heap is generaly obtained from a firmware (TEE) and could > > sometimes be a carved-out memory with restricted access. >=20 > Which is a reserved memory, isn't it? >=20 > >=20 > > The Panthor CSF kernel driver does not own or manage the protected heap > > and is instead a consumer of it (assuming the heap is made available by > > the system integrator). > >=20 > > I initially used a phandle, but then I realised it would introduce a ne= w > > API to share the heap across kernel driver. In addition I found this > > patch series: > > - > > https://lore.kernel.org/lkml/20230911023038.30649-1-yong.wu@mediatek.co= m/#t > >=20 > > which introduces a DMA Heap API to the rest of the kernel to find a > > heap by name: > > - dma_heap_find() > >=20 > > I then decided to follow that approach to help isolate the heap > > management from the GPU driver code. In the Panthor driver, if the > > heap is not found at probe time, the driver will defer the probe until > > the exporter made it available. >=20 >=20 > I don't talk here really about the driver but even above mediatek > patchset uses reserved memory bindings. >=20 > You explained some things about driver yet you did not answer the > question. This looks like reserved memory. If it does not, bring > arguments why this binding cannot be a reserved memory, why hardware is > not a carve out memory. I think the point is that from the Mali GPU view, the memory does not need = to be within the range the Linux Kernel actually see, even though current integra= tion have that. From Mali GPU driver stand point (or codec drivers and what's no= t), the memory range is not useful to allocate protected/restricted memory. On = top of which, its not reserved specifically for the Mali GPU. What's your practical suggestion here ? Introduce dma_heap_find_by_region()= ? Nicolas >=20 > Best regards, > Krzysztof >=20