Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3627393ybi; Fri, 5 Jul 2019 10:44:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqwwJPuInTOlq8sz6BNbCnh/WYPfmVfdT/sE0GjPbDYtrjrmUVkJ9bPL4sYlE+kd0bj4hmQM X-Received: by 2002:a17:902:2f:: with SMTP id 44mr7110414pla.5.1562348671611; Fri, 05 Jul 2019 10:44:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562348671; cv=none; d=google.com; s=arc-20160816; b=tbT2YrJXkeQ76i0I5e1eLNI90/gKxoZSt6AM10k01rg56225qVjkflIAYa/cZBz9FD OUW2nxJgZGiKIXUnZ7ExiR8yRr/fDlHOuyRJ7RWD89rEVSVqOqAtISkrdOv/7P/urm9X oqHIINeS7JKyYkNf94ziWaqNlzDziGsj8NoOk0fDvxLNWQF3UKiorpmwZaXNJK+Oqx6E 5I8B1w6ACWTzW/Fz7Edf0SNl7QAS07ZTSbCICf/7cPe5XKzFKDpSSTluaUTXXJk0Ytwh gU455nUTiXem8CU605h//p7Z4M3Vvcxa3n7ZSEnaxJWJDSpLg5BKjbgRGkbAaRrcbxct xTZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=OZxT04gFLaytkGm/DzGBYCBCGqk5NGXSEVy2rS3EiwI=; b=vyceqjiun5ykovW83cFk5SvAvS/kZtcxN6IKF14dy5kh81KYw1wUbX+bGhnN973ZtP d9QcLjzgFCdWKupiE6RZX5ks9VLrZ7i2qBiAQW43QFejJAukCR7qdAWZheoeVlmqF58B 84CAT7V39Ss574py+tO8fSDzkFRQBuNJ3S59Z9NFD0CnM1WvfUWL//cUzD0HEq0cdcFv OBumIxVmWwFX2niHTHDeOJPUrylnlaaubCN59U+XTezDNq/wKWPDK2fSn+SKfA1zwVpZ OwDt7l5o3yP7bqccLcR8GuCnQp8IGviOZZiTyiOVYjfA6yWbidyUffdq0D+gF2QuYGa/ f70g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cL1wObRo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y21si9263516plp.332.2019.07.05.10.44.15; Fri, 05 Jul 2019 10:44:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cL1wObRo; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727665AbfGERHn (ORCPT + 99 others); Fri, 5 Jul 2019 13:07:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:49582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727459AbfGERHn (ORCPT ); Fri, 5 Jul 2019 13:07:43 -0400 Received: from mail-qt1-f180.google.com (mail-qt1-f180.google.com [209.85.160.180]) (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 7438E2184C; Fri, 5 Jul 2019 17:07:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1562346462; bh=OZxT04gFLaytkGm/DzGBYCBCGqk5NGXSEVy2rS3EiwI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=cL1wObRoQenEIXsCCKDarEPhPCAIkA44+i28Z4Iwx050I/EAAm3u/7u7xuHLnObdI ZU+TI07MpefFoZRe1d4xMc5kGx6FJr1p8BDAYGn46woqrkYBlEC85vbgHFzMHO8Vok NYLz4M8AaxPGX0zlpAmVfjD/GXa4Py27Czdb4BiI= Received: by mail-qt1-f180.google.com with SMTP id l9so3548318qtu.6; Fri, 05 Jul 2019 10:07:42 -0700 (PDT) X-Gm-Message-State: APjAAAUtqXHCK9RNtUBzCxP/6rBRdZ182qN9hCSGHTblXkusGrDnhY0/ +jFwyrrkz6uEezXyMZ14QHbj0JULIgCs77h5Ig== X-Received: by 2002:ac8:36b9:: with SMTP id a54mr3646411qtc.300.1562346461718; Fri, 05 Jul 2019 10:07:41 -0700 (PDT) MIME-Version: 1.0 References: <20190703193724.246854-1-mka@chromium.org> <20190703213327.GH18473@lunn.ch> <20190705162926.GM18473@lunn.ch> In-Reply-To: <20190705162926.GM18473@lunn.ch> From: Rob Herring Date: Fri, 5 Jul 2019 11:07:29 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/7] dt-bindings: net: Add bindings for Realtek PHYs To: Andrew Lunn Cc: Matthias Kaehlcke , "David S . Miller" , Mark Rutland , Florian Fainelli , Heiner Kallweit , netdev , devicetree@vger.kernel.org, "linux-kernel@vger.kernel.org" , Douglas Anderson 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 Fri, Jul 5, 2019 at 10:29 AM Andrew Lunn wrote: > > On Fri, Jul 05, 2019 at 10:17:16AM -0600, Rob Herring wrote: > > On Wed, Jul 3, 2019 at 3:33 PM Andrew Lunn wrote: > > > > > > > I think if we're going to have custom properties for phys, we should > > > > have a compatible string to at least validate whether the custom > > > > properties are even valid for the node. > > > > > > Hi Rob > > > > > > What happens with other enumerable busses where a compatible string is > > > not used? > > > > We usually have a compatible. USB and PCI both do. Sometimes it is a > > defined format based on VID/PID. > > Hi Rob > > Is it defined what to do with this compatible? Just totally ignore it? > Validate it against the hardware and warning if it is wrong? Force > load the driver that implements the compatible, even thought bus > enumeration says it is the wrong driver? The short answer is either the problems get fixed or if DTs exist and need to be supported which are wrong then the OS deals with the problem to make things work as desired (see PowerMac code). If the ethernet phy subsystem wants to ignore compatible, that is totally fine. > > > The Ethernet PHY subsystem will ignore the compatible string and load > > > the driver which fits the enumeration data. Using the compatible > > > string only to get the right YAML validator seems wrong. I would > > > prefer adding some other property with a clear name indicates its is > > > selecting the validator, and has nothing to do with loading the > > > correct driver. And it can then be used as well for USB and PCI > > > devices etc. > > > > Just because Linux happens to not use compatible really has nothing to > > do with whether or not the nodes should have a compatible. What does > > FreeBSD want? U-boot? > > > > I don't follow how adding a validate property would help. It would > > need to be 'validate-node-as-a-realtek-phy'. > > This makes it clear it is all about validating the DT, and nothing > about the actual running hardware. What i don't really want to see is > the poorly defined situation that DT contains a compatible string, but > we have no idea what it is actually used for. See the question above. What's poorly defined are the current bindings, type definitions of properties, and what properties are valid or not in specific nodes. If we only had to better define the rules around compatible use or mismatches, we'd be a lot better off. I'm not going to add properties solely for validation when we already have a well defined, 15 year+ pattern for defining what a node contains that practically every other subsystem and node uses. I guess we just won't worry about validating ethernet phy nodes beyond some basic checks. Rob