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=-4.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,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 70D4FC433E7 for ; Fri, 9 Oct 2020 18:02:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1947C21D6C for ; Fri, 9 Oct 2020 18:02:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602266556; bh=+Qlo7BolLAP9m6Ffv6w+9hC2SebSQMTwGubJY69Tx9E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=lTkrrL/1eAQSss6VwALPCk7hL6CFfmHwtI0lsKtBORZeunfKyMkdy/kBkEHDKkuO4 CqJmV+D2+/NXBX5gpC5AxHn/z8qI430GGvLvTHEXDvhieZhQjiqaQQCKz46ZTbs0lS +R2IqDAk7LGufcIxHwB4PjJl58tkmIzJbgF/K5Kw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390347AbgJISCe (ORCPT ); Fri, 9 Oct 2020 14:02:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:52556 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390309AbgJISCd (ORCPT ); Fri, 9 Oct 2020 14:02:33 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 7A77C2158C; Fri, 9 Oct 2020 18:02:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602266553; bh=+Qlo7BolLAP9m6Ffv6w+9hC2SebSQMTwGubJY69Tx9E=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mbunbG2gaaeqfcH+fWpSY1NoZwW31I8jJwez6dTIwDm5xAGRyB3PMkjgRpztRsPWG eIyR4HXu5q9WqX+kkYE4JKkwOJi4Ql9bQFfZ8ClEimiCFYP4T+DZmorb2BdWM5fqIQ 7YkJtFbbpKbZOn4Ui1I4icCrVwIEP/g3U6HBJOWA= Date: Fri, 9 Oct 2020 11:02:30 -0700 From: Jakub Kicinski To: Marek Vasut Cc: Florian Fainelli , netdev@vger.kernel.org, Christoph Niedermaier , "David S . Miller" , NXP Linux Team , Richard Leitner , Shawn Guo , Andrew Lunn , Heiner Kallweit Subject: Re: [PATCH] net: fec: Fix phy_device lookup for phy_reset_after_clk_enable() Message-ID: <20201009110230.3d8693df@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <6b8ec5fe-ca93-d2cf-3060-4f087fcdc85a@denx.de> References: <20201006202029.254212-1-marex@denx.de> <110b63bb-9096-7ce0-530f-45dffed09077@gmail.com> <9f882603-2419-5931-fe8f-03c2a28ac785@denx.de> <20201008174619.282b3482@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20201009081532.30411d62@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <6b8ec5fe-ca93-d2cf-3060-4f087fcdc85a@denx.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org On Fri, 9 Oct 2020 19:34:10 +0200 Marek Vasut wrote: > >>> To an untrained eye this looks pretty weird. > >> > >> I see, I'm not quite sure how to address this comment. > > > > If ndev->phydev sometimes is not-NULL on open, then that's a valid > > state to be in. Why not make sure that we're always in that state > > and can depend on ndev->phydev rather than rummaging around for > > the phy_device instance. > > Nope, the problem is in probe() in this case. In that case it would be cleaner to pass fep and phydev as arguments into fec_enet_clk_enable(), rather than netdev, and have only probe() do the necessary dance.