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=-0.7 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 C1AA6C4361A for ; Thu, 3 Dec 2020 15:08:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6A96A206F0 for ; Thu, 3 Dec 2020 15:08:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729204AbgLCPIq (ORCPT ); Thu, 3 Dec 2020 10:08:46 -0500 Received: from static.214.254.202.116.clients.your-server.de ([116.202.254.214]:33352 "EHLO ciao.gmane.io" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726988AbgLCPIq (ORCPT ); Thu, 3 Dec 2020 10:08:46 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1kkqDD-0001P3-Rr for netdev@vger.kernel.org; Thu, 03 Dec 2020 16:08:03 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: netdev@vger.kernel.org From: Grant Edwards Subject: Re: net: macb: fail when there's no PHY Date: Thu, 3 Dec 2020 15:07:58 -0000 (UTC) Message-ID: References: <66c0a032-4d20-69f1-deb4-6c65af6ec740@gmail.com> <6a9c1d4a-ed73-3074-f9fa-158c697c7bfe@gmail.com> <20201202183531.GJ2324545@lunn.ch> <20201202211134.GM2324545@lunn.ch> <57728908-1ae3-cbe9-8721-81f06ab688b8@gmail.com> <20201203040758.GC2333853@lunn.ch> User-Agent: slrn/1.0.3 (Linux) Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On 2020-12-03, Andrew Lunn wrote: >> So I can avoid my local hack to macb_main.c by doing a doing a local >> hack to macb_main.c? > > User space drivers were never supported in any meaningful way. The > IOCTL call is basically there for mii-tool, and nothing much more. I probably wouldn't call a single ioctl() to check the link status a user-space-driver, but I guess that's what it is. If it's good enough for the mii-tool, it's good enough for me. > The way to avoid your local hack is to move your drivers into the > kernel, along side all the other drivers for devices on MDIO busses. I don't think I can justify the additional effort to devlope and maintain a custom kern-space driver. We've already got a custom macb driver, and writing a spearate driver in order to remove a handful of lines from the macb driver just isn't worth it. What has confused me all along was Florian Fainelli's post: >> [I modified the macb driver to support fixed PHY plus mdio access] > > That should be unnecessary see below. > >> Was there some other way I should have done this with a 5.4 kernel >> that I was unable to discover? > > You should be able to continue having the macb MDIO bus controller > be registered with no PHY/MDIO devices represented in Device Tree > such that user-space can continue to use it for ioctl() *and* you > can point the macb node to a fixed PHY for the purpose of having > fixed link parameters. But to do that, I have to modify the macb driver to support a fixed PHY plus mdio access. What would be the advantage of that modification over the modification I've already made and tested? Alternatively, I could write a seperate kernel driver that would "own" the macb's mdio bus and provide some something equivalent to the existing SIOC[SG]MIIREG ioctl() calls to access the devices on that mdio bus. Thanks for clearing this up for me. BTW Andrew, we're still shipping plenty of product that running eCos. :) -- Grant