Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp275113lqp; Wed, 22 May 2024 04:29:44 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXBmwB+fgC2FboTos+jsbuRYowJBsp2pUl2zwA8Er/7qqWooIM9rr/0FKsZZwb0ye5jMepkL3OiAYl+XofD4dVm7dqV7fy4+o+/HJDDIQ== X-Google-Smtp-Source: AGHT+IG2jfEe5gkSqEv2fIzhM/P1p2VN7Md6EEZuR4mvK/BO3jpFa/HXk27P/i5LfJdc+fBZpiO6 X-Received: by 2002:a17:907:868e:b0:a59:cf0d:d7c8 with SMTP id a640c23a62f3a-a5d59fa1367mr1162844466b.15.1716377384557; Wed, 22 May 2024 04:29:44 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716377384; cv=pass; d=google.com; s=arc-20160816; b=FtyKunZtSus8So4oVmFcCQmEPeYnMGjaqL40SC+nIYg0sanYRXqAbdVFDsIbAvGNuV DxQ6WJuY85MdqW/uD+JZqQf5ihB07w4gf6LlyVpbB3fWgKh3pywhu3pc2NSIEdLynAYV B9EYHSpK6hMviJWR9qnLGat7PSgSsfLehkYLQoOEh7xXuE1IExBAOPuBY9B+MyIUFMJs wOXowRPp92GJfqBRNcQzUgT5PpqViGmwWOLyS9Vn7g/NGQmrNxLYoDmadO0PuJ++G9O1 XmUoNoqP3eFwXyeQleB92svwLIGKk53eh1+5jP7Mi/ubwhua/DmNtWS2XSrTwdTVp7LU XdoQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:content-language :from:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=6ENhlX6q1hmhdbS1Vbkp/Kk5rjBAzkY494b+7B8vZjU=; fh=Svxg33U9hRl868PCPp0NVoIF7EvdIQjhfFKh8AUBDvQ=; b=PPcH9muhB00jkt4sVWzfWveZXUnD/3N5SXC4F+ItiZ7UYbxo+U0TZ8BW/SdqwR5L22 pYDGzQ6IIUkRNhdMKILSUuYpqgeoFjpJ55ZKZfV2HL/sGEE3CtUs0e2sFUj3EixnP9l+ eXwnn8rCMz1DyZfum4cv5h9iLTWXKs8/eusUU0l2nYEXkuZZMUZK+bMPWUAzScJmtGLh 1YvEoRy4b64idEBOFteG3VtYiJwpxTJFmmF35kNvvrXsL85/gx/XNDEiYO1qXq9B2dP6 r4GV3zcXDn2xwd9LRJUNsnfczDnEpWLsI+yvPXtHbHArt5LOcQyG9w3XOmt+lIi5RTLX ftvg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mkReHIBR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-186137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186137-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a5a17c2c4c7si1510362066b.978.2024.05.22.04.29.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 04:29:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-186137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=mkReHIBR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-186137-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-186137-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 255CB1F219E5 for ; Wed, 22 May 2024 11:29:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3681F82886; Wed, 22 May 2024 11:29:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="mkReHIBR" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 2681B824AF; Wed, 22 May 2024 11:29:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716377375; cv=none; b=N0fNZhPXCEHnFglSUFc0rRD+u24tOpvAGwL6D6HJYfIfqD+NnEZKZrc45RU76HUaRjtl2pGRtDH/yZriAoaQrhwijDZgwWanAmVYnhuyrH7v6/yRxEjJpDIX4u2A9eL4Kv0hEi9Qjqd2yPgD8evRyrelEq32FlF2VBIoDNRw0R0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716377375; c=relaxed/simple; bh=v9sTb1YPD0eyXpGV9zrS8qJaIGoTzfld+AFYcRslwoU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=IwcQNaO0GZovIW+J+WfWM/9dH654BNvb8AFEa+jmH9R6nG60/1g6Uf4+sg84wcanb/ZQrSFFmdSxTIOPcEMhyoUk6f2MuRlSsyJPgjmpoD2/ZlKs29+W0RDMJucq5Gn6YMUQ8yXOpAXQKRZFbh+YQtI3uWJOwC6xA599CnuuiOg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=mkReHIBR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 22119C2BD11; Wed, 22 May 2024 11:29:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1716377374; bh=v9sTb1YPD0eyXpGV9zrS8qJaIGoTzfld+AFYcRslwoU=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=mkReHIBRSYEtmd3hIYMzBO5Heb3KH5Qr+Im/mlh9DIJsrSLTykHd7qfQE/JHSBDm1 3wVerYYyHetfJdDZ0/YoJk5RPVzKaBTslonF+3clPkr+uQnX5hK622yBzUhvFOmqdz hL0WOk99Gzp722x6k7n41/QiexaYr10Zcw5ngeobOuvZXl/yszGgPXaAErOcpbMKpe 6PacgvOkhZzeJbf04HbJfsLFj/7L0Py+ifxhU4rWk9Df+VRCyw2uLRNGyfMe2/JNV6 A7xCOwhoszGy48oMvhKJX6oRnHGe2PSdYw5A5/BGbEoRbYJMsqw9UTwbKfuynsPqOi 1iMkwHxx97KnQ== Message-ID: <774df64c-56a1-461a-82fa-a0340732b779@kernel.org> Date: Wed, 22 May 2024 13:29:30 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RESEND PATCH 1/2] dt-bindings: dma: Add reg-names to nvidia,tegra210-adma To: Sameer Pujar , vkoul@kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, thierry.reding@gmail.com, jonathanh@nvidia.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, ldewangan@nvidia.com, mkumard@nvidia.com References: <20240521110801.1692582-1-spujar@nvidia.com> <20240521110801.1692582-2-spujar@nvidia.com> <80b6e6e6-9805-4a85-97d5-38e1b2bf2dd0@kernel.org> <56bf93ac-6c1e-48aa-89d0-7542ea707848@kernel.org> From: Krzysztof Kozlowski Content-Language: en-US Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUf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5Q/GS5M9RFWS+nYyJh+c3OcfKqVcZQNANItt7+ULzdNJuhvTRRdC3g9hmCEuNSr+CLMdnRBY fv0= In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 22/05/2024 09:43, Sameer Pujar wrote: > > > On 22-05-2024 12:17, Krzysztof Kozlowski wrote: >> On 22/05/2024 07:35, Sameer Pujar wrote: >>> On 21-05-2024 17:23, Krzysztof Kozlowski wrote: >>>> On 21/05/2024 13:08, Sameer Pujar wrote: >>>>> From: Mohan Kumar >>>>> >>>>> For Non-Hypervisor mode, Tegra ADMA driver requires the register >>>>> resource range to include both global and channel page in the reg >>>>> entry. For Hypervisor more, Tegra ADMA driver requires only the >>>>> channel page and global page range is not allowed for access. >>>>> >>>>> Add reg-names DT binding for Hypervisor mode to help driver to >>>>> differentiate the config between Hypervisor and Non-Hypervisor >>>>> mode of execution. >>>>> >>>>> Signed-off-by: Mohan Kumar >>>>> Signed-off-by: Sameer Pujar >>>>> --- >>>>> .../devicetree/bindings/dma/nvidia,tegra210-adma.yaml | 10 ++++++++++ >>>>> 1 file changed, 10 insertions(+) >>>>> >>>>> diff --git a/Documentation/devicetree/bindings/dma/nvidia,tegra210-adma.yaml b/Documentation/devicetree/bindings/dma/nvidia,tegra210-adma.yaml >>>>> index 877147e95ecc..ede47f4a3eec 100644 >>>>> --- a/Documentation/devicetree/bindings/dma/nvidia,tegra210-adma.yaml >>>>> +++ b/Documentation/devicetree/bindings/dma/nvidia,tegra210-adma.yaml >>>>> @@ -29,8 +29,18 @@ properties: >>>>> - const: nvidia,tegra186-adma >>>>> >>>>> reg: >>>>> + description: | >>>>> + For hypervisor mode, the address range should include a >>>>> + ADMA channel page address range, for non-hypervisor mode >>>>> + it starts with ADMA base address covering Global and Channel >>>>> + page address range. >>>>> maxItems: 1 >>>>> >>>>> + reg-names: >>>>> + description: only required for Hypervisor mode. >>>> This does not work like that. I provide vm entry for non-hypervisor mode >>>> and what? You claim it is virtualized? >>>> >>>> Drop property. >>> With 'vm' entry added for hypervisor mode, the 'reg' address range needs >>> to be updated to use channel specific region only. This is used to >>> inform driver to skip global regions which is taken care by hypervisor. >>> This is expected to be used in the scenario where Linux acts as a >>> virtual machine (VM). May be the hypervisor mode gives a different >>> impression here? Sorry, I did not understand what dropping the property >>> exactly means here. >> It was imperative. Drop it. Remove it. I provided explanation why. > > The driver doesn't know if it is operated in a native config or in the > hypervisor config based on the 'reg' address range alone. So 'vm' entry > with restricted 'reg' range is used to differentiate here for the > hypervisor config. Just adding 'vm' entry won't be enough, the 'reg' > region must be updated as well to have expected behavior. Not sure how > this dependency can be enforced in the schema. That's not a unusual problem, so please come with a solution for your entire subarch. We've been discussing similar topic in terms of SCMI controlled resources (see talk on Linaro Connect a week ago: https://www.kitefor.events/events/linaro-connect-24/submissions/161 I don't know where is recording or slides, see also discussions on mailing lists about it), which is not that far away from the problem here. Other platforms and maybe nvidia had as well changes in IO space for virtualized configuration. Come with unified approach FOR ALL your devices, not only this one (that's kind of basic thing we keep repeating... don't solve only one your problem), do not abuse the regular property, because as I said: reg-names will be provided as well in non-vm case and then your entire logic is wrong. The purpose of reg-names is not to tell whether you have or have not virtualized environment. Best regards, Krzysztof