linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used
@ 2022-07-18 11:58 Sudip Mukherjee (Codethink)
  2022-07-18 12:42 ` Arnd Bergmann
  2022-07-19 21:04 ` Bjorn Helgaas
  0 siblings, 2 replies; 7+ messages in thread
From: Sudip Mukherjee (Codethink) @ 2022-07-18 11:58 UTC (permalink / raw)
  To: Richard Zhu, Lucas Stach, Lorenzo Pieralisi, Rob Herring,
	Krzysztof, Wilczyński, Bjorn Helgaas, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Philipp Zabel, Liam Girdwood, Mark Brown
  Cc: linux-pci, linux-arm-kernel, linux-kernel, linux-next

Hi All,

Not sure if it has been reported, builds of alpha, csky, xtensa, riscv, s390 allmodsconfig
have failed to build next-20220718 with the error:


drivers/pci/controller/dwc/pci-imx6.c:973:13: error: 'imx6_pcie_host_exit' defined but not used [-Werror=unused-function]
  973 | static void imx6_pcie_host_exit(struct dw_pcie_rp *pp)
      |             ^~~~~~~~~~~~~~~~~~~
drivers/pci/controller/dwc/pci-imx6.c:904:13: error: 'imx6_pcie_stop_link' defined but not used [-Werror=unused-function]
  904 | static void imx6_pcie_stop_link(struct dw_pcie *pci)
      |             ^~~~~~~~~~~~~~~~~~~


--
Regards
Sudip

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used
  2022-07-18 11:58 build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used Sudip Mukherjee (Codethink)
@ 2022-07-18 12:42 ` Arnd Bergmann
  2022-07-18 16:14   ` Bjorn Helgaas
  2022-07-19 21:04 ` Bjorn Helgaas
  1 sibling, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2022-07-18 12:42 UTC (permalink / raw)
  To: Sudip Mukherjee (Codethink)
  Cc: Richard Zhu, Lucas Stach, Lorenzo Pieralisi, Rob Herring,
	Wilczyński, Bjorn Helgaas, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Philipp Zabel, Liam Girdwood, Mark Brown, linux-pci, Linux ARM,
	Linux Kernel Mailing List, Linux-Next Mailing List

On Mon, Jul 18, 2022 at 1:58 PM Sudip Mukherjee (Codethink)
<sudipm.mukherjee@gmail.com> wrote:
>
> Hi All,
>
> Not sure if it has been reported, builds of alpha, csky, xtensa, riscv, s390 allmodsconfig
> have failed to build next-20220718 with the error:
>
>
> drivers/pci/controller/dwc/pci-imx6.c:973:13: error: 'imx6_pcie_host_exit' defined but not used [-Werror=unused-function]
>   973 | static void imx6_pcie_host_exit(struct dw_pcie_rp *pp)
>       |             ^~~~~~~~~~~~~~~~~~~
> drivers/pci/controller/dwc/pci-imx6.c:904:13: error: 'imx6_pcie_stop_link' defined but not used [-Werror=unused-function]
>   904 | static void imx6_pcie_stop_link(struct dw_pcie *pci)
>       |             ^~~~~~~~~~~~~~~~~~~
>

These are called from inside an "#ifdef CONFIG_PM_SLEEP" section. The best
fix is to remove the #ifdef and replace SET_NOIRQ_SYSTEM_SLEEP_PM_OPS()
with the new simpler NOIRQ_SYSTEM_SLEEP_PM_OPS().

          Arnd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used
  2022-07-18 12:42 ` Arnd Bergmann
@ 2022-07-18 16:14   ` Bjorn Helgaas
  2022-07-19  7:52     ` Arnd Bergmann
  0 siblings, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2022-07-18 16:14 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Sudip Mukherjee (Codethink),
	Richard Zhu, Lucas Stach, Lorenzo Pieralisi, Rob Herring,
	Wilczyński, Bjorn Helgaas, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Philipp Zabel, Liam Girdwood, Mark Brown, linux-pci, Linux ARM,
	Linux Kernel Mailing List, Linux-Next Mailing List

