Received: by 10.213.65.68 with SMTP id h4csp1577244imn; Thu, 29 Mar 2018 07:16:37 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+YmIj5waZG9aZgwtesvuJtBoVo4N0bh0mNEbE/6NUe018i+9EOzzgC0WqX15vIFjTVmUkO X-Received: by 10.101.90.203 with SMTP id d11mr5613848pgt.20.1522332997728; Thu, 29 Mar 2018 07:16:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522332997; cv=none; d=google.com; s=arc-20160816; b=n3+MgZl6ezF0F7zXEVg9wGnsZPNlD54Ve9M6TWLG8Lrduy5BfnUZnbrGviSqgTIcZu l9TgzxUnQBLYOT98ZHL5KyWRBU3yCSqccGGXU+VooKdAly6HzFPRiGG5fTYpo+sENlPC ZeRkvqj+rO+f/bd8FTNiT0U/wEPo20xKuVjQ7jtuvLgLSW9d0haxOf8gMuhyUCz8Z4xp dKRZM3Qh7c3hNnOGt1q4v5Qnjp8QB6Z15htwA5WUQpgfKCLQSaVinj2RVxzlA0THPqZ9 csqZtbVWQBU1EvnvqI2TmsEK+WRn14YMEaWuqbqyuTwkvQFkECZeDATBz1w9Zkcl4Xrx pijQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=QhtaV+jX5WZjOaHZr+2GUxvMpoYJ345cmvEj+MhHrs4=; b=ZKXMZzp/3PH/8CBenoBd7EaeMRzagukCMHzmMvtFk2HRhRlER3RSDQaXNiYrflGHgl gFmXBHaK9rVwyYIBqJ8UzFRQqSlERJntHPsAjlx92he0BBlY6ISVkvkBN5++j/7nDcQl JDbE64PpO+D1fBoif6aj3Ow0gR2JeXqO4nlBO3PQi0/CX5WE01Qyr6m8eiAXm1Q6I8R8 kiwd7njPkIq6HWz5AACpDZYETF8OmSy+JHVx7wX4CfmxO1BRksgIiNJwgnyxi/mg9ybJ FA+gSkXVVEQczv+QwuhwNJrCv4ak8jJu27V/rkHMnZOS6dTQokaNlvypaGTRMu3Iih/O aQgg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f9-v6si1749388plo.93.2018.03.29.07.16.10; Thu, 29 Mar 2018 07:16:37 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751218AbeC2OOW (ORCPT + 99 others); Thu, 29 Mar 2018 10:14:22 -0400 Received: from mail.bootlin.com ([62.4.15.54]:42024 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750732AbeC2OOU (ORCPT ); Thu, 29 Mar 2018 10:14:20 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 3C1AB2083E; Thu, 29 Mar 2018 16:14:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [37.71.171.242]) by mail.bootlin.com (Postfix) with ESMTPSA id DED662037A; Thu, 29 Mar 2018 16:14:08 +0200 (CEST) Date: Thu, 29 Mar 2018 16:14:08 +0200 From: Alexandre Belloni To: Florian Fainelli Cc: "David S . Miller" , Allan Nielsen , razvan.stefanescu@nxp.com, po.liu@nxp.com, Thomas Petazzoni , Andrew Lunn , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@linux-mips.org Subject: Re: [PATCH net-next 3/8] net: mscc: Add MDIO driver Message-ID: <20180329141408.GC12066@piout.net> References: <20180323201117.8416-1-alexandre.belloni@bootlin.com> <20180323201117.8416-4-alexandre.belloni@bootlin.com> <9547b11d-147d-5029-0abe-8bf0f705c959@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9547b11d-147d-5029-0abe-8bf0f705c959@gmail.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 23/03/2018 at 14:51:19 -0700, Florian Fainelli wrote: > > + writel(MSCC_MIIM_CMD_VLD | (mii_id << MSCC_MIIM_CMD_PHYAD_SHIFT) | > > + (regnum << MSCC_MIIM_CMD_REGAD_SHIFT) | MSCC_MIIM_CMD_OPR_READ, > > + miim->regs + MSCC_MIIM_REG_CMD); > > + > > + ret = mscc_miim_wait_ready(bus); > > + if (ret) > > + goto out; > > Your example had an interrupt specified, can't you use that instead of > polling? > the interrupt doesn't handle that. It is used to detect when a PHY register has changed once the MIIM controller is configured to poll the phys. At some point, this could be used to replace the PHY interrupts but it doesn't correspond to the linux model so I didn't investigate too much. > > + for (i = 0; i < PHY_MAX_ADDR; i++) { > > + if (mscc_miim_read(bus, i, MII_PHYSID1) < 0) > > + bus->phy_mask |= BIT(i); > > + } > > What is this used for? You have an OF MDIO bus which would create a > phy_device for each node specified, is this a similar workaround to what > drivers/net/phy/mdio-bcm-unimac.c has to do? If so, please document it > as such. > I replied to Andrew who had the same question. -- Alexandre Belloni, Bootlin (formerly Free Electrons) Embedded Linux and Kernel engineering https://bootlin.com