[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <dac30597-6d62-46f4-9493-059344e253c4@huawei.com>
Date: Thu, 6 Mar 2025 11:35:26 +0800
From: "zhangzekun (A)" <zhangzekun11@...wei.com>
To: <gregkh@...uxfoundation.org>
CC: <akpm@...ux-foundation.org>, <jslaby@...e.cz>,
<linux-kernel@...r.kernel.org>, <lwn@....net>, <stable@...r.kernel.org>,
<torvalds@...ux-foundation.org>, <chenweilong@...wei.com>,
<liuyongqiang13@...wei.com>, <arnd@...db.de>
Subject: Re: Is there something wrong with v5.10.234 patch 664760c49d98
("xhci: use pm_ptr() instead of #ifdef for CONFIG_PM conditionals")?
Sorry for make noise. Please ignore this messgae.
The latter patch c762b76981fc ("Partial revert of xhci: use pm_ptr()
instead #ifdef for CONFIG_PM conditionals") patial revert the patch, So,
there is no such problem with the patch.
Thanks,
Zekunk
在 2025/3/6 10:33, Zhang Zekun 写道:
> Hi, Greg,
> The stable patch 664760c49d98 ("xhci: use pm_ptr() instead of #ifdef for CONFIG_PM conditionals") in linux-5.10.y, is different with the mainline patch. In the following code.
>
> mainline:
> -#ifdef CONFIG_PM
> - xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend;
> - xhci_pci_hc_driver.pci_resume = xhci_pci_resume;
> - xhci_pci_hc_driver.pci_poweroff_late = xhci_pci_poweroff_late;
> - xhci_pci_hc_driver.shutdown = xhci_pci_shutdown;
> -#endif
> + xhci_pci_hc_driver.pci_suspend = pm_ptr(xhci_pci_suspend);
> + xhci_pci_hc_driver.pci_resume = pm_ptr(xhci_pci_resume);
> + xhci_pci_hc_driver.pci_poweroff_late = pm_ptr(xhci_pci_poweroff_late);
> + xhci_pci_hc_driver.shutdown = pm_ptr(xhci_pci_shutdown);
>
> linux-5.10.y:
> -#ifdef CONFIG_PM
> xhci_pci_hc_driver.pci_suspend = xhci_pci_suspend;
> xhci_pci_hc_driver.pci_resume = xhci_pci_resume;
> xhci_pci_hc_driver.shutdown = xhci_pci_shutdown;
> -#endif
>
> xhci_pci_shutdown() in mainline is wrapped with pm_ptr(), which is NULL if CONFIG_PM is not enabled, but for linux-5.10.y, xhci_pci_shutdown() it will not be converted to a NULL pointer. The .shutdown() function seems has been used in usb_hcd_platform_shutdown() in usb platfrom device shutdown routine:
>
> drivers/usb/host/ehci-atmel.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-brcm.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-exynos.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-fsl.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-grlib.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-mxc.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-npcm7xx.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-omap.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-orion.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-platform.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-ppc-of.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-spear.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-st.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ehci-xilinx-of.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-at91.c: usb_hcd_platform_shutdown(pdev);
> drivers/usb/host/ohci-at91.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-da8xx.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-omap.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-platform.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-ppc-of.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-pxa27x.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-s3c2410.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-sm501.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-st.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/ohci-tmio.c: .shutdown = usb_hcd_platform_shutdown,
> drivers/usb/host/xhci-plat.c: .shutdown = usb_hcd_platform_shutdown,
>
> For the mainline patch seems does not want to call xhci_pci_shutdown() when CONFIG_PM is diabled, is there something wrong with the stable patch?
Powered by blists - more mailing lists