Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp526934pxj; Thu, 10 Jun 2021 06:40:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJylrEwr3IphTN4TEzmLxfvpIjGIHgQUz3+4hJJ+2QXoQ8ARMw+iSGcU7wtTw2aDhrs9DzE9 X-Received: by 2002:a17:907:20c6:: with SMTP id qq6mr4483320ejb.207.1623332449165; Thu, 10 Jun 2021 06:40:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1623332449; cv=none; d=google.com; s=arc-20160816; b=NaM3IvLeXkDJ7sJpZ1FHQIQ3PUkDla5i0FhkoM9aM0tbdd2YELgi2eNGZE32feXA3q at456H8Br6WeLpeqfhIMEKyR9IMutoaDJjlmEqy4MUrVYgEgPwox0DdWy6C8jNJ4NO/a 6ElEQUCBTbh+dtlsCaseY7WuH2W1ncR4OOkv7WAljr8QdENvy9ZoUML22Q8p8p1mdcNJ 1871aqAD0AI2fal5pJg+CwKms9NdklmTn+zgallQKtGotJWJ/MI3NxFt00exGXhhl9iO xllD18CKvSPNVSystxJqWDsv93uAJxnfMm/9pP2zrbbbw57AxAoYlR6boCKISpKa+v3Q 7o+g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=lXnRcWnPU5LMpa96tYcSkP8b3vWO11VPP+i+rPVj0AM=; b=zn3rXHUBOsMU4euxoFbsx+RKTGUPf/UqlKEBPsd6WKvP+E/knaGhyPZUzba9M0mPPv 7VOE+S+CG9IR0REGAs8yHjkfmdJC/wvS7G6WKuMwCc33XLvGpfjW+xW8TMfrkwvrzkq+ emLUdU6r8BHJLbZPC8JATO9RC7Cq8L8vEwz+MzhAqn/XLbollECNAVuwnH947NouctpI OBFSq/TOqpFtxgccOlHMBTpm9CEaX3XUzSPYKj5SnvfkY/aMVsKLvsVa1q7zbZmaGl4F cF2gwmOiejJ5dv1sTf5PnEd93/iu11M4Y3xxpvjwEBAlFj7M/+/PC+h4I7Ofr2yWxKEB SyvA== ARC-Authentication-Results: i=1; mx.google.com; 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 h24si2716729ejt.504.2021.06.10.06.40.25; Thu, 10 Jun 2021 06:40:49 -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; 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 S231214AbhFJNjG (ORCPT + 99 others); Thu, 10 Jun 2021 09:39:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230188AbhFJNjF (ORCPT ); Thu, 10 Jun 2021 09:39:05 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7B0DC061760 for ; Thu, 10 Jun 2021 06:37:08 -0700 (PDT) Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lrKrl-0001DZ-0G; Thu, 10 Jun 2021 15:37:01 +0200 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1lrKrh-00017e-Kr; Thu, 10 Jun 2021 15:36:57 +0200 Date: Thu, 10 Jun 2021 15:36:57 +0200 From: Oleksij Rempel To: Heiner Kallweit Cc: Marek Szyprowski , "David S. Miller" , Jakub Kicinski , Andrew Lunn , Russell King , kernel@pengutronix.de, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v2 4/8] net: usb: asix: ax88772: add phylib support Message-ID: <20210610133657.7hchbeidynpd7m7b@pengutronix.de> References: <20210607082727.26045-1-o.rempel@pengutronix.de> <20210607082727.26045-5-o.rempel@pengutronix.de> <84ff1dab-ab0a-f27c-a948-e1ebdf778485@samsung.com> <20210609124609.zngg6sfcu6cj4p2m@pengutronix.de> <44a16219-0575-49ee-758b-be6fe9971962@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <44a16219-0575-49ee-758b-be6fe9971962@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 15:36:14 up 190 days, 3:42, 50 users, load average: 0.07, 0.04, 0.01 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 09, 2021 at 03:12:37PM +0200, Heiner Kallweit wrote: > On 09.06.2021 14:46, Oleksij Rempel wrote: > > Hi Marek, > > > > On Wed, Jun 09, 2021 at 11:59:23AM +0200, Marek Szyprowski wrote: > >> Hi Oleksij, > >> > >> On 07.06.2021 10:27, Oleksij Rempel wrote: > >>> To be able to use ax88772 with external PHYs and use advantage of > >>> existing PHY drivers, we need to port at least ax88772 part of asix > >>> driver to the phylib framework. > >>> > >>> Signed-off-by: Oleksij Rempel > >> > >> This patch landed recently in linux-next as commit e532a096be0e ("net: > >> usb: asix: ax88772: add phylib support"). I found that it causes some > >> warnings on boards with those devices, see the following log: > >> > >> root@target:~# time rtcwake -s10 -mmem > >> rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jun  9 08:16:41 2021 > >> [  231.226579] PM: suspend entry (deep) > >> [  231.231697] Filesystems sync: 0.002 seconds > >> [  231.261761] Freezing user space processes ... (elapsed 0.002 seconds) > >> done. > >> [  231.270526] OOM killer disabled. > >> [  231.273557] Freezing remaining freezable tasks ... (elapsed 0.002 > >> seconds) done. > >> [  231.282229] printk: Suspending console(s) (use no_console_suspend to > >> debug) > >> ... > >> [  231.710852] Disabling non-boot CPUs ... > >> ... > >> [  231.901794] Enabling non-boot CPUs ... > >> ... > >> [  232.225640] usb usb3: root hub lost power or was reset > >> [  232.225746] usb usb1: root hub lost power or was reset > >> [  232.225864] usb usb5: root hub lost power or was reset > >> [  232.226206] usb usb6: root hub lost power or was reset > >> [  232.226207] usb usb4: root hub lost power or was reset > >> [  232.297749] usb usb2: root hub lost power or was reset > >> [  232.343227] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -22 > >> [  232.343293] asix 3-1:1.0 eth0: Failed to enable software MII access > >> [  232.344486] asix 3-1:1.0 eth0: Failed to read reg index 0x0000: -22 > >> [  232.344512] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -22 > >> [  232.344529] PM: dpm_run_callback(): mdio_bus_phy_resume+0x0/0x78 > >> returns -22 > >> [  232.344554] Asix Electronics AX88772C usb-003:002:10: PM: failed to > >> resume: error -22 > >> [  232.563712] usb 1-1: reset high-speed USB device number 2 using > >> exynos-ehci > >> [  232.757653] usb 3-1: reset high-speed USB device number 2 using xhci-hcd > >> [  233.730994] OOM killer enabled. > >> [  233.734122] Restarting tasks ... done. > >> [  233.754992] PM: suspend exit > >> > >> real    0m11.546s > >> user    0m0.000s > >> sys     0m0.530s > >> root@target:~# sleep 2 > >> root@target:~# time rtcwake -s10 -mmem > >> rtcwake: wakeup from "mem" using /dev/rtc0 at Wed Jun  9 08:17:02 2021 > >> [  241.959608] PM: suspend entry (deep) > >> [  241.963446] Filesystems sync: 0.001 seconds > >> [  241.978619] Freezing user space processes ... (elapsed 0.004 seconds) > >> done. > >> [  241.989199] OOM killer disabled. > >> [  241.992215] Freezing remaining freezable tasks ... (elapsed 0.005 > >> seconds) done. > >> [  242.003979] printk: Suspending console(s) (use no_console_suspend to > >> debug) > >> ... > >> [  242.592030] Disabling non-boot CPUs ... > >> ... > >> [  242.879721] Enabling non-boot CPUs ... > >> ... > >> [  243.145870] usb usb3: root hub lost power or was reset > >> [  243.145910] usb usb4: root hub lost power or was reset > >> [  243.147084] usb usb5: root hub lost power or was reset > >> [  243.147157] usb usb6: root hub lost power or was reset > >> [  243.147298] usb usb1: root hub lost power or was reset > >> [  243.217137] usb usb2: root hub lost power or was reset > >> [  243.283807] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -22 > >> [  243.284005] asix 3-1:1.0 eth0: Failed to enable software MII access > >> [  243.285526] asix 3-1:1.0 eth0: Failed to read reg index 0x0000: -22 > >> [  243.285676] asix 3-1:1.0 eth0: Failed to read reg index 0x0004: -22 > >> [  243.285769] ------------[ cut here ]------------ > >> [  243.286011] WARNING: CPU: 2 PID: 2069 at drivers/net/phy/phy.c:916 > >> phy_error+0x28/0x68 > >> [  243.286115] Modules linked in: cmac bnep mwifiex_sdio mwifiex > >> sha256_generic libsha256 sha256_arm cfg80211 btmrvl_sdio btmrvl > >> bluetooth s5p_mfc uvcvideo s5p_jpeg exynos_gsc v > >> [  243.287490] CPU: 2 PID: 2069 Comm: kworker/2:5 Not tainted > >> 5.13.0-rc5-next-20210608 #10443 > >> [  243.287555] Hardware name: Samsung Exynos (Flattened Device Tree) > >> [  243.287609] Workqueue: events_power_efficient phy_state_machine > >> [  243.287716] [] (unwind_backtrace) from [] > >> (show_stack+0x10/0x14) > >> [  243.287807] [] (show_stack) from [] > >> (dump_stack_lvl+0xa0/0xc0) > >> [  243.287882] [] (dump_stack_lvl) from [] > >> (__warn+0x118/0x11c) > >> [  243.287954] [] (__warn) from [] > >> (warn_slowpath_fmt+0xb4/0xbc) > >> [  243.288021] [] (warn_slowpath_fmt) from [] > >> (phy_error+0x28/0x68) > >> [  243.288094] [] (phy_error) from [] > >> (phy_state_machine+0x218/0x278) > >> [  243.288173] [] (phy_state_machine) from [] > >> (process_one_work+0x30c/0x884) > >> [  243.288254] [] (process_one_work) from [] > >> (worker_thread+0x58/0x594) > >> [  243.288333] [] (worker_thread) from [] > >> (kthread+0x160/0x1c0) > >> [  243.288408] [] (kthread) from [] > >> (ret_from_fork+0x14/0x38) > >> [  243.288475] Exception stack(0xc4683fb0 to 0xc4683ff8) > >> [  243.288531] 3fa0:                                     00000000 > >> 00000000 00000000 00000000 > >> [  243.288587] 3fc0: 00000000 00000000 00000000 00000000 00000000 > >> 00000000 00000000 00000000 > >> [  243.288641] 3fe0: 00000000 00000000 00000000 00000000 00000013 00000000 > >> [  243.288690] irq event stamp: 1611 > >> [  243.288744] hardirqs last  enabled at (1619): [] > >> vprintk_emit+0x230/0x290 > >> [  243.288830] hardirqs last disabled at (1626): [] > >> vprintk_emit+0x26c/0x290 > >> [  243.288906] softirqs last  enabled at (1012): [] > >> __do_softirq+0x500/0x63c > >> [  243.288978] softirqs last disabled at (1007): [] > >> irq_exit+0x214/0x220 > >> [  243.289055] ---[ end trace eeacda95eb7db60a ]--- > >> [  243.289345] asix 3-1:1.0 eth0: Failed to write reg index 0x0000: -22 > >> [  243.289466] asix 3-1:1.0 eth0: Failed to write Medium Mode mode to > >> 0x0000: ffffffea > >> [  243.289540] asix 3-1:1.0 eth0: Link is Down > >> [  243.482809] usb 1-1: reset high-speed USB device number 2 using > >> exynos-ehci > >> [  243.647251] usb 3-1: reset high-speed USB device number 2 using xhci-hcd > >> [  244.847161] OOM killer enabled. > >> [  244.850221] Restarting tasks ... done. > >> [  244.861372] PM: suspend exit > >> > >> real    0m13.050s > >> user    0m0.000s > >> sys     0m1.152s > >> root@target:~# > >> > >> It looks that some kind of system suspend/resume integration for phylib > >> is not implemented. > > > > Probably it is should be handled only by the asix driver. I'll take a > > look in to it. Did interface was able to resume after printing some > > warnings? > > > > Regards, > > Oleksij > > > > Maybe it's a use case for the new mac_managed_pm flag, see > fba863b81604 ("net: phy: make PHY PM ops a no-op if MAC driver manages PHY PM") > Thx! this is the right one :) Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |