2011-06-27 15:45:56

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 00/12] Fix various section mismatches and build errors.

I'm getting screen and screens full of section mismatches from my test
builds of the current kernel to the point where it's sometimes more
meaningful messages get hidden by the bulk of mismatches. This is the
first round of fixes with more to come.

Ralf

drivers/gpu/drm/radeon/radeon_clocks.c | 4 ++--
drivers/leds/leds-lp5521.c | 4 ++--
drivers/leds/leds-lp5523.c | 4 ++--
drivers/misc/ioc4.c | 2 +-
drivers/net/3c509.c | 2 +-
drivers/net/3c59x.c | 2 +-
drivers/net/depca.c | 25 +++++++++++++------------
drivers/net/hp100.c | 2 +-
drivers/net/ne3210.c | 12 +++++++-----
drivers/net/tulip/de4x5.c | 2 +-
drivers/scsi/sim710.c | 2 +-
drivers/tty/serial/Kconfig | 2 +-
12 files changed, 33 insertions(+), 30 deletions(-)


2011-06-27 15:39:29

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 01/12] SCSI: sim710: Fix section mismatch

WARNING: drivers/scsi/sim710.o(.data+0x4c): Section mismatch in reference from the variable sim710_eisa_driver to the function .init.text:sim710_eisa_probe()
The variable sim710_eisa_driver references
the function __init sim710_eisa_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Signed-off-by: Ralf Baechle <[email protected]>
Cc: "James E.J. Bottomley" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/scsi/sim710.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/scsi/sim710.c b/drivers/scsi/sim710.c
index 8ac6ce7..a128502 100644
--- a/drivers/scsi/sim710.c
+++ b/drivers/scsi/sim710.c
@@ -286,7 +286,7 @@ static struct eisa_device_id sim710_eisa_ids[] = {
};
MODULE_DEVICE_TABLE(eisa, sim710_eisa_ids);

-static __init int
+static __devinit int
sim710_eisa_probe(struct device *dev)
{
struct eisa_device *edev = to_eisa_device(dev);
--
1.7.4.4

2011-06-27 15:38:11

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 02/12] NET: 3c509: Fix section mismatch

WARNING: drivers/net/3c509.o(.data+0x190): Section mismatch in reference from the variable el3_eisa_driver to the function .init.text:el3_eisa_probe()
The variable el3_eisa_driver references
the function __init el3_eisa_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Signed-off-by: Ralf Baechle <[email protected]>
To: "David S. Miller" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/net/3c509.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/3c509.c b/drivers/net/3c509.c
index 44b28b2..dc4bf07 100644
--- a/drivers/net/3c509.c
+++ b/drivers/net/3c509.c
@@ -671,7 +671,7 @@ static int __init el3_mca_probe(struct device *device)
#endif /* CONFIG_MCA */

#ifdef CONFIG_EISA
-static int __init el3_eisa_probe (struct device *device)
+static int __devinit el3_eisa_probe(struct device *device)
{
short i;
int ioaddr, irq, if_port;
--
1.7.4.4

2011-06-27 15:38:27

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 03/12] NET: 3c59x: Fix section mismatch.

WARNING: drivers/net/3c59x.o(.data+0x40): Section mismatch in reference from the variable vortex_eisa_driver to the function .init.text:vortex_eisa_probe()
The variable vortex_eisa_driver references
the function __init vortex_eisa_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Signed-off-by: Ralf Baechle <[email protected]>
To: "David S. Miller" <[email protected]>
Cc: Steffen Klassert <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/net/3c59x.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/3c59x.c b/drivers/net/3c59x.c
index 8cc2256..f33fecc 100644
--- a/drivers/net/3c59x.c
+++ b/drivers/net/3c59x.c
@@ -908,7 +908,7 @@ static struct eisa_device_id vortex_eisa_ids[] = {
};
MODULE_DEVICE_TABLE(eisa, vortex_eisa_ids);

-static int __init vortex_eisa_probe(struct device *device)
+static int __devinit vortex_eisa_probe(struct device *device)
{
void __iomem *ioaddr;
struct eisa_device *edev;
--
1.7.4.4

2011-06-27 15:38:22

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 04/12] NET: depca: Fix bucketload full of section mismatches.

WARNING: drivers/net/depca.o(.data+0x34): Section mismatch in reference from the variable depca_eisa_driver to the function .init.text:depca_eisa_probe()
The variable depca_eisa_driver references
the function __init depca_eisa_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

