From patchwork Wed Jun 8 09:52:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lukas Wunner X-Patchwork-Id: 12873251 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 B1168CCA47B for ; Wed, 8 Jun 2022 10:47:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237247AbiFHKrm (ORCPT ); Wed, 8 Jun 2022 06:47:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38078 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237318AbiFHKrl (ORCPT ); Wed, 8 Jun 2022 06:47:41 -0400 X-Greylist: delayed 1799 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 08 Jun 2022 03:47:36 PDT Received: from mailout3.hostsharing.net (mailout3.hostsharing.net [IPv6:2a01:4f8:150:2161:1:b009:f236:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A1C8419B6AD; Wed, 8 Jun 2022 03:47:35 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (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 mailout3.hostsharing.net (Postfix) with ESMTPS id D7E4A101E6C50; Wed, 8 Jun 2022 11:52:35 +0200 (CEST) Received: from localhost (unknown [89.246.108.87]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id 94BC5621B6E1; Wed, 8 Jun 2022 11:52:35 +0200 (CEST) X-Mailbox-Line: From 78ad73b93adb59edfa2d68e44a9fcfea65e98131 Mon Sep 17 00:00:00 2001 Message-Id: From: Lukas Wunner Date: Wed, 8 Jun 2022 11:52:10 +0200 Subject: [PATCH net v2 0/1] PHY interruptus horribilis To: "David S. Miller" , Jakub Kicinski , Paolo Abeni , Eric Dumazet , Andrew Lunn , Heiner Kallweit , Russell King , Marek Szyprowski , Thomas Gleixner , "Rafael J. Wysocki" , Len Brown , Pavel Machek Cc: netdev@vger.kernel.org, Steve Glendinning , UNGLinuxDriver@microchip.com, Oliver Neukum , Andre Edich , Oleksij Rempel , Martyn Welch , Gabriel Hojda , Christoph Fritz , Lino Sanfilippo , Philipp Rosenberger , Ferry Toth , Krzysztof Kozlowski , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@kernel.org Andrew Lunn (PHY maintainer) asked me to resend this patch and cc the IRQ maintainer. I'm also cc'ing PM maintainers for good measure. The patch addresses an issue with PHY interrupts occurring during a system sleep transition after the PHY has already been suspended. The IRQ subsystem uses an internal flag IRQD_WAKEUP_ARMED to avoid handling such interrupts, but it's not set until suspend_device_irqs() is called during the ->suspend_noirq() phase. That's too late in this case as PHYs are suspended in the ->suspend() phase. And there's no external interface to set the flag earlier. As I'm lacking access to the flag, I'm open coding its functionality in this patch. Is this the correct approach or should I instead look into providing an external interface to the flag? Side note: suspend_device_irqs() and resume_device_irqs() have been exported since forever even though there's no module user... Thanks! Changes since v1: * Extend rationale in the commit message. * Drop Fixes tag, add Tested-by tag (Marek). Link to v1: https://lore.kernel.org/netdev/688f559346ea747d3b47a4d16ef8277e093f9ebe.1653556322.git.lukas@wunner.de/ Lukas Wunner (1): net: phy: Don't trigger state machine while in suspend drivers/net/phy/phy.c | 23 +++++++++++++++++++++++ drivers/net/phy/phy_device.c | 23 +++++++++++++++++++++++ include/linux/phy.h | 6 ++++++ 3 files changed, 52 insertions(+)