All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <jszhang@kernel.org>
To: Bough Chen <haibo.chen@nxp.com>
Cc: "Ulf Hansson" <ulf.hansson@linaro.org>,
	"Aubin Constans" <aubin.constans@microchip.com>,
	"Nicolas Ferre" <nicolas.ferre@microchip.com>,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>,
	"Claudiu Beznea" <claudiu.beznea@tuxon.dev>,
	"Manuel Lauss" <manuel.lauss@gmail.com>,
	"Micha�� Miros��aw" <mirq-linux@rere.qmqm.pl>,
	"Jaehoon Chung" <jh80.chung@samsung.com>,
	"Krzysztof Kozlowski" <krzk@kernel.org>,
	"Alim Akhtar" <alim.akhtar@samsung.com>,
	"Heiko Stuebner" <heiko@sntech.de>,
	"Russell King" <linux@armlinux.org.uk>,
	"Chaotian Jing" <chaotian.jing@mediatek.com>,
	"Matthias Brugger" <matthias.bgg@gmail.com>,
	"AngeloGioacchino Del Regno"
	<angelogioacchino.delregno@collabora.com>,
	"Shawn Guo" <shawnguo@kernel.org>,
	"Sascha Hauer" <s.hauer@pengutronix.de>,
	"Pengutronix Kernel Team" <kernel@pengutronix.de>,
	"Fabio Estevam" <festevam@gmail.com>,
	"Adrian Hunter" <adrian.hunter@intel.com>,
	"Kamal Dasu" <kamal.dasu@broadcom.com>,
	"Al Cooper" <alcooperx@gmail.com>,
	"Broadcom internal kernel review list"
	<bcm-kernel-feedback-list@broadcom.com>,
	"Florian Fainelli" <florian.fainelli@broadcom.com>,
	"Michal Simek" <michal.simek@amd.com>,
	"Eugen Hristev" <eugen.hristev@linaro.org>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"Ben Dooks" <ben-linux@fluff.org>,
	"Viresh Kumar" <vireshk@kernel.org>,
	"Orson Zhai" <orsonzhai@gmail.com>,
	"Baolin Wang" <baolin.wang@linux.alibaba.com>,
	"Chunyan Zhang" <zhang.lyra@gmail.com>,
	"Patrice Chotard" <patrice.chotard@foss.st.com>,
	"Thierry Reding" <thierry.reding@gmail.com>,
	"Jonathan Hunter" <jonathanh@nvidia.com>,
	"Chen-Yu Tsai" <wens@csie.org>,
	"Jernej Skrabec" <jernej.skrabec@gmail.com>,
	"Samuel Holland" <samuel@sholland.org>,
	"Alexey Charkov" <alchark@gmail.com>,
	"linux-mmc@vger.kernel.org" <linux-mmc@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
Date: Tue, 19 Aug 2025 19:59:23 +0800	[thread overview]
Message-ID: <aKRnG7P_krdC9zKY@xhacker> (raw)
In-Reply-To: <DU0PR04MB9496FAB31EE76054B79E05F99030A@DU0PR04MB9496.eurprd04.prod.outlook.com>