WARNING: drivers/net/depca.o(.devinit.text+0x2c): Section mismatch in reference from the function depca_isa_probe() to the function .init.text:depca_common_init()
The function __devinit depca_isa_probe() references
a function __init depca_common_init().
If depca_common_init is only used by depca_isa_probe then
annotate depca_common_init with a matching annotation.

WARNING: drivers/net/depca.o(.devinit.text+0x44): Section mismatch in reference from the function depca_isa_probe() to the function .init.text:depca_shmem_probe()
The function __devinit depca_isa_probe() references
a function __init depca_shmem_probe().
If depca_shmem_probe is only used by depca_isa_probe then
annotate depca_shmem_probe with a matching annotation.

WARNING: drivers/net/depca.o(.devinit.text+0x8c): Section mismatch in reference from the function depca_isa_probe() to the function .init.text:depca_hw_init()
The function __devinit depca_isa_probe() references
a function __init depca_hw_init().
If depca_hw_init is only used by depca_isa_probe then
annotate depca_hw_init with a matching annotation.

Fixing these in turn triggers yet more mismatches, fix those as well.

Signed-off-by: Ralf Baechle <[email protected]>
To: "David S. Miller" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/net/depca.c | 25 +++++++++++++------------
1 files changed, 13 insertions(+), 12 deletions(-)

diff --git a/drivers/net/depca.c b/drivers/net/depca.c
index 8b0084d..d40536a 100644
--- a/drivers/net/depca.c
+++ b/drivers/net/depca.c
@@ -331,7 +331,7 @@ static struct {
"DE422",\
""}

-static char* __initdata depca_signature[] = DEPCA_SIGNATURE;
+static char* __devinitdata depca_signature[] = DEPCA_SIGNATURE;

enum depca_type {
DEPCA, de100, de101, de200, de201, de202, de210, de212, de422, unknown
@@ -541,9 +541,9 @@ static void SetMulticastFilter(struct net_device *dev);
static int load_packet(struct net_device *dev, struct sk_buff *skb);
static void depca_dbg_open(struct net_device *dev);

-static u_char de1xx_irq[] __initdata = { 2, 3, 4, 5, 7, 9, 0 };
-static u_char de2xx_irq[] __initdata = { 5, 9, 10, 11, 15, 0 };
-static u_char de422_irq[] __initdata = { 5, 9, 10, 11, 0 };
+static u_char de1xx_irq[] __devinitdata = { 2, 3, 4, 5, 7, 9, 0 };
+static u_char de2xx_irq[] __devinitdata = { 5, 9, 10, 11, 15, 0 };
+static u_char de422_irq[] __devinitdata = { 5, 9, 10, 11, 0 };
static u_char *depca_irq;

static int irq;
@@ -580,7 +580,8 @@ static const struct net_device_ops depca_netdev_ops = {
.ndo_validate_addr = eth_validate_addr,
};

-static int __init depca_hw_init (struct net_device *dev, struct device *device)
+static int __devinit depca_hw_init (struct net_device *dev,
+ struct device *device)
{
struct depca_private *lp;
int i, j, offset, netRAM, mem_len, status = 0;
@@ -1302,7 +1303,7 @@ static void SetMulticastFilter(struct net_device *dev)
}
}

-static int __init depca_common_init (u_long ioaddr, struct net_device **devp)
+static int __devinit depca_common_init (u_long ioaddr, struct net_device **devp)
{
int status = 0;

@@ -1333,7 +1334,7 @@ static int __init depca_common_init (u_long ioaddr, struct net_device **devp)
/*
** Microchannel bus I/O device probe
*/
-static int __init depca_mca_probe(struct device *device)
+static int __devinit depca_mca_probe(struct device *device)
{
unsigned char pos[2];
unsigned char where;
@@ -1497,7 +1498,7 @@ static void __init depca_platform_probe (void)
}
}