On Mon, Jul 18, 2022 at 02:42:16PM +0200, Arnd Bergmann wrote:
> On Mon, Jul 18, 2022 at 1:58 PM Sudip Mukherjee (Codethink)
> <sudipm.mukherjee@gmail.com> wrote:
> >
> > Hi All,
> >
> > Not sure if it has been reported, builds of alpha, csky, xtensa, riscv, s390 allmodsconfig
> > have failed to build next-20220718 with the error:
> >
> >
> > drivers/pci/controller/dwc/pci-imx6.c:973:13: error: 'imx6_pcie_host_exit' defined but not used [-Werror=unused-function]
> >   973 | static void imx6_pcie_host_exit(struct dw_pcie_rp *pp)
> >       |             ^~~~~~~~~~~~~~~~~~~
> > drivers/pci/controller/dwc/pci-imx6.c:904:13: error: 'imx6_pcie_stop_link' defined but not used [-Werror=unused-function]
> >   904 | static void imx6_pcie_stop_link(struct dw_pcie *pci)
> >       |             ^~~~~~~~~~~~~~~~~~~
> >
> 
> These are called from inside an "#ifdef CONFIG_PM_SLEEP" section. The best
> fix is to remove the #ifdef and replace SET_NOIRQ_SYSTEM_SLEEP_PM_OPS()
> with the new simpler NOIRQ_SYSTEM_SLEEP_PM_OPS().

Might be simpler, but wow, it's hard to keep up with all the
permutations of sleep ops ;)

Unfortunately 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros,
deprecate old ones"), which added NOIRQ_SYSTEM_SLEEP_PM_OPS, didn't
add any hints near SET_NOIRQ_SYSTEM_SLEEP_PM_OPS.

We have several PCI controller drivers that use the "#ifdef
CONFIG_PM_SLEEP" and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS pattern or the
"__maybe_unused" + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS pattern.  I guess we
need to look at all of them and figure out the best practice.

Bjorn

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used
  2022-07-18 16:14   ` Bjorn Helgaas
@ 2022-07-19  7:52     ` Arnd Bergmann
  0 siblings, 0 replies; 7+ messages in thread
From: Arnd Bergmann @ 2022-07-19  7:52 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Arnd Bergmann, Sudip Mukherjee (Codethink),
	Richard Zhu, Lucas Stach, Lorenzo Pieralisi, Rob Herring,
	Wilczyński, Bjorn Helgaas, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Philipp Zabel, Liam Girdwood, Mark Brown, linux-pci, Linux ARM,
	Linux Kernel Mailing List, Linux-Next Mailing List

On Mon, Jul 18, 2022 at 6:14 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> On Mon, Jul 18, 2022 at 02:42:16PM +0200, Arnd Bergmann wrote:
>
> Might be simpler, but wow, it's hard to keep up with all the
> permutations of sleep ops ;)
>
> Unfortunately 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros,
> deprecate old ones"), which added NOIRQ_SYSTEM_SLEEP_PM_OPS, didn't
> add any hints near SET_NOIRQ_SYSTEM_SLEEP_PM_OPS.
>
> We have several PCI controller drivers that use the "#ifdef
> CONFIG_PM_SLEEP" and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS pattern or the
> "__maybe_unused" + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS pattern.  I guess we
> need to look at all of them and figure out the best practice.

Yes, this is a larger effort. It's been under discussion for many years until we
could agree on a nicer way to handle this and avoid both the #ifdef  and the
__maybe_unused annotations. There are hundreds of drivers using the older
patterns, and I think there is an effort to address them one subsystem
at a time,
whenever someone finds the time.

       Arnd

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used
  2022-07-18 11:58 build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used Sudip Mukherjee (Codethink)
  2022-07-18 12:42 ` Arnd Bergmann
@ 2022-07-19 21:04 ` Bjorn Helgaas
  2022-07-19 21:16   ` Arnd Bergmann
  1 sibling, 1 reply; 7+ messages in thread
From: Bjorn Helgaas @ 2022-07-19 21:04 UTC (permalink / raw)
  To: Sudip Mukherjee (Codethink)
  Cc: Richard Zhu, Lucas Stach, Lorenzo Pieralisi, Rob Herring,
	Krzysztof, Wilczyński, Bjorn Helgaas, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, Philipp Zabel, Liam Girdwood, Mark Brown,
	linux-pci, linux-arm-kernel, linux-kernel, linux-next

On Mon, Jul 18, 2022 at 12:58:05PM +0100, Sudip Mukherjee (Codethink) wrote:
> Hi All,
> 
> Not sure if it has been reported, builds of alpha, csky, xtensa, riscv, s390 allmodsconfig
> have failed to build next-20220718 with the error:
> 
> 
> drivers/pci/controller/dwc/pci-imx6.c:973:13: error: 'imx6_pcie_host_exit' defined but not used [-Werror=unused-function]
>   973 | static void imx6_pcie_host_exit(struct dw_pcie_rp *pp)
>       |             ^~~~~~~~~~~~~~~~~~~
> drivers/pci/controller/dwc/pci-imx6.c:904:13: error: 'imx6_pcie_stop_link' defined but not used [-Werror=unused-function]
>   904 | static void imx6_pcie_stop_link(struct dw_pcie *pci)
>       |             ^~~~~~~~~~~~~~~~~~~

Thanks for the report!  I propose the following patch, which I have
tentatively applied to my pci/ctrl/imx6 branch:


commit 0e4daeaa52ca ("PCI: imx6: Convert to NOIRQ_SYSTEM_SLEEP_PM_OPS()")
Author: Bjorn Helgaas <bhelgaas@google.com>
Date:   Tue Jul 19 15:50:18 2022 -0500

    PCI: imx6: Convert to NOIRQ_SYSTEM_SLEEP_PM_OPS()
    
    Replace SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() with NOIRQ_SYSTEM_SLEEP_PM_OPS(),
    which has the advantage that the compiler always sees the PM callbacks as
    referenced, so they don't need to be wrapped with "#ifdef CONFIG_PM_SLEEP"
    or tagged with "__maybe_unused" to avoid "defined but not used" warnings.
    
    See 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones").
    
    Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

diff --git a/drivers/pci/controller/dwc/pci-imx6.c b/drivers/pci/controller/dwc/pci-imx6.c
index 5ea01ed4674d..6f1dfbfc4304 100644
--- a/drivers/pci/controller/dwc/pci-imx6.c
+++ b/drivers/pci/controller/dwc/pci-imx6.c
@@ -884,7 +884,6 @@ static const struct dw_pcie_ops dw_pcie_ops = {
 	.start_link = imx6_pcie_start_link,
 };
 
-#ifdef CONFIG_PM_SLEEP
 static void imx6_pcie_ltssm_disable(struct device *dev)
 {
 	struct imx6_pcie *imx6_pcie = dev_get_drvdata(dev);
@@ -1008,11 +1007,10 @@ static int imx6_pcie_resume_noirq(struct device *dev)
 
 	return 0;
 }
-#endif
 
 static const struct dev_pm_ops imx6_pcie_pm_ops = {
-	SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(imx6_pcie_suspend_noirq,
-				      imx6_pcie_resume_noirq)
+	NOIRQ_SYSTEM_SLEEP_PM_OPS(imx6_pcie_suspend_noirq,
+				  imx6_pcie_resume_noirq)
 };
 
 static int imx6_pcie_probe(struct platform_device *pdev)

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used
  2022-07-19 21:04 ` Bjorn Helgaas
@ 2022-07-19 21:16   ` Arnd Bergmann
  2022-07-19 21:47     ` Bjorn Helgaas
  0 siblings, 1 reply; 7+ messages in thread
From: Arnd Bergmann @ 2022-07-19 21:16 UTC (permalink / raw)
  To: Bjorn Helgaas
  Cc: Sudip Mukherjee (Codethink),
	Richard Zhu, Lucas Stach, Lorenzo Pieralisi, Rob Herring,
	Wilczyński, Bjorn Helgaas, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Philipp Zabel, Liam Girdwood, Mark Brown, linux-pci, Linux ARM,
	Linux Kernel Mailing List, Linux-Next Mailing List

On Tue, Jul 19, 2022 at 11:04 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
>
> commit 0e4daeaa52ca ("PCI: imx6: Convert to NOIRQ_SYSTEM_SLEEP_PM_OPS()")
> Author: Bjorn Helgaas <bhelgaas@google.com>
> Date:   Tue Jul 19 15:50:18 2022 -0500
>
>     PCI: imx6: Convert to NOIRQ_SYSTEM_SLEEP_PM_OPS()
>
>     Replace SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() with NOIRQ_SYSTEM_SLEEP_PM_OPS(),
>     which has the advantage that the compiler always sees the PM callbacks as
>     referenced, so they don't need to be wrapped with "#ifdef CONFIG_PM_SLEEP"
>     or tagged with "__maybe_unused" to avoid "defined but not used" warnings.
>
>     See 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones").
>
>     Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used
  2022-07-19 21:16   ` Arnd Bergmann
@ 2022-07-19 21:47     ` Bjorn Helgaas
  0 siblings, 0 replies; 7+ messages in thread
From: Bjorn Helgaas @ 2022-07-19 21:47 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Sudip Mukherjee (Codethink),
	Richard Zhu, Lucas Stach, Lorenzo Pieralisi, Rob Herring,
	Wilczyński, Bjorn Helgaas, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	Philipp Zabel, Liam Girdwood, Mark Brown, linux-pci, Linux ARM,
	Linux Kernel Mailing List, Linux-Next Mailing List

On Tue, Jul 19, 2022 at 11:16:40PM +0200, Arnd Bergmann wrote:
> On Tue, Jul 19, 2022 at 11:04 PM Bjorn Helgaas <helgaas@kernel.org> wrote:
> >
> > commit 0e4daeaa52ca ("PCI: imx6: Convert to NOIRQ_SYSTEM_SLEEP_PM_OPS()")
> > Author: Bjorn Helgaas <bhelgaas@google.com>
> > Date:   Tue Jul 19 15:50:18 2022 -0500
> >
> >     PCI: imx6: Convert to NOIRQ_SYSTEM_SLEEP_PM_OPS()
> >
> >     Replace SET_NOIRQ_SYSTEM_SLEEP_PM_OPS() with NOIRQ_SYSTEM_SLEEP_PM_OPS(),
> >     which has the advantage that the compiler always sees the PM callbacks as
> >     referenced, so they don't need to be wrapped with "#ifdef CONFIG_PM_SLEEP"
> >     or tagged with "__maybe_unused" to avoid "defined but not used" warnings.
> >
> >     See 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones").
> >
> >     Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>

Thanks!  And sorry about being crabby earlier.  If this allows us to
get rid of those #ifdefs and __maybe_unused, it's a great improvement!

Bjorn

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-07-19 21:48 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-18 11:58 build failure of next-20220718 due to 'imx6_pcie_host_exit' defined but not used Sudip Mukherjee (Codethink)
2022-07-18 12:42 ` Arnd Bergmann
2022-07-18 16:14   ` Bjorn Helgaas
2022-07-19  7:52     ` Arnd Bergmann
2022-07-19 21:04 ` Bjorn Helgaas
2022-07-19 21:16   ` Arnd Bergmann
2022-07-19 21:47     ` Bjorn Helgaas

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).