[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <52599d6e-dc16-4186-9fb9-d17ce428fe9c@app.fastmail.com>
Date: Thu, 27 Oct 2022 16:08:22 +0200
From: "Arnd Bergmann" <arnd@...db.de>
To: "Greg Kroah-Hartman" <gregkh@...uxfoundation.org>,
"Scott J. Crouch" <scottjcrouch@...il.com>
Cc: "Florian Fainelli" <f.fainelli@...il.com>,
"Broadcom internal kernel review list"
<bcm-kernel-feedback-list@...adcom.com>,
kernel-janitors@...r.kernel.org,
linux-rpi-kernel@...ts.infradead.org,
linux-arm-kernel@...ts.infradead.org,
linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: vchiq: add 'static' to function definition
On Sat, Oct 22, 2022, at 10:07, Greg Kroah-Hartman wrote:
> On Sat, Oct 22, 2022 at 03:35:48PM +1100, Scott J. Crouch wrote:
> Nice try, but this breaks the build in a very horrible and strange way
> that no one has been able to figure out yet:
I got curious and figured out what happens:
Without CONFIG_OF, of_match_node() always returns NULL, so
vchiq_probe() returns -EINVAL unconditionally before calling
vchiq_platform_init().
If vchiq_platform_init() is marked 'static', gcc's dead code
elimination then eliminates it, which in turn means that
'g_fragments_base' is never initialized and gets replaced
with a NULL pointer.
I think the easiest workaround is to take this otherwise correct
patch but at the same time add 'depends on OF' to BCM2835_VCHIQ.
This is a correct dependency as shown by gcc above, and it still
allows compile testing this driver on x86 allmodconfig, which
enables CONFIG_OF.
Arnd
Powered by blists - more mailing lists