Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp6169791rwl; Wed, 22 Mar 2023 07:22:30 -0700 (PDT) X-Google-Smtp-Source: AK7set/oOKCIb/AMrtrC8Wijxw+hInlJgR5fDIDDQJDKWZdzpcFXCo4P8Qh7G7RVZ3Y7SDjUmlcl X-Received: by 2002:a17:90b:1647:b0:237:47b0:3235 with SMTP id il7-20020a17090b164700b0023747b03235mr3667685pjb.32.1679494950702; Wed, 22 Mar 2023 07:22:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679494950; cv=none; d=google.com; s=arc-20160816; b=KbH1ltdyfGS16YNZGcO2LBGwmlhWB5dhZWfT7st8HdzDiTtQxY2h/bmug3Vd2zpPOi qmn+y6iNWHGStO+tBZ6dzSF+Msymo313/tHSWPOQXXgQ67rSsv71GHJJq1CiTKsu/+95 GrtXiCcwgWA1JTjSucGgtEnYbD0ENuHctZKGkEDUdXYbVIgNS3NPFEFER9W5CCcY25iA Hd9GORJYO4vpBFi4MwurhrQpWzXNcq40yqCtZJg9HHvek9s3EUsDf61rbrgDpPtcBIhE bflsGhCZ6voonaLsvdVT33Khzw72GirUROEycHtGxW2Wc1DugtJ7ow4JQ69RdsEQsZxJ uYUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=qj0syStHj7h4B0XAImt7mMexy7tBi48lJGaBNb7+JlY=; b=XScR4P+6UQRKO2UvKfog7mVopnysVfKi5X1g651HjArpk7MdC2YcHTa4T5bbhugVgZ 8keLU7N1k+tqwSy5gFK/ugdD+0aBr3Avs0JCe75MIMURlcQ2c7LWzW/sFFIy4Jd48nvk KWdBSdVyf9fzM3u+xF67ff8nhP/Ftj8qn58/buvWcseIq3R6BThBkfCAuGQysoRL3tok ZSdFSZQQMDiIIbyktJgRrVoLLaQRbAsqXnhASL0z+FYpdIs7VwUus20QXyEc+cxR0SiL MSDG43iRuwao6yW/U4eqADA4qQEK3kXTyG9a3ZOJCrGWyTCN64ShxU7/PeAEioZrIK4N MSaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=q6sYTwFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e65-20020a636944000000b0050f7c2037bfsi7897805pgc.605.2023.03.22.07.22.18; Wed, 22 Mar 2023 07:22:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=q6sYTwFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230358AbjCVOO4 (ORCPT + 99 others); Wed, 22 Mar 2023 10:14:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231348AbjCVOOy (ORCPT ); Wed, 22 Mar 2023 10:14:54 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1C08E04D for ; Wed, 22 Mar 2023 07:14:50 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id C67025FD03; Wed, 22 Mar 2023 17:14:46 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1679494486; bh=qj0syStHj7h4B0XAImt7mMexy7tBi48lJGaBNb7+JlY=; h=Date:From:To:Subject:Message-ID:MIME-Version:Content-Type; b=q6sYTwFniqUNHRlfOq8EqSUgww71G+fVT2WNgb+KKOw/wSYpYN2Mze4CpcLqwZjMN xH8dowjQPpdbs46PTFIwsxHv5UkIu+xUeMssyvbCyITg7jAJatxG/PUuxzv0En/oqm pf0tLQojuFKXJlIT89GbHTGvQCOR6K5kK2vJQbHc5ftapAIykWUZ5OuCTGw+c9mHJ3 YkdkjlZX+Emdn8jnAgz0XXy1IurKX+MaZT/7Cuu4rvZ4HIuBfK7sbaYx+ZSMWnk5aH EaPegTAHrPxBXL+JSVa6p3JWRnp9NuZzqJB3GvsfJ8jtBZTVYv9JRsAf/ylJdLycZ3 MgYiRmNdX1pTw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Wed, 22 Mar 2023 17:14:45 +0300 (MSK) Date: Wed, 22 Mar 2023 17:14:44 +0300 From: Dmitry Rokosov To: Rob Herring CC: , , , , , , , Subject: Re: [PATCH v3] checkpatch: add missing bindings license check Message-ID: <20230322141444.abwirejgfbeer7lr@CAB-WSD-L081021> References: <20230320203350.13696-1-ddrokosov@sberdevices.ru> <20230321215337.GA1656483-robh@kernel.org> <20230322102607.5rac7lmy5w653jen@CAB-WSD-L081021> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: NeoMutt/20220415 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2023/03/22 10:34:00 #20990985 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Mar 22, 2023 at 08:40:21AM -0500, Rob Herring wrote: > On Wed, Mar 22, 2023 at 5:26 AM Dmitry Rokosov wrote: > > > > Hello Rob, thank you for the comments. Please find my thoughts below. > > > > On Tue, Mar 21, 2023 at 04:53:37PM -0500, Rob Herring wrote: > > > On Mon, Mar 20, 2023 at 11:33:50PM +0300, Dmitry Rokosov wrote: > > > > All headers from 'include/dt-bindings/' must be verified by checkpatch > > > > together with Documentation bindings, because all of them are part of > > > > the whole DT bindings system. > > > > > > > > The requirement is dual licensed and matching pattern: > > > > /GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/ > > > > > > This is not correct. The headers can and should be licensed like the dts > > > files which are (unfortunately) all over the place and differ from the > > > bindings. > > > > > > Also, GPL-2.0-or-later is neither desired nor encouraged. > > > > Sorry, I'm little bit confused. Let's discuss correct way. > > > > We had such discussion in another review. > > > > https://lore.kernel.org/all/20230313201259.19998-4-ddrokosov@sberdevices.ru/ > > > > Krzysztof has mentioned that Documentation yaml bindings schemas and > > include bindings headers should have the same license by default. > > By default is the key. Logically, headers are part of the binding > definition. However, they are included by dts files, so IMO their > license should align with dts files. If you don't yet have any dts > files, then yes, "GPL-2.0-only OR BSD-2-Clause" is what you should > use. > > > And checkpath must check not only Documentation schema (previous > > implementation), but 'include bindings' as well: > > > > From Krzysztof at https://lore.kernel.org/all/9d176288-cd7c-7107-e180-761e372a2b6e@linaro.org/: > > Checkpatch has no way of knowing about the dts file part, so it can't > tell you what license. > > Even as-is, checkpatch is wrong sometimes. If you convert a binding > (that defaulted to GPL-2.0-only) to schema, you can't just relicense > it dual licensed. > > > > > --- > > >>>>> @@ -0,0 +1,20 @@ > > >>>>> +/* SPDX-License-Identifier: GPL-2.0+ */ > > >>>> > > >>>> I found in changelog: > > >>>> "fix license issue, it's GPL-2.0+ only in the current version" > > >>>> and I do not understand. > > >>>> > > >>>> The license is wrong, so what did you fix? > > >>>> > > >>> > > >>> Sorry don't get you. Why is it wrong? > > >> > > >> Run checkpatch - it will tell you why wrong. The license is not correct. > > >> This is part of binding and should be the same as binding. > > >> > > > > > > I always run checkpatch before sending the next patch series. Checkpatch > > > doesn't highlight this problem: > > > > > > -------------- > > > $ rg SPDX a1_clkc_v10/v10-0003-dt-bindings-clock-meson-add-A1-PLL-and-Periphera.patch > > > 32:+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > > > 111:+# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause > > > 188:+/* SPDX-License-Identifier: GPL-2.0+ */ > > > 294:+/* SPDX-License-Identifier: GPL-2.0+ */ > > > > > > $ ./scripts/checkpatch.pl --strict a1_clkc_v10/v10-0003-dt-bindings-clock-meson-add-A1-PLL-and-Periphera.patch > > > total: 0 errors, 0 warnings, 0 checks, 259 lines checked > > > > Hmm, my bad, that's something to fix/improve in checkpatch. > > --- > > > > Actually, I agree with Krzysztof that checkpatch should verify 'include > > bindings', but looks like there is misunderstanding which license pattern > > we have to use. > > > > Rob, could you please share your thoughts if possible? Which one pattern > > we have to base on? GPL-2.0-only without 'later' suffix? Or you totally > > disagree that checkpatch is responsible for 'include bindings' > > verification? > > I think we could do this: > > Schemas should be: GPL-2.0-only OR BSD-2-Clause > Headers should be: GPL-2.0-only OR .* > > Perhaps the 2nd term can be constrained to "(MIT|BSD-[23]-Clause)", > but I haven't looked at what variations exist in the headers. It may > be too varied that we can only check for "OR". We don't want to > encourage folks to blindly relicense things because checkpatch says > so. If you are copying an existing header and modifying it, then you > keep the original license (unless you have rights to change it). Yes, if we are thinking in the such terms, when bindings are part of device tree source, it's one option to make the same license for both of them. But usually developer creates bindings definition in the first. After that, developer or other contributor creates device tree nodes. Also different device tree sources (for differnt boards as an example) can have different licenses. Maybe it's better option to make license dependency between dts and bindings when bindings have a first priority and dts should have the same license or dual license, because bindings are the primary from the git history point of view. OR Make default value of bindings as suggested in the patchset (maybe without +/or-later) and show notice log from the checkpatch, like: ''' DT binding documents should be licensed (GPL-2.0-only OR BSD-2-Clause) For special cases ask 'devicetree@vger.kernel.org' directly ''' And handle all exceptions during LKML review, as Krzysztof suggested before. What do you think about above approaches? Krzysztof, please share your opinion as well. For sure, current checkpatch behaviour is wrong, it doesn't help to understand all mentioned interlacements. -- Thank you, Dmitry