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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CCD91C433F5 for ; Thu, 26 May 2022 13:55:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233541AbiEZNz7 (ORCPT ); Thu, 26 May 2022 09:55:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48152 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229922AbiEZNz6 (ORCPT ); Thu, 26 May 2022 09:55:58 -0400 Received: from bmailout2.hostsharing.net (bmailout2.hostsharing.net [83.223.78.240]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 860446B67E; Thu, 26 May 2022 06:55:56 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout2.hostsharing.net (Postfix) with ESMTPS id C2000280D406E; Thu, 26 May 2022 15:55:54 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id AC8B12ED8D5; Thu, 26 May 2022 15:55:54 +0200 (CEST) Date: Thu, 26 May 2022 15:55:54 +0200 From: Lukas Wunner To: Andrew Lunn Cc: Marek Szyprowski , "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , netdev@vger.kernel.org, linux-usb@vger.kernel.org, Steve Glendinning , UNGLinuxDriver@microchip.com, Oliver Neukum , Andre Edich , Oleksij Rempel , Martyn Welch , Gabriel Hojda , Christoph Fritz , Lino Sanfilippo , Philipp Rosenberger , Heiner Kallweit , Russell King , Ferry Toth , Krzysztof Kozlowski , 'Linux Samsung SOC' Subject: Re: [PATCH net-next v3 5/7] usbnet: smsc95xx: Forward PHY interrupts to PHY driver to avoid polling Message-ID: <20220526135554.GA22214@wunner.de> References: <748ac44eeb97b209f66182f3788d2a49d7bc28fe.1652343655.git.lukas@wunner.de> <20220519190841.GA30869@wunner.de> <31baa38c-b2c7-10cd-e9cd-eee140f01788@samsung.com> <20220523094343.GA7237@wunner.de> <2f612dd0-ac30-4860-ef1b-bbb180da21af@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org On Tue, May 24, 2022 at 02:03:52PM +0200, Andrew Lunn wrote: > As for this hardware, if it does not support WOL, why are interrupts > still enabled? LAN95xx chips do support WoL and will signal a USB wake event. But whether that actually results in resume from system sleep depends on the capabilities of the SoC and its USB host controller. LAN95xx supports a variety of wake options (WoL, PHY Energy Detect, ...) and can use either its integrated SMSC PHY or an external PHY. I'm not sure all wake options will work with arbitrary external PHYs. If WoL or Wake on PHY Energy Detect is not used, we just program the LAN95xx to enter a deeper power state which results in the respective wake events being ignored. As a result, interrupts may be left enabled even though they're not used as a wakeup source. The phylib doesn't provide an API to selectively disable or enable interrupts, other than phy_stop() and phy_start(), which does a lot more. The patch I've submitted today treats such unnecessarily enabled interrupts leniently: It will not signal wakeup if that wasn't enabled and just remembers that an interrupt occurred. The interrupt will be replayed upon resume and that's it. Thanks, Lukas