Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 275627EA for ; Wed, 4 Jan 2023 09:29:34 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 44F744661; Wed, 4 Jan 2023 09:29:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1672824572; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zLmQmkQw6xubYTIzbi2meMNuyRMOlcASYbgGa0RZR8w=; b=adGwzGh4O41Qplflej3jD60cgOz57shgKr7CpG0p4gzdqj6oJx+G9A4E4IPKX8BU8HpYrB zPbr/JOMlxvKmmYA1h2Q9VHqJgKqvfLKkngig4VlCMuwuK6nkn4fsIJ75/mrjaI3M0+l2W YT/M0slP7I0WrBrNHp9eQ2vqdI4HuP8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1672824572; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=zLmQmkQw6xubYTIzbi2meMNuyRMOlcASYbgGa0RZR8w=; b=qNcqXbUd1hjSqcOqF3GauoQAWNDgO7Xx+FFdJllkD6w8ovDKXhHWcUTCNrmlIIcyNF+6Ba 8iYtmPg7bPME6EBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 1A451133D1; Wed, 4 Jan 2023 09:29:32 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 82RpBfxGtWPCOQAAMHmgww (envelope-from ); Wed, 04 Jan 2023 09:29:32 +0000 Date: Wed, 04 Jan 2023 10:29:31 +0100 Message-ID: <874jt6ps04.wl-tiwai@suse.de> From: Takashi Iwai To: waldek andrukiewicz Cc: stable@vger.kernel.org, regressions@lists.linux.dev, tiwai@suse.de, Stefan Binding , Richard Fitzgerald , Lucas Tanure Subject: Re: i2c-CLSA0100:00-cs35l41-hda.1: System Suspend not supported In-Reply-To: <4262e3c4-6169-bbd2-e918-16b06f6994bc@protonmail.com> References: <4262e3c4-6169-bbd2-e918-16b06f6994bc@protonmail.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) Emacs/27.2 Mule/6.0 Precedence: bulk X-Mailing-List: regressions@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit [ adding Cirrus people to Cc ] On Tue, 03 Jan 2023 21:39:42 +0100, waldek andrukiewicz wrote: > > Hello, > > I am running Manjaro, after upgrading from kernel 6.0.15 to 6.1.1 ( > https://gitlab.manjaro.org/packages/core/linux61) I have noticed that suspend > stopped working, what I can see in the logs is the following issue which IMO > points to cs35l41 > > Machine: >   Type: Laptop System: LENOVO product: 82N6 v: Legion 7 16ACHg6 > > journalctl output below: > > Jan 02 21:52:54 legion16 systemd[1]: Starting System Suspend... > Jan 02 21:52:54 legion16 wpa_supplicant[1193]: wlp4s0: CTRL-EVENT-DSCP-POLICY > clear_all > Jan 02 21:52:54 legion16 systemd-sleep[2912]: Entering sleep state > 'suspend'... > Jan 02 21:52:54 legion16 kernel: PM: suspend entry (deep) > Jan 02 21:52:54 legion16 kernel: Filesystems sync: 0.008 seconds > Jan 02 21:52:54 legion16 wpa_supplicant[1193]: wlp4s0: CTRL-EVENT-DSCP-POLICY > clear_all > Jan 02 21:52:54 legion16 wpa_supplicant[1193]: nl80211: deinit ifname=wlp4s0 > disabled_11b_rates=0 > Jan 02 21:52:54 legion16 plasmashell[1770]: qml: [DEBUG] - onNewData > Jan 02 21:52:54 legion16 kernel: Freezing user space processes ... (elapsed > 0.002 seconds) done. > Jan 02 21:52:54 legion16 kernel: OOM killer disabled. > Jan 02 21:52:54 legion16 kernel: Freezing remaining freezable tasks ... > (elapsed 0.001 seconds) done. > Jan 02 21:52:54 legion16 kernel: printk: Suspending console(s) (use > no_console_suspend to debug) > Jan 02 21:52:54 legion16 kernel: cs35l41-hda i2c-CLSA0100:00-cs35l41-hda.1: > System Suspend not supported > Jan 02 21:52:54 legion16 kernel: cs35l41-hda i2c-CLSA0100:00-cs35l41-hda.0: > System Suspend not supported > Jan 02 21:52:54 legion16 kernel: cs35l41-hda i2c-CLSA0100:00-cs35l41-hda.1: > PM: dpm_run_callback(): cs35l41_system_suspend+0x0/0xd0 > [snd_hda_scodec_cs35l41] returns -22 Indeed the suspend isn't supported for this chip wrt the specific model/config, but it's a bad behavior to block the whole system suspend due to that. Could you try the patch below? Takashi -- 8< -- diff --git a/sound/pci/hda/cs35l41_hda.c b/sound/pci/hda/cs35l41_hda.c index 91842c0c8c74..6322157c7ea2 100644 --- a/sound/pci/hda/cs35l41_hda.c +++ b/sound/pci/hda/cs35l41_hda.c @@ -598,8 +598,8 @@ static int cs35l41_system_suspend(struct device *dev) dev_dbg(cs35l41->dev, "System Suspend\n"); if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) { - dev_err(cs35l41->dev, "System Suspend not supported\n"); - return -EINVAL; + dev_err_once(cs35l41->dev, "System Suspend not supported\n"); + return 0; /* don't block the whole system suspend */ } ret = pm_runtime_force_suspend(dev); @@ -624,8 +624,8 @@ static int cs35l41_system_resume(struct device *dev) dev_dbg(cs35l41->dev, "System Resume\n"); if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) { - dev_err(cs35l41->dev, "System Resume not supported\n"); - return -EINVAL; + dev_err_once(cs35l41->dev, "System Resume not supported\n"); + return 0; /* don't block the whole system resume */ } if (cs35l41->reset_gpio) { @@ -647,6 +647,15 @@ static int cs35l41_system_resume(struct device *dev) return ret; } +static int cs35l41_runtime_idle(struct device *dev) +{ + struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev); + + if (cs35l41->hw_cfg.bst_type == CS35L41_EXT_BOOST_NO_VSPK_SWITCH) + return -EBUSY; /* suspend not supported yet on this model */ + return 0; +} + static int cs35l41_runtime_suspend(struct device *dev) { struct cs35l41_hda *cs35l41 = dev_get_drvdata(dev); @@ -1536,7 +1545,8 @@ void cs35l41_hda_remove(struct device *dev) EXPORT_SYMBOL_NS_GPL(cs35l41_hda_remove, SND_HDA_SCODEC_CS35L41); const struct dev_pm_ops cs35l41_hda_pm_ops = { - RUNTIME_PM_OPS(cs35l41_runtime_suspend, cs35l41_runtime_resume, NULL) + RUNTIME_PM_OPS(cs35l41_runtime_suspend, cs35l41_runtime_resume, + cs35l41_runtime_idle) SYSTEM_SLEEP_PM_OPS(cs35l41_system_suspend, cs35l41_system_resume) }; EXPORT_SYMBOL_NS_GPL(cs35l41_hda_pm_ops, SND_HDA_SCODEC_CS35L41);