On Tue, Aug 19, 2025 at 03:48:57AM +0000, Bough Chen wrote:
> > -----Original Message-----
> > From: Jisheng Zhang <jszhang@kernel.org>
> > Sent: 2025年8月18日 20:15
> > To: Bough Chen <haibo.chen@nxp.com>
> > Cc: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> > <aubin.constans@microchip.com>; Nicolas Ferre
> > <nicolas.ferre@microchip.com>; Alexandre Belloni
> > <alexandre.belloni@bootlin.com>; Claudiu Beznea
> > <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> > Micha�� Miros��aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> > <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>; Alim
> > Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner <heiko@sntech.de>;
> > Russell King <linux@armlinux.org.uk>; Chaotian Jing
> > <chaotian.jing@mediatek.com>; Matthias Brugger <matthias.bgg@gmail.com>;
> > AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>;
> > Shawn Guo <shawnguo@kernel.org>; Sascha Hauer <s.hauer@pengutronix.de>;
> > Pengutronix Kernel Team <kernel@pengutronix.de>; Fabio Estevam
> > <festevam@gmail.com>; Adrian Hunter <adrian.hunter@intel.com>; Kamal
> > Dasu <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> > Broadcom internal kernel review list
> > <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> > <florian.fainelli@broadcom.com>; Michal Simek <michal.simek@amd.com>;
> > Eugen Hristev <eugen.hristev@linaro.org>; Vignesh Raghavendra
> > <vigneshr@ti.com>; Ben Dooks <ben-linux@fluff.org>; Viresh Kumar
> > <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>; Baolin Wang
> > <baolin.wang@linux.alibaba.com>; Chunyan Zhang <zhang.lyra@gmail.com>;
> > Patrice Chotard <patrice.chotard@foss.st.com>; Thierry Reding
> > <thierry.reding@gmail.com>; Jonathan Hunter <jonathanh@nvidia.com>;
> > Chen-Yu Tsai <wens@csie.org>; Jernej Skrabec <jernej.skrabec@gmail.com>;
> > Samuel Holland <samuel@sholland.org>; Alexey Charkov <alchark@gmail.com>;
> > linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> > Subject: Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
> > 
> > On Sat, Aug 16, 2025 at 02:03:48PM +0800, Jisheng Zhang wrote:
> > > On Fri, Aug 15, 2025 at 03:23:56AM +0000, Bough Chen wrote:
> > > > > -----Original Message-----
> > > > > From: Jisheng Zhang <jszhang@kernel.org>
> > > > > Sent: 2025Ҵ8??15?? 9:34
> > > > > To: Ulf Hansson <ulf.hansson@linaro.org>; Aubin Constans
> > > > > <aubin.constans@microchip.com>; Nicolas Ferre
> > > > > <nicolas.ferre@microchip.com>; Alexandre Belloni
> > > > > <alexandre.belloni@bootlin.com>; Claudiu Beznea
> > > > > <claudiu.beznea@tuxon.dev>; Manuel Lauss <manuel.lauss@gmail.com>;
> > > > > Micha?? Miros??aw <mirq-linux@rere.qmqm.pl>; Jaehoon Chung
> > > > > <jh80.chung@samsung.com>; Krzysztof Kozlowski <krzk@kernel.org>;
> > > > > Alim Akhtar <alim.akhtar@samsung.com>; Heiko Stuebner
> > > > > <heiko@sntech.de>; Russell King <linux@armlinux.org.uk>; Chaotian
> > > > > Jing <chaotian.jing@mediatek.com>; Matthias Brugger
> > > > > <matthias.bgg@gmail.com>; AngeloGioacchino Del Regno
> > > > > <angelogioacchino.delregno@collabora.com>;
> > > > > Shawn Guo <shawnguo@kernel.org>; Sascha Hauer
> > > > > <s.hauer@pengutronix.de>; Pengutronix Kernel Team
> > > > > <kernel@pengutronix.de>; Fabio Estevam <festevam@gmail.com>;
> > > > > Adrian Hunter <adrian.hunter@intel.com>; Kamal Dasu
> > > > > <kamal.dasu@broadcom.com>; Al Cooper <alcooperx@gmail.com>;
> > > > > Broadcom internal kernel review list
> > > > > <bcm-kernel-feedback-list@broadcom.com>; Florian Fainelli
> > > > > <florian.fainelli@broadcom.com>; Bough Chen <haibo.chen@nxp.com>;
> > > > > Michal Simek <michal.simek@amd.com>; Eugen Hristev
> > > > > <eugen.hristev@linaro.org>; Vignesh Raghavendra <vigneshr@ti.com>;
> > > > > Ben Dooks <ben-linux@fluff.org>; Viresh Kumar
> > > > > <vireshk@kernel.org>; Orson Zhai <orsonzhai@gmail.com>; Baolin
> > > > > Wang <baolin.wang@linux.alibaba.com>; Chunyan Zhang
> > > > > <zhang.lyra@gmail.com>; Patrice Chotard
> > > > > <patrice.chotard@foss.st.com>; Thierry Reding
> > > > > <thierry.reding@gmail.com>; Jonathan Hunter
> > > > > <jonathanh@nvidia.com>; Chen-Yu Tsai <wens@csie.org>; Jernej
> > > > > Skrabec <jernej.skrabec@gmail.com>; Samuel Holland
> > > > > <samuel@sholland.org>; Alexey Charkov <alchark@gmail.com>
> > > > > Cc: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org
> > > > > Subject: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros
> > > > >
> > > > > Use the modern PM macros for the suspend and resume functions to
> > > > > be automatically dropped by the compiler when CONFIG_PM or
> > > > > CONFIG_PM_SLEEP are disabled, without having to use #ifdef guards.
> > > > >
> > > > > This has the advantage of always compiling these functions in,
> > > > > independently of any Kconfig option. Thanks to that, bugs and
> > > > > other regressions are subsequently easier to catch.
> > > >
> > > > Hi Jisheng,
> > >
> > > Hi,
> > >
> > > >
> > > > When I remove all the configs under Power management options I got the
> > following build warning:
> > > >
> > > > drivers/mmc/host/sdhci-esdhc-imx.c:2079:12: warning:
> > > > ??sdhci_esdhc_resume?? defined but not used [-Wunused-function]
> > > >  2079 | static int sdhci_esdhc_resume(struct device *dev)
> > > >       |            ^~~~~~~~~~~~~~~~~~
> > > >   CC      drivers/mmc/host/cqhci-core.o
> > > > drivers/mmc/host/sdhci-esdhc-imx.c:2017:12: warning:
> > > > ??sdhci_esdhc_suspend?? defined but not used [-Wunused-function]
> > > >  2017 | static int sdhci_esdhc_suspend(struct device *dev)
> > > >       |            ^~~~~~~~~~~~~~~~~~~
> > >
> > > Hmm interesting, what's test toolchain? I tested this patch with gcc14
> > > with below three combinations before sending out, no warnings at all:
> > > PM + PM_SLEEP
> > > PM only
> > > !PM + ! PM_SLEEP
> > >
> > > The sdhci_esdhc_suspend|resume are referenced by
> > SYSTEM_SLEEP_PM_OPS.
> > > The pm_sleep_ptr() macro does the tricky, when both PM and PM_SLEEP
> > > are disabled, they are optimized out.
> > 
> > Hi Haibo,
> > 
> > Could you plz share your toolchain information? And FYI, today I tested clang
> > with the above three combinations, also no warnings. So I'm really interested
> > how to reproduce your warnings.
> > 
> > And the kernel CI build robot hasn't sent out warning email so far.
> 
> I'm not sure whether my test step is correct.
> I find for ARM, it force to enable the CONFIG_PM. to test your patch, I force remove all the PM related configs in .config. then meet this warning. And also many other driver build warning.

