Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2390961iof; Wed, 8 Jun 2022 04:05:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybf1YIERxtNWOq8r0VnPM5i/Ny1RCox14XAnsYm9+Exen3jvE9Au2dQDYHgQMccbNsE8u1 X-Received: by 2002:a17:90b:5091:b0:1e8:990c:f735 with SMTP id rt17-20020a17090b509100b001e8990cf735mr11258285pjb.153.1654686358432; Wed, 08 Jun 2022 04:05:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654686358; cv=none; d=google.com; s=arc-20160816; b=LBfp20jeMEsqvFUzKEu9aguGDMOdzerAXGEVbv0JYeScS7Q7Y7rF9DBvR8PTNI5Fot 2McHkp+4gP2+1yGIwhcDbLX2GaRFxQvoDrVy/tQzXHr/keUPiJcUFMetxvRInhhVk295 iQ5hhnWXh3tSlI4hOz0mO9swoWc8wnVeQPKfRBqv8v4j+FYr5PLlrylWzIlSRh7lwUJS SbDv2xRBDWCV4AoO26ptcXAfHnBVrL3VNeP4cGai/Y3htfrwP9104DZ27Wl/0Y9H6EK3 eHvx2fEinSMLWnskV9vbBs+E3r8167SKqh6k/M1sW5onsBeZ91hqI8EhTjCDrdCYgdO7 +IbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:date:from:message-id; bh=zP4RZb8EAUUlWV99hY576PeoHvk73yjef3DGYdx5bCo=; b=mF02iP+LW3hgBAqsRpFarCPz6/FpFVk3OrB71Obf2GiOFgc4ATRODg50E6m8ZLPtEs Q94J6cZ5VB9nal74sW8ry32zuM+HLSyVzjv8vYonQ/gS5Yb7qRkufmFPkvroTuqbuBpR sBeZvoOEUH70sVi36NMN5pBjVRV6uAQRHnsle3awRT58E+ensc4ztl9Kt8Z6qD79yTH+ 4JbDJUNG9vuXnQOFSpDkKEYk8jmg31WC/wXabyvwTGtDnmFlwdSf6RDRu5eOvsLyk4uP g8QI5oNFKlFWpIdlbPWWHBGjLqdnqSBBd3h8jaa7iUNIjr8JwpV6g7reLe/LGjx7JpcK Bp6w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id l191-20020a6391c8000000b003c6b63ed4adsi2288225pge.331.2022.06.08.04.05.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 04:05:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1DED61B07AA; Wed, 8 Jun 2022 03:31:24 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236748AbiFHKaW (ORCPT + 99 others); Wed, 8 Jun 2022 06:30:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237205AbiFHK2X (ORCPT ); Wed, 8 Jun 2022 06:28:23 -0400 Received: from mailout3.hostsharing.net (mailout3.hostsharing.net [176.9.242.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 986C9EE8EF; Wed, 8 Jun 2022 03:17:40 -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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.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(+) -- 2.35.2