Received: by 2002:ab2:715a:0:b0:1fd:c064:50c with SMTP id l26csp53847lqm; Mon, 10 Jun 2024 12:25:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUjORHjSa5XMAjljXAF4w41fTCydWjuiRbnmbvJv1TE9p6grK7UdppwHVzNukaDfRCqBR4yUDiMF7poI2YjCiBl8kLIFSHNf2TUizj/gQ== X-Google-Smtp-Source: AGHT+IEzX26nDZbTePlgSDvMo0M7T59/b0+uiyjfOEbmWYUFl5TmtXUm0r9hLzMp6fyYp+kbJKGy X-Received: by 2002:a05:622a:1b91:b0:43d:db03:81b4 with SMTP id d75a77b69052e-44041ce37ccmr127473361cf.43.1718047552307; Mon, 10 Jun 2024 12:25:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718047552; cv=pass; d=google.com; s=arc-20160816; b=JkkmqWq36VeLc8WQaDAif3YDoenfIbZxskrol/RcccnitT9wzOLqaeGNFXzP+iW0Jx iV0NHhMtBLNHuHUL1xsW7Uls+opvZZCbontEPMEkVcImmIw4zVVIJPnsGLPoRKtVNHiS 3SbdVx5PF4BZkZrbGxqpBPbr6im0+bTPyv991Qgdei+BrgfBAB4x1DlKuQUGfOrxx0k7 yVTi67HUwwvTtxooL+wOfODz7kwaZX2vJhIZZj1dGoMK2x1zsiedvRvSvAqsBDrdEGDa aOYZSkPqEOF2TeAyaJcKZWJbsZNwSDd8/KzZOdg2VZ0G9cUHgSufPGJpynaGHAxi6v2y ni8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=HBt4RKo9/sSLehurMEIcT3Dh56M0u1PHePIeTS7hnRw=; fh=9pwNdCSeNiPNF2Z/oXz8F3ner/5GDdmEYx11Cf91YJE=; b=OzDpvci4wExW0mr6jyTs1s5BH6ZyugoeBlfw4kXQTN0Uew3hfjptyBJu8CEdKdftXK /UWZ1F6k2e6+pe7NwuYwrcLNJeZGTSyxK4jY3ArEijNRSWkxRcP+4PUUAdTWCMMQTUYs Cx9dHegSmwdiGLVhxwJBHL57p5/x9ivWoz1UQAjsiuGHxarlbzUK6nUKeE1UR7j3E3iX 38p4ykEJvFGQY+EVwqwbS5IjK9L0XbRvADMwoTvvfNc9P5KajyKU0tcJVrq5688Jiii1 qFlUWV0IuyOw2weISoqV9PRQWA0bdpUbG01d5olWoUi9g2PcsEzGYqLmH2Q4a8kQOKJF 1TCw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IlhXHSOh; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208793-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208793-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id d75a77b69052e-44038b39fddsi81762201cf.437.2024.06.10.12.25.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 12:25:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208793-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=IlhXHSOh; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; arc=pass (i=1 spf=pass spfdomain=linutronix.de dkim=pass dkdomain=linutronix.de dmarc=pass fromdomain=linutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-208793-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208793-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 09FCE1C21803 for ; Mon, 10 Jun 2024 19:25:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A161814D714; Mon, 10 Jun 2024 19:25:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="IlhXHSOh"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Zna2BmKA" Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 17816147C6E for ; Mon, 10 Jun 2024 19:25:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718047548; cv=none; b=Okfxeh2IvROX8rAHt02XN4k9hU9lnfjoXEDeN5aKN9tPBEblm8qkkIbYN2c7wvV70uOLOCRqfiIxs+Xeekyqv9e6DIteapcZh/IqwfHCCZaYQvX/cis7rcSgOAfJlo8Zvqv8gqzDtfi/3E5Xw1ZQ8RcrbecWCaGY6SiGigvMxw0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718047548; c=relaxed/simple; bh=DReATjJoT0Z7EmcEOoRiUxp+pwQWIV8qe+F7SKa/pjQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=tnsn3/CVZuZbXlaEm71gbYWxyTtnJLiEn2pADiOJbSFKL9ou14DjaVyw3JB5f1YDvstrZDqFQ+KGM9ZBPcL018eAhYubxb4F6KPzxIRTSq6+gOLIRlXZqgk6gAlNRj0hzZVXRrH2s+yw/aeQLg+nQeDp0NubysdyqRIHh/+mNPE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=IlhXHSOh; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=Zna2BmKA; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1718047545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HBt4RKo9/sSLehurMEIcT3Dh56M0u1PHePIeTS7hnRw=; b=IlhXHSOhzceeTs+KjqgGWcnB+tOL37d0XkoH8KGcl/f3auE9ZvOToE+Lbp6SAZ/XFnSnVI PyRbDjVl4jVNvOL1y7W91ukJHWojaiylWJd07nf6TC8GvXM+OKzqbZUULFSFyZW6/zGT81 RKZoUexhvZm0yFH/k+nJM+dq0UMtLuNvxj8JSN9re5jyCuqut/N2HnhPEo7+ZpQrzN3CTP 0vW23/rH0ohHL8WckTg/rz5fYAZzf2aESAYE2V21S7Ou4WJqS4b5qmQCFXhxebUfhfPoSp OB3+AlAzAFrDPqvYEha4qNAKeealma7njvduKyw9eaLpAmZLfRCspjI8Hfm/fw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1718047545; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HBt4RKo9/sSLehurMEIcT3Dh56M0u1PHePIeTS7hnRw=; b=Zna2BmKAdndDlYeKlXEgBvUsgTOfwew9M1RwrvppBwLbNBn8eD53c1ji68YBheQyJdAvB3 9lom/nbu33KsSkDw== To: Zhenze Zhuang Cc: linux-kernel@vger.kernel.org, Zhenze Zhuang Subject: Re: [PATCH] genirq: Fix gpio irq will fail to be resend under certain conditions In-Reply-To: <20240608163620.89028-1-luuiiruo@163.com> References: <20240608163620.89028-1-luuiiruo@163.com> Date: Mon, 10 Jun 2024 21:25:44 +0200 Message-ID: <874ja0wqfb.ffs@tglx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Zhenze! On Sun, Jun 09 2024 at 00:36, Zhenze Zhuang wrote: This has nothing to do with GPIO interrupts. It's a general problem vs. resend, no? > When a gpio irq is disable and the wakeup function is enable, and > the device enters suspend, the irq wakeup is triggered but then enters > suspend, the IRQS_REPLAY flag will be set, but the IRQS_REPLAY will > not be cleared because the irq_may_run() condition is not met. After > the gpio irq is enabled and the suspend is entered again, after the > gpio irq is triggered, the check_irq_resend() execution will fail > because the IRQS_REPLAY is asserted, resulting in the interrupt not > being resned. The concept of separate sentences and paragrahs exists for a reason. https://www.kernel.org/doc/html/latest/process/maintainer-tip.html#changelog No let me break that world salad apart and digest it. > When a gpio irq is disable and the wakeup function is enable, and > the device enters suspend, the irq wakeup is triggered but then enters > suspend, the IRQS_REPLAY flag will be set, but the IRQS_REPLAY will > not be cleared because the irq_may_run() condition is not met. So what you are saying is: An interrupt is disabled, but the wakeup function of the interrupt is enabled, right? Now the system enters suspend and the interrupt is raised, which triggers the wakeup function, right? Now the system enters suspend nevertheless. How can that happen? Due to that the IRQS_REPLAY flag will be set. How so? IRQS_REPLAY is only set from the resend function. Due to that IRQS_REPLAY will not be cleared because the irq_may_run() condition is not cleared. Sure, but how does any of this happen in the first place? > After the gpio irq is enabled and the suspend is entered again, after > the gpio irq is triggered, the check_irq_resend() execution will fail > because the IRQS_REPLAY is asserted, resulting in the interrupt not > being resned. This sentence really makes my brain go in circles. None of this change log makes any sense. Before you send me a decipherable description of the problem, let me ask you a few obvious questions: 1) Why is the interrupt disabled _and_ marked as wakeup interrupt? 2) If it should still wakeup the system even if disabled, then the interrupt chip should have the IRQCHIP_ENABLE_WAKEUP_ON_SUSPEND flag set. That's not the case, right? Thanks, tglx