lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aKRnG7P_krdC9zKY@xhacker>
Date: Tue, 19 Aug 2025 19:59:23 +0800
From: Jisheng Zhang <jszhang@...nel.org>
To: Bough Chen <haibo.chen@....com>
Cc: Ulf Hansson <ulf.hansson@...aro.org>,
	Aubin Constans <aubin.constans@...rochip.com>,
	Nicolas Ferre <nicolas.ferre@...rochip.com>,
	Alexandre Belloni <alexandre.belloni@...tlin.com>,
	Claudiu Beznea <claudiu.beznea@...on.dev>,
	Manuel Lauss <manuel.lauss@...il.com>,
	Micha�� Miros��aw <mirq-linux@...e.qmqm.pl>,
	Jaehoon Chung <jh80.chung@...sung.com>,
	Krzysztof Kozlowski <krzk@...nel.org>,
	Alim Akhtar <alim.akhtar@...sung.com>,
	Heiko Stuebner <heiko@...ech.de>,
	Russell King <linux@...linux.org.uk>,
	Chaotian Jing <chaotian.jing@...iatek.com>,
	Matthias Brugger <matthias.bgg@...il.com>,
	AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>,
	Shawn Guo <shawnguo@...nel.org>,
	Sascha Hauer <s.hauer@...gutronix.de>,
	Pengutronix Kernel Team <kernel@...gutronix.de>,
	Fabio Estevam <festevam@...il.com>,
	Adrian Hunter <adrian.hunter@...el.com>,
	Kamal Dasu <kamal.dasu@...adcom.com>,
	Al Cooper <alcooperx@...il.com>,
	Broadcom internal kernel review list <bcm-kernel-feedback-list@...adcom.com>,
	Florian Fainelli <florian.fainelli@...adcom.com>,
	Michal Simek <michal.simek@....com>,
	Eugen Hristev <eugen.hristev@...aro.org>,
	Vignesh Raghavendra <vigneshr@...com>,
	Ben Dooks <ben-linux@...ff.org>, Viresh Kumar <vireshk@...nel.org>,
	Orson Zhai <orsonzhai@...il.com>,
	Baolin Wang <baolin.wang@...ux.alibaba.com>,
	Chunyan Zhang <zhang.lyra@...il.com>,
	Patrice Chotard <patrice.chotard@...s.st.com>,
	Thierry Reding <thierry.reding@...il.com>,
	Jonathan Hunter <jonathanh@...dia.com>,
	Chen-Yu Tsai <wens@...e.org>,
	Jernej Skrabec <jernej.skrabec@...il.com>,
	Samuel Holland <samuel@...lland.org>,
	Alexey Charkov <alchark@...il.com>,
	"linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 18/38] mmc: sdhci-esdhc-imx: use modern PM macros

