Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3244772imm; Fri, 25 May 2018 02:14:13 -0700 (PDT) X-Google-Smtp-Source: AB8JxZq5k7E0yUyB6gHpiWBZO/8P7fPtl/8L/bKjR9EVdwgqdNDynP1Mu8CxS8c97SfCwiud1gyN X-Received: by 2002:a62:6105:: with SMTP id v5-v6mr1692554pfb.197.1527239653519; Fri, 25 May 2018 02:14:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527239653; cv=none; d=google.com; s=arc-20160816; b=yQ3LtNN2Y0UHyKHEML2ZT4Miz7jypme/7XD8aQ5Lm4tQg7rBfAxFLEKFtUgiF5JmLe 9yDSiZ/dW//gx7yfcUzXGvzPrm7F8gCHIJOmmf++ZKS8/9AhHmsssyFBT+q8Py73/7Mn Wr5wHsG9TyTRZtVoE62rXijUhTWyUwv4vVbMkp3M1/hdTqVOt36EF1BkG2X9dKHK1vPL y65SxMKJrCskt2fGo6frFighwQm7YXprIXf2ZHdezGm1w56dNxx/pZ5BkPQXZXph1tJb Xgo8Mk6srmSRpx2Uh5YMaiKPWANfiQeEi205hsj8aOaemcEZ7IFz/QIX8voxzxBA7d8j 6Zfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=2Fi99WkwI5URC2UpJshbDmSIBeTv9J+TTS8qcUc7yBk=; b=erXG+w9nbWWXwL/0yFVs14AGN701YhhHg7KmZ1kmbuiS/07ajWHuQwvaZvunD2pCdK rlK+5bp+994gv8HdBmB5LluOzI66jhK0yc9M4rYPhSSOPm56RT/eKkipqrP8+nH5ylok 5uSzBGG4axL+R2UvCEknvZUOTMI+g6/7/7vVwXzuGKujutucMsDOJhxyNh1fqfnDu5YS FdfO+9bYkTqnWyMuZ2tZpaSuNHyqeEdwIc9DMUZ2o5EVOspBpmfmTK4Z/6DTpsFZHXov vaxyhYgBuGlNdmYYfCa070Vrz8OV4J84wd8VRG+LggiUY0YVPvbmh4wjEZpxHJ9tYnLl 3EWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YGbCND35; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j2-v6si22197350pff.184.2018.05.25.02.13.58; Fri, 25 May 2018 02:14:13 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=YGbCND35; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965213AbeEYJMf (ORCPT + 99 others); Fri, 25 May 2018 05:12:35 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:43229 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964909AbeEYJMc (ORCPT ); Fri, 25 May 2018 05:12:32 -0400 Received: by mail-vk0-f66.google.com with SMTP id x191-v6so2741282vke.10; Fri, 25 May 2018 02:12:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=2Fi99WkwI5URC2UpJshbDmSIBeTv9J+TTS8qcUc7yBk=; b=YGbCND35EPQoXfkN/omCCdWwRfnAUxqfiZPlm1S+FzSK2jJMEb8jzMc6ile4AK3RoJ Z93bbbaMjsZW5UhDbID7XSc8BanTt7OOslXAy4o8sGIvAVVkKKWg+Oy3dZZCUKgVE7V4 aVqOUjrj0NzKOX7biK7MIgAB64Ua/zSPKtPlwGefirQpXIvFwZtXxD/MQC/eydebyPLA uXpMZVHgQchQlNLijZct6D/CznhgWT5QvKk1NdAqBXCgSjhtNbXr42bTSrRHLwTXeubA c93Hf16hqB39hq0GRi1G60lLerjH1RdCFAvj2s7T0nZv8TBFEUW7JbknQHzVHNJBwd/u wMZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=2Fi99WkwI5URC2UpJshbDmSIBeTv9J+TTS8qcUc7yBk=; b=fYR6hc5WPXw9jJkft+OsPjaI57L7aZgCScgA6Sfk2mdEVDAw4pjUIF5Pv4Tt7rC+M2 oZB9lL2c6ke+4tSoYduCCeJNY1fS/WJXYG9cMmSGLFSzwVcsQRBU0m6yEVKQ1Ew0auw6 3Yo1Q0vqYY0cpeE1GB3H1pepItlP22jabcisc3+1h1dXzjfEyRKH3Roa3CMSgPwX9h6Z 4Kw+yWeF+oiy6AxIe9XVNTsCaNMS4kTolCD4/+lhBhNw9bzOMIx8K5Q9i8NQdFWGvn8h 9AEB5kE2DH8m3Xo+/Mq1OcugSglPfAQ+fn1OwTcrYmrEK4EH3Yu3ibXE2B32p7QM4z4A ph6w== X-Gm-Message-State: ALKqPwdBHE4Jj7nhCdwjfFHGTi3S/mNUQ5iSP3d6eOdFQnycUHWr9Ytj fSMeo4qH1prghXim2gzejyhv/D/WklAcLBL/wtQ= X-Received: by 2002:a1f:2cc6:: with SMTP id s189-v6mr858642vks.106.1527239551533; Fri, 25 May 2018 02:12:31 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:7a0a:0:0:0:0:0 with HTTP; Fri, 25 May 2018 02:12:30 -0700 (PDT) In-Reply-To: References: <1526983321-41949-1-git-send-email-michel.pollet@bp.renesas.com> <1526983321-41949-3-git-send-email-michel.pollet@bp.renesas.com> From: Geert Uytterhoeven Date: Fri, 25 May 2018 11:12:30 +0200 X-Google-Sender-Auth: Mik9aF7n1O_ImPWQCnbQwEcZsoM Message-ID: Subject: Re: [PATCH v6 2/6] dt-bindings: Add the rzn1-clocks.h file To: M P Cc: Michel Pollet , Linux-Renesas , Simon Horman , Phil Edworthy , Michel Pollet , Magnus Damm , Rob Herring , Mark Rutland , Michael Turquette , Stephen Boyd , Geert Uytterhoeven , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Linux Kernel Mailing List , linux-clk Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michel, On Wed, May 23, 2018 at 10:17 AM, M P wrote: > On Wed, 23 May 2018 at 08:26, Geert Uytterhoeven > wrote: >> On Wed, May 23, 2018 at 8:44 AM, M P wrote: >> > On Tue, 22 May 2018 at 19:44, Geert Uytterhoeven >> > wrote: >> >> On Tue, May 22, 2018 at 12:01 PM, Michel Pollet >> >> wrote: >> >> > --- /dev/null >> >> > +++ b/include/dt-bindings/clock/rzn1-clocks.h >> > >> >> Given this is part of the DT ABI, and there exist multiple different > RZ/N1 >> >> SoCs (and there are probably planned more), I wouldn't call this header >> >> file "rzn1-clocks.h", but e.g. "r9a06g032-clocks.h". >> > >> > Actually, no, there already are two r906g03X devices that will work >> > perfectly fine with this driver. We had that discussion before, and you >> > insist and me removing mentions of the rzn1 everywhere, however, this >> > applies to *two* devices already, and I'm supposed to upstream support > for >> > them. I can't rename r9g06g032 because it is *inexact* that's why it's > >> My worry is not that there are two r906g03X devices that will work fine >> with this driver, but that there will be other "rzn1" devices that will > not >> work with these bindings (the header file is part of the bindings). >> Besides, RZ/N1D and RZ/N1S (Which apparently differ in packaging only? >> Oh no, RZ/N1D (the larger package) has less QSPI channels than RZ/N1S >> (the smaller package)), there's also (at least) RZ/N1L. > >> > called rzn1. So unless you let me call it r9a06g0xx-clocks.h (which i > know >> > you won't as per multiple previous discussions) this can't be called >> > r9a06g032 because it won't be fit for my purpose when I try to bring > back >> > the RZ/N1S into the picture. > >> You can add r9a06g033-clocks.h when adding support for RZ/N1S. > > So it is now acceptable to duplicate a huge amount of code, and constants > when in fact there differences are so minor they would require minimal > amount of code to take care of them? That just flies straight against my > 30+ years of programming -- We're going to have twice the *identical* code, > twice the header, and completely incompatible device tree files -- I mean, > *right now* our rzn1.dtsi works *as is* on the 1D and 1S, we've got ONE > file to maintain, and you can switch your CPU board from 1D to 1S and your > 'board file' can stay the same. > > Wasn't it the idea of that stuff in the first place? Isn't it in the > customer/engineer interest to be able to cross grade from one > manufacturer's device *in the same series* to another without having to > duplicate his whole board file? Yes, all of these are desirable. Now, given the clock definitions for RZ/N1[DSL] are the same (although some don't exist on some variants), you could keep on using RZN1_CLK_FOO for the names of the defines, and store them in a common file, included by the soc-specific file. But please make clear the common file cannot be included directly, so the filename does not become part of the DT ABI, and you are shielded from future marketing silliness (e.g. next quarter's RZ/N1X being totally different). E.g.: include/dt-bindings/clock/r9a06g033-clocks.h: #ifndef __DT_BINDINGS_R9A06G033_CLOCK_H__ #define __DT_BINDINGS_R9A06G033_CLOCK_H__ #include "rzn1-clocks.h" // ... additions and fixups, if needed #endif // __DT_BINDINGS_R9A06G033_CLOCK_H__ include/dt-bindings/clock/rzn1-clocks.h: #ifndef __DT_BINDINGS_RZN1_CLOCK_H__ #define __DT_BINDINGS_RZN1_CLOCK_H__ #ifndef __DT_BINDINGS_R9A06G033_CLOCK_H__ #error Do not include rzn1-clocks.h directly #endif #define RZN1_CLK_FOO 0 #define RZN1_CLK_BAR 1 ... #endif // __DT_BINDINGS_RZN1_CLOCK_H__ As for the driver, I think you should make sure the driver instantiates no clocks that don't exist on the actual SoC it runs on. BTW, someone asked why I didn't use the same definitions for R-Car M3-W and R-Car H3 (there were only a few differences), and didn't use common definitions for all R-Car Gen3 SoCs. I doubted a long time that we made the right decision, but then V3M and V3H appeared in later revisions of the datasheet, and D3 and E3 later, reconfirming our decision. Even for compatible values for IP cores within the same family: there are differences, but usually we only discover them after a while. In theory all the same IP cores in R-Car Gen3 SoCs are the same (except for obvious differences like clocks and pinctrl), in practice they are not. So it may sound silly to have SoC-specific compatible values for the gross of the IP cores, but it would be worse if we got bitten later by not having them. BTW, you're too quick reposting your series. I can't finish my reviews in time ;-) Please give people a reasonable amount of time to handle them. Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds