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=-5.6 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS, USER_AGENT_MUTT autolearn=ham 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 4EB89C169C4 for ; Wed, 6 Feb 2019 22:28:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 18831218B0 for ; Wed, 6 Feb 2019 22:28:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549492093; bh=uq6ptW0/WFSaKM/4jMMs8f38CFq5F+0ytk3kZrAK/jk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=0Kj1FMgSq+izjuLNgs2qAXS4jhlBgYoHbUsTxfz8k+dBxft39jqve3Oe1iwIfrAw/ 2XDqIEUpiDvBxRmkRfONYErE3KrLOcLJVImwgWWrKsUsvoPt6zxMtmTNEYp/kV7i6t kcgpS+HLcpT31SiLzwM3WJOv39JCuTXgTKXn3gnw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726062AbfBFW2L (ORCPT ); Wed, 6 Feb 2019 17:28:11 -0500 Received: from mail-pl1-f194.google.com ([209.85.214.194]:42156 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbfBFW2L (ORCPT ); Wed, 6 Feb 2019 17:28:11 -0500 Received: by mail-pl1-f194.google.com with SMTP id s1so3786095plp.9 for ; Wed, 06 Feb 2019 14:28:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EvY3goOkA7xKSEY+47goKdBbRqQ1FkmbLSC9aboa8Qw=; b=Zrq+shIXcMpE3p4SYUAD8pimjm/wN6avP0MVJLrvFH13F/6kX8yswoCH+iAPS3i+7e U+haCxyjQmpg0xK7yEmKzKRd5cNAU/krKefU3lw8AYG/nXEyo5oqxiVdf89423RdOaMt AHVMK6BI1qvgeta/pbu07TMrkB4fsvwBZHemcBFRvuzFfzmnE+VaJsZ/JUpMiZwfEVnC bh6RZTynaQRCTCoWHn7yMPuHDebtN4kCE27BgqGU9fQNdm8yHs+0yQh9cmqCQoEk9UtI wcPOkEP1ynuLIpg9zjD/s+4GfbtBE+bZt+dCiwFbnNXD8pgDHXQRhRfKKrhyBYCv/FIM QJIw== X-Gm-Message-State: AHQUAuY0NRb6nH7qtQHNNk9Y4tJrCA5ycRt3f8kyi5FXDWNb/3ZQMAG9 YsCyRbdCCcjDosGWpNf9UfdTrQ== X-Google-Smtp-Source: AHgI3IbxhQZw9ODcmdbduDsWlhCvIdipRI+EkDLQJxJGaCirkpvNFoFNRDkrew7HVwE6qJsgr0Yb/A== X-Received: by 2002:a17:902:c5:: with SMTP id a63mr13275676pla.267.1549492090834; Wed, 06 Feb 2019 14:28:10 -0800 (PST) Received: from localhost ([2601:647:4700:93d:6db5:e35d:dacd:7872]) by smtp.gmail.com with ESMTPSA id g20sm3700207pfg.85.2019.02.06.14.28.10 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 06 Feb 2019 14:28:10 -0800 (PST) Date: Wed, 6 Feb 2019 14:28:09 -0800 From: Moritz Fischer To: Andrew Lunn Cc: Moritz Fischer , netdev@vger.kernel.org, f.fainelli@gmail.com, hkallweit1@gmail.com, davem@davemloft.net Subject: Re: [PATCH net-next] net: phy: fixed_phy: Fix fixed_phy not checking GPIO Message-ID: <20190206222809.GA21303@archbook> References: <20190206181040.29539-1-mdf@kernel.org> <20190206215905.GD32483@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190206215905.GD32483@lunn.ch> User-Agent: Mutt/1.11.3 (2019-02-01) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi Andrew, On Wed, Feb 06, 2019 at 10:59:05PM +0100, Andrew Lunn wrote: > On Wed, Feb 06, 2019 at 10:10:40AM -0800, Moritz Fischer wrote: > > Fix fixed_phy not checking GPIO if no link_update callback > > is registered. > > > > Signed-off-by: Moritz Fischer > > --- > > > > Hi all, > > > > I've been trying to figure out where exactly this broke, > > it must've been somewhere when the file was refactored > > in connection with phylink? > > Hi Moritz > > With a quick inspection, i also cannot see where it broken. > > I think part of the issue is that all the current users have moved > onto using phylink, and phylink polls the GPIO, rather than having > fixed_link do it. Yeah, I suspected at much :) I still feel we should fix fixed_phy as long as there are still users for it. > > I would prefer to understand exactly which change broke it. Without > knowing how it broke, it is hard to say if this is the correct fix. It might've been always this way. That being said I don't see why one should've to implement an empty function (link_update) in my driver just to read back the GPIO pin. Looking at the code it seems clear that nothing else polls the GPIO, which doesn't seem right. In my current understanding (correct me if I'm wrong), the link_update callback would give the MAC a chance to update link parameters that since we are a fixed phy we cannot read back from a PHY. That seems conceptually independent from obtaining a link up/down info from a GPIO pin. Wouldn't you agree? > > What is your use-case? You Cc: the usb list. So a USB-Ethernet dongle? > But then why fixed-link? Not for this patch, did I ? I ran into this when testing nixge, but it seemed unrelated with my changes. Thanks, Moritz