On Tue, Aug 19, 2025 at 03:48:57AM +0000, Bough Chen wrote:
> > -----Original Message-----
> > From: Jisheng Zhang <jszhang@...nel.org>
> > Sent: 2025年8月18日 20:15
> > To: Bough Chen <haibo.chen@....com>
> > Cc: Ulf Hansson <ulf.hansson@...aro.org>; Aubin Constans
> > <aubin.constans@...rochip.com>; Nicolas Ferre
> > <nicolas.ferre@...rochip.com>; Alexandre Belloni
> > <alexandre.belloni@...tlin.com>; Claudiu Beznea
> > <claudiu.beznea@...on.dev>; Manuel Lauss <manuel.lauss@...il.com>;
> > Micha�� Miros��aw <mirq-linux@...e.qmqm.pl>; Jaehoon Chung
> > <jh80.chung@...sung.com>; Krzysztof Kozlowski <krzk@...nel.org>; Alim
> > Akhtar <alim.akhtar@...sung.com>; Heiko Stuebner <heiko@...ech.de>;
> > Russell King <linux@...linux.org.uk>; Chaotian Jing
> > <chaotian.jing@...iatek.com>; Matthias Brugger <matthias.bgg@...il.com>;
> > AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>;
> > Shawn Guo <shawnguo@...nel.org>; Sascha Hauer <s.hauer@...gutronix.de>;
> > Pengutronix Kernel Team <kernel@...gutronix.de>; Fabio Estevam
> > <festevam@...il.com>; Adrian Hunter <adrian.hunter@...el.com>; Kamal
> > Dasu <kamal.dasu@...adcom.com>; Al Cooper <alcooperx@...il.com>;
> > Broadcom internal kernel review list
> > <bcm-kernel-feedback-list@...adcom.com>; Florian Fainelli
> > <florian.fainelli@...adcom.com>; Michal Simek <michal.simek@....com>;
> > Eugen Hristev <eugen.hristev@...aro.org>; Vignesh Raghavendra
> > <vigneshr@...com>; Ben Dooks <ben-linux@...ff.org>; Viresh Kumar
> > <vireshk@...nel.org>; Orson Zhai <orsonzhai@...il.com>; Baolin Wang
> > <baolin.wang@...ux.alibaba.com>; Chunyan Zhang <zhang.lyra@...il.com>;
> > Patrice Chotard <patrice.chotard@...s.st.com>; Thierry Reding
> > <thierry.reding@...il.com>; Jonathan Hunter <jonathanh@...dia.com>;
> > Chen-Yu Tsai <wens@...e.org>; Jernej Skrabec <jernej.skrabec@...il.com>;
> > Samuel Holland <samuel@...lland.org>; Alexey Charkov <alchark@...il.com>;
> > linux-mmc@...r.kernel.org; linux-kernel@...r.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@...nel.org>
> > > > > Sent: 2025Ҵ8??15?? 9:34
> > > > > To: Ulf Hansson <ulf.hansson@...aro.org>; Aubin Constans
> > > > > <aubin.constans@...rochip.com>; Nicolas Ferre
> > > > > <nicolas.ferre@...rochip.com>; Alexandre Belloni
> > > > > <alexandre.belloni@...tlin.com>; Claudiu Beznea
> > > > > <claudiu.beznea@...on.dev>; Manuel Lauss <manuel.lauss@...il.com>;
> > > > > Micha?? Miros??aw <mirq-linux@...e.qmqm.pl>; Jaehoon Chung
> > > > > <jh80.chung@...sung.com>; Krzysztof Kozlowski <krzk@...nel.org>;
> > > > > Alim Akhtar <alim.akhtar@...sung.com>; Heiko Stuebner
> > > > > <heiko@...ech.de>; Russell King <linux@...linux.org.uk>; Chaotian
> > > > > Jing <chaotian.jing@...iatek.com>; Matthias Brugger
> > > > > <matthias.bgg@...il.com>; AngeloGioacchino Del Regno
> > > > > <angelogioacchino.delregno@...labora.com>;
> > > > > Shawn Guo <shawnguo@...nel.org>; Sascha Hauer
> > > > > <s.hauer@...gutronix.de>; Pengutronix Kernel Team
> > > > > <kernel@...gutronix.de>; Fabio Estevam <festevam@...il.com>;
> > > > > Adrian Hunter <adrian.hunter@...el.com>; Kamal Dasu
> > > > > <kamal.dasu@...adcom.com>; Al Cooper <alcooperx@...il.com>;
> > > > > Broadcom internal kernel review list
> > > > > <bcm-kernel-feedback-list@...adcom.com>; Florian Fainelli
> > > > > <florian.fainelli@...adcom.com>; Bough Chen <haibo.chen@....com>;
> > > > > Michal Simek <michal.simek@....com>; Eugen Hristev
> > > > > <eugen.hristev@...aro.org>; Vignesh Raghavendra <vigneshr@...com>;
> > > > > Ben Dooks <ben-linux@...ff.org>; Viresh Kumar
> > > > > <vireshk@...nel.org>; Orson Zhai <orsonzhai@...il.com>; Baolin
> > > > > Wang <baolin.wang@...ux.alibaba.com>; Chunyan Zhang
> > > > > <zhang.lyra@...il.com>; Patrice Chotard
> > > > > <patrice.chotard@...s.st.com>; Thierry Reding
> > > > > <thierry.reding@...il.com>; Jonathan Hunter
> > > > > <jonathanh@...dia.com>; Chen-Yu Tsai <wens@...e.org>; Jernej
> > > > > Skrabec <jernej.skrabec@...il.com>; Samuel Holland
> > > > > <samuel@...lland.org>; Alexey Charkov <alchark@...il.com>
> > > > > Cc: linux-mmc@...r.kernel.org; linux-kernel@...r.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