From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) (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 4323B240232 for ; Mon, 13 Jan 2025 17:33:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.180 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736789593; cv=none; b=d1WGU3Da9XaTpFHQ1kQEgieN1oQrItSkUk/o64tA0dkbtiSgvFxqDsoFr3/wu4WoiqX5tzCWqq3B3SQ3dtbnWS1PawI/3Nh07XV0twQpmNqkgq0gNeGd889wEb257ZBaqzTzEOLy5qpA17O8I7OHftPmMUtVTCp966FfEYs7ox0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736789593; c=relaxed/simple; bh=AJ5/MMfgBZen8y/e9JOkj1yTQNlzdt26plRGk+CW7k8=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=eTNFOPGo3RvxA7I3RBC+cvTFMOwOe9ipU2vEO1WOGYb25CgtnhJnfTzxLGc1v7Yu1vVoPxjGC0dIZMbHQ9XRrCccx0TXSknw5/KP7dSGP0xEBo5anF0Tbf9YAIUp0DlkEKJRe4LuDXyZAqzQHOj2n2yvzKBIMk9WOXrUme6Ss/Y= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com; spf=fail smtp.mailfrom=broadcom.com; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b=GRBHKdC3; arc=none smtp.client-ip=209.85.214.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=broadcom.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="GRBHKdC3" Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-21654fdd5daso77734215ad.1 for ; Mon, 13 Jan 2025 09:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; t=1736789591; x=1737394391; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to; bh=JsHTkn0UEejY0NKbuUQmD06tWs6IR3e3B3FlamRDu0Q=; b=GRBHKdC3kQWspBlo/OYimra0fhvL0pejYoZDccu4CCXBKDFw5tl6NLjm2LdvpKZeia ZHiiLg2HQ9E3t/bsCdjkCJLm65hSyVdeCSask+Ft0e5lRiA//SCrk32VUIyW/LSWH7el GtU1ZcZaejuCw5MVm39duSIt3KeSw/ACWETow= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736789591; x=1737394391; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=JsHTkn0UEejY0NKbuUQmD06tWs6IR3e3B3FlamRDu0Q=; b=VLKHJsoOQeF8kCIMtNiDglBBNwCQdHiXCC7c03ZUe4pztaYWmzvD7TkzbUmvF38JTw BCFWXGx2xmAcolKd58atZ1NAX56ccxPIYYZK+zQAcyH2bjD3BFE2wxBrbzRL1+zMlHvB v+TYD1NHOSJXF3/iZp4enQ7+G81E91SVGo+8zlh+xhpWXR4KYFHo6RlVaSZdD9klUE2l qfs6VgY3f2mFWuAueH/uCIXI7OJobcaA9sor+QRJyyP8j0ePB2xp2N4QdJ4NhbXpf1kj Stc+ba9UAVbnOc8S3sPc5AHzQnYbv8Rjrocg9v4qD04C6/aMvRzIVCmskR5jD1HGC9gp Fw6g== X-Forwarded-Encrypted: i=1; AJvYcCXN29ynfdfEyad2ayzpAq2BtSa7xp1ttOAcD0SVgNpHxKdeNdxYEE9DWmO11lRPg2hyZGkOKUognIZh+wk=@vger.kernel.org X-Gm-Message-State: AOJu0YxAwdlfmHjI3WJub21hJ8v+q0ffXSeZ2JYoVCHglrr7AApWFEDK YpiGFjzYYUq3exWe9sK+IqNMFK/7VupBioQ9MaqY1bYD9zAFWPZ5L8RKqvTPug== X-Gm-Gg: ASbGnctTDMq6AsAVidbqrg3tb7U+QV4wXIN4/tyYQCl2yDOjdUmwLlEyjjR6mIN2+NV kqPX4O+PlmDMZR3NNqx0Fp8p8E86/6sc0Z4euH4c27UfwTNeODHWrblEwW7YpKGqh5sEYG8nh+I 56SCwKM9+oPQmVa4GfDHviimFp9cRMLrai3Y4h5/Hk4plMxKk5ZmP5ksDqfOvBqxa8lsGKmiMH+ RI41RkwgtlMS3QWPlygOijx38Wdila6ZNP4iIhkSV1/beWmwI6fOkbj5RLiE21li70rFV3cwLcI Y4ZOwz41JkB4HcEt7dHMeddE2DsW+mA= X-Google-Smtp-Source: AGHT+IGEtpFio/VZYQKRI3mqtgami6WdXlPv0aTekaxc7wyL2kYN8GhDHCTJXSQ84LlfMNYYrzoO4Q== X-Received: by 2002:a17:902:e74d:b0:216:3e9a:89e with SMTP id d9443c01a7336-21a83fde4f2mr335899785ad.35.1736789590489; Mon, 13 Jan 2025 09:33:10 -0800 (PST) Received: from [192.168.1.3] (ip68-4-215-93.oc.oc.cox.net. [68.4.215.93]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21a9f22cabdsm56241225ad.183.2025.01.13.09.33.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Jan 2025 09:33:09 -0800 (PST) Message-ID: <55d3c151-ae5e-4b02-8ac0-987b89b1d731@broadcom.com> Date: Mon, 13 Jan 2025 09:33:09 -0800 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: [PATCH 1/2] dt-bindings: memory-controller: Document rev c.1.5 compatible To: Krzysztof Kozlowski Cc: linux-arm-kernel@lists.infradead.org, Rob Herring , Conor Dooley , Broadcom internal kernel review list , "open list:MEMORY CONTROLLER DRIVERS" , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" References: <20241217194439.929040-1-florian.fainelli@broadcom.com> <20241217194439.929040-2-florian.fainelli@broadcom.com> <2e33t7ft5ermsfr7c4ympxrn6l5sqdef3wml4hlbnhdupoouwj@gfjpbmowjadi> <93a1333d-442f-4cec-b823-9b1a5ff6dc6b@broadcom.com> <0058c37b-9e7c-4af8-b7c0-c48b5b046d6a@broadcom.com> <1357f0ff-3493-491b-b06f-976c16a81681@kernel.org> Content-Language: en-US From: Florian Fainelli Autocrypt: addr=florian.fainelli@broadcom.com; keydata= xsBNBFPAG8ABCAC3EO02urEwipgbUNJ1r6oI2Vr/+uE389lSEShN2PmL3MVnzhViSAtrYxeT M0Txqn1tOWoIc4QUl6Ggqf5KP6FoRkCrgMMTnUAINsINYXK+3OLe7HjP10h2jDRX4Ajs4Ghs JrZOBru6rH0YrgAhr6O5gG7NE1jhly+EsOa2MpwOiXO4DE/YKZGuVe6Bh87WqmILs9KvnNrQ PcycQnYKTVpqE95d4M824M5cuRB6D1GrYovCsjA9uxo22kPdOoQRAu5gBBn3AdtALFyQj9DQ KQuc39/i/Kt6XLZ/RsBc6qLs+p+JnEuPJngTSfWvzGjpx0nkwCMi4yBb+xk7Hki4kEslABEB AAHNMEZsb3JpYW4gRmFpbmVsbGkgPGZsb3JpYW4uZmFpbmVsbGlAYnJvYWRjb20uY29tPsLB IQQQAQgAywUCZWl41AUJI+Jo+hcKAAG/SMv+fS3xUQWa0NryPuoRGjsA3SAUAAAAAAAWAAFr ZXktdXNhZ2UtbWFza0BwZ3AuY29tjDAUgAAAAAAg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3Z2/4fTnJqdJS//YcEhlr8uGs+ZWFcqAPbteFCM4dGDRruo69IrHfyyQGx16s CcFlrN8vD066RKevFepb/ml7eYEdN5SRALyEdQMKeCSf3mectdoECEqdF/MWpfWIYQ1hEfdm C2Kztm+h3Nkt9ZQLqc3wsPJZmbD9T0c9Rphfypgw/SfTf2/CHoYVkKqwUIzI59itl5Lze+R5 wDByhWHx2Ud2R7SudmT9XK1e0x7W7a5z11Q6vrzuED5nQvkhAAoJEIExtcQpvGagugcIAJd5 EYe6KM6Y6RvI6TvHp+QgbU5dxvjqSiSvam0Ms3QrLidCtantcGT2Wz/2PlbZqkoJxMQc40rb fXa4xQSvJYj0GWpadrDJUvUu3LEsunDCxdWrmbmwGRKqZraV2oG7YEddmDqOe0Xm/NxeSobc MIlnaE6V0U8f5zNHB7Y46yJjjYT/Ds1TJo3pvwevDWPvv6rdBeV07D9s43frUS6xYd1uFxHC 7dZYWJjZmyUf5evr1W1gCgwLXG0PEi9n3qmz1lelQ8lSocmvxBKtMbX/OKhAfuP/iIwnTsww 95A2SaPiQZA51NywV8OFgsN0ITl2PlZ4Tp9hHERDe6nQCsNI/Us= In-Reply-To: <1357f0ff-3493-491b-b06f-976c16a81681@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 12/26/2024 10:58 PM, Krzysztof Kozlowski wrote: > On 26/12/2024 19:50, Florian Fainelli wrote: >> >> >> On 12/21/2024 12:04 PM, Krzysztof Kozlowski wrote: >>> On 20/12/2024 00:43, Florian Fainelli wrote: >>>> On 12/19/24 00:58, Krzysztof Kozlowski wrote: >>>>> On Wed, Dec 18, 2024 at 09:15:08AM -0800, Florian Fainelli wrote: >>>>>> On 12/18/24 03:37, Krzysztof Kozlowski wrote: >>>>>>> On Tue, Dec 17, 2024 at 11:44:38AM -0800, Florian Fainelli wrote: >>>>>>>> Document the revision c.1.5 compatible string that is present on newer >>>>>>>> Broadcom STB memory controllers (74165 and onwards). >>>>>>>> >>>>>>>> Signed-off-by: Florian Fainelli >>>>>>>> --- >>>>>>>> .../bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml | 1 + >>>>>>>> 1 file changed, 1 insertion(+) >>>>>>>> >>>>>>>> diff --git a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml >>>>>>>> index 4b072c879b02..99d79ccd1036 100644 >>>>>>>> --- a/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml >>>>>>>> +++ b/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml >>>>>>>> @@ -29,6 +29,7 @@ properties: >>>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.2 >>>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.3 >>>>>>>> - brcm,brcmstb-memc-ddr-rev-c.1.4 >>>>>>>> + - brcm,brcmstb-memc-ddr-rev-c.1.5 >>>>>>> >>>>>>> You should use v2.1 fallback and drop driver patch. Or explain in >>>>>>> commit briefly why different approach is suitable. >>>>>> >>>>>> Are you suggesting that we should have fallback compatible strings, such >>>>>> that we have something like this: >>>>>> >>>>>> compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5", >>>>>> "brcm,brcmstb-memc-ddr-rev-c", "brcm,brcmstb-memc-ddr" >>>>>> >>>>>> and the driver only needs to match on "brcm,brcmstb-memc-ddr-rev-c" and >>>>>> apply the adequate register offset table? >>>>> >>>>> Almost, fallback should be brcm,brcmstb-memc-ddr-rev-b.2.1 or whatever >>>>> was in the driver first or whatever is the oldest known common >>>>> interface. >>>>> >>>>> brcm,brcmstb-memc-ddr-rev-c is not a specific compatible. >>>>> >>>>>> If so, that is not how the current binding, and therefore DTBs are being >>>>>> deployed, so that will introduce a breakage until we update all DTBs in the >>>>>> field... >>>>> >>>>> No. First, I thought about new comaptible so the one you add here. No >>>>> breakage, it's new compatible. This saves you these pointless updates of >>>>> driver everytime you add new compatible. >>>> >>>> Yes, but that is not how the binding has been defined until now, so all >>>> of the DTBs out there have: >>>> >>>> compatible = "brcm,brcmstb-memc-ddr-rev-b.2.x", "brcm,brcmstb-memc-ddr" >>> >>> I don't understand the problem. We talk about new devices here, it does >>> not matter what existing/old devices have in binding in that matter. >> >> It does matter, because the DTBs that contain this compatible string are >> already in the field, we cannot retrofit them overnight with an >> additional compatible string in order to provide a fallback. Because > > Then they run downstream and it does not matter whether you change here > something or not. And anyway downstream choices do not shape choices > here. We never accept bindings just because downstream already shipped > something. Fair enough, but it does matter anyway, because as you can see from the original binding that you accepted [1] we have a precedent for having compatible strings of the form: compatible = "brcm,brcmstb-memc-ddr-rev-c.1.x" with each possible value of X being documented, this is just adding another way, and surprise, keeps things consistent. Why did not you reject the original binding back then? Why the change of heart now? All of this feels from my side very very arbitrary, and as such it is difficult to document for other people and build a correct mental model of. [1]: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/Documentation/devicetree/bindings/memory-controllers/brcm,brcmstb-memc-ddr.yaml?id=fa0321ba51ddff78ebe3c7c945830a85c987e3ed > >> this is submitted now does not mean it is a new device, this was part of >> my backlog to get submitted earlier on. > > Well, that's great yet is not an argument in the bindings. > >> >>> >>>> >>>> (where X is in range [1..5]) >>>> >>>> and there is no fallback defined to "brcm,brcmstb-memc-ddr-rev-b.2.1", >>>> so it is not like we can retrofit that easily by adding one now. >>>> >>>> > > Second, you can introduce fallbacks to older compatibles as well - >>>> there >>>>> will be no breakage, because you add one more compatible. The old >>>>> compatibles (covered by fallback) of course stays in the driver, so >>>>> there is no breakage at all. We did it multiple times for several >>>>> different bindings in Qualcomm. People were doing exactly the same: >>>>> adding compatible for new device to binding and driver, without >>>>> considering the compatibility at all. >>>>> >>>>> Except being logically correct choice - using fallbacks - this really >>>>> has huge benefits when later upstreaming complete, big SoCs, like we do >>>>> for latest Qualcomm SoCs: several changes will be only bindings updates. >>>> >>>> Yes, there are advantages to using fallbacks and we (ab)use that >>>> whenever practical. >>>> >>>> The driver only uses a very limited subset of registers (for now), the >>>> registers change between minor revisions as well in a way that using a >>>> fallback like "brcm,brcmstb-memc-ddr-rev-b.2.1" is not accurate enough >>>> not practical. In particular for some of the changes that I am thinking >>>> of adding later on, we would need the precise minor version because the >>>> behavior and/or register interface is subtly different that this matters. >>> >>> Devices work fine now with the same driver data, so they are compatible. >> >> For now they do, but not for other features that will be submitted >> later, they will not be, and at that point we will need to know that >> this is a rev C.1.5 controller versus say a rev C.1.4 controller. > > Which is exactly what compatibility is for. Are you saying that the compatible strings must now all be updated to be of the form: compatible = "brcm,brcmstb-memc-ddr-rev-c.1.5", "brcm,brcmstb-memc-ddr-rev-c.1.x", "brcm,brcmstb-memc-ddr" or something different? -- Florian