* sdhci_pci module is blocking low power s0ix sleep with GL9767 @ 2024-09-26 15:31 Georg Gottleuber 2024-10-08 15:05 ` Ulf Hansson 0 siblings, 1 reply; 10+ messages in thread From: Georg Gottleuber @ 2024-09-26 15:31 UTC (permalink / raw) To: Georg Gottleuber Cc: victor.shih, Lucas.Lai, Greg.tu, HL.Liu, adrian.hunter, ulf.hansson, linux-mmc, linux-kernel Hello, I have a problem with s0ix sleep on a laptop with GL9767 SD card reader. The device is a TUXEDO InfinityBook Pro 14 Gen9 Intel laptop and consumes 6 watts in s2idle (not reaching s0ix). If I blacklist sdhci_pci in /etc/modprobe.d/blacklist.conf then the device sleeps with 1.2 watts (this is not super good, but OK). Unfortunately unloading and reloading does not work either. Once the module has been loaded, the high power consumption remains, even after a rmmod. I tested this behavior with linux mainline 6.11, 6.11.0-rc7-next-20240909. Kernel mmc/next does not work either. In an AMD device (InfinityBook Pro 14 Gen9 AMD), however, the same card reader sleeps without any problems. Link https://bugzilla.kernel.org/show_bug.cgi?id=219284 Any ideas? Kind regards Georg Gottleuber ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sdhci_pci module is blocking low power s0ix sleep with GL9767 2024-09-26 15:31 sdhci_pci module is blocking low power s0ix sleep with GL9767 Georg Gottleuber @ 2024-10-08 15:05 ` Ulf Hansson 2024-10-15 12:47 ` [RFC PATCH 1/1] mmc: sdhci-pci-gli: fix x86/S0ix SoCs suspend for GL9767 Georg Gottleuber 0 siblings, 1 reply; 10+ messages in thread From: Ulf Hansson @ 2024-10-08 15:05 UTC (permalink / raw) To: Georg Gottleuber Cc: victor.shih, Lucas.Lai, Greg.tu, HL.Liu, adrian.hunter, linux-mmc, linux-kernel, Ben Chuang + Ben On Thu, 26 Sept 2024 at 17:31, Georg Gottleuber <ggo@tuxedocomputers.com> wrote: > > Hello, > > I have a problem with s0ix sleep on a laptop with GL9767 SD card reader. > > The device is a TUXEDO InfinityBook Pro 14 Gen9 Intel laptop and > consumes 6 watts in s2idle (not reaching s0ix). If I blacklist sdhci_pci > in /etc/modprobe.d/blacklist.conf then the device sleeps with 1.2 watts > (this is not super good, but OK). Unfortunately unloading and reloading > does not work either. Once the module has been loaded, the high power > consumption remains, even after a rmmod. > > I tested this behavior with linux mainline 6.11, > 6.11.0-rc7-next-20240909. Kernel mmc/next does not work either. > > In an AMD device (InfinityBook Pro 14 Gen9 AMD), however, the same card > reader sleeps without any problems. > > Link https://bugzilla.kernel.org/show_bug.cgi?id=219284 > > Any ideas? I am sorry, but I don't have any useful suggestions at this point. We need some help from the guys from Genesys Logic. > > Kind regards > Georg Gottleuber Kind regards Uffe ^ permalink raw reply [flat|nested] 10+ messages in thread
* [RFC PATCH 1/1] mmc: sdhci-pci-gli: fix x86/S0ix SoCs suspend for GL9767 2024-10-08 15:05 ` Ulf Hansson @ 2024-10-15 12:47 ` Georg Gottleuber 0 siblings, 0 replies; 10+ messages in thread From: Georg Gottleuber @ 2024-10-15 12:47 UTC (permalink / raw) To: Ulf Hansson Cc: victor.shih, Lucas.Lai, Greg.tu, HL.Liu, adrian.hunter, linux-mmc, linux-kernel, Ben Chuang, Georg Gottleuber Adapt commit 1202d617e3d04c ("mmc: sdhci-pci-gli: fix LPM negotiation so x86/S0ix SoCs can suspend") also for GL9767 card reader. This patch was written without specs or deeper knowledge of PCI sleep states. Tests show that S0ix is reached and a lower power consumption when suspended (6 watts vs 1.2 watts for TUXEDO InfinityBook Pro Gen9 Intel). The function of the card reader appears to be normal. Link: https://bugzilla.kernel.org/show_bug.cgi?id=219284 Co-developed-by: Christoffer Sandberg <cs@tuxedo.de> Signed-off-by: Christoffer Sandberg <cs@tuxedo.de> Signed-off-by: Georg Gottleuber <ggo@tuxedocomputers.com> --- drivers/mmc/host/sdhci-pci-gli.c | 65 +++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/host/sdhci-pci-gli.c b/drivers/mmc/host/sdhci-pci-gli.c index 0f81586a19df..40f43f5cd5c7 100644 --- a/drivers/mmc/host/sdhci-pci-gli.c +++ b/drivers/mmc/host/sdhci-pci-gli.c @@ -1205,6 +1205,32 @@ static void gl9763e_set_low_power_negotiation(struct sdhci_pci_slot *slot, pci_write_config_dword(pdev, PCIE_GLI_9763E_VHS, value); } +static void gl9767_set_low_power_negotiation(struct sdhci_pci_slot *slot, + bool enable) +{ + struct pci_dev *pdev = slot->chip->pdev; + u32 value; + + pci_read_config_dword(pdev, PCIE_GLI_9767_VHS, &value); + value &= ~GLI_9767_VHS_REV; + value |= FIELD_PREP(GLI_9767_VHS_REV, GLI_9767_VHS_REV_W); + pci_write_config_dword(pdev, PCIE_GLI_9767_VHS, value); + + pci_read_config_dword(pdev, PCIE_GLI_9767_CFG, &value); + + if (enable) + value &= ~PCIE_GLI_9767_CFG_LOW_PWR_OFF; + else + value |= PCIE_GLI_9767_CFG_LOW_PWR_OFF; + + pci_write_config_dword(pdev, PCIE_GLI_9767_CFG, value); + + pci_read_config_dword(pdev, PCIE_GLI_9767_VHS, &value); + value &= ~GLI_9767_VHS_REV; + value |= FIELD_PREP(GLI_9767_VHS_REV, GLI_9767_VHS_REV_R); + pci_write_config_dword(pdev, PCIE_GLI_9767_VHS, value); +} + static void sdhci_set_gl9763e_signaling(struct sdhci_host *host, unsigned int timing) { @@ -1470,6 +1496,42 @@ static int gl9763e_suspend(struct sdhci_pci_chip *chip) gl9763e_set_low_power_negotiation(slot, false); return ret; } + +static int gl9767_resume(struct sdhci_pci_chip *chip) +{ + struct sdhci_pci_slot *slot = chip->slots[0]; + int ret; + + ret = sdhci_pci_gli_resume(chip); + if (ret) + return ret; + + gl9767_set_low_power_negotiation(slot, false); + + return 0; +} + +static int gl9767_suspend(struct sdhci_pci_chip *chip) +{ + struct sdhci_pci_slot *slot = chip->slots[0]; + int ret; + + /* + * Certain SoCs can suspend only with the bus in low- + * power state, notably x86 SoCs when using S0ix. + * Re-enable LPM negotiation to allow entering L1 state + * and entering system suspend. + */ + gl9767_set_low_power_negotiation(slot, true); + + ret = sdhci_suspend_host(slot->host); + if (ret) { + gl9767_set_low_power_negotiation(slot, false); + return ret; + } + + return 0; +} #endif static int gli_probe_slot_gl9763e(struct sdhci_pci_slot *slot) @@ -1605,6 +1667,7 @@ const struct sdhci_pci_fixes sdhci_gl9767 = { .probe_slot = gli_probe_slot_gl9767, .ops = &sdhci_gl9767_ops, #ifdef CONFIG_PM_SLEEP - .resume = sdhci_pci_gli_resume, + .resume = gl9767_resume, + .suspend = gl9767_suspend, #endif }; -- 2.34.1 ^ permalink raw reply related [flat|nested] 10+ messages in thread
* sdhci_pci module is blocking low power s0ix sleep with GL9767
@ 2024-09-18 9:50 Georg Gottleuber via Bugspray Bot
2024-09-23 12:15 ` Georg Gottleuber via Bugspray Bot
` (5 more replies)
0 siblings, 6 replies; 10+ messages in thread
From: Georg Gottleuber via Bugspray Bot @ 2024-09-18 9:50 UTC (permalink / raw)
To: linux-mmc, ulf.hansson
Georg Gottleuber added an attachment on Kernel.org Bugzilla:
Created attachment 306887
kernel.log s2idle without and with sdhci_pci module
S2idle sleep on TUXEDO InfinityBook Pro 14 Gen9 Intel laptop with GL9767 SD card reader consumes 6 watts. Intel Core Ultra 7 155H is not entering s0ix properly. If I blacklist sdhci_pci in /etc/modprobe.d/blacklist.conf then the device sleeps with 1.2 watts (this is not super good, but OK). Unfortunately unloading and reloading does not work either. Once the module has been loaded, the high power consumption remains, even after a rmmod.
I tested this behavior with linux mainline 6.11.0-rc7, 6.11.0-rc7-next-20240909. Kernel mmc/next does not work either.
I also used Intel S0ix Selftest Tool and it blamed the GL9767 SD card reader.
File: kernel.log (text/plain)
Size: 150.48 KiB
Link: https://bugzilla.kernel.org/attachment.cgi?id=306887
---
kernel.log s2idle without and with sdhci_pci module
You can reply to this message to join the discussion.
--
Deet-doot-dot, I am a bot.
Kernel.org Bugzilla (bugspray 0.1-dev)
^ permalink raw reply [flat|nested] 10+ messages in thread* Re: sdhci_pci module is blocking low power s0ix sleep with GL9767 2024-09-18 9:50 sdhci_pci module is blocking low power s0ix sleep with GL9767 Georg Gottleuber via Bugspray Bot @ 2024-09-23 12:15 ` Georg Gottleuber via Bugspray Bot 2024-09-25 13:40 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot ` (4 subsequent siblings) 5 siblings, 0 replies; 10+ messages in thread From: Georg Gottleuber via Bugspray Bot @ 2024-09-23 12:15 UTC (permalink / raw) To: ulf.hansson, linux-mmc Georg Gottleuber writes via Kernel.org Bugzilla: I was able to reproduce the behaviour with kernel v6.11. View: https://bugzilla.kernel.org/show_bug.cgi?id=219284#c1 You can reply to this message to join the discussion. -- Deet-doot-dot, I am a bot. Kernel.org Bugzilla (bugspray 0.1-dev) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sdhci_pci module is blocking low power s0ix sleep with GL9767 2024-09-18 9:50 sdhci_pci module is blocking low power s0ix sleep with GL9767 Georg Gottleuber via Bugspray Bot 2024-09-23 12:15 ` Georg Gottleuber via Bugspray Bot @ 2024-09-25 13:40 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot 2024-09-30 12:55 ` Georg Gottleuber via Bugspray Bot ` (3 subsequent siblings) 5 siblings, 0 replies; 10+ messages in thread From: The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot @ 2024-09-25 13:40 UTC (permalink / raw) To: ulf.hansson, linux-mmc The Linux kernel's regression tracker (Thorsten Leemhuis) writes via Kernel.org Bugzilla: In case this is a regression (sounds like it's not!) please let me know. Side note: reminder, there is a decent chance that your report here won't be seen by the developers; for details search for "bugzilla" in documents like https://docs.kernel.org/admin-guide/reporting-issues.html or https://linux-regtracking.leemhuis.info/post/frequent-reasons-why-linux-kernel-bug-reports-are-ignored/ View: https://bugzilla.kernel.org/show_bug.cgi?id=219284#c2 You can reply to this message to join the discussion. -- Deet-doot-dot, I am a bot. Kernel.org Bugzilla (bugspray 0.1-dev) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sdhci_pci module is blocking low power s0ix sleep with GL9767 2024-09-18 9:50 sdhci_pci module is blocking low power s0ix sleep with GL9767 Georg Gottleuber via Bugspray Bot 2024-09-23 12:15 ` Georg Gottleuber via Bugspray Bot 2024-09-25 13:40 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot @ 2024-09-30 12:55 ` Georg Gottleuber via Bugspray Bot 2024-12-16 20:05 ` GRbit via Bugspray Bot ` (2 subsequent siblings) 5 siblings, 0 replies; 10+ messages in thread From: Georg Gottleuber via Bugspray Bot @ 2024-09-30 12:55 UTC (permalink / raw) To: ulf.hansson, linux-mmc Georg Gottleuber writes via Kernel.org Bugzilla: In an AMD device (InfinityBook Pro 14 Gen9 AMD), however, the same card reader sleeps without any problems. View: https://bugzilla.kernel.org/show_bug.cgi?id=219284#c3 You can reply to this message to join the discussion. -- Deet-doot-dot, I am a bot. Kernel.org Bugzilla (bugspray 0.1-dev) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sdhci_pci module is blocking low power s0ix sleep with GL9767 2024-09-18 9:50 sdhci_pci module is blocking low power s0ix sleep with GL9767 Georg Gottleuber via Bugspray Bot ` (2 preceding siblings ...) 2024-09-30 12:55 ` Georg Gottleuber via Bugspray Bot @ 2024-12-16 20:05 ` GRbit via Bugspray Bot 2024-12-16 21:25 ` GRbit via Bugspray Bot 2024-12-16 21:25 ` GRbit via Bugspray Bot 5 siblings, 0 replies; 10+ messages in thread From: GRbit via Bugspray Bot @ 2024-12-16 20:05 UTC (permalink / raw) To: ulf.hansson, linux-mmc GRbit writes via Kernel.org Bugzilla: I have InfinityBook Pro 14 Gen9 AMD and have troubles with going to sleep and back. After debugging suspend using this instruction https://www.kernel.org/doc/html/latest/power/s2ram.html I found this logs in dmesg: [ 0.638016] PM: Magic number: 0:66:178 [ 0.638019] PM: hash matches drivers/base/power/main.c:1272 [ 0.638074] acpi PNP0C02:0b: hash matches [ 0.638093] acpi device:0e: hash matches device:0e points to 00:02.3 PCI bridge: Advanced Micro Devices, Inc. [AMD] Phoenix GPP Bridge 04:00.0 SD Host controller: Genesys Logic, Inc GL9767 SD Host Controller (rev 03) I have no idea which information could be helpful, but I'm willing to provide any needed info. View: https://bugzilla.kernel.org/show_bug.cgi?id=219284#c4 You can reply to this message to join the discussion. -- Deet-doot-dot, I am a bot. Kernel.org Bugzilla (bugspray 0.1-dev) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sdhci_pci module is blocking low power s0ix sleep with GL9767 2024-09-18 9:50 sdhci_pci module is blocking low power s0ix sleep with GL9767 Georg Gottleuber via Bugspray Bot ` (3 preceding siblings ...) 2024-12-16 20:05 ` GRbit via Bugspray Bot @ 2024-12-16 21:25 ` GRbit via Bugspray Bot 2024-12-16 21:25 ` GRbit via Bugspray Bot 5 siblings, 0 replies; 10+ messages in thread From: GRbit via Bugspray Bot @ 2024-12-16 21:25 UTC (permalink / raw) To: linux-mmc, ulf.hansson GRbit writes via Kernel.org Bugzilla: I'm sorry, I didn't provide the exact description of "troubles" I mentioned. For me, after going to sleep, I can not resume. The laptop just boots starting from grub menu. View: https://bugzilla.kernel.org/show_bug.cgi?id=219284#c5 You can reply to this message to join the discussion. -- Deet-doot-dot, I am a bot. Kernel.org Bugzilla (bugspray 0.1-dev) ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: sdhci_pci module is blocking low power s0ix sleep with GL9767 2024-09-18 9:50 sdhci_pci module is blocking low power s0ix sleep with GL9767 Georg Gottleuber via Bugspray Bot ` (4 preceding siblings ...) 2024-12-16 21:25 ` GRbit via Bugspray Bot @ 2024-12-16 21:25 ` GRbit via Bugspray Bot 5 siblings, 0 replies; 10+ messages in thread From: GRbit via Bugspray Bot @ 2024-12-16 21:25 UTC (permalink / raw) To: linux-mmc, ulf.hansson GRbit writes via Kernel.org Bugzilla: Well, I must admit I'm not used to think before I write. Modern platforms that allow to edit your messages made me lazy. Some more info on the topic: I've tested suspend on tuxedo kernel: $ uname -a Linux tuxedo-inf9 6.11.0-107011-tuxedo #11tuxnoble1 SMP PREEMPT_DYNAMIC Sat Nov 9 11:02:15 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux After that I found a public thread with a patch to the problem of the topic starter: https://www.spinics.net/lists/linux-mmc/msg82920.html I'm not sure how to check the code of the 6.11.0-107011-tuxedo kernel, yet I found that this patch is applied on the latest kernel version 6.12.5 I copied configs of the tuxedo kernel and build a 6.12.5 kernel with "make -j bindeb-pkg" Unfortunately, s2ram still gives me the same problem: system can not go to sleep properly and just turns off. Blacklisting sdhci module didn't help, I still see the same messages in dmesg. View: https://bugzilla.kernel.org/show_bug.cgi?id=219284#c6 You can reply to this message to join the discussion. -- Deet-doot-dot, I am a bot. Kernel.org Bugzilla (bugspray 0.1-dev) ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2024-12-16 21:24 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2024-09-26 15:31 sdhci_pci module is blocking low power s0ix sleep with GL9767 Georg Gottleuber 2024-10-08 15:05 ` Ulf Hansson 2024-10-15 12:47 ` [RFC PATCH 1/1] mmc: sdhci-pci-gli: fix x86/S0ix SoCs suspend for GL9767 Georg Gottleuber -- strict thread matches above, loose matches on Subject: below -- 2024-09-18 9:50 sdhci_pci module is blocking low power s0ix sleep with GL9767 Georg Gottleuber via Bugspray Bot 2024-09-23 12:15 ` Georg Gottleuber via Bugspray Bot 2024-09-25 13:40 ` The Linux kernel's regression tracker (Thorsten Leemhuis) via Bugspray Bot 2024-09-30 12:55 ` Georg Gottleuber via Bugspray Bot 2024-12-16 20:05 ` GRbit via Bugspray Bot 2024-12-16 21:25 ` GRbit via Bugspray Bot 2024-12-16 21:25 ` GRbit via Bugspray Bot
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox