Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3919614pxb; Tue, 17 Nov 2020 07:01:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxDqEHQzJXE6ZSYO57LOVoIyQAI3LzEtlhXrWzu2EWpBGJt+7+dm9DTz6o9w9rwHvcGNwOS X-Received: by 2002:a05:6512:3590:: with SMTP id m16mr2020637lfr.201.1605625261923; Tue, 17 Nov 2020 07:01:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605625261; cv=none; d=google.com; s=arc-20160816; b=FItMftN5gLBPLrqDDOhNrBvR68mpdgefK+ipqZuweazj8YkXqTjbqbPWUDQ/oApAnS Lrbo0MI5vYK6KsmUmq8pVBxzHPWNmkA5QW4ELghFSSyD4pha8jIHyg6hAkyshXHB00Nn OcN7eVKvEhm56uank4oqPXovoeQuwocgKATWPI3gh2U3eLBvobRFr8KzDInMqwrFYM1E jSFARPtOnrjiUr06e8xBZHdn0YWudmo7NHO3u+Jo0xN87tRrzXkV8Vzq7jYUmkljYDPJ V6hVQAj83L/7oP90o+uzC6S4VZzokr+p5vcVn2j2+LCIRleAsNFURKZr4dtwrli4JtKl oQiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=t8nyE1HD7lf47cYzd6YFwJ9sabMnFQsRmR22W8X+y1g=; b=zXXLmDY57o0WZG7lTq9QMvpDsb2ExdQrkK8zw/3/ZTCc1liv9vA5QQE63tq7nhP6Ll Iq3SQpMX9Lbf/0ql/Kli44D/wCAiUWuMN5tPmVzCGU1lYYB3UVZqRHXi6Lv+acDquBG0 wUPfdMVkOl7HUyKZ5f6pyqDdCDPOZQUv0UR1ls7hoiLjdgHYg/9QM7BeVicKPlYvv/Ew HnjGj4pPVFP91q5zz5sAoa3jP19/YvkjjAEKyFBMhRl7KUjHmppICgIwEnxEqsx5dIZd Zi5kmW3sDaR9YGWv2TRfjtnRcLmg+YSKY5c+RR1OnedvqETRTMD35m+H/d+D/5Q374fI iCCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L6+F9+39; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b14si6133754ejc.581.2020.11.17.07.00.25; Tue, 17 Nov 2020 07:01:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=L6+F9+39; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729998AbgKQO6X (ORCPT + 99 others); Tue, 17 Nov 2020 09:58:23 -0500 Received: from mail.kernel.org ([198.145.29.99]:49946 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729875AbgKQO6X (ORCPT ); Tue, 17 Nov 2020 09:58:23 -0500 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7B67B24198; Tue, 17 Nov 2020 14:58:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605625102; bh=ntJaD8fOjxDYGmX2Qdy51YlJpyvBSJbhwkEb7CuraqY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=L6+F9+39hJDJ2LJ07FgxJsizUSiHF4hhUH8EyvtqzZSXTJXV9IuJjM4C7bHwckbEr fwqAg8tVHb5cTonFG6VVP28EwX+VaiDxpG8SsRUn9hxD3bNg41d8GSy1sMp7e10jBl 6QMw1HhE1xkaelac5XtdVIHyksI5y1bdKZYfrbpw= Received: by mail-ot1-f52.google.com with SMTP id 79so19626435otc.7; Tue, 17 Nov 2020 06:58:22 -0800 (PST) X-Gm-Message-State: AOAM531+eGMGdPOFYUkDu4I0ZMg9PfFEEeVg38s+cKDb+YBexFibE8ef j1D+2w+j9WUAVyFSFBALV63fHUwi/1gC3qrupw== X-Received: by 2002:a9d:5e14:: with SMTP id d20mr3083096oti.107.1605625101656; Tue, 17 Nov 2020 06:58:21 -0800 (PST) MIME-Version: 1.0 References: <20200916071950.1493-1-gilad@benyossef.com> <20200916071950.1493-2-gilad@benyossef.com> <20200923015702.GA3676455@bogus> In-Reply-To: From: Rob Herring Date: Tue, 17 Nov 2020 08:58:10 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] dt-bindings: crypto: update ccree optional params To: Gilad Ben-Yossef Cc: Herbert Xu , "David S. Miller" , Ofir Drang , Linux Crypto Mailing List , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux kernel mailing list , Robin Murphy , Steven Price Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Nov 17, 2020 at 1:39 AM Gilad Ben-Yossef wrote: > > On Mon, Nov 16, 2020 at 8:54 PM Rob Herring wrote: > > > > On Thu, Oct 22, 2020 at 1:18 AM Gilad Ben-Yossef wrote: > > > > > > > > > Hi again, > > > > > > Any opinion on the suggested below? > > > > Sorry, lost in the pile... > > No problem at all. I know how it is... > > > > > > > > > > > On Tue, Sep 29, 2020 at 9:08 PM Gilad Ben-Yossef wrote: > > >> > > >> > > >> On Wed, Sep 23, 2020 at 4:57 AM Rob Herring wrote: > > >> > > > >> > On Wed, Sep 16, 2020 at 10:19:49AM +0300, Gilad Ben-Yossef wrote: > > >> > > Document ccree driver supporting new optional parameters allowing to > > >> > > customize the DMA transactions cache parameters and ACE bus sharability > > >> > > properties. > > >> > > > > >> > > Signed-off-by: Gilad Ben-Yossef > > >> > > --- > > >> > > Documentation/devicetree/bindings/crypto/arm-cryptocell.txt | 4 ++++ > > >> > > 1 file changed, 4 insertions(+) > > >> > > > > >> > > diff --git a/Documentation/devicetree/bindings/crypto/arm-cryptocell.txt b/Documentation/devicetree/bindings/crypto/arm-cryptocell.txt > > >> > > index 6130e6eb4af8..1a1603e457a8 100644 > > >> > > --- a/Documentation/devicetree/bindings/crypto/arm-cryptocell.txt > > >> > > +++ b/Documentation/devicetree/bindings/crypto/arm-cryptocell.txt > > >> > > @@ -13,6 +13,10 @@ Required properties: > > >> > > Optional properties: > > >> > > - clocks: Reference to the crypto engine clock. > > >> > > - dma-coherent: Present if dma operations are coherent. > > >> > > +- awcache: Set write transactions cache attributes > > >> > > +- arcache: Set read transactions cache attributes > > >> > > > > > > >> > These could also just be implied by the compatible string (and requiring > > >> > an SoC specific one). > > >> > > >> hm... we could do it but this will require us to know (and publicly > > >> acknowledge) of every SoC making use of this piece of hardware design. > > > > That's already a requirement in general. Sometimes we can avoid it, > > but that's cases of getting lucky. > > > > >> There is currently no other part of the driver that needs this. > > > > If your DT is part of firmware, then waiting until adding some driver > > feature or quirk based on a new DT property is too late. Whereas with > > a SoC specific compatible, you can handle any new feature or quirk > > without a DT change (e.g. just a stable kernel update). Some platforms > > may not care about that model, but in general that's the policy we > > follow. Not doing that, we end up with the DWC3 binding. > > > > A fallback compatible is how we avoid updating drivers for every > > single SoC unless needed. > > OK, I now better understand what you meant and that does make some > sense and I will defer to your better judgment about the proper way > to do this. > > Having said that, there is still something that bugs me about this, > even just at the level of better understanding why we do things: > > Way back when, before DT, we had SoC specific code that identified the > SoC somehow and set things up in a SoC specific way. > Then we introduced DT as a way to say - "hey look, this is how my > busses looks like, these are the devices I have, deal with it" and I > always assumed that this was meant as a way to release us from having > SoC specific setup code. Yes, but in the end it's a judgement call as to what the boundary is. Take clocks for example, in the beginning we were trying to describe clocks on a mux/divider/gate level in DT. We realized this would result in hundreds to thousands of DT nodes and it would never be completely correct. So we model only the leaf clocks for the most part and there's lots of SoC code for clock controller blocks still. The questions for having properties or not to ask is: Is this board specific? Yes, then use a property. Who needs to change this and when? Should/would you want to control this in your PC BIOS or via a BIOS update? Zero SoC code was never a goal. It was about a standard way to define SoCs and having common frameworks (we have a common clock api, but not implementation at the time). We have *way* less SoC code per SoC than we used to. At the start of the DT conversion for Arm, we had ~400 boards and now we're at ~1400 last I checked. > It seems now potentially every SoC vendor needs to modify not just the > device tree source (which makes sense of course) but also the driver > supporting their platform. > It now looks like we've come a full circle to me :-) As I said, if the h/w is 'exactly the same' (hint: it rarely is), then use a fallback compatible. Then the new SoC specific compatible is there just in case. Think of compatible just as a VID/PID in PCI and USB land (though the closest thing to a fallback there is class codes). They are the only way we can uniquely identify h/w. Rob