Now, I tried arm multi_v7_defconfig, then unselect those platforms which
enable CONFIG_PM, then enable COMPILE_TEST, then unselect CONFIG_PM and
CONFIG_PM_SLEEP, and build with  arm-linux-gnueabihf-gcc-14, stil no
any warning.
So can you plz share your defconfig? you can save it by 'make savedefconfig'
And I asked twice about your toolchain information, can you plz provide
it?

> Seems this test method is not correct, can anyone confirm here?
> 
> I did another test today, I enable the COMPILE_TEST, and use x86, chose the usdhc in menuconfig, disable CONFIG_PM, and build kernel by the following command, do not meet any warning:
> make ARCH=x86 CC=gcc -j64
> Seems this means !PM + !PM_SLEEP verify ok.

I tested not only x86, but also arm64 and riscv...

> 
> What's your method to test these PM related combination?

Similar as yours -- enable COMPILE_TEST.
Sure for the drivers I used: sdhci-of-dwcmshc, sdhci-pxav3 and
sdhci-xenon, I tested them.

B.R

  reply	other threads:[~2025-08-19 12:16 UTC|newest]

Thread overview: 52+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-15  1:33 [PATCH 00/38] mmc: host: use modern PM macros Jisheng Zhang
2025-08-15  1:33 ` [PATCH 01/38] sdhci: add some simple inline functions for !CONFIG_PM Jisheng Zhang
2025-08-18 11:29   ` Adrian Hunter
2025-08-15  1:33 ` [PATCH 02/38] mmc: sdhci-of-dwcmshc: use modern PM macros Jisheng Zhang
2025-08-18 18:30   ` Drew Fustini
2025-08-15  1:33 ` [PATCH 03/38] mmc: sdhci-xenon: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 04/38] mmc: sdhci-pxav3: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 05/38] mmc: sunxi: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 06/38] mmc: alcor: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 07/38] mmc: atmel: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 08/38] mmc: au1xmmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 09/38] mmc: cb710-mmc: " Jisheng Zhang
2025-08-20 19:21   ` Michał Mirosław
2025-08-15  1:33 ` [PATCH 10/38] mmc: davinci_mmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 11/38] mmc: mmci: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 12/38] mmc: mxs-mmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 13/38] mmc: omap_hsmmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 14/38] mmc: rtsx_usb_sdmmc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 15/38] mmc: sdhci-acpi: " Jisheng Zhang
2025-08-18 10:40   ` Adrian Hunter
2025-08-15  1:33 ` [PATCH 16/38] mmc: sdhci_am654: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 17/38] mmc: sdhci-brcmstb: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 18/38] mmc: sdhci-esdhc-imx: " Jisheng Zhang
2025-08-15  3:23   ` Bough Chen
2025-08-16  6:03     ` Jisheng Zhang
2025-08-18 12:15       ` Jisheng Zhang
2025-08-19  3:48         ` Bough Chen
2025-08-19 11:59           ` Jisheng Zhang [this message]
2025-08-20  2:15             ` Bough Chen
2025-08-15  1:33 ` [PATCH 19/38] mmc: sdhci-of-arasan: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 20/38] mmc: sdhci-of-at91: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 21/38] mmc: sdhci-of-esdhc: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 22/38] mmc: sdhci-omap: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 23/38] mmc: sdhci-cadence: " Jisheng Zhang
2025-08-15  1:33 ` [PATCH 24/38] mmc: sdhci-s3c: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 25/38] mmc: sdhci-spear: " Jisheng Zhang
2025-08-18  6:38   ` Viresh Kumar
2025-08-15  1:34 ` [PATCH 26/38] mmc: sdhci-sprd: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 27/38] mmc: sdhci-st: " Jisheng Zhang
2025-08-18  8:49   ` Patrice CHOTARD
2025-08-15  1:34 ` [PATCH 28/38] mmc: sdhci-tegra: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 29/38] mmc: sh_mmicf: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 30/38] mmc: toshsd: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 31/38] mmc: wmt-sdmmc: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 32/38] mmc: mtk-sd: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 33/38] mmc: sdhci-msm: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 34/38] mmc: via-sdmmc: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 35/38] mmc: dw_mmc: exynos: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 36/38] mmc: dw_mmc-k3: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 37/38] mmc: dw_mmc-pci: " Jisheng Zhang
2025-08-15  1:34 ` [PATCH 38/38] mmc: dw_mmc-rockchip: " Jisheng Zhang
2025-08-22 10:15 ` [PATCH 00/38] mmc: host: " Ulf Hansson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aKRnG7P_krdC9zKY@xhacker \
    --to=jszhang@kernel.org \
    --cc=adrian.hunter@intel.com \
    --cc=alchark@gmail.com \
    --cc=alcooperx@gmail.com \
    --cc=alexandre.belloni@bootlin.com \
    --cc=alim.akhtar@samsung.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=aubin.constans@microchip.com \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=ben-linux@fluff.org \
    --cc=chaotian.jing@mediatek.com \
    --cc=claudiu.beznea@tuxon.dev \
    --cc=eugen.hristev@linaro.org \
    --cc=festevam@gmail.com \
    --cc=florian.fainelli@broadcom.com \
    --cc=haibo.chen@nxp.com \
    --cc=heiko@sntech.de \
    --cc=jernej.skrabec@gmail.com \
    --cc=jh80.chung@samsung.com \
    --cc=jonathanh@nvidia.com \
    --cc=kamal.dasu@broadcom.com \
    --cc=kernel@pengutronix.de \
    --cc=krzk@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mmc@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=manuel.lauss@gmail.com \
    --cc=matthias.bgg@gmail.com \
    --cc=michal.simek@amd.com \
    --cc=mirq-linux@rere.qmqm.pl \
    --cc=nicolas.ferre@microchip.com \
    --cc=orsonzhai@gmail.com \
    --cc=patrice.chotard@foss.st.com \
    --cc=s.hauer@pengutronix.de \
    --cc=samuel@sholland.org \
    --cc=shawnguo@kernel.org \
    --cc=thierry.reding@gmail.com \
    --cc=ulf.hansson@linaro.org \
    --cc=vigneshr@ti.com \
    --cc=vireshk@kernel.org \
    --cc=wens@csie.org \
    --cc=zhang.lyra@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.