-static enum depca_type __init depca_shmem_probe (ulong *mem_start)
+static enum depca_type __devinit depca_shmem_probe (ulong *mem_start)
{
u_long mem_base[] = DEPCA_RAM_BASE_ADDRESSES;
enum depca_type adapter = unknown;
@@ -1558,7 +1559,7 @@ static int __devinit depca_isa_probe (struct platform_device *device)
*/

#ifdef CONFIG_EISA
-static int __init depca_eisa_probe (struct device *device)
+static int __devinit depca_eisa_probe (struct device *device)
{
enum depca_type adapter = unknown;
struct eisa_device *edev;
@@ -1629,7 +1630,7 @@ static int __devexit depca_device_remove (struct device *device)
** and Boot (readb) ROM. This will also give us a clue to the network RAM
** base address.
*/
-static int __init DepcaSignature(char *name, u_long base_addr)
+static int __devinit DepcaSignature(char *name, u_long base_addr)
{
u_int i, j, k;
void __iomem *ptr;
@@ -1698,7 +1699,7 @@ static int __init DepcaSignature(char *name, u_long base_addr)
** PROM address counter is correctly positioned at the start of the
** ethernet address for later read out.
*/
-static int __init DevicePresent(u_long ioaddr)
+static int __devinit DevicePresent(u_long ioaddr)
{
union {
struct {
@@ -1751,7 +1752,7 @@ static int __init DevicePresent(u_long ioaddr)
** reason: access the upper half of the PROM with x=0; access the lower half
** with x=1.
*/
-static int __init get_hw_addr(struct net_device *dev)
+static int __devinit get_hw_addr(struct net_device *dev)
{
u_long ioaddr = dev->base_addr;
struct depca_private *lp = netdev_priv(dev);
--
1.7.4.4

2011-06-27 15:40:09

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 06/12] NET: ne3210: Fix bucketload full of section mismatches.

WARNING: drivers/net/ne3210.o(.data+0x40): Section mismatch in reference from the variable ne3210_eisa_driver to the function .init.text:ne3210_eisa_probe()
The variable ne3210_eisa_driver references
the function __init ne3210_eisa_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Fixing this mismatch triggers yet more mismatches, fix those as well.

Signed-off-by: Ralf Baechle <[email protected]>
To: "David S. Miller" <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/net/ne3210.c | 12 +++++++-----
1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/net/ne3210.c b/drivers/net/ne3210.c
index 243ed2a..e30b8ff 100644
--- a/drivers/net/ne3210.c
+++ b/drivers/net/ne3210.c
@@ -80,17 +80,19 @@ static void ne3210_block_output(struct net_device *dev, int count, const unsigne

#define NE3210_DEBUG 0x0

-static unsigned char irq_map[] __initdata = {15, 12, 11, 10, 9, 7, 5, 3};
-static unsigned int shmem_map[] __initdata = {0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0};
-static const char *ifmap[] __initdata = {"UTP", "?", "BNC", "AUI"};
-static int ifmap_val[] __initdata = {
+static unsigned char irq_map[] __devinitdata = {15, 12, 11, 10, 9, 7, 5, 3};
+static unsigned int shmem_map[] __devinitdata = {
+ 0xff0, 0xfe0, 0xfff0, 0xd8, 0xffe0, 0xffc0, 0xd0, 0x0
+};
+static const char *ifmap[] __devinitdata = {"UTP", "?", "BNC", "AUI"};
+static int ifmap_val[] __devinitdata = {
IF_PORT_10BASET,
IF_PORT_UNKNOWN,
IF_PORT_10BASE2,
IF_PORT_AUI,
};

-static int __init ne3210_eisa_probe (struct device *device)
+static int __devinit ne3210_eisa_probe (struct device *device)
{
unsigned long ioaddr, phys_mem;
int i, retval, port_index;
--
1.7.4.4

2011-06-27 15:38:53

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 07/12] NET: de4x5: Fix section mismatch

WARNING: drivers/net/tulip/de4x5.o(.data+0x34): Section mismatch in reference from the variable de4x5_eisa_driver to the function .init.text:de4x5_eisa_probe()
The variable de4x5_eisa_driver references
the function __init de4x5_eisa_probe()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

Signed-off-by: Ralf Baechle <[email protected]>
To: "David S. Miller" <[email protected]>
Cc: Grant Grundler <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/net/tulip/de4x5.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/tulip/de4x5.c b/drivers/net/tulip/de4x5.c
index efaa1d6..ea473b6 100644
--- a/drivers/net/tulip/de4x5.c
+++ b/drivers/net/tulip/de4x5.c
@@ -1995,7 +1995,7 @@ SetMulticastFilter(struct net_device *dev)

static u_char de4x5_irq[] = EISA_ALLOWED_IRQ_LIST;

-static int __init de4x5_eisa_probe (struct device *gendev)
+static int __devinit de4x5_eisa_probe (struct device *gendev)
{
struct eisa_device *edev;
u_long iobase;
--
1.7.4.4

2011-06-27 15:39:00

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 08/12] LED: lp5521: Fix section mismatches

WARNING: drivers/leds/leds-lp5521.o(.text+0xf2c): Section mismatch in reference from the function lp5521_probe() to the function .init.text:lp5521_init_led()
The function lp5521_probe() references
the function __init lp5521_init_led().
This is often because lp5521_probe lacks a __init
annotation or the annotation of lp5521_init_led is wrong.

Fixing this mismatch triggers one more mismatch, fix that one as well.

Signed-off-by: Ralf Baechle <[email protected]>
To: Richard Purdie <[email protected]>
To: Andrew Morton <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/leds/leds-lp5521.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
index c0cff64..cc1dc48 100644
--- a/drivers/leds/leds-lp5521.c
+++ b/drivers/leds/leds-lp5521.c
@@ -593,7 +593,7 @@ static void lp5521_unregister_sysfs(struct i2c_client *client)
&lp5521_led_attribute_group);
}

-static int __init lp5521_init_led(struct lp5521_led *led,
+static int __devinit lp5521_init_led(struct lp5521_led *led,
struct i2c_client *client,
int chan, struct lp5521_platform_data *pdata)
{
@@ -637,7 +637,7 @@ static int __init lp5521_init_led(struct lp5521_led *led,
return 0;
}

-static int lp5521_probe(struct i2c_client *client,
+static int __devinit lp5521_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct lp5521_chip *chip;
--
1.7.4.4

2011-06-27 15:39:09

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 09/12] LED: lp5523: Fix section mismatches.

WARNING: drivers/leds/leds-lp5523.o(.text+0x12f4): Section mismatch in reference from the function lp5523_probe() to the function .init.text:lp5523_init_led()
The function lp5523_probe() references
the function __init lp5523_init_led().
This is often because lp5523_probe lacks a __init
annotation or the annotation of lp5523_init_led is wrong.

Fixing this one triggers one more mismatch, fix that one as well.

Signed-off-by: Ralf Baechle <[email protected]>
To: Richard Purdie <[email protected]>
To: Andrew Morton <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/leds/leds-lp5523.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/leds/leds-lp5523.c b/drivers/leds/leds-lp5523.c
index e19fed2..5971e309 100644
--- a/drivers/leds/leds-lp5523.c
+++ b/drivers/leds/leds-lp5523.c
@@ -826,7 +826,7 @@ static int __init lp5523_init_engine(struct lp5523_engine *engine, int id)
return 0;
}

-static int __init lp5523_init_led(struct lp5523_led *led, struct device *dev,
+static int __devinit lp5523_init_led(struct lp5523_led *led, struct device *dev,
int chan, struct lp5523_platform_data *pdata)
{
char name[32];
@@ -872,7 +872,7 @@ static int __init lp5523_init_led(struct lp5523_led *led, struct device *dev,

static struct i2c_driver lp5523_driver;

-static int lp5523_probe(struct i2c_client *client,
+static int __devinit lp5523_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
struct lp5523_chip *chip;
--
1.7.4.4

2011-06-27 15:39:51

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 10/12] SERIAL: SC26xx: Fix link error.

Kconfig allows enabling console support for the SC26xx driver even when
it's configured as a module resulting in a:

ERROR: "uart_console_device" [drivers/tty/serial/sc26xx.ko] undefined!

modpost error since the driver was merged in
eea63e0e8a60d00485b47fb6e75d9aa2566b989b [SC26XX: New serial driver for
SC2681 uarts] in 2.6.25. Fixed by only allowing console support to be
enabled if the driver is builtin.

Signed-off-by: Ralf Baechle <[email protected]>
To: Alan Cox <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/tty/serial/Kconfig | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 636144c..b3692e6 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1419,7 +1419,7 @@ config SERIAL_SC26XX

config SERIAL_SC26XX_CONSOLE
bool "Console on SC2681/SC2692 serial port"
- depends on SERIAL_SC26XX
+ depends on SERIAL_SC26XX=y
select SERIAL_CORE_CONSOLE
help
Support for Console on SC2681/SC2692 serial ports.
--
1.7.4.4

2011-06-27 15:45:24

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 11/12] MISC: IOC4: Fix section mismatch / race condition.

WARNING: drivers/misc/ioc4.o(.data+0x144): Section mismatch in reference from the variable ioc4_load_modules_work to the function .devinit.text:ioc4_load_modules()
The variable ioc4_load_modules_work references
the function __devinit ioc4_load_modules()
If the reference is valid then annotate the
variable with __init* or __refdata (see linux/init.h) or name the variable:
*driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console

This one is potencially fatal; by the time ioc4_load_modules is invoked
it may already have been freed. For that reason ioc4_load_modules_work
can't be turned to __devinitdata but also because it's referenced in
ioc4_exit.

Signed-off-by: Ralf Baechle <[email protected]>
To: Brent Casavant <[email protected]>
To: Andrew Morton <[email protected]>
Cc: Tejun Heo <[email protected]>
Cc: [email protected]
Cc: [email protected]
---
drivers/misc/ioc4.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c
index 668d41e..df03dd3 100644
--- a/drivers/misc/ioc4.c
+++ b/drivers/misc/ioc4.c
@@ -270,7 +270,7 @@ ioc4_variant(struct ioc4_driver_data *idd)
return IOC4_VARIANT_PCI_RT;
}

-static void __devinit
+static void
ioc4_load_modules(struct work_struct *work)
{
request_module("sgiioc4");
--
1.7.4.4

2011-06-27 15:39:45

by Ralf Baechle

[permalink] [raw]
Subject: [PATCH 12/12] DRM: Radeon: Fix section mismatch.

WARNING: drivers/gpu/drm/radeon/radeon.o(.text+0x5d1fc): Section mismatch in reference from the function radeon_get_clock_info() to the function .devinit.text:radeon_read_clocks_OF()
The function radeon_get_clock_info() references
the function __devinit radeon_read_clocks_OF().
This is often because radeon_get_clock_info lacks a __devinit
annotation or the annotation of radeon_read_clocks_OF is wrong.

Signed-off-by: Ralf Baechle <[email protected]>
To: David Airlie <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
---
drivers/gpu/drm/radeon/radeon_clocks.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/radeon/radeon_clocks.c b/drivers/gpu/drm/radeon/radeon_clocks.c
index 2d48e7a..dcd0863e 100644
--- a/drivers/gpu/drm/radeon/radeon_clocks.c
+++ b/drivers/gpu/drm/radeon/radeon_clocks.c
@@ -96,7 +96,7 @@ uint32_t radeon_legacy_get_memory_clock(struct radeon_device *rdev)
* Read XTAL (ref clock), SCLK and MCLK from Open Firmware device
* tree. Hopefully, ATI OF driver is kind enough to fill these
*/
-static bool __devinit radeon_read_clocks_OF(struct drm_device *dev)
+static bool radeon_read_clocks_OF(struct drm_device *dev)
{
struct radeon_device *rdev = dev->dev_private;
struct device_node *dp = rdev->pdev->dev.of_node;
@@ -166,7 +166,7 @@ static bool __devinit radeon_read_clocks_OF(struct drm_device *dev)
return true;
}
#else
-static bool __devinit radeon_read_clocks_OF(struct drm_device *dev)
+static bool radeon_read_clocks_OF(struct drm_device *dev)
{
return false;
}
--
1.7.4.4

2011-06-27 15:57:26

by Brent Casavant

[permalink] [raw]
Subject: Re: [PATCH 11/12] MISC: IOC4: Fix section mismatch / race condition.

On Mon, 27 Jun 2011, Ralf Baechle wrote:

> WARNING: drivers/misc/ioc4.o(.data+0x144): Section mismatch in reference from the variable ioc4_load_modules_work to the function .devinit.text:ioc4_load_modules()
> The variable ioc4_load_modules_work references
> the function __devinit ioc4_load_modules()
> If the reference is valid then annotate the
> variable with __init* or __refdata (see linux/init.h) or name the variable:
> *driver, *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console
>
> This one is potencially fatal; by the time ioc4_load_modules is invoked
> it may already have been freed. For that reason ioc4_load_modules_work
> can't be turned to __devinitdata but also because it's referenced in
> ioc4_exit.
>
> Signed-off-by: Ralf Baechle <[email protected]>
> To: Brent Casavant <[email protected]>
> To: Andrew Morton <[email protected]>
> Cc: Tejun Heo <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> ---
> drivers/misc/ioc4.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/misc/ioc4.c b/drivers/misc/ioc4.c
> index 668d41e..df03dd3 100644
> --- a/drivers/misc/ioc4.c
> +++ b/drivers/misc/ioc4.c
> @@ -270,7 +270,7 @@ ioc4_variant(struct ioc4_driver_data *idd)
> return IOC4_VARIANT_PCI_RT;
> }
>
> -static void __devinit
> +static void
> ioc4_load_modules(struct work_struct *work)
> {
> request_module("sgiioc4");
> --
> 1.7.4.4
>

Acked-by: Brent Casavant <[email protected]>

--
Brent Casavant
Silicon Graphics International

2011-06-28 05:16:28

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 00/12] Fix various section mismatches and build errors.


See commit:

commit 948252cb9e01d65a89ecadf67be5018351eee15e
Author: David S. Miller <[email protected]>
Date: Tue May 31 19:27:48 2011 -0700

Revert "net: fix section mismatches"

This reverts commit e5cb966c0838e4da43a3b0751bdcac7fe719f7b4.

It causes new build regressions with gcc-4.2 which is
pretty common on non-x86 platforms.

Reported-by: James Bottomley <[email protected]>
Signed-off-by: David S. Miller <[email protected]>

and postings that led to this revert including:

http://marc.info/?l=linux-netdev&m=130653748205263&w=2

2011-06-28 08:29:40

by Alan

[permalink] [raw]
Subject: Re: [PATCH 10/12] SERIAL: SC26xx: Fix link error.

On Mon, 27 Jun 2011 14:26:56 +0100
Ralf Baechle <[email protected]> wrote:

> Kconfig allows enabling console support for the SC26xx driver even
> when it's configured as a module resulting in a:
>
> ERROR: "uart_console_device" [drivers/tty/serial/sc26xx.ko] undefined!
>
> modpost error since the driver was merged in
> eea63e0e8a60d00485b47fb6e75d9aa2566b989b [SC26XX: New serial driver
> for SC2681 uarts] in 2.6.25. Fixed by only allowing console support
> to be enabled if the driver is builtin.
>
> Signed-off-by: Ralf Baechle <[email protected]>

Acked-by: Alan Cox <[email protected]>

2011-06-29 13:08:35

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH 00/12] Fix various section mismatches and build errors.

On Mon, Jun 27, 2011 at 10:12:57PM -0700, David Miller wrote:

> commit 948252cb9e01d65a89ecadf67be5018351eee15e
> Author: David S. Miller <[email protected]>
> Date: Tue May 31 19:27:48 2011 -0700
>
> Revert "net: fix section mismatches"
>
> This reverts commit e5cb966c0838e4da43a3b0751bdcac7fe719f7b4.
>
> It causes new build regressions with gcc-4.2 which is
> pretty common on non-x86 platforms.
>
> Reported-by: James Bottomley <[email protected]>
> Signed-off-by: David S. Miller <[email protected]>
>
> and postings that led to this revert including:
>
> http://marc.info/?l=linux-netdev&m=130653748205263&w=2

Thanks for the pointers; I looked into it a bit deeper and found that the
construct which hppa64-linux-gcc 4.2.4 doesn't like is the combination of
const and __devinitconst __devinitdata.

My patches are minimalistic and don't do any constification and seem to
work fine for PA-RISC.

A possible alternative to allow the use of Michał's reverted patch would
be to conditionalize the definition of __devinitconst. There is no
user of __devexitconst so I left that unchanged.

Ralf

Signed-off-by: Ralf Baechle <[email protected]>

include/linux/init.h | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/include/linux/init.h b/include/linux/init.h
index 577671c..e12fd85 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -84,7 +84,15 @@
/* Used for HOTPLUG */
#define __devinit __section(.devinit.text) __cold
#define __devinitdata __section(.devinit.data)
+#if defined __GNUC__ && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
+/*
+ * GCC 4.2 will sometimes throw an error if the combination of const and
+ * __devinitconst is being used. As a workaround make __devinitconst a noop
+ */
+#define __devinitconst
+#else
#define __devinitconst __section(.devinit.rodata)
+#endif
#define __devexit __section(.devexit.text) __exitused __cold
#define __devexitdata __section(.devexit.data)
#define __devexitconst __section(.devexit.rodata)

2011-06-29 13:58:24

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCH 00/12] Fix various section mismatches and build errors.

On Wed, 2011-06-29 at 14:07 +0100, Ralf Baechle wrote:
> On Mon, Jun 27, 2011 at 10:12:57PM -0700, David Miller wrote:
>
> > commit 948252cb9e01d65a89ecadf67be5018351eee15e
> > Author: David S. Miller <[email protected]>
> > Date: Tue May 31 19:27:48 2011 -0700
> >
> > Revert "net: fix section mismatches"
> >
> > This reverts commit e5cb966c0838e4da43a3b0751bdcac7fe719f7b4.
> >
> > It causes new build regressions with gcc-4.2 which is
> > pretty common on non-x86 platforms.
> >
> > Reported-by: James Bottomley <[email protected]>
> > Signed-off-by: David S. Miller <[email protected]>
> >
> > and postings that led to this revert including:
> >
> > http://marc.info/?l=linux-netdev&m=130653748205263&w=2
>
> Thanks for the pointers; I looked into it a bit deeper and found that the
> construct which hppa64-linux-gcc 4.2.4 doesn't like is the combination of
> const and __devinitconst __devinitdata.
>
> My patches are minimalistic and don't do any constification and seem to
> work fine for PA-RISC.
>
> A possible alternative to allow the use of Michał's reverted patch would
> be to conditionalize the definition of __devinitconst. There is no
> user of __devexitconst so I left that unchanged.

To be honest, my own take on this is that, apart from the compiler
cockups trying to do read only annotations, which affect various
versions of gcc not just the parisc ones, the _devX annotations are
pretty pointless. They only really do something in the non-hotplug
case, so since 95% of the world seems to use hotplug now and the other
5% doesn't care that much about the odd page of memory (which you rarely
get, since modules sections are accumulated per module, not aggregate),
I'd just favour stripping __init and __exit where there's a problem.

I think we should simply concentrate on __init and __exit; that's where
most of the discard value lies and stop expending huge efforts on the
__devX stuff which adds huge complexity for no real gain.

James

2011-06-29 15:16:16

by Greg KH

[permalink] [raw]
Subject: Re: [PATCH 00/12] Fix various section mismatches and build errors.

On Wed, Jun 29, 2011 at 08:58:19AM -0500, James Bottomley wrote:
> I think we should simply concentrate on __init and __exit; that's where
> most of the discard value lies and stop expending huge efforts on the
> __devX stuff which adds huge complexity for no real gain.

I have long felt that those __devX markings should just go away as they
cause nothing but problems and have no real gain as you point out.

greg k-h

2011-06-29 16:20:13

by Ralf Baechle

[permalink] [raw]
Subject: Re: [PATCH 00/12] Fix various section mismatches and build errors.

On Wed, Jun 29, 2011 at 08:14:24AM -0700, Greg KH wrote:

>
> On Wed, Jun 29, 2011 at 08:58:19AM -0500, James Bottomley wrote:
> > I think we should simply concentrate on __init and __exit; that's where
> > most of the discard value lies and stop expending huge efforts on the
> > __devX stuff which adds huge complexity for no real gain.
>
> I have long felt that those __devX markings should just go away as they
> cause nothing but problems and have no real gain as you point out.

The suggestion to do that has been floated around before but seems to
have missed sufficient thrust. I'm all for it; the manual tagging with
__devX has not been very efficient on developer time. I just want to see
meaningful warnings again over all that noise the current mechanisn may
produce.

Ralf

2011-06-29 17:24:42

by James Bottomley

[permalink] [raw]
Subject: Re: [PATCH 00/12] Fix various section mismatches and build errors.

On Wed, 2011-06-29 at 17:19 +0100, Ralf Baechle wrote:
> On Wed, Jun 29, 2011 at 08:14:24AM -0700, Greg KH wrote:
>
> >
> > On Wed, Jun 29, 2011 at 08:58:19AM -0500, James Bottomley wrote:
> > > I think we should simply concentrate on __init and __exit; that's where
> > > most of the discard value lies and stop expending huge efforts on the
> > > __devX stuff which adds huge complexity for no real gain.
> >
> > I have long felt that those __devX markings should just go away as they
> > cause nothing but problems and have no real gain as you point out.
>
> The suggestion to do that has been floated around before but seems to
> have missed sufficient thrust. I'm all for it; the manual tagging with
> __devX has not been very efficient on developer time. I just want to see
> meaningful warnings again over all that noise the current mechanisn may
> produce.

For me, just go ahead and fix the actual problems: so _init sections and
_exit sections that are used from the main body, just strip the
annotations, don't try to change them for _devX ones.

Thanks,

James