Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752209AbdLGJgO (ORCPT ); Thu, 7 Dec 2017 04:36:14 -0500 Received: from rtits2.realtek.com ([211.75.126.72]:47074 "EHLO rtits2.realtek.com.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750862AbdLGJgN (ORCPT ); Thu, 7 Dec 2017 04:36:13 -0500 Authenticated-By: X-SpamFilter-By: BOX Solutions SpamTrap 5.62 with qID vB79a5uX028908, This message is accepted by code: ctaloc0852 From: =?utf-8?B?5Yav6ZSQ?= To: Lee Jones CC: Hans de Goede , "linux-kernel@vger.kernel.org" Subject: =?utf-8?B?562U5aSNOiDnrZTlpI06IFtQQVRDSF0gbWZkOiBGaXggUlRTNTIyNyAoYW5k?= =?utf-8?Q?_others)_powermanagement?= Thread-Topic: =?utf-8?B?562U5aSNOiBbUEFUQ0hdIG1mZDogRml4IFJUUzUyMjcgKGFuZCBvdGhlcnMp?= =?utf-8?Q?_powermanagement?= Thread-Index: AQHTboRjh6tbiYG0SkWGPmKOk0IJ7aM1qGGAgAF2ZGD///mEAIAAh8XQ Date: Thu, 7 Dec 2017 09:36:04 +0000 Message-ID: <2A308283684ECD4B896628E09AF5361E01A80FED@RS-MBS01.realsil.com.cn> References: <20171206112135.9332-1-hdegoede@redhat.com> <2A308283684ECD4B896628E09AF5361E01A80FAE@RS-MBS01.realsil.com.cn> <20171207092818.yuh2e43vc6ta233o@dell> In-Reply-To: <20171207092818.yuh2e43vc6ta233o@dell> Accept-Language: zh-CN, en-US Content-Language: zh-CN X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.29.40.150] Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by nfs id vB79aJr6012673 Content-Length: 3171 Lines: 87 > On Thu, 07 Dec 2017, 冯锐 wrote: > > > > Hi, > > > > > > On 06-12-17 12:21, Hans de Goede wrote: > > > > Commit 8275b77a1513 ("mfd: rts5249: Add support for RTS5250S power > > > > saving") adds powersaving support for device-ids 5249 524a and 525a. > > > > > > > > But as a side effect it breaks ASPM support for all the other > > > > device-ids, causing e.g. the Haswell CPU on a Lenovo T440s to not > > > > go into a higher c-state then PC3, while previously it would go to > > > > PC7, causing the machine to idle at 7.4W instead of 6.6W! > > > > > > > > The problem here is the new option.dev_aspm_mode field, which only > > > > gets explicitly initialized in the new code for the device-ids > > > > 5249 524a and 525a. Leaving the dev_aspm_mode 0 for the other > device-ids. > > > > > > > > The default dev_aspm_mode 0 is mapped to DEV_ASPM_DISABLE, but > the > > > old > > > > behavior of calling rtsx_pci_enable_aspm() when idle and > > > > rtsx_pci_disable_aspm() when busy happens when dev_aspm_mode == > > > > DEV_ASPM_DYNAMIC. > > > > > > > > This commit changes the enum so that 0 = DEV_ASPM_DYNAMIC > matching > > > the > > > > old default behavior, fixing the pm regression with the other device-ids. > > > > > > > > Cc: Rui Feng > > > > Signed-off-by: Hans de Goede > > > > > > p.s. > > > > > > 2 remarks: > > > > > > 1. As this is a regression in 4.15, please queue this up as a fix for 4.15 > > > (I prioritized bisecting this, which took me a whole day to get a fix > > > ready in time for 4.15). > > > > > > 2. This bit of the original commit also looks weird, but I don't > > > have the hardware in case, Rui Feng should probably take a look at this: > > > > > > @@ -1063,6 +1185,16 @@ static int rtsx_pci_init_hw(struct rtsx_pcr *pcr) > > > if (err < 0) > > > return err; > > > > > > + switch (PCI_PID(pcr)) { > > > + case PID_5250: > > > + case PID_524A: > > > + case PID_525A: > > > + rtsx_pci_write_register(pcr, PM_CLK_FORCE_CTL, 1, 1); > > > + break; > > > + default: > > > + break; > > > + } > > > + > > > /* Enable clk_request_n to enable clock power management */ > > > rtsx_pci_write_config_byte(pcr, pcr->pcie_cap + PCI_EXP_LNKCTL + 1, > 1); > > > /* Enter L1 when host tx idle */ > > > > > > The PID5250 looks weird here, the rtsx_pci_ids table does not > > > contain it; and neither does the switch (PCI_PID(pcr)) in > > > rtsx_pci_init_chip() at the same time the commit does make changes to the > codepaths for the 5249... ? > > > > > Thank you for pointing out the problem. The old driver isn't written > > by me, 5249, 524a and 525a are in the same file, I didn't notice that > > rtsx_pci_ids table does not contain 5250. But the power saving > > function for 5250 and 525a is the same, > > PID_5250 here will not effect the power saving function. > > Is that an Ack or a NAck? > Acked-by: Rui Feng Thanks. > -- > Lee Jones > Linaro Services Technical Lead > Linaro.org │ Open source software for ARM SoCs Follow Linaro: Facebook | > Twitter | Blog > > ------Please consider the environment before printing this e-mail.