Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp2136318pxb; Wed, 9 Feb 2022 11:36:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJzaRyJcsdY3N6Zosj4kPxXpxGlka+jTV8xLLkg5wAgl/ET7nKgfMevd6dTeVXnbyj2KogNT X-Received: by 2002:a17:902:6f10:: with SMTP id w16mr3977335plk.142.1644435410533; Wed, 09 Feb 2022 11:36:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644435410; cv=none; d=google.com; s=arc-20160816; b=r99kFjrA3ZhAUHBm+P8du7fOQuZu1jXE0KZzj/XBUpX/VKerNdnyZr/zMCTGVun+3b 3YkHzNgERgUtJani/ilN2GFreQ2dxGkklcAUhisJBkMgPDfWbIvu70Ex1BKtiEHtCGCT qUS9D/KypBkgeEOCIX5IiQ4hnrQA8c1c0MXyXc93hU3QOePbXMGvBOA5W3GSNzZoEG86 hw1Ni6HHDZgGhetgNjk2xuyWQf1SXHvT1ulRT+rIhnn7JB5Acgi9r2is4otNWYB3NdsG Hc3wg9c8nVCP1rGmRrdTGMaEruSvOO/o2XTcTJlrUAnXestKmO10zVWgXptfMePbX2qs YGdw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=H03g3i6GXgjxVbCGTOuoISvy5cVtGUQ/BV218pz6cW0=; b=q44RWFrQl9waXr/Lirn1nCiEv2DkC1NROzIobbNdb1YzD5FaOoV4CwDryhmBYGV3OB G7PPQegLvoB26WLUQFM0h+NCCgehdvSfh6JaJNkK3Xad9T3sXA44/7EGzifCPw4ZH0nx ATMYx2wvQkurUmQhAGRHIN5Fx5etuvRswdSbA+pDt8/UULnwWrkO7Hgtx/Ke6NEtl6Pr w7dcj02al+IviA0WLa2/+/Hg5gl/A5JB2a0mDc3vuSuHGoZmwuf6ftiw4J7y2WC49l1G HieZ+tLstqP6cAlcwS5mf9vWoo791SNBYzygKxbcDxC6ifc1AtxI7MOxMLIhmbpce0YQ WVlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Fqr6pbmQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id lr15si3315631pjb.115.2022.02.09.11.36.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Feb 2022 11:36:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Fqr6pbmQ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 91FB2C1DC074; Wed, 9 Feb 2022 11:36:17 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241504AbiBIS5P (ORCPT + 99 others); Wed, 9 Feb 2022 13:57:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56874 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241294AbiBIS4s (ORCPT ); Wed, 9 Feb 2022 13:56:48 -0500 Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7742DC050CEE; Wed, 9 Feb 2022 10:55:51 -0800 (PST) Received: by mail-pf1-x434.google.com with SMTP id i21so4385987pfd.13; Wed, 09 Feb 2022 10:55:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=H03g3i6GXgjxVbCGTOuoISvy5cVtGUQ/BV218pz6cW0=; b=Fqr6pbmQTvsoINaecveOiWLRmDJbIKdkGCN9s/+MsQZmK9DUvPh5fMTH3FJxfiGIsw YEcjfXI5seO0643HI4fG0PKFvtHmrQPkM+eiQXY9lzXrsQRwDjJnc9d8cfmZEe8hg5B2 RuTs8XOny+9J1bm8Lr0vZtoZFKuW9eg9xBg4gzaP1q9dzZRoXvoOqylwF7z055BZSdJm ea1qTMl6Xsd2qm4a7C2D95fneNSR1SKXPdjMl7wGAXpIWsUY83MOt1Q9ijyQwJdU2L95 wc1xAyLsSbdExATzCL1MB+h+LXaQnhRN0/egv7TvdeSMRj/pipaQQ9e4LoAVWwPhP4ix HPPg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=H03g3i6GXgjxVbCGTOuoISvy5cVtGUQ/BV218pz6cW0=; b=zkz3w7WNQDBdVYv7d4RZYN/7m/9eo3mZSs/KKo8cGxnxrsDcSAkHioBCqaeQWNyU2C nOsVHmeV4MejvdlBcJo8o4nJFBB1k4ZhzC7wDYBaN6sPkgwxbkrkhZ/4DMdx4g6FnqAw gWmOkpkzzo+714fJZivwApsm3MUKbL4GTULzz4y5hVLthA3G24OaQhMPlJ9D+styn0so /OMFSfQ1uDqSuqUZyrc+6pfTXKwDsAEzXddxs1eTsTXoFQ4HgB6zhNRwTSDNGwWm5K6U 3OsraTfNX4Gl7bJGSFsxPtWhh1NKfLVhNsUy+Szzraao5CCz5USbMijt4VzYDFYBCeU2 j0MQ== X-Gm-Message-State: AOAM530kIU6RDHpr1suyrSVtUfKSNVIvlC7Wzf6a6uOX4ea6VASyhd2e Z8KGj3q11IH2JzY/CbiKvfh/L7rNpyA= X-Received: by 2002:a63:86c8:: with SMTP id x191mr2931827pgd.362.1644432950500; Wed, 09 Feb 2022 10:55:50 -0800 (PST) Received: from [10.67.48.245] ([192.19.223.252]) by smtp.googlemail.com with ESMTPSA id p1sm22045633pfh.98.2022.02.09.10.55.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 09 Feb 2022 10:55:49 -0800 (PST) Subject: Re: [PATCH] dt-bindings: net: dsa: realtek-smi: convert to YAML schema To: Luiz Angelo Daros de Luca , Andrew Lunn Cc: =?UTF-8?Q?Alvin_=c5=a0ipraga?= , Rob Herring , Linus Walleij , "devicetree@vger.kernel.org" , Arnd Bergmann , Olof Johansson , =?UTF-8?B?QXLEsW7DpyDDnE5BTA==?= , Stephen Rothwell , Vivien Didelot , Vladimir Oltean , "David S . Miller" , Jakub Kicinski , "open list:NETWORKING DRIVERS" , open list References: <20211228072645.32341-1-luizluca@gmail.com> <87zgn0gf3k.fsf@bang-olufsen.dk> From: Florian Fainelli Message-ID: Date: Wed, 9 Feb 2022 10:55:43 -0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 2/9/22 10:43 AM, Luiz Angelo Daros de Luca wrote: >>> However, the linux driver today does not care about any of these >>> interruptions but INT_TYPE_LINK_STATUS. So it simply multiplex only >>> this the interruption to each port, in a n-cell map (n being number of >>> ports). >>> I don't know what to describe here as device-tree should be something >>> independent of a particular OS or driver. >> >> You shouldn't need to know what Linux does to figure this out. > > The Linux driver is masquerading all those interruptions into a single > "link status changed". If interrupts property is about what the HW > sends to us, it is a single pin. > > interrupt-controller: > type: object > description: | > This defines an interrupt controller with an IRQ line (typically > a GPIO) that will demultiplex and handle the interrupt from the single > interrupt line coming out of one of the Realtek switch chips. It most > importantly provides link up/down interrupts to the PHY blocks inside > the ASIC. The de-multiplexing is a software construct/operation, in fact, what the GPIO line does is multiplex since the line is used as an output to the next level interrupt controller it connects to. > > properties: > > interrupt-controller: true > > interrupts: > maxItems: 1 > description: > A single IRQ line from the switch, either active LOW or HIGH > > '#address-cells': > const: 0 > > '#interrupt-cells': > const: 1 > > required: > - interrupt-controller > - '#address-cells' > - '#interrupt-cells' > > Now as it is also an interrupt-controller, shouldn't I document what it emits? The interrupt controller emits a single output towards the next level, and you documented that already with these properties. If you want to go ahead and define what the various interrupt bits map to within the switch's interrupt controller, you can do that in an include/dt-bindings/ header file, or you can just open code the numbers. Up to you. > I've just sent the new version and we can discuss it there. > >>> - one interrupt for the switch >>> - the switch is an interrupt-controller >>> - ... and is the interrupt-parent for the phy nodes. >> >> This pattern is pretty common for DSA switches, which have internal >> PHYs. You can see this in the mv88e6xxx binding for example. > > The issue is that those similar devices are still not in yaml format. That does not mean we could not update dsa.yaml to list the 'interrupts', 'interrupt-controller' and '#interrupt-cells' properties and just leave it to the individual YAML bindings to specify the shape and size of those properties so they don't have to repeat them. -- Florian