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, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 7DD5FC433ED for ; Mon, 5 Apr 2021 22:30:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 513A7613D9 for ; Mon, 5 Apr 2021 22:30:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242796AbhDEWaV (ORCPT ); Mon, 5 Apr 2021 18:30:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60502 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233086AbhDEWaT (ORCPT ); Mon, 5 Apr 2021 18:30:19 -0400 Received: from hs01.dk-develop.de (hs01.dk-develop.de [IPv6:2a02:c207:3002:6234::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 92A8AC06174A; Mon, 5 Apr 2021 15:30:12 -0700 (PDT) Date: Tue, 6 Apr 2021 00:30:08 +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: <6f1dfc28368d098ace9564e53ed92041@dk-develop.de> <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: netdev@vger.kernel.org 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. > > Andrew >