Received: by 2002:a05:6a10:6d25:0:0:0:0 with SMTP id gq37csp1282101pxb; Sun, 12 Sep 2021 13:51:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyHacjTlTxzOVRv9Fyo2q70H4wGAT7cC69AfOmF5e8XIUSgTufUxmvM8MBz9OrPqbls45d3 X-Received: by 2002:a50:cd87:: with SMTP id p7mr1905081edi.294.1631479878208; Sun, 12 Sep 2021 13:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631479878; cv=none; d=google.com; s=arc-20160816; b=PkAQrcRqTKQaXL4TALftq0j6OguoPMtDvmLZv8AilsGmdJY3B3Y4+vjY/PTvieQK/p sos6gSMPAtiyzyb7IkBbLY6Be7qflkcR8UJvnrdezTbta3mJx+CbMK2GlSrfTwdfatrQ sIq2txQjLeACLtu0QkgYuZUkzaEPl4N6Mqohf7D/Lgu21s2tztnyZ6BPvci3jOd/u2Nx PKBvzZPqqRfiyEC8fuHHOQIyhMXiPuBGJSJ+3a4xcDB0LNzHR3ToniELPpyp/dxBiTdI NxFD3ve208f5mJ5Ta+XMnc8sVm7rmQASXbnDQHM13qASc5fjcx6y8woV/0ryJckI/vNb pyAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=4fqrnJ0RvaPV34Ys1XGOynmGvVMwS7FGS8x+jer6CM4=; b=EpYArv5nYwugM9FIdlHp3Grr8Vy5ggaIdccDt4r4wrR0tJjLrv/M73gi7Uk3aR0boL IRpUIPlhnCZo0w/6ldBezKfJPvjcYo58FOWTVw13V0zfkH9WPP7cPKdFa2LfZHsqDIN1 xXKL3Wq2WckkC5yJnnfXhiMYCrdd543QD4bRECAjEcKlAlg3m0OWuXoq4U67z+tD0ixZ rISqAgxScXtSXgcIZE5MHMilD2OEtl8weK6XRGVzN8VIO3Lrf+HV6x5Z9Cw8sVqD2yje bAbvaXayysDg9F8wvMeN/jjjxcAUXLxZlDiLcX3B0PTR1491d7XtbawMPVfLRfxK1GfH tSwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@engleder-embedded-com.20150623.gappssmtp.com header.s=20150623 header.b="vqw18g/4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ml24si636667ejb.363.2021.09.12.13.50.54; Sun, 12 Sep 2021 13:51:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@engleder-embedded-com.20150623.gappssmtp.com header.s=20150623 header.b="vqw18g/4"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236373AbhILUuv (ORCPT + 99 others); Sun, 12 Sep 2021 16:50:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231560AbhILUuv (ORCPT ); Sun, 12 Sep 2021 16:50:51 -0400 Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7D84C061574 for ; Sun, 12 Sep 2021 13:49:36 -0700 (PDT) Received: by mail-il1-x12b.google.com with SMTP id l10so7927810ilh.8 for ; Sun, 12 Sep 2021 13:49:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=engleder-embedded-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=4fqrnJ0RvaPV34Ys1XGOynmGvVMwS7FGS8x+jer6CM4=; b=vqw18g/43jU33OI4YtOS9L1fADFEcMt/EtjBzrzZqvc8r8lNbH+VmuMPPEL4T0BCvL iV/Iplllv6OCuu5P6Olv5ZTZ7RAN2Q7oQdmGuGFXvCBaT7aRhzVKIR7P47QjNR0PztZz u/8KmHN5npX+Xl8F+t3loWTm1ef9GsiKBy35STXQvPb8MvBZ4Q71WJYb+a7U8ZtQmqys grp5di2og8LHbj00JBSDvAf4O2CR1rJHasdJWyXy5AS0oQrHbfLyxP0s9meTqVnB7p+6 aN8U6VqAYhm5ED8bSRNz7e8lfj9t870yhxaQvxPL//ubfgHzjW48l1HBKdGZUOQ2iX6O o7sQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=4fqrnJ0RvaPV34Ys1XGOynmGvVMwS7FGS8x+jer6CM4=; b=wVwr+w3WAmNBWxZt2PypFdyjtizk9vnyqPzABZzjk7aoMT2ey9nWq5hZwwPw5+vk5W IUBtsTP4wLGvVfKpfYEb+eARpDrhSnJp8dVK92Av2IgvcCPbPRXT59akiKZWZugFEcpZ tWznjC8X+bveIoFjJ1c8F1V5RQmWActCbRxcutQj7Co6EbEOzKpdC380k8pn7k12wv5m h2scXQhceu+7HJccOK1ujS750Tiy3cZvharxmY2xBpiYN/JDzwcG63TCvzXxzfNwDCPU KbCYYvOMVgwNqOogxHgjmqHG8DkRXdBmAr8jcInTNP7xxkwNipg5Y+OXzd3BNLIDcsR2 HRuA== X-Gm-Message-State: AOAM532AKztrpGvBTQHlkrnzKZNzbji4Z67dMSZO6YjSDHL7zVvcGcKP fDBDQuwTrUwg9oIXszVmo0YSU5bekLQZikPIIqWszg== X-Received: by 2002:a92:6b10:: with SMTP id g16mr5562273ilc.147.1631479776208; Sun, 12 Sep 2021 13:49:36 -0700 (PDT) MIME-Version: 1.0 References: <20210912192805.1394305-1-vladimir.oltean@nxp.com> In-Reply-To: <20210912192805.1394305-1-vladimir.oltean@nxp.com> From: Gerhard Engleder Date: Sun, 12 Sep 2021 22:49:25 +0200 Message-ID: Subject: Re: [RFC PATCH net] Revert "net: phy: Uniform PHY driver access" To: Vladimir Oltean Cc: netdev , Andrew Lunn , Heiner Kallweit , "David S. Miller" , Russell King , Jakub Kicinski , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > This reverts commit 3ac8eed62596387214869319379c1fcba264d8c6. > > I am not actually sure I follow the patch author's logic, because the > change does more than it says on the box, but this patch breaks > suspend/resume on NXP LS1028A and probably on any other systems which > have PHY devices with no driver bound, because the patch has removed the > "!phydev->drv" check without actually explaining why that is fine. The wrong assumption was that the driver is set for every device during probe before suspend. Intention of the patch was only clean up of to_phy_driver() usage. > static bool mdio_bus_phy_may_suspend(struct phy_device *phydev) > { > + struct device_driver *drv = phydev->mdio.dev.driver; > + struct phy_driver *phydrv = to_phy_driver(drv); > struct net_device *netdev = phydev->attached_dev; > > - if (!phydev->drv->suspend) > + if (!drv || !phydrv->suspend) > return false; > > /* PHY not attached? May suspend if the PHY has not already been I suggest to add the "!phydev->drv" check, but others may know it better than me. Gerhard