Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp2399282iof; Wed, 8 Jun 2022 04:15:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwspudZfuVmp3FSMPcjbb8R3j4ZNZA5LW0/fPwdhQlVrJB6REAxF7zHwVBOoE2iHY3PzFe1 X-Received: by 2002:a65:6e0b:0:b0:3aa:6146:15a8 with SMTP id bd11-20020a656e0b000000b003aa614615a8mr29097688pgb.181.1654686958724; Wed, 08 Jun 2022 04:15:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654686958; cv=none; d=google.com; s=arc-20160816; b=n1x4LYzNV0yK2wdpeguSJDzZXjoXtZXEfTFEy5Udt8f0qbAwlB4WmGYKaXUyuw79mb PwAhOw6elU5ScRrHfs2nUJ/BWWPL51jDcowsQfPQ6N4zZdVf69tmZKGXrOWmCyCjkQlC 3RaOwiOodLUCwhjYSScllqIiyqYAI6L3FZXWSAVMbRyY3YqBCMJq1bhr9Jwgyywxy8xQ /Sa2nMd/Gne6SzqpuCWtw+XnORO1GLemaMjemKkKB4BHqk0DtOj7flyhAx6RQr6sZc5a 1VvHs/mphwyGtacs/YgJXdvnTVO2lxyaj/mZUObp4bxMzwrT+S+v3poNjhW1aE6lfXwl verw== 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; bh=9inqKolylwY+9CN5LJBsj0ieLUPaFRDgrwMAar4kegU=; b=rA3zZh1UNTem3iwR6ngYw5xbC3jnBxVSdJ7zhyQBZR9lZwVl81FCrugVaAKsTNh38a U6o2kGbiKsaSD1WXYDrq3rf+IuJwTsC8ScuNXHTYDyZ7ychrSFh2G68WX7RWzJmDLEqn awdIcyDcuvnSOwk5adEMi2yK9A3Z3Q9D2ATHDa2hxs6WAyj8EQaxrxT2yskJ/Pjk1NHi vXcE4FW9H0uMa4WXWDJMcdbc7AGg1HCjFD89fCaKf9HGIMFP1sXXsdh6hfeRklGHEkV4 0vX8jqedHv76lsda2T2qoVYW7PJYO/LuteFuPWNORTs0+HpYbgr2YzR1Dq6B71sBC5f3 x68w== 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id f18-20020a170902ce9200b0015e05374e86si30443830plg.443.2022.06.08.04.15.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jun 2022 04:15: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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 40C8921483A; Wed, 8 Jun 2022 03:39:47 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236691AbiFHKjh (ORCPT + 99 others); Wed, 8 Jun 2022 06:39:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237554AbiFHKi2 (ORCPT ); Wed, 8 Jun 2022 06:38:28 -0400 Received: from mail-yw1-f178.google.com (mail-yw1-f178.google.com [209.85.128.178]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D20592AC570; Wed, 8 Jun 2022 03:36:07 -0700 (PDT) Received: by mail-yw1-f178.google.com with SMTP id 00721157ae682-30fdbe7467cso169047797b3.1; Wed, 08 Jun 2022 03:36:07 -0700 (PDT) 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=9inqKolylwY+9CN5LJBsj0ieLUPaFRDgrwMAar4kegU=; b=Jlxd/4InTGQ3arVIG1dE5u8RLbDijR85cJdJkLZxMfEDJ0LcqaK8pNUmD7G/4Kuipa 0/m6VAeFfaa4qNn4iRS9qrtJ07B8X631E6f1ByRrqjcAD2gANeexzTDAbwmOMadIF/HM qqPtd3bN3doJ/IZKHM+Y1z6nrBOoXefUwp9RzqviGn8cDK5uDbrC9vG+Olh5lusSiLWY 7uNN3+deX6pmOlUo6aN8dxPVGeahcTnJe4MwHaztIwXEMA9i0PPi6uqThYY7HbtI3Mry dxCsmyg4rvNtH9iAUYS8n7E6xfGRw1GJr6K+jcmXaqV2xxtGCALShmCaJoYJD2hx/G7+ hvCQ== X-Gm-Message-State: AOAM531GBASXUwklrtisXb1YzJoUP5dL9DfeDGq6MxPZH1pmJe/TPF5K QBG7m9BbO0JDNbCP561XOJyDeRYFc+tn6Su8Z8A= X-Received: by 2002:a81:260a:0:b0:2f4:ca82:a42f with SMTP id m10-20020a81260a000000b002f4ca82a42fmr36701040ywm.149.1654684546217; Wed, 08 Jun 2022 03:35:46 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 8 Jun 2022 12:35:35 +0200 Message-ID: Subject: Re: [PATCH net v2 0/1] PHY interruptus horribilis To: Lukas Wunner Cc: "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 , netdev , 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 , Linux Kernel Mailing List , Linux PM Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,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 On Wed, Jun 8, 2022 at 11:52 AM Lukas Wunner wrote: > > 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. Yes, it is not there intentionally. Strictly speaking, IRQD_WAKEUP_ARMED is there to indicate to the IRQ subsystem that the given IRQ is a system wakeup one and has been left enabled specifically in order to signal system wakeup. It allows the IRQ to trigger between suspend_device_irqs() and resume_device_irqs() exactly once, which causes the system to wake up from suspend-to-idle (that's the primary use case for it) or aborts system suspends in progress. As you have noticed, it is set automatically by suspend_device_irqs() if the given IRQ has IRQD_WAKEUP_STATE which is the case when it has been enabled for system wakeup. > 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? The idea is that the regular IRQ "action" handler will run before suspend_device_irqs(), so it should take care of signaling wakeup if need be. IRQD_WAKEUP_ARMED to trigger wakeup when IRQ "action" handlers don't run. > Side note: suspend_device_irqs() and resume_device_irqs() have been > exported since forever even though there's no module user... Well, that's a mistake.