From mboxrd@z Thu Jan 1 00:00:00 1970 From: Rob Herring Subject: Re: [PATCH v10 4/5] dt-bindings: arm-smmu: add binding for Tegra194 SMMU Date: Tue, 14 Jul 2020 08:22:43 -0600 Message-ID: References: <20200708050017.31563-1-vdumpa@nvidia.com> <20200708050017.31563-5-vdumpa@nvidia.com> <20200709201348.GA808454@bogus> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: In-Reply-To: Sender: linux-tegra-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org To: Robin Murphy Cc: Krishna Reddy , "joro-zLv9SwRftAIdnm+yROfE0A@public.gmane.org" , "will-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org" , Thierry Reding , Jonathan Hunter , "devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , "linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , "linux-tegra-u79uwXL29TY76Z2rM5mHXA@public.gmane.org" , Yu-Huan Hsu , Sachin Nikam , Pritesh Raithatha , Timo Alho , Bitan Biswas , Mikko Perttunen , Nicolin Chen List-Id: linux-tegra@vger.kernel.org On Mon, Jul 13, 2020 at 8:10 AM Robin Murphy wrote: > > On 2020-07-10 21:29, Krishna Reddy wrote: > > Thanks Rob. One question on setting "minItems: ". Please see below. > > > >>> +allOf: > >>> + - if: > >>> + properties: > >>> + compatible: > >>> + contains: > >>> + enum: > >>> + - nvidia,tegra194-smmu > >>> + then: > >>> + properties: > >>> + reg: > >>> + minItems: 2 > >>> + maxItems: 2 > > > >> This doesn't work. The main part of the schema already said there's only > >> 1 reg region. This part is ANDed with that, not an override. You need to add an else clause with 'maxItems: 1' and change the base schema to > >> {minItems: 1, maxItems: 2}. > > > > As the earlier version of base schema doesn't have "minItems: " set, should it be set to 0 for backward compatibility? Or can it just be omitted setting in base schema as before? > > We've always needed at least 1 "reg" specifier in practice, so I don't > think being backwards-compatible with broken DTs is a concern :) 'minItems: 0' would be a boolean (e.g. "reg;") and I'm not sure that's even really valid json-schema. What you'd want here is 'reg' not present (i.e. not in 'required'). Rob From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E1326C433EB for ; Tue, 14 Jul 2020 14:22:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BFB6E2250F for ; Tue, 14 Jul 2020 14:22:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594736578; bh=rd5OIlYx3b2juzE6QiM4oAmdyVKpLPJAqVO/kNES7eg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=qsw12tUgImcz7XRSwCaSPmLFQX2g1OvHqokzzATKK+5LUk4TFlxjLprwUkWnZCuR/ Rby2Lh7//1OAKkuwKm2fM37AY8P+dWw4qVvNgsPbfEi4kJ5+Ko1JV24VZmMCFkXuPE hrCaGTHN1ggA375nwP9aNMkZKXdh4Yl7suubypHE= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728651AbgGNOW5 (ORCPT ); Tue, 14 Jul 2020 10:22:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:48240 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726187AbgGNOW5 (ORCPT ); Tue, 14 Jul 2020 10:22:57 -0400 Received: from mail-oi1-f173.google.com (mail-oi1-f173.google.com [209.85.167.173]) (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 18E2E22365; Tue, 14 Jul 2020 14:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594736576; bh=rd5OIlYx3b2juzE6QiM4oAmdyVKpLPJAqVO/kNES7eg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PmB0EueNtgPHX2PIZw5HyzxDwaxVRzOwkSePCRZQxkefXAoStuJY3G5ocmAJHX+la yemTL8A5jKBcSxloLAbA443fa5XKv/kgtrnrPv0eGK30vnwYtNcS57d5TYFzXRwpMk 4ojoqTORPROKHmG4o+HWInEO4xTKdJmcT20nSsSQ= Received: by mail-oi1-f173.google.com with SMTP id l63so14008939oih.13; Tue, 14 Jul 2020 07:22:56 -0700 (PDT) X-Gm-Message-State: AOAM5308eTQBeyuzycoIcssq26o1jkt3dr22JRo7TSk4bfUp0IPUyqz8 P1SALUiL8rCHP7O1klmvTzdHAneWOv7NZSuGNQ== X-Google-Smtp-Source: ABdhPJy6ZkarJ5J32IIpIQEGE/Wjp/cSwpg14EGOzfNSeRzwriu/1T8mkB7ZW+5hPoMCr1+/ya+Nb4Ie4kq7OvbrRc8= X-Received: by 2002:aca:bb82:: with SMTP id l124mr3965827oif.106.1594736575478; Tue, 14 Jul 2020 07:22:55 -0700 (PDT) MIME-Version: 1.0 References: <20200708050017.31563-1-vdumpa@nvidia.com> <20200708050017.31563-5-vdumpa@nvidia.com> <20200709201348.GA808454@bogus> In-Reply-To: From: Rob Herring Date: Tue, 14 Jul 2020 08:22:43 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v10 4/5] dt-bindings: arm-smmu: add binding for Tegra194 SMMU To: Robin Murphy Cc: Krishna Reddy , "joro@8bytes.org" , "will@kernel.org" , Thierry Reding , Jonathan Hunter , "devicetree@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "iommu@lists.linux-foundation.org" , "linux-kernel@vger.kernel.org" , "linux-tegra@vger.kernel.org" , Yu-Huan Hsu , Sachin Nikam , Pritesh Raithatha , Timo Alho , Bitan Biswas , Mikko Perttunen , Nicolin Chen , Bryan Huntsman , "nicoleotsuka@gmail.com" 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 On Mon, Jul 13, 2020 at 8:10 AM Robin Murphy wrote: > > On 2020-07-10 21:29, Krishna Reddy wrote: > > Thanks Rob. One question on setting "minItems: ". Please see below. > > > >>> +allOf: > >>> + - if: > >>> + properties: > >>> + compatible: > >>> + contains: > >>> + enum: > >>> + - nvidia,tegra194-smmu > >>> + then: > >>> + properties: > >>> + reg: > >>> + minItems: 2 > >>> + maxItems: 2 > > > >> This doesn't work. The main part of the schema already said there's only > >> 1 reg region. This part is ANDed with that, not an override. You need to add an else clause with 'maxItems: 1' and change the base schema to > >> {minItems: 1, maxItems: 2}. > > > > As the earlier version of base schema doesn't have "minItems: " set, should it be set to 0 for backward compatibility? Or can it just be omitted setting in base schema as before? > > We've always needed at least 1 "reg" specifier in practice, so I don't > think being backwards-compatible with broken DTs is a concern :) 'minItems: 0' would be a boolean (e.g. "reg;") and I'm not sure that's even really valid json-schema. What you'd want here is 'reg' not present (i.e. not in 'required'). Rob From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4EF4C433E2 for ; Tue, 14 Jul 2020 14:22:59 +0000 (UTC) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6B5F522515 for ; Tue, 14 Jul 2020 14:22:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="PmB0EueN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6B5F522515 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 449AF204F0; Tue, 14 Jul 2020 14:22:59 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id M5BjEP0XRgWo; Tue, 14 Jul 2020 14:22:57 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by silver.osuosl.org (Postfix) with ESMTP id D9E8C24804; Tue, 14 Jul 2020 14:22:57 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id BCC69C0888; Tue, 14 Jul 2020 14:22:57 +0000 (UTC) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by lists.linuxfoundation.org (Postfix) with ESMTP id DC744C0733 for ; Tue, 14 Jul 2020 14:22:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id C924688423 for ; Tue, 14 Jul 2020 14:22:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id OYsHQcAN4zxO for ; Tue, 14 Jul 2020 14:22:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 5F12D88410 for ; Tue, 14 Jul 2020 14:22:56 +0000 (UTC) Received: from mail-oi1-f170.google.com (mail-oi1-f170.google.com [209.85.167.170]) (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 23A1B22519 for ; Tue, 14 Jul 2020 14:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594736576; bh=rd5OIlYx3b2juzE6QiM4oAmdyVKpLPJAqVO/kNES7eg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PmB0EueNtgPHX2PIZw5HyzxDwaxVRzOwkSePCRZQxkefXAoStuJY3G5ocmAJHX+la yemTL8A5jKBcSxloLAbA443fa5XKv/kgtrnrPv0eGK30vnwYtNcS57d5TYFzXRwpMk 4ojoqTORPROKHmG4o+HWInEO4xTKdJmcT20nSsSQ= Received: by mail-oi1-f170.google.com with SMTP id 12so14050700oir.4 for ; Tue, 14 Jul 2020 07:22:56 -0700 (PDT) X-Gm-Message-State: AOAM531wxvgZ/dXjdgnk8HERV0aurI0Kqvw+kaMbZmRv96jsSBWlQBc1 dT3h5DYXowxjMYI5ra+JRVTYCOgYI1YQVkN5VQ== X-Google-Smtp-Source: ABdhPJy6ZkarJ5J32IIpIQEGE/Wjp/cSwpg14EGOzfNSeRzwriu/1T8mkB7ZW+5hPoMCr1+/ya+Nb4Ie4kq7OvbrRc8= X-Received: by 2002:aca:bb82:: with SMTP id l124mr3965827oif.106.1594736575478; Tue, 14 Jul 2020 07:22:55 -0700 (PDT) MIME-Version: 1.0 References: <20200708050017.31563-1-vdumpa@nvidia.com> <20200708050017.31563-5-vdumpa@nvidia.com> <20200709201348.GA808454@bogus> In-Reply-To: From: Rob Herring Date: Tue, 14 Jul 2020 08:22:43 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v10 4/5] dt-bindings: arm-smmu: add binding for Tegra194 SMMU To: Robin Murphy Cc: Sachin Nikam , "devicetree@vger.kernel.org" , Mikko Perttunen , Pritesh Raithatha , Bryan Huntsman , "linux-kernel@vger.kernel.org" , "iommu@lists.linux-foundation.org" , Jonathan Hunter , Timo Alho , Nicolin Chen , "linux-tegra@vger.kernel.org" , Yu-Huan Hsu , Thierry Reding , "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" , Bitan Biswas X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" On Mon, Jul 13, 2020 at 8:10 AM Robin Murphy wrote: > > On 2020-07-10 21:29, Krishna Reddy wrote: > > Thanks Rob. One question on setting "minItems: ". Please see below. > > > >>> +allOf: > >>> + - if: > >>> + properties: > >>> + compatible: > >>> + contains: > >>> + enum: > >>> + - nvidia,tegra194-smmu > >>> + then: > >>> + properties: > >>> + reg: > >>> + minItems: 2 > >>> + maxItems: 2 > > > >> This doesn't work. The main part of the schema already said there's only > >> 1 reg region. This part is ANDed with that, not an override. You need to add an else clause with 'maxItems: 1' and change the base schema to > >> {minItems: 1, maxItems: 2}. > > > > As the earlier version of base schema doesn't have "minItems: " set, should it be set to 0 for backward compatibility? Or can it just be omitted setting in base schema as before? > > We've always needed at least 1 "reg" specifier in practice, so I don't > think being backwards-compatible with broken DTs is a concern :) 'minItems: 0' would be a boolean (e.g. "reg;") and I'm not sure that's even really valid json-schema. What you'd want here is 'reg' not present (i.e. not in 'required'). Rob _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 972D7C433DF for ; Tue, 14 Jul 2020 14:24:26 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 62C2C22365 for ; Tue, 14 Jul 2020 14:24:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lRogr+CM"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="PmB0EueN" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 62C2C22365 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=QGzXPUtHVl06CwBsXUmw1uIj0CHqNn/HVtBSFdXLTYM=; b=lRogr+CMygCtW8A8SIbylPOew 9oZNX1IGRUMA60OnqTSQluYiuW1oljH2k0ANntaoqXrwEnXdFZM+J+aOjegOrJl3TNgG1CwABSd0i r+K2ll752Lfy9op6V/yGIHC1dlHGupxSC4xUupD/37YA/S5ZssAWI8IGSaXazyshC2xYi1/DELlDd x8fn0ZLvZDPAlKRI/Iz3gGH2xCZtBnAN07aO9juXudoG5U3J1/ktO8BCzpUw2JwVR9ZSpOvJCnEIm HzHUCnCmpqB6hR84STBbOnv38cN+A0qFvnX6rIfqFRjM1s3B2Tf74ICWCvPBRqv5QOQ3gZo5ffiNG Xzt5twF5w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvLpj-0007xo-OP; Tue, 14 Jul 2020 14:22:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jvLph-0007xA-3j for linux-arm-kernel@lists.infradead.org; Tue, 14 Jul 2020 14:22:57 +0000 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (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 1B89522518 for ; Tue, 14 Jul 2020 14:22:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594736576; bh=rd5OIlYx3b2juzE6QiM4oAmdyVKpLPJAqVO/kNES7eg=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=PmB0EueNtgPHX2PIZw5HyzxDwaxVRzOwkSePCRZQxkefXAoStuJY3G5ocmAJHX+la yemTL8A5jKBcSxloLAbA443fa5XKv/kgtrnrPv0eGK30vnwYtNcS57d5TYFzXRwpMk 4ojoqTORPROKHmG4o+HWInEO4xTKdJmcT20nSsSQ= Received: by mail-oi1-f177.google.com with SMTP id k22so14089225oib.0 for ; Tue, 14 Jul 2020 07:22:56 -0700 (PDT) X-Gm-Message-State: AOAM533VDfxfgwiVDg4h7osKNyzcqPcOYlb+QZkoU+CeYKrkuxXIsB2T XQqqH6jON0CTFPr8G8ccbCt1YuVwd0wrm7WT2Q== X-Google-Smtp-Source: ABdhPJy6ZkarJ5J32IIpIQEGE/Wjp/cSwpg14EGOzfNSeRzwriu/1T8mkB7ZW+5hPoMCr1+/ya+Nb4Ie4kq7OvbrRc8= X-Received: by 2002:aca:bb82:: with SMTP id l124mr3965827oif.106.1594736575478; Tue, 14 Jul 2020 07:22:55 -0700 (PDT) MIME-Version: 1.0 References: <20200708050017.31563-1-vdumpa@nvidia.com> <20200708050017.31563-5-vdumpa@nvidia.com> <20200709201348.GA808454@bogus> In-Reply-To: From: Rob Herring Date: Tue, 14 Jul 2020 08:22:43 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v10 4/5] dt-bindings: arm-smmu: add binding for Tegra194 SMMU To: Robin Murphy X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200714_102257_272179_09A1F113 X-CRM114-Status: GOOD ( 14.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sachin Nikam , "devicetree@vger.kernel.org" , "nicoleotsuka@gmail.com" , Mikko Perttunen , Pritesh Raithatha , Bryan Huntsman , "linux-kernel@vger.kernel.org" , "joro@8bytes.org" , "iommu@lists.linux-foundation.org" , Jonathan Hunter , Timo Alho , Nicolin Chen , "linux-tegra@vger.kernel.org" , Yu-Huan Hsu , Thierry Reding , "will@kernel.org" , "linux-arm-kernel@lists.infradead.org" , Bitan Biswas Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jul 13, 2020 at 8:10 AM Robin Murphy wrote: > > On 2020-07-10 21:29, Krishna Reddy wrote: > > Thanks Rob. One question on setting "minItems: ". Please see below. > > > >>> +allOf: > >>> + - if: > >>> + properties: > >>> + compatible: > >>> + contains: > >>> + enum: > >>> + - nvidia,tegra194-smmu > >>> + then: > >>> + properties: > >>> + reg: > >>> + minItems: 2 > >>> + maxItems: 2 > > > >> This doesn't work. The main part of the schema already said there's only > >> 1 reg region. This part is ANDed with that, not an override. You need to add an else clause with 'maxItems: 1' and change the base schema to > >> {minItems: 1, maxItems: 2}. > > > > As the earlier version of base schema doesn't have "minItems: " set, should it be set to 0 for backward compatibility? Or can it just be omitted setting in base schema as before? > > We've always needed at least 1 "reg" specifier in practice, so I don't > think being backwards-compatible with broken DTs is a concern :) 'minItems: 0' would be a boolean (e.g. "reg;") and I'm not sure that's even really valid json-schema. What you'd want here is 'reg' not present (i.e. not in 'required'). Rob _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel