On Tue, Oct 2, 2012 at 6:36 PM, Arnd Bergmann <a...@arndb.de> wrote:
> The PL310_ERRATA_753970 and ARM_ERRATA_764369 symbols only make sense
> when the base features for them are enabled, so select them
> conditionally in Kconfig to avoid warnings like:
> warning: (UX500_SOC_COMMON) selects PL310_ERRATA_753970 which has unmet direct dependencies (CACHE_PL310)
> warning: (ARCH_TEGRA_2x_SOC && ARCH_TEGRA_3x_SOC && UX500_SOC_COMMON) selects ARM_ERRATA_764369 which has unmet direct dependencies (CPU_V7 && SMP)
The code using the variable 'i' in this function is conditional which
results in a harmless compiler warning. Using the IS_ENABLED macro
instead of #ifdef makes the code look nicer and gets rid of the
warning.
Without this patch, building at91sam9263_defconfig results in:
/home/arnd/linux-arm/arch/arm/mach-at91/pm.c: In function 'at91_pm_verify_clocks':
/home/arnd/linux-arm/arch/arm/mach-at91/pm.c:137:6: warning: unused variable 'i' [-Wunused-variable]
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c
index 2c2d865..5315f05 100644
--- a/arch/arm/mach-at91/pm.c
+++ b/arch/arm/mach-at91/pm.c
@@ -153,7 +153,9 @@ static int at91_pm_verify_clocks(void)
}
}
-#ifdef CONFIG_AT91_PROGRAMMABLE_CLOCKS
+ if (!IS_ENABLED(CONFIG_AT91_PROGRAMMABLE_CLOCKS))
+ return 1;
+
/* PCK0..PCK3 must be disabled, or configured to use clk32k */
for (i = 0; i < 4; i++) {
u32 css;
@@ -167,7 +169,6 @@ static int at91_pm_verify_clocks(void)
return 0;
}
}
-#endif
On Tuesday 02 October 2012, Jean-Christophe PLAGNIOL-VILLARD wrote:
> On 18:36 Tue 02 Oct , Arnd Bergmann wrote:
> > On NOMMU systems, we do cannot remap the MMIO space, so the
> > definition of at91_io_desc is unused.
> > Without this patch, building at91x40_defconfig results in:
> > arch/arm/mach-at91/setup.c:90:24: warning: 'at91_io_desc' defined but not used [-Wunused-variable]
> I prefer a __maybe_unused on the struct so the compilator will just drop it
Ok, makes sense. I've fixed up the patch accordingly.
On Thu, Oct 04, 2012 at 08:34:54AM +0000, Arnd Bergmann wrote:
> On Wednesday 03 October 2012, Simon Horman wrote:
> > I looked through my fines and found a config that I believe
> > worked with a derivative of 2.6.35.7.
> > It has CONFIG_MEMORY_SIZE=0x1e800000.
> > So what I suspect has happened is that an extra zero has crept into
> > arch/arm/configs/kota2_defconfig and the intended value is:
> > CONFIG_MEMORY_SIZE=0x1e000000
> > Unfortunately I do not have access to a board to test this,
> > nor am I aware of anyone who does.
> Ok, I'll drop this patch for now then, so we keep the warning around
> to remind us of the problem.
Thanks. I have subsequently located a Kota2 board,
however it may be a little while before I get my hands on it.
> On Tue, Oct 2, 2012 at 10:36 AM, Arnd Bergmann <a...@arndb.de> wrote:
> > pci_scan_root_bus is __devinit, so iop13xx_scan_bus has to be the
> > same in order to safely call it. This is ok because the function
> > itself is only called from the hwpci->scan callback.
> > WARNING: vmlinux.o(.text+0x10138): Section mismatch in reference from the function iop13xx_scan_bus() to the function .devinit.text:pci_scan_root_bus()
> > The function iop13xx_scan_bus() references
> > the function __devinit pci_scan_root_bus().
> > This is often because iop13xx_scan_bus lacks a __devinit
> > annotation or the annotation of pci_scan_root_bus is wrong.
> With CONFIG_HOTPLUG going away (I think the current state is that it
> is always set to "y"), __devinit will effectively become a no-op, so I
> expect we'll remove it from pci_scan_root_bus().
> Therefore, I would skip this patch and live with the warning a little longer.
Hmm, I'm just trying to get rid of all build time warnings in the defconfigs
right now, and modpost still complains about the section mismatches. I have
a bunch more of these patches, but it would also be fine with me if we can
patch mostpost to ignore these cases.
I've also redone the analysis that Greg cited in the commit message for
45f035ab9b8 "CONFIG_HOTPLUG should be always on"
It is quite hard to disable it these days, and even if you do, it
only saves you about 200 bytes. However, if it is disabled, lots of
bugs show up because it is almost never tested if the option is disabled.
My test case (ARM omap2plus_defconfig, one of the most common configurations)
shows these size -A differences:
total 13359171 13371357 12186
after boot 13001183 13054521 53338
That is over 50kb difference after discarding the init sections,
significantly more than the 200 bytes that Greg found.
The point about lack of testing is still valid of course, and I'm
not saying we need to keep the option around, but it's really
not as obvious as before. An argument in favor of removing the
__devinit logic is that these 50kb is still just 0.4% of the
kernel size.
For the five ARM defconfig files that actually turn off hotplug,
the absolute numbers are a bit lower, but the percentage is similar.
This is the amount of space wasted by enabling on CONFIG_HOTPLUG
on them, in bytes after discarding the init sections, and as a
percentage of the vmlinux size:
Footbridge is the only config among these that enables PCI and USB, so
it has a bunch more drivers that actually have notable functions that can be discarded.
> The mityomapl138_cpufreq_init and read_factory_config function in
> board-mityomapl138.c are not __init functions and might be called
> at a later stage, so da850_register_cpufreq must not be __init either.
> Without this patch, building da8xx_omapl_defconfig results in:
> WARNING: arch/arm/mach-davinci/built-in.o(.text+0x2eb4): Section mismatch in reference from the function read_factory_config() to the function .init.text:da850_register_cpufreq()
> The function read_factory_config() references
> the function __init da850_register_cpufreq().
> This is often because read_factory_config lacks a __init
> annotation or the annotation of da850_register_cpufreq is wrong.
> Signed-off-by: Arnd Bergmann <a...@arndb.de>
> Cc: Sekhar Nori <nsek...@ti.com>
> Cc: Kevin Hilman <khil...@ti.com>
> The code using the variable 'i' in this function is conditional which
> results in a harmless compiler warning. Using the IS_ENABLED macro
> instead of #ifdef makes the code look nicer and gets rid of the
> warning.
> Without this patch, building at91sam9263_defconfig results in:
> /home/arnd/linux-arm/arch/arm/mach-at91/pm.c: In function 'at91_pm_verify_clocks':
> /home/arnd/linux-arm/arch/arm/mach-at91/pm.c:137:6: warning: unused variable 'i' [-Wunused-variable]
On Thu, Oct 04, 2012 at 10:32:20AM +0000, Arnd Bergmann wrote:
> (+Greg)
> On Tuesday 02 October 2012, Bjorn Helgaas wrote:
> > On Tue, Oct 2, 2012 at 10:36 AM, Arnd Bergmann <a...@arndb.de> wrote:
> > > pci_scan_root_bus is __devinit, so iop13xx_scan_bus has to be the
> > > same in order to safely call it. This is ok because the function
> > > itself is only called from the hwpci->scan callback.
> > > WARNING: vmlinux.o(.text+0x10138): Section mismatch in reference from the function iop13xx_scan_bus() to the function .devinit.text:pci_scan_root_bus()
> > > The function iop13xx_scan_bus() references
> > > the function __devinit pci_scan_root_bus().
> > > This is often because iop13xx_scan_bus lacks a __devinit
> > > annotation or the annotation of pci_scan_root_bus is wrong.
> > With CONFIG_HOTPLUG going away (I think the current state is that it
> > is always set to "y"), __devinit will effectively become a no-op, so I
> > expect we'll remove it from pci_scan_root_bus().
> > Therefore, I would skip this patch and live with the warning a little longer.
> Hmm, I'm just trying to get rid of all build time warnings in the defconfigs
> right now, and modpost still complains about the section mismatches. I have
> a bunch more of these patches, but it would also be fine with me if we can
> patch mostpost to ignore these cases.
> I've also redone the analysis that Greg cited in the commit message for
> 45f035ab9b8 "CONFIG_HOTPLUG should be always on"
> It is quite hard to disable it these days, and even if you do, it
> only saves you about 200 bytes. However, if it is disabled, lots of
> bugs show up because it is almost never tested if the option is disabled.
> My test case (ARM omap2plus_defconfig, one of the most common configurations)
> shows these size -A differences:
> total 13359171 13371357 12186
> after boot 13001183 13054521 53338
> That is over 50kb difference after discarding the init sections,
> significantly more than the 200 bytes that Greg found.
> The point about lack of testing is still valid of course, and I'm
> not saying we need to keep the option around, but it's really
> not as obvious as before. An argument in favor of removing the
> __devinit logic is that these 50kb is still just 0.4% of the
> kernel size.
> For the five ARM defconfig files that actually turn off hotplug,
> the absolute numbers are a bit lower, but the percentage is similar.
> This is the amount of space wasted by enabling on CONFIG_HOTPLUG
> on them, in bytes after discarding the init sections, and as a
> percentage of the vmlinux size:
> Footbridge is the only config among these that enables PCI and USB, so
> it has a bunch more drivers that actually have notable functions that > can be discarded.
USB drivers should not be having anything discarded if CONFIG_HOTPLUG is
disabled (it shouldn't be disabled for USB systems, unless someone isn't
going to plug a USB device into the system after it comes up, which is
one of the main confusions here.)
As for PCI, that seems like a lot of code getting thrown away, it would
be interesting to figure out why that is.
My plans are to now start unwinding the CONFIG_HOTPLUG dependancies. If
a driver subsystem really does want to throw away sections (like PCI
will if CONFIG_PCI_HOTPLUG is not enabled), then it should be able to.
But I imagine all of the real savings will be in the bus cores, not the
individual drivers, unless they have huge module_init() functions.
Thanks for the numbers, I'll look into this more in the coming weeks.
On Tue, Oct 02, 2012 at 06:36:48PM +0200, Arnd Bergmann wrote:
> As tests using 'make randconfig' showed, imx5 requires the same logic
> as imx6 to select ARM_CPU_SUSPEND when building with power management
> enabled.
> The defconfig does not have this problem because it enables imx6
> as well, but disabling it leads to this warning:
> arch/arm/mach-imx/built-in.o: In function `v7_cpu_resume':
> arch/arm/mach-imx/head-v7.S:104: undefined reference to `cpu_resume'
Yes, you are right, my mistake. That patch was already merged, I just
accidentally picked up the older one again when going through my backlog
and forgot to check that it still applies.
On Wed, Oct 3, 2012 at 12:36 AM, Arnd Bergmann <a...@arndb.de> wrote:
> The sharpsl_fatal_check has not been used since Pavel Machek removed
> the caller in 99f329a2b "pxa/sharpsl_pm: zaurus c3000 aka spitz: fix
> resume". Nobody has complained since 2009, so it's safe to assume we
> can just remove the function.
> Without this patch, building corgi_defconfig results in:
> /home/arnd/linux-arm/arch/arm/mach-pxa/sharpsl_pm.c:693:12: warning: 'sharpsl_fatal_check' defined but not used [-Wunused-function]
> Signed-off-by: Arnd Bergmann <a...@arndb.de>
> Cc: Pavel Machek <pa...@ucw.cz>
> Cc: Stanislav Brabec <u...@penguin.cz>
> Cc: Eric Miao <eric.y.m...@gmail.com>
> Cc: Haojian Zhuang <haojian.zhu...@gmail.com>
On Mon, Oct 8, 2012 at 10:38 AM, Eric Miao <eric.y.m...@gmail.com> wrote:
> On Wed, Oct 3, 2012 at 12:36 AM, Arnd Bergmann <a...@arndb.de> wrote:
>> The sharpsl_fatal_check has not been used since Pavel Machek removed
>> the caller in 99f329a2b "pxa/sharpsl_pm: zaurus c3000 aka spitz: fix
>> resume". Nobody has complained since 2009, so it's safe to assume we
>> can just remove the function.
>> Without this patch, building corgi_defconfig results in:
>> /home/arnd/linux-arm/arch/arm/mach-pxa/sharpsl_pm.c:693:12: warning: 'sharpsl_fatal_check' defined but not used [-Wunused-function]
>> Signed-off-by: Arnd Bergmann <a...@arndb.de>
>> Cc: Pavel Machek <pa...@ucw.cz>
>> Cc: Stanislav Brabec <u...@penguin.cz>
>> Cc: Eric Miao <eric.y.m...@gmail.com>
>> Cc: Haojian Zhuang <haojian.zhu...@gmail.com>
> Let's get it cleaned up firstly. One can always reference the history for a
> sample implementation later if this is needed in the future.
Acked-by: Haojian Zhuang <haojian.zhu...@gmail.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
On Thu, Oct 4, 2012 at 1:58 AM, Simon Horman <ho...@verge.net.au> wrote:
> On Thu, Oct 04, 2012 at 08:34:54AM +0000, Arnd Bergmann wrote:
>> On Wednesday 03 October 2012, Simon Horman wrote:
>> > I looked through my fines and found a config that I believe
>> > worked with a derivative of 2.6.35.7.
>> > It has CONFIG_MEMORY_SIZE=0x1e800000.
>> > So what I suspect has happened is that an extra zero has crept into
>> > arch/arm/configs/kota2_defconfig and the intended value is:
>> > CONFIG_MEMORY_SIZE=0x1e000000
>> > Unfortunately I do not have access to a board to test this,
>> > nor am I aware of anyone who does.
>> Ok, I'll drop this patch for now then, so we keep the warning around
>> to remind us of the problem.
> Thanks. I have subsequently located a Kota2 board,
> however it may be a little while before I get my hands on it.
Gentle ping. I just came across this warning again so I figured I'd check.
On Fri, Nov 30, 2012 at 02:10:47PM -0800, Olof Johansson wrote:
> Hi,
> On Thu, Oct 4, 2012 at 1:58 AM, Simon Horman <ho...@verge.net.au> wrote:
> > On Thu, Oct 04, 2012 at 08:34:54AM +0000, Arnd Bergmann wrote:
> >> On Wednesday 03 October 2012, Simon Horman wrote:
> >> > I looked through my fines and found a config that I believe
> >> > worked with a derivative of 2.6.35.7.
> >> > It has CONFIG_MEMORY_SIZE=0x1e800000.
> >> > So what I suspect has happened is that an extra zero has crept into
> >> > arch/arm/configs/kota2_defconfig and the intended value is:
> >> > CONFIG_MEMORY_SIZE=0x1e000000
> >> > Unfortunately I do not have access to a board to test this,
> >> > nor am I aware of anyone who does.
> >> Ok, I'll drop this patch for now then, so we keep the warning around
> >> to remind us of the problem.
> > Thanks. I have subsequently located a Kota2 board,
> > however it may be a little while before I get my hands on it.
> Gentle ping. I just came across this warning again so I figured I'd check.
Sorry, I still don't have a kota2 board.
However, I expect to obtain one within the next week.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
On Fri, Nov 30, 2012 at 02:10:47PM -0800, Olof Johansson wrote:
> Hi,
> On Thu, Oct 4, 2012 at 1:58 AM, Simon Horman <ho...@verge.net.au> wrote:
> > On Thu, Oct 04, 2012 at 08:34:54AM +0000, Arnd Bergmann wrote:
> >> On Wednesday 03 October 2012, Simon Horman wrote:
> >> > I looked through my fines and found a config that I believe
> >> > worked with a derivative of 2.6.35.7.
> >> > It has CONFIG_MEMORY_SIZE=0x1e800000.
> >> > So what I suspect has happened is that an extra zero has crept into
> >> > arch/arm/configs/kota2_defconfig and the intended value is:
> >> > CONFIG_MEMORY_SIZE=0x1e000000
> >> > Unfortunately I do not have access to a board to test this,
> >> > nor am I aware of anyone who does.
> >> Ok, I'll drop this patch for now then, so we keep the warning around
> >> to remind us of the problem.
> > Thanks. I have subsequently located a Kota2 board,
> > however it may be a little while before I get my hands on it.
> Gentle ping. I just came across this warning again so I figured I'd check.
Hi,
I have my kota2 board up and running now and I believe that
the correct value is 0x1e000000. I will apply a patch to my
defconfigs branch accordingly.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
> I have my kota2 board up and running now and I believe that
> the correct value is 0x1e000000. I will apply a patch to my
> defconfigs branch accordingly.
On Mon, Jan 07, 2013 at 01:33:56PM +0000, Arnd Bergmann wrote:
> On Monday 07 January 2013, Simon Horman wrote:
> > I have my kota2 board up and running now and I believe that
> > the correct value is 0x1e000000. I will apply a patch to my
> > defconfigs branch accordingly.
> Ok, thanks!
> Should we mark that patch for stable backports?
I don't believe it warrants a stable backport as
the board appears to function well without the change.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
> > Should we mark that patch for stable backports?
> I don't believe it warrants a stable backport as
> the board appears to function well without the change.
Ok, fair enough. I was thinking of getting rid of the build warning in the older
kernel, but it's probably not worth it if there is no functional impact.