From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.82.48 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795398614; b=gOg6m1dnqHmnHmYqHnfP+OTLsC9lggafiUqBlEuLrsAjPbMeMc89OS8YI8WbZEEIrQ32 UtJocYxoRTHCWZg/nqx3UnhgRxO1jKSWOrStnF0du6nF1qeBcjKXIOpxfY5dSfN0HPkln KtVQmo3VleZYRfz9bRlaGt/+H0wX4errnxAfvrE2PclDX6DBvklxcdr3eS2aAJe4T/kOZ 0YlvEAtHG3uThztJSgg4SBCl92jGA4voDNidQjHBEh2F7GdSAXY3ELThIG92huHeAhSC1 jWKxjzZ/I9Cp6oVzW2U493//tuyG5JQA9iF48Cxq9RwlDMO02CaGUQKLA5jVfzmwqmA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795398614; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:Message-ID:From:To:Cc:Subject:In-Reply-To:References: MIME-Version:Content-Type:Content-Transfer-Encoding: Content-Disposition; bh=HPgiKAKXJD1IfapqnG6OwznXuOp3qOSKSxNr/yY/XDo=; b=SORgbPxSTa17G8tCcE7JUdb2yecJVrjanoMOuVCTrWObNJRY5iIyzKcNh1+FF7wFXVX8 ncFmQR0lIaeHBg1c1aWsfYHBr4ywRLvIBTirPiflbguibtgh5Y6hgVNg2chrhslK/wvxU vdYGS6rX09bSPIC7cq3vQVUv+uygLjMeg4pZ1kSM1k6VUACwYaHZxltOusdFtK435nUQ5 fTKGq0sVhww7un+hmUAKrnzEvhrEb6AE8XC5E6dSMq2AaFdNvvLjTqq8VWLoxsO3cxO7F SovHrX0zMqG3ydFX/w2XWA0ZPafOINKHgMmGYvg8mWEiKijCgndPSAF8p3gnh8a2V+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=MNA1EOOg; arc=none smtp.remote-ip=74.125.82.48 Received: from mail-dl1-f48.google.com (mail-dl1-f48.google.com [74.125.82.48]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D312F606A320 for ; Mon, 23 Nov 2026 01:50:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D312F606A320 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=MNA1EOOg Received: by mail-dl1-f48.google.com with SMTP id a92af1059eb24-14394530ec6so4135672c88.1 for ; Sun, 22 Nov 2026 17:50:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1795398613; x=1796003413; darn=vger.kernel.org; h=content-disposition:content-transfer-encoding:content-type :mime-version:references:in-reply-to:subject:cc:to:from:message-id :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=HPgiKAKXJD1IfapqnG6OwznXuOp3qOSKSxNr/yY/XDo=; b=MNA1EOOgy6ZBUuhdD/ZBI7Krj7F286wnIncjH3RvwMa9Lc6CVzlP3UWssD/jKo8kN7 184A5ipSF0KxnBffvHbZUN+7mGJxIAZqrn4T/nS9fYIOIeVXd1Xfe58RDS3ca8MxmdlG f7ip3ojQ3TguSeO2SPj0EX9SjMAZLOpzJI7OppbJeoTT+ksGEU/4zTxb31E2/b+LE1ky XZR4ZxT+5e3Ks+ZDfQnGbk5ix4v6y6AlYras45QHR/82UCqVk5NvRExUoY/e7bjEGuid 1axATOXDH4WLjGw3TC4bdTjr6UJy04UtiZyYcHA4T8SfZsYNl3mcJ3kKl9XUgaLCMnRq vKLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795398613; x=1796003413; h=content-disposition:content-transfer-encoding:content-type :mime-version:references:in-reply-to:subject:cc:to:from:message-id :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=HPgiKAKXJD1IfapqnG6OwznXuOp3qOSKSxNr/yY/XDo=; b=fiVDuFO2igtnCc5aZ2KJGaKFHh4IrYQWoJrH2dhsujF6EXKZLIO5dbGp+lUSVvtP3z iydcfLwjx4r7TMba4adP0sRHQqq0WrsrHP+w7LzOkH8p9mP/xQyGNldLH6S2rE92uz08 tHk/+jg1xv1al7UD4EklLp2WiC1YNoqut5iDjZDw8/xft++iheBGntb9zWowI5pZRY0K 4/w7E4HKL50SxC0npRnWpucXoQEI4qqzsfzLlbLWOUmKDq9wnwZ7h/v4TrBbENdmZFkv WHN7zT6K/fAVJgBNeKMBwBW0QL6zLZc4+4TMZXfVWN1B9vXLKpZYlppEeRlDQruAjrU/ SNUw== X-Forwarded-Encrypted: i=1; AL+hErEj0/cQBYTfl4yiY3U55AiCyF0B/c7AEnOfU2Sklu/2q84gnUl/HISqursc6G8PdlVWWeFyQveCOJR41hE=@vger.kernel.org X-Gm-Message-State: APuU4Z88ugX/+DyzhwEpCM/Y5gzcEuYTr1ztUeATxXfprjbY2poOg3tn md6xuwBfGgIjvhRNJyMr9/sz89eBYfr5ulZcFmzey4lOYOtJJocrV61b X-Gm-Gg: AZFdTZdCEsEMnReOLHGM6g8HeGCR7qrSCDgGOY2dCGvYCTBGK8cs3Upm42Ty22EcvC7 ilE0oXaD20axFJZS2g0ROgLWr5JF8fC2Vvv+3+FXyWPXbG17bx7fvS+N/bRqsLy3burfK7l4Hel Zpa674eHN765Nfxb7R2pJysiPc7XZy1ZCbYMNNJCWnSuQ5hjnYwVp7O8EokHclcQWIj3W9jyCk9 /wYK/DCWvalSHBavvCf7/RkYu8E4PmGi832/rzNNtl1XkGwev4H7KXdRffTsE9ymT0NSlXqGyTq 4OnA9TuP+IFfXa5lB/60G0/GQ+ShPreKHFwLJQZlwBUJAiF2WnHqgc5jzBbvoSWOJvZkxj6a0O6 ATyp2cYLRXxcOgTHwWT//lqw5RpbPOw12ugeSZc0azPP+OD8rVT287vBPkltHuucuYRTSE70xOm VDKHbHpYsk571EcQmBekJyXi1iC8AqJcJid6gvO9AZYHobkzuXMXhrMNhxs9bgRUHfm8PZNoc9y yhWgeQSH8Y4feX2nWr/n4Q/SA5Enc31hULH/OrSX1ZZfqvqB94zkCPjcJ/xt2kl1Bd/scSjLvA2 J5kAlenIc5vTZO379LTUvwreT5eFiu9536PPYsHuNRzUC63Gl2wDbvgiqRFCxwRvF1gkDw== X-Received: by 2002:a05:701b:230b:b0:1b2:4da6:bccd with SMTP id a92af1059eb24-1b5568feaadmr8740253c88.34.1795398612828; Sun, 22 Nov 2026 17:50:12 -0800 (PST) Received: from localhost ([2a00:79e0:2ebe:8:f002:4621:aeeb:e0e7]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1b5567e2bd1sm23364703c88.3.2026.11.22.17.50.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Nov 2026 17:50:12 -0800 (PST) Date: Sun, 22 Nov 2026 17:50:11 -0800 Message-ID: <8c2d4920319771e3f7edb083b2e831a9@gmail.com> From: Dmitry Torokhov To: Jakob Unterwurzacher Cc: Mark Brown , Jakob Unterwurzacher , "Rafael J. Wysocki" , Tony Lindgren , Joseph Chen , Lee Jones , Sebastian Reichel , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Heiko Stuebner , linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, mfd@lists.linux.dev, devicetree@vger.kernel.org Subject: Re: [PATCH 1/4] Input: rk805-pwrkey - enable the wakeup interrupt during system suspend In-Reply-To: <7bec766f-14b1-4eac-96c7-d7f1cf38021d@cherry.de> References: <20261029-dev-tiger-v7-4-pre-20261028-tiger-suspend-b4-v1-0-cb12621c1fb4@cherry.de> <20261029-dev-tiger-v7-4-pre-20261028-tiger-suspend-b4-v1-1-cb12621c1fb4@cherry.de> <7bec766f-14b1-4eac-96c7-d7f1cf38021d@cherry.de> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Content-Disposition: inline Hi Jakob, On Fri, Nov 20, 2026 at 02:42:57PM +0100, Jakob Unterwurzacher wrote: > On 11/12/26 01:25, Dmitry Torokhov wrote: ... > > Sounds like this needs to be solved in PM core rather than hacked around > > in individual driver? Let's CC Tony and Rafael. > > How about something like this, copy-pasted below? If no immediate > objections I'll post it as a proper patch. > > With this, rk805-pwrkey can use dev_pm_set_wake_irq with no issues > (tested on RK3588-Tiger). This approach makes sense to me (and matches what several I2C controller drivers such as i2c-imx already do), though ultimately it is up to Mark Brown to decide for SPI. For rk805-pwrkey, please use devm_pm_set_wake_irq() in v2. ... > > Take a runtime PM reference in the regular suspend phase and drop it on > > resume. This keeps the controller usable until its noirq suspend > > callback, and since it was active then, pm_runtime_force_resume() > > restores it in the noirq resume phase, before interrupts of child > > devices are handled again. > > > > Signed-off-by: Jakob Unterwurzacher Probably worth adding Fixes: be721b451aff ("spi: rockchip: Resolve unbalanced runtime PM / system PM handling") as well. ... > > +/* > > + * Child devices (e.g. an RK806 PMIC with its interrupt controller and wakeup > > + * interrupts) can still need the bus during the late and noirq phases of > > + * system suspend and resume, while runtime PM is disabled. Keep the controller > > + * runtime-active from the regular suspend phase on, so that such transfers > > + * work and pm_runtime_force_resume() restores the controller in the noirq > > + * resume phase, before child device interrupts are handled again. > > + */ One nit on the comment: rockchip_spi_isr() does not use IRQF_NO_SUSPEND (and pl330 DMA suspends in the late phase), so arbitrary transfers in child suspend_noirq()/resume_noirq() callbacks still will not work. What this actually enables are PIO transfers in the late/early phases, during device_wakeup_arm_wake_irqs() before device IRQs are suspended, and once resume_device_irqs() re-enables them at the end of the noirq resume phase. It might be worth wording the comment more precisely so nobody assumes general noirq transfers are supported. Thanks. -- Dmitry