Message ID | 20230320203350.13696-1-ddrokosov@sberdevices.ru |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:604a:0:0:0:0:0 with SMTP id j10csp1429505wrt; Mon, 20 Mar 2023 13:46:58 -0700 (PDT) X-Google-Smtp-Source: AK7set8rhsChq3XaGBP9piacSI3nDR+RusMleZtJ6YFNijzEePqnH8a4riWDkVo2aIJ/Efp8Le8b X-Received: by 2002:a05:6a20:489:b0:d3:84ca:11b with SMTP id 9-20020a056a20048900b000d384ca011bmr16015039pzc.40.1679345218677; Mon, 20 Mar 2023 13:46:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679345218; cv=none; d=google.com; s=arc-20160816; b=oQ0LWpoeHO7ZwNBctBkeOBpPwzfKAbRNwFNXFOqT9TrLLSvDPPOIXaTQof2MnoAeBt rV0b6hZ6qnRWfzSSoT/d6o5Mwhf1m2qlL88Kbk7dyb/UZuYv2uknpICiZBtc5xGDyxDD 8WTBVevQ5TVRG3Tkz/pQo2+q+sIv/LF20/XA4BYrxGatmjrv+3pJ7pFtB9Q/tiAkEw+0 YUjSW4RVc69NvO65ZgKOIlGYrp8M+x6UMUXhs5VYKMrTZnfnkZ3qI6mKOWuL9SKK2Jv+ KqBx2w4K6DUaokCF3K6cJV1f4NGzlwaFEbf3cAujMazkyCrGPkhRorV3o2akepjN3ryp oc/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=DFzqPpTMUf1xZTOArO7q4XeqATyxAxZahKRgAMFPTfk=; b=igSUs9Aijmk+100SeqSWgdYPFIs9TBaec4/DXIxsGW80ERf2eozI8YsAJ24GOKF3dw 2ivlQ6wlODGo16uIRxfFET1l4LT6GD/Cqf0A73GE3pcPOBQbWLn72mG2hOhLS+cvUMwQ oudclAai/hYvR0xqxoVEcuhcdGu5C8NgL5n9VKSCkMskWkL55aoHF3d8aCgSskHtMx8m SYrCP87pGGlxSfLho7f8wFAMgng82chwupiQcvrVNdNjCUlZFoWvGj+tdlAmhF0+rsVe CiR9WJoKDtPr9dMgcjgBtAyPT7+zWhSlwOCYC/8rzKYdhB4MpxaAw7v1yUnju89xIO/D re/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b="f+o/ipMr"; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 123-20020a630381000000b00500a71d8b47si11370272pgd.214.2023.03.20.13.46.41; Mon, 20 Mar 2023 13:46:58 -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="f+o/ipMr"; 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 S229744AbjCTUeU (ORCPT <rfc822;pusanteemu@gmail.com> + 99 others); Mon, 20 Mar 2023 16:34:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229819AbjCTUeO (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 20 Mar 2023 16:34:14 -0400 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EC373468A for <linux-kernel@vger.kernel.org>; Mon, 20 Mar 2023 13:34:04 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 2F1AC5FD10; Mon, 20 Mar 2023 23:34:00 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1679344440; bh=DFzqPpTMUf1xZTOArO7q4XeqATyxAxZahKRgAMFPTfk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=f+o/ipMrcwfkV861m/R4vi8KJqdlVx8zDL93KbIu7iq/WT5JYU/kyUuuXSjGOPI87 1w6m6BgdERW1NvOQdZoFs0/o/QJh4sr5CaLPRLnPt77yWNS0MN5rww7SDIbZCh+K91 lgc6jtdQn/kgPSuygaPw8cwkHi2V7Qp3ImowHKzqJZIoJQNV2AkiyINCl/7eYKXq1n o7qhg/jTyG/UrlMNA5tBq5/GyPxWOFB5+wj6q9yXtM7zNUn31YDseQzUF7mVLvCVlJ ddPTqBjpuVCBFyCXbuNkiVUtJbDDPFykn4aAcj701tvFnUHmdVelde9aWY6zSTqhjc gNcNRikgXlNbQ== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 20 Mar 2023 23:33:58 +0300 (MSK) From: Dmitry Rokosov <ddrokosov@sberdevices.ru> To: <krzysztof.kozlowski@linaro.org>, <robh@kernel.org>, <apw@canonical.com>, <joe@perches.com>, <dwaipayanray1@gmail.com>, <lukas.bulwahn@gmail.com> CC: <kernel@sberdevices.ru>, <linux-kernel@vger.kernel.org>, <rockosov@gmail.com>, Dmitry Rokosov <ddrokosov@sberdevices.ru> Subject: [PATCH v3] checkpatch: add missing bindings license check Date: Mon, 20 Mar 2023 23:33:50 +0300 Message-ID: <20230320203350.13696-1-ddrokosov@sberdevices.ru> X-Mailer: git-send-email 2.36.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH02.sberdevices.ru (172.16.1.5) 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/20 09:56:00 #20977321 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760647721909291205?= X-GMAIL-MSGID: =?utf-8?q?1760921092249024886?= |
Series |
[v3] checkpatch: add missing bindings license check
|
|
Commit Message
Dmitry Rokosov
March 20, 2023, 8:33 p.m. UTC
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/
The issue was found during patch review:
https://lore.kernel.org/all/20230313201259.19998-4-ddrokosov@sberdevices.ru/
Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru>
---
Changes v3 since v2 at [2]:
- replace 'not =~' expression with '!~' to be aligned with other
checkpatch lines
Changes v2 since v1 at [1]:
- include/dt-bindings check is aligned to open parens
- introduce more strict pattern for bindings license:
/GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/
Links:
[1] https://lore.kernel.org/all/20230317201621.15518-1-ddrokosov@sberdevices.ru/
[2] https://lore.kernel.org/all/20230320100027.27788-1-ddrokosov@sberdevices.ru/
---
scripts/checkpatch.pl | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
Comments
On Mon, 2023-03-20 at 23:33 +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/ > > The issue was found during patch review: > https://lore.kernel.org/all/20230313201259.19998-4-ddrokosov@sberdevices.ru/ > > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> > --- Assuming the devicetree people are good with this change: Acked-by: Joe Perches <joe@perches.com> > Changes v3 since v2 at [2]: > - replace 'not =~' expression with '!~' to be aligned with other > checkpatch lines > > Changes v2 since v1 at [1]: > - include/dt-bindings check is aligned to open parens > - introduce more strict pattern for bindings license: > /GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/ > > Links: > [1] https://lore.kernel.org/all/20230317201621.15518-1-ddrokosov@sberdevices.ru/ > [2] https://lore.kernel.org/all/20230320100027.27788-1-ddrokosov@sberdevices.ru/ > --- [] > diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl > @@ -3709,8 +3709,9 @@ sub process { > WARN("SPDX_LICENSE_TAG", > "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); > } > - if ($realfile =~ m@^Documentation/devicetree/bindings/@ && > - not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) { > + if (($realfile =~ m@^Documentation/devicetree/bindings/@ || > + $realfile =~ m@^include/dt-bindings/@) && > + $spdx_license !~ /GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/) { > my $msg_level = \&WARN; > $msg_level = \&CHK if ($file); > if (&{$msg_level}("SPDX_LICENSE_TAG",
On 20/03/2023 21:33, 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/ > > The issue was found during patch review: > https://lore.kernel.org/all/20230313201259.19998-4-ddrokosov@sberdevices.ru/ > > Signed-off-by: Dmitry Rokosov <ddrokosov@sberdevices.ru> > --- > Changes v3 since v2 at [2]: Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> Best regards, Krzysztof
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. Rob
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. 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/: --- >>>>> @@ -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?
On Wed, Mar 22, 2023 at 5:26 AM Dmitry Rokosov <ddrokosov@sberdevices.ru> 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). Rob
On Wed, Mar 22, 2023 at 08:40:21AM -0500, Rob Herring wrote: > On Wed, Mar 22, 2023 at 5:26 AM Dmitry Rokosov <ddrokosov@sberdevices.ru> 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.
On Wed, Mar 22, 2023 at 9:15 AM Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote: > > On Wed, Mar 22, 2023 at 08:40:21AM -0500, Rob Herring wrote: > > On Wed, Mar 22, 2023 at 5:26 AM Dmitry Rokosov <ddrokosov@sberdevices.ru> 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. No, most often they are copied from something else. Any tool can't know what the source (and its license) is and actively telling users to do something different is bad. I imagine writing the schema is the last thing because upstream requires it and downstream doesn't. > 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. I'm sure there are combinations of dts files and headers with incompatible licenses. A tool to check that would be nice. Just need to generate a list of all input files perhaps with the preprocessor dependency generation and then get the licenses for all the files. > 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. dts files are too far gone to define any rule in checkpatch. Binding files are not because there's really only 2 variations since all the existing bindings are just kernel default license (GPL-2.0-only). > 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 For special cases, ask your lawyer... > ''' > > And handle all exceptions during LKML review, as Krzysztof suggested > before. > > What do you think about above approaches? I laid out what the options are already. > > Krzysztof, please share your opinion as well. > > For sure, current checkpatch behaviour is wrong, it doesn't help to > understand all mentioned interlacements. checkpatch is suggestions or possible issues in many cases. It's not absolute nor completely accurate to begin with. Rob
On Wed, Mar 22, 2023 at 09:36:40AM -0500, Rob Herring wrote: > On Wed, Mar 22, 2023 at 9:15 AM Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote: > > > > On Wed, Mar 22, 2023 at 08:40:21AM -0500, Rob Herring wrote: > > > On Wed, Mar 22, 2023 at 5:26 AM Dmitry Rokosov <ddrokosov@sberdevices.ru> 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. > > No, most often they are copied from something else. Any tool can't > know what the source (and its license) is and actively telling users > to do something different is bad. > > I imagine writing the schema is the last thing because upstream > requires it and downstream doesn't. > Maybe checkpatch strict rules would allow developers to double confirm licenses in the copied files... > > 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. > > I'm sure there are combinations of dts files and headers with > incompatible licenses. A tool to check that would be nice. Just need > to generate a list of all input files perhaps with the preprocessor > dependency generation and then get the licenses for all the files. > Are you talking about some make rule like 'dt_bindings_check' or part of 'dtb_check'? > > 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. > > dts files are too far gone to define any rule in checkpatch. Binding > files are not because there's really only 2 variations since all the > existing bindings are just kernel default license (GPL-2.0-only). > > > 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 > > For special cases, ask your lawyer... > > > ''' > > > > And handle all exceptions during LKML review, as Krzysztof suggested > > before. > > > > What do you think about above approaches? > > I laid out what the options are already. > I don't get your position, sorry. By adding GPL-2.0 OR .* pattern rule we are just checking GPL licensed of bindings, it's not enough. Different licenses in the *new* yaml schemas and *new* bindings are bad idea, aren't? If we introduce strict rules (read as 'suggestion') to checkpatch, the world will be better. Because new bindings will be aligned with schemas by license. The dual license, incompatible licenses with dts files are already existed, it doens't solve this problem. But as a next step we can expand dtb_check make rule and analyse dts license issues in preprocessor execution time. > > > > Krzysztof, please share your opinion as well. > > > > For sure, current checkpatch behaviour is wrong, it doesn't help to > > understand all mentioned interlacements. > > checkpatch is suggestions or possible issues in many cases. It's not > absolute nor completely accurate to begin with. > > Rob
Rob, Krzysztof, Andrew, Sorry for one more ping. I don't understand the status for this patchset. If you don't mind, let's discuss solution which will be okay for all maintainers. What we have for now: - Krzysztof acked v3 patchset - Andrew applied it to mm-unstable - Rob didn't agree with the current approach. I would be grateful if you can share your opinion. And we will be on the same page. On Wed, Mar 22, 2023 at 05:56:20PM +0300, Dmitry Rokosov wrote: > On Wed, Mar 22, 2023 at 09:36:40AM -0500, Rob Herring wrote: > > On Wed, Mar 22, 2023 at 9:15 AM Dmitry Rokosov <ddrokosov@sberdevices.ru> wrote: > > > > > > On Wed, Mar 22, 2023 at 08:40:21AM -0500, Rob Herring wrote: > > > > On Wed, Mar 22, 2023 at 5:26 AM Dmitry Rokosov <ddrokosov@sberdevices.ru> 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. > > > > No, most often they are copied from something else. Any tool can't > > know what the source (and its license) is and actively telling users > > to do something different is bad. > > > > I imagine writing the schema is the last thing because upstream > > requires it and downstream doesn't. > > > > Maybe checkpatch strict rules would allow developers to double confirm > licenses in the copied files... > > > > 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. > > > > I'm sure there are combinations of dts files and headers with > > incompatible licenses. A tool to check that would be nice. Just need > > to generate a list of all input files perhaps with the preprocessor > > dependency generation and then get the licenses for all the files. > > > > Are you talking about some make rule like 'dt_bindings_check' or part of > 'dtb_check'? > > > > 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. > > > > dts files are too far gone to define any rule in checkpatch. Binding > > files are not because there's really only 2 variations since all the > > existing bindings are just kernel default license (GPL-2.0-only). > > > > > 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 > > > > For special cases, ask your lawyer... > > > > > ''' > > > > > > And handle all exceptions during LKML review, as Krzysztof suggested > > > before. > > > > > > What do you think about above approaches? > > > > I laid out what the options are already. > > > > I don't get your position, sorry. By adding GPL-2.0 OR .* pattern rule > we are just checking GPL licensed of bindings, it's not enough. > > Different licenses in the *new* yaml schemas and *new* bindings are bad > idea, aren't? > > If we introduce strict rules (read as 'suggestion') to checkpatch, the > world will be better. Because new bindings will be aligned with schemas > by license. The dual license, incompatible licenses with dts files are > already existed, it doens't solve this problem. But as a next step we > can expand dtb_check make rule and analyse dts license issues in > preprocessor execution time. > > > > > > > Krzysztof, please share your opinion as well. > > > > > > For sure, current checkpatch behaviour is wrong, it doesn't help to > > > understand all mentioned interlacements. > > > > checkpatch is suggestions or possible issues in many cases. It's not > > absolute nor completely accurate to begin with. > > > > Rob > > -- > Thank you, > Dmitry
diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl index 78cc595b98ce..65db3d2518a7 100755 --- a/scripts/checkpatch.pl +++ b/scripts/checkpatch.pl @@ -3709,8 +3709,9 @@ sub process { WARN("SPDX_LICENSE_TAG", "'$spdx_license' is not supported in LICENSES/...\n" . $herecurr); } - if ($realfile =~ m@^Documentation/devicetree/bindings/@ && - not $spdx_license =~ /GPL-2\.0.*BSD-2-Clause/) { + if (($realfile =~ m@^Documentation/devicetree/bindings/@ || + $realfile =~ m@^include/dt-bindings/@) && + $spdx_license !~ /GPL-2\.0(?:-only|-or-later|\+)? (?:OR|or) BSD-2-Clause/) { my $msg_level = \&WARN; $msg_level = \&CHK if ($file); if (&{$msg_level}("SPDX_LICENSE_TAG",