Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp4048223pxf; Tue, 6 Apr 2021 06:51:40 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCHBSARWv6HPifzykT4VwPeb7YF77MEjPYHEg44VMlwufAeKKAh8acEWImZLCTJ2kOQdW1 X-Received: by 2002:a17:906:8807:: with SMTP id zh7mr34396169ejb.196.1617717100738; Tue, 06 Apr 2021 06:51:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617717100; cv=none; d=google.com; s=arc-20160816; b=lrQmDLkGctxLXqhzqPjl6MVPACzs8A1J97gKcngPoiqK2cDc0QMw+98Nj8L650bJjm n58xgasi7VU204U9CyNrqnNOGYKXesuQgsGMf+zx3gvoiuBw92//ib0YFzFdDGQWyYEw 5FXc46M0+WXYXkJyZXbbTUpaELN5rFlBX5jD8NikbVTRtAuZAQM4T9MOt+eogQZlVnyh ggY8rdkex1rzps1/t1qiC8RT23gBh2fRUcMEjYhjCljanm+Sjn3QplvIfwMa8B6aLRQZ wCd97DN4ma3wxOz1x7TmNpilzVmVu+6vRDil5weP5frwWhrAocVvUZ63yKwoknEJQm7d bgjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=kJu+RAir09xZXFJJN5rDLcWtlXlzrLRmyDqDMaWjtS8=; b=jKB8tzgdtiuU7EN1LU8YwLeSGEaLm1hQPVQRyjfG16uFe7dn6pPzUXrqj4Xqzq7M0j bFXaVtebTOwEIJnzMNgrWvuVqTOJ2SVRhfGLZOHdOuknlDxDpAyNJV49jmaLOJRoHyhX Fnc2UlRu9srqsQ+0ZI1mfTEjqec2h6UwFXxJYg8XBVuVl3jsYtzot7itx6+phLmyMzgP T68auu4iu4qZTSawGh4z5OQNd26mGk7IPDAH0e9Qth5H/SyKu4cqZUm2cxVIqayj2lNa 3ZJygJzqbLe61sOLxZkIt0b/7iYJBVDeFnyMrWlEOmk7IFl8ZBY/jlInJh1bcKge3plB lkSg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dk10si4514711ejb.80.2021.04.06.06.51.16; Tue, 06 Apr 2021 06:51:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244249AbhDFHV2 (ORCPT + 99 others); Tue, 6 Apr 2021 03:21:28 -0400 Received: from hs01.dk-develop.de ([173.249.23.66]:40976 "EHLO hs01.dk-develop.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232943AbhDFHV2 (ORCPT ); Tue, 6 Apr 2021 03:21:28 -0400 Date: Tue, 6 Apr 2021 09:21:15 +0200 From: Danilo Krummrich To: Andrew Lunn Cc: Russell King - ARM Linux admin , davem@davemloft.net, hkallweit1@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, jeremy.linton@arm.com Subject: Re: [PATCH 2/2] net: mdio: support c45 peripherals on c22 busses Message-ID: References: <20210331183524.GV1463@shell.armlinux.org.uk> <2f0ea3c3076466e197ca2977753b07f3@dk-develop.de> <20210401084857.GW1463@shell.armlinux.org.uk> <20210402125858.GB1463@shell.armlinux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 06, 2021 at 12:30:11AM +0200, Danilo Krummrich wrote: > On Mon, Apr 05, 2021 at 09:27:44PM +0200, Andrew Lunn wrote: > > > Now, instead of encoding this information of the bus' capabilities at both > > > places, I'd propose just checking the mii_bus->capabilities field in the > > > mdiobus_c45_*() functions. IMHO this would be a little cleaner, than having two > > > places where this information is stored. What do you think about that? > > > > You will need to review all the MDIO bus drivers to make sure they > > correctly set the capabilities. There is something like 55 using > > of_mdiobus_register() and 45 using mdiobus_register(). So you have 100 > > drivers to review. > Yes, but I think it would be enough to look at the drivers handling the > MII_ADDR_C45 flag, because those are either > - actually capable to do C45 bus transfers or > - do properly return -EOPNOTSUPP. > > I counted 27 drivers handling the MII_ADDR_C45 flag. Setting the capabilities > for those should be pretty easy. > > The remaining ones, which should be about 73 then, could be left untouched, > because the default capability MDIOBUS_NO_CAP would indicate they can C22 only. > Since they don't handle the MII_ADDR_C45 flag at all, this should be the > correct assumption. Forgot to mention, this would also automatically fixup that userspace C45 requests for those "remaining" drivers results in garbage on the bus. :-) > > > > Andrew > >