On Tue, 2023-06-13 at 16:30 +0200, Rafael J. Wysocki wrote: > > On Tue, Jun 13, 2023 at 9:57 AM Zhiren Chen (陈志仁) > <Zhiren.Chen@xxxxxxxxxxxx> wrote: > > > > On Fri, 2023-06-09 at 19:58 +0200, Rafael J. Wysocki wrote: > > > > > > On Fri, Jun 9, 2023 at 1:49 PM Bjorn Helgaas <helgaas@xxxxxxxxxx > > > > > wrote: > > > > > > > > [+cc Rafael, linux-pm] > > > > > > > > On Fri, Jun 09, 2023 at 10:30:38AM +0800, Zhiren Chen wrote: > > > > > From: Zhiren Chen <Zhiren.Chen@xxxxxxxxxxxx> > > > > > > > > > > The platform_pci_choose_state function and other low-level > > > platform > > > > > interfaces used by PCI power management processing did not > take > > > into > > > > > account non-ACPI-supported platforms. This shortcoming can > result > > > in > > > > > limitations and issues. > > > > > > > > > > For example, in embedded systems like smartphones, a PCI > device > > > can be > > > > > shared by multiple processors for different purposes. The PCI > > > device and > > > > > some of the processors are controlled by Linux, while the > rest of > > > the > > > > > processors runs its own operating system. > > > > > When Linux initiates system-level sleep, if it does not > consider > > > the > > > > > working state of the shared PCI device and forcefully sets > the > > > PCI device > > > > > state to D3, it will affect the functionality of other > processors > > > that > > > > > are currently using the PCI device. > > > > > > > > > > To address this problem, an interface should be created for > PCI > > > devices > > > > > that don't support ACPI to enable accurate reporting of the > power > > > state > > > > > during the PCI PM handling process. > > > > > > > > > > Signed-off-by: Zhiren Chen <Zhiren.Chen@xxxxxxxxxxxx> > > > > > > Something like the pci_platform_pm_ops introduced here had been > there > > > for several years and the only users of it known to me were ACPI > and > > > Intel MID, which is why it was dropped. > > > > > > I would like to see the platform code using these new callbacks > in > > > the > > > first place. > > > > > I think that more and more embedded products will use PCI devices > to > > achieve higher performance for data transfer, and these products > may > > not necessarily support ACPI. > > > > When developing the Mediatek T8xx modem chip driver, I found that > there > > was no good way for T8xx to skip D3 setting in certain PM > scenarios. > > Well, is there any code that you are planning to add to the mainline > Linux kernel that is going to use the proposed interface? > yes, Mediatek T8xx modem chip driver without PM code is under review now. refs: https://patchwork.kernel.org/project/netdevbpf/cover/20230317080942.183514-1-yanchao.yang@xxxxxxxxxxxx/ > If not, the interface itself will not be useful in the mainline Linux > kernel. I will submit this patch based on T8xx after T8xx driver is added to mainline. Thank you for your comment. Best Regards, Zhiren