Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp481976rwb; Thu, 18 Aug 2022 07:12:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR4aQ+cPTXvp4NIKTouv5EJpE6xkCyKp16VDQ3+D0SRaZwoKw5FPTI3BCjYwJRI58V8B+IZK X-Received: by 2002:a17:902:e3d5:b0:172:a78f:dbc with SMTP id r21-20020a170902e3d500b00172a78f0dbcmr2742532ple.144.1660831926486; Thu, 18 Aug 2022 07:12:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660831926; cv=none; d=google.com; s=arc-20160816; b=w0FD13iouVYn9qkABYamzrYHyF3mm0RWnm71eHohLkBCkRNwoTJtorDeJy0cUuiLBY xna8vFjT14ZZ6T3EV9f2lR+NVxw0eersaywLdn8i3kAf0touEHs/fYvALZeyjNGleVlc qT8PYxIkAJL+INmiwkEkieRHJxVc7t7GnBcMCf8Pr+prPAxEY16Uy5FsXx1O5KdqHylQ iqDUduMKiLCUVSCMn3omXbbPzJwFhEab1vnQPiyVJbkw4E3aFTjSx6dxxRSUZUbuG+ah kCmGbZY9K9uS03HbxfSKYfPmm7LkfoEHBsiZUxGJQ7yTel7OSeBcwKJQ7jTGIjTRvcvE /oOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=/fleTIpnS9IEBTbF8wo3ueeoCXUGjNkQO4k9xiqRrj4=; b=SD/lNaiyt9HOoZWFyhnyVUbaCYVBIdv7SLjQIOTy8WrR8G4YnhPK8VnJ6J16Rn9vkC 5ZUn4bogWoshgkPcsz9ikDG4q29U9sputt/QysBGGIMollDM7YZC+4a405NnE2jH6hlE bKwZygDfUD1JpA5yt/9cdqdDZ3/OZz4Trd0IXT/iDlhI0gh1RY0EX7LxL9F7FUtOPBpl ckFYCJqCDsios88A7eBas/FDPssNV7oRhuKNtCrOukmCCw67QQN2nN46NSAEEIyfUxKS aOQyzBs+bPK9VEuhpbRlXweI8xzoqxLabXg5zy1Gp1fwy6vDr8oi9JSqwCloqAvTx/Ry 5rUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WXgDg4S0; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pj4-20020a17090b4f4400b001f0d1914b69si1673929pjb.9.2022.08.18.07.11.54; Thu, 18 Aug 2022 07:12:06 -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=@linaro.org header.s=google header.b=WXgDg4S0; 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=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245591AbiHROEi (ORCPT + 99 others); Thu, 18 Aug 2022 10:04:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47912 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245574AbiHROE1 (ORCPT ); Thu, 18 Aug 2022 10:04:27 -0400 Received: from mail-lf1-x134.google.com (mail-lf1-x134.google.com [IPv6:2a00:1450:4864:20::134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C466165818 for ; Thu, 18 Aug 2022 07:04:25 -0700 (PDT) Received: by mail-lf1-x134.google.com with SMTP id v2so2259503lfi.6 for ; Thu, 18 Aug 2022 07:04:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc; bh=/fleTIpnS9IEBTbF8wo3ueeoCXUGjNkQO4k9xiqRrj4=; b=WXgDg4S099HTx4GYgF7438X6p5+shS7CVHR1tjTv5vT25xR45B6IpZ9jhDZz24MFIE QYgcE82wPnA6kp/yoF5KRHFg2R1O1rA0Hj3teQ/VwW6ecJCoTpgo1t1hwWTLfUqm7isa wPhcprIQQyMzd5VP3nJthYZeUSeel/FnDfuu8sVUdrc9ivIl0o9G/FLaK4i83CbCUR95 dPmZq615cmnqNWTE8xGMASQ5tJP/6xGoFpVrz611Tyy0YuQz/kvNwF22eEsEO7mWuqll UDQIMCwYqn7bOluibttIYU6Mn5Cei8pA13Vu99//76sJQFaN5oyc3DG6XTjq0FOjoFFJ /Uvw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc; bh=/fleTIpnS9IEBTbF8wo3ueeoCXUGjNkQO4k9xiqRrj4=; b=KwAwjtrJFtmsEM1+/PlGLhzv1sW5VXYps6BdXyoi2ZdGhrog89WkQ+QLn3CCG9VZvB XuAKjcVGLtUmoBWolf5i1DAAssiKJELdNmhdsqR4ZZoIcB9N9C6NYH3PX+46qOuY3mv3 8Qg6VHwh4Hbkrc6mcHHqShyxJUsd5Q+6ZLG+Y4u468dTEzQBlW8Ajra+1UuKlmTWjiBU H9eT7cHtNzIOOorzn+Fr9PJ55oHl1BwRU4i3yd/lfgIAvfyEOGu/jH6rvQO7sWYOq126 EihcuWs6BCQWllE/XQPYZKBsajEdGKo8nc0VV5Ri3aKKhZLhGrOmAazgDxhsJjo6JUeU ujVg== X-Gm-Message-State: ACgBeo1e7CjysNSmcDRrXtMrHe8D/ncZVqp4+fGr3MLu1OgAYVSyg8+h JqIWtaxnb2h6WJAJiMoL+3XifQ== X-Received: by 2002:a05:6512:159b:b0:492:c1c0:5aab with SMTP id bp27-20020a056512159b00b00492c1c05aabmr477299lfb.523.1660831463816; Thu, 18 Aug 2022 07:04:23 -0700 (PDT) Received: from ?IPV6:2001:14bb:ae:539c:53ab:2635:d4f2:d6d5? (d15l54z9nf469l8226z-4.rev.dnainternet.fi. [2001:14bb:ae:539c:53ab:2635:d4f2:d6d5]) by smtp.gmail.com with ESMTPSA id a2-20020a05651c030200b002619257da21sm241529ljp.118.2022.08.18.07.04.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 18 Aug 2022 07:04:23 -0700 (PDT) Message-ID: <00614b8f-0fdd-3d7e-0153-3846be5bb645@linaro.org> Date: Thu, 18 Aug 2022 17:04:20 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH 1/3] dt-bings: net: fsl,fec: update compatible item Content-Language: en-US To: Shawn Guo Cc: Wei Fang , davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, s.hauer@pengutronix.de, netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, peng.fan@nxp.com, ping.bai@nxp.com, sudeep.holla@arm.com, linux-arm-kernel@lists.infradead.org, aisheng.dong@nxp.com References: <20220704101056.24821-1-wei.fang@nxp.com> <20220704101056.24821-2-wei.fang@nxp.com> <20220818013344.GE149610@dragon> <20220818092257.GF149610@dragon> <20220818135727.GG149610@dragon> From: Krzysztof Kozlowski In-Reply-To: <20220818135727.GG149610@dragon> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,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 18/08/2022 16:57, Shawn Guo wrote: > On Thu, Aug 18, 2022 at 12:46:33PM +0300, Krzysztof Kozlowski wrote: >> On 18/08/2022 12:22, Shawn Guo wrote: >>> On Thu, Aug 18, 2022 at 10:51:02AM +0300, Krzysztof Kozlowski wrote: >>>> On 18/08/2022 04:33, Shawn Guo wrote: >>>>> On Mon, Jul 04, 2022 at 11:12:09AM +0200, Krzysztof Kozlowski wrote: >>>>>>> diff --git a/Documentation/devicetree/bindings/net/fsl,fec.yaml b/Documentation/devicetree/bindings/net/fsl,fec.yaml >>>>>>> index daa2f79a294f..6642c246951b 100644 >>>>>>> --- a/Documentation/devicetree/bindings/net/fsl,fec.yaml >>>>>>> +++ b/Documentation/devicetree/bindings/net/fsl,fec.yaml >>>>>>> @@ -40,6 +40,10 @@ properties: >>>>>>> - enum: >>>>>>> - fsl,imx7d-fec >>>>>>> - const: fsl,imx6sx-fec >>>>>>> + - items: >>>>>>> + - enum: >>>>>>> + - fsl,imx8ulp-fec >>>>>>> + - const: fsl,imx6ul-fec >>>>>> >>>>>> This is wrong. fsl,imx6ul-fec has to be followed by fsl,imx6q-fec. I >>>>>> think someone made similar mistakes earlier so this is a mess. >>>>> >>>>> Hmm, not sure I follow this. Supposing we want to have the following >>>>> compatible for i.MX8ULP FEC, why do we have to have "fsl,imx6q-fec" >>>>> here? >>>>> >>>>> fec: ethernet@29950000 { >>>>> compatible = "fsl,imx8ulp-fec", "fsl,imx6ul-fec"; >>>>> ... >>>>> }; >>>> >>>> Because a bit earlier this bindings is saying that fsl,imx6ul-fec must >>>> be followed by fsl,imx6q-fec. >>> >>> The FEC driver OF match table suggests that fsl,imx6ul-fec and fsl,imx6q-fec >>> are not really compatible. >>> >>> static const struct of_device_id fec_dt_ids[] = { >>> { .compatible = "fsl,imx25-fec", .data = &fec_devtype[IMX25_FEC], }, >>> { .compatible = "fsl,imx27-fec", .data = &fec_devtype[IMX27_FEC], }, >>> { .compatible = "fsl,imx28-fec", .data = &fec_devtype[IMX28_FEC], }, >>> { .compatible = "fsl,imx6q-fec", .data = &fec_devtype[IMX6Q_FEC], }, >>> { .compatible = "fsl,mvf600-fec", .data = &fec_devtype[MVF600_FEC], }, >>> { .compatible = "fsl,imx6sx-fec", .data = &fec_devtype[IMX6SX_FEC], }, >>> { .compatible = "fsl,imx6ul-fec", .data = &fec_devtype[IMX6UL_FEC], }, >> >> I don't see here any incompatibility. Binding driver with different >> driver data is not a proof of incompatible devices. > > To me, different driver data is a good sign of incompatibility. It > mostly means that software needs to program the hardware block > differently. Any device being 100% compatible with old one and having additional features will have different driver data... so no, it's not a proof. There are many of such examples and we call them compatible, because the device could operate when bound by the fallback compatible. If this is the case here - how do I know? I raised and the answer was affirmative... > > >> Additionally, the >> binding describes the hardware, not the driver. >> >>> { .compatible = "fsl,imx8mq-fec", .data = &fec_devtype[IMX8MQ_FEC], }, >>> { .compatible = "fsl,imx8qm-fec", .data = &fec_devtype[IMX8QM_FEC], }, >>> { /* sentinel */ } >>> }; >>> MODULE_DEVICE_TABLE(of, fec_dt_ids); >>> >>> Should we fix the binding doc? >> >> Maybe, I don't know. The binding describes the hardware, so based on it >> the devices are compatible. Changing this, except ABI impact, would be >> possible with proper reason, but not based on Linux driver code. > > Well, if Linux driver code is written in the way that hardware requires, > I guess that's just based on hardware characteristics. > > To me, having a device compatible to two devices that require different > programming model is unnecessary and confusing. It's the first time anyone mentions here the programming model is different... If it is different, the devices are likely not compatible. However when I raised this issue last time, there were no concerns with calling them all compatible. Therefore I wonder if the folks working on this driver actually know what's there... I don't know, I gave recommendations based on what is described in the binding and expect the engineer to come with that knowledge. Best regards, Krzysztof