* Re: [3.0-git16] Oops at driver_uevent_store(). @ 2011-08-04 2:21 Tetsuo Handa 2011-08-04 2:48 ` Arnaud Lacombe 0 siblings, 1 reply; 10+ messages in thread From: Tetsuo Handa @ 2011-08-04 2:21 UTC (permalink / raw) To: lacombar, greg; +Cc: akpm, torvalds, linux-kernel Commit 005bdad7 "eisa/pci_eisa.c: fix section mismatch" triggers oops. Reverting it solved the oops. Is this rather a sysfs bug? [ 7.460292] dracut: Mounted root filesystem /dev/sda1 [ 7.603017] dracut: Loading SELinux policy [ 7.976804] dracut: /sbin/load_policy: Can't load policy: No such device [ 8.095959] dracut: Switching root [ 9.452334] udev: starting version 147 [ 9.456695] BUG: unable to handle kernel paging request at c15dd684 [ 9.457860] IP: [<c12408a0>] driver_uevent_store+0x20/0x40 [ 9.457860] *pde = 01d60067 *pte = 015dd162 [ 9.457860] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC [ 9.457860] Modules linked in: [ 9.457860] [ 9.457860] Pid: 2914, comm: udevadm Tainted: G W 3.0.0-03636-g005bdad #12 VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform [ 9.457860] EIP: 0060:[<c12408a0>] EFLAGS: 00010246 CPU: 1 [ 9.457861] EIP is at driver_uevent_store+0x20/0x40 [ 9.457861] EAX: 00000000 EBX: 00000003 ECX: ffffffff EDX: f4422000 [ 9.457861] ESI: c15dd650 EDI: 00000003 EBP: f4b63f30 ESP: f4b63f24 [ 9.457861] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 9.459164] Process udevadm (pid: 2914, ti=f4b62000 task=f49f87e0 task.ti=f4b62000) [ 9.463514] Stack: [ 9.464278] 00000000 c1240880 f4d61f70 f4b63f40 c12405e7 c13e0240 f5c1bea8 f4b63f64 [ 9.465858] c111cf6c 00000003 c13e0240 f4f82f84 f4d61f70 f18cdf20 00000003 bfe20f1e [ 9.465858] f4b63f8c c10c6bba f4b63f98 f18cdf28 00000020 c111ced0 f4b63fa0 f18cdf20 [ 9.467123] Call Trace: [ 9.468030] [<c1240880>] ? bus_uevent_store+0x40/0x40 [ 9.469764] [<c12405e7>] drv_attr_store+0x27/0x40 [ 9.469856] [<c111cf6c>] sysfs_write_file+0x9c/0xf0 [ 9.469856] [<c10c6bba>] vfs_write+0x9a/0x140 [ 9.469857] [<c111ced0>] ? sysfs_open_file+0x1e0/0x1e0 [ 9.469857] [<c10c6d2d>] sys_write+0x3d/0x70 [ 9.469857] [<c13be60c>] sysenter_do_call+0x12/0x32 [ 9.469857] Code: f8 89 ec 5d c3 8d b6 00 00 00 00 55 89 e5 83 ec 0c 89 5d f8 89 cb 89 75 fc 8d 4d f4 89 c6 89 d0 89 da e8 34 b5 f7 ff 85 c0 75 0b <8b> 46 34 8b 55 f4 e8 b5 b9 f7 ff 89 d8 8b 75 fc 8b 5d f8 89 ec [ 9.469964] EIP: [<c12408a0>] driver_uevent_store+0x20/0x40 SS:ESP 0068:f4b63f24 [ 9.471828] CR2: 00000000c15dd684 [ 9.472987] ---[ end trace 93d72a36b9146f25 ]--- [ 9.959305] pcnet32: pcnet32.c:v1.35 21.Apr.2008 tsbogend@alpha.franken.de [ 9.961686] pcnet32 0000:02:01.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19 [ 9.963766] pcnet32: PCnet/PCI II 79C970A at 0x2000, 00:0c:29:6c:1a:76 assigned IRQ 19 Config is at http://I-love.SAKURA.ne.jp/tmp/config-3.0-git16 . Regards. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [3.0-git16] Oops at driver_uevent_store(). 2011-08-04 2:21 [3.0-git16] Oops at driver_uevent_store() Tetsuo Handa @ 2011-08-04 2:48 ` Arnaud Lacombe 2011-08-04 3:55 ` Tetsuo Handa 0 siblings, 1 reply; 10+ messages in thread From: Arnaud Lacombe @ 2011-08-04 2:48 UTC (permalink / raw) To: Tetsuo Handa; +Cc: greg, akpm, torvalds, linux-kernel 2011/8/3 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>: > Commit 005bdad7 "eisa/pci_eisa.c: fix section mismatch" triggers oops. > Reverting it solved the oops. Is this rather a sysfs bug? > > [ 7.460292] dracut: Mounted root filesystem /dev/sda1 > [ 7.603017] dracut: Loading SELinux policy > [ 7.976804] dracut: /sbin/load_policy: Can't load policy: No such device > [ 8.095959] dracut: Switching root > [ 9.452334] udev: starting version 147 > [ 9.456695] BUG: unable to handle kernel paging request at c15dd684 > [ 9.457860] IP: [<c12408a0>] driver_uevent_store+0x20/0x40 > [ 9.457860] *pde = 01d60067 *pte = 015dd162 > [ 9.457860] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC > [ 9.457860] Modules linked in: > [ 9.457860] > [ 9.457860] Pid: 2914, comm: udevadm Tainted: G W 3.0.0-03636-g005bdad #12 VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform > [ 9.457860] EIP: 0060:[<c12408a0>] EFLAGS: 00010246 CPU: 1 > [ 9.457861] EIP is at driver_uevent_store+0x20/0x40 > [ 9.457861] EAX: 00000000 EBX: 00000003 ECX: ffffffff EDX: f4422000 > [ 9.457861] ESI: c15dd650 EDI: 00000003 EBP: f4b63f30 ESP: f4b63f24 > [ 9.457861] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 > [ 9.459164] Process udevadm (pid: 2914, ti=f4b62000 task=f49f87e0 task.ti=f4b62000) > [ 9.463514] Stack: > [ 9.464278] 00000000 c1240880 f4d61f70 f4b63f40 c12405e7 c13e0240 f5c1bea8 f4b63f64 > [ 9.465858] c111cf6c 00000003 c13e0240 f4f82f84 f4d61f70 f18cdf20 00000003 bfe20f1e > [ 9.465858] f4b63f8c c10c6bba f4b63f98 f18cdf28 00000020 c111ced0 f4b63fa0 f18cdf20 > [ 9.467123] Call Trace: > [ 9.468030] [<c1240880>] ? bus_uevent_store+0x40/0x40 > [ 9.469764] [<c12405e7>] drv_attr_store+0x27/0x40 > [ 9.469856] [<c111cf6c>] sysfs_write_file+0x9c/0xf0 > [ 9.469856] [<c10c6bba>] vfs_write+0x9a/0x140 > [ 9.469857] [<c111ced0>] ? sysfs_open_file+0x1e0/0x1e0 > [ 9.469857] [<c10c6d2d>] sys_write+0x3d/0x70 > [ 9.469857] [<c13be60c>] sysenter_do_call+0x12/0x32 > [ 9.469857] Code: f8 89 ec 5d c3 8d b6 00 00 00 00 55 89 e5 83 ec 0c 89 5d f8 89 cb 89 75 fc 8d 4d f4 89 c6 89 d0 89 da e8 34 b5 f7 ff 85 c0 75 0b <8b> 46 34 8b 55 f4 e8 b5 b9 f7 ff 89 d8 8b 75 fc 8b 5d f8 89 ec > [ 9.469964] EIP: [<c12408a0>] driver_uevent_store+0x20/0x40 SS:ESP 0068:f4b63f24 > [ 9.471828] CR2: 00000000c15dd684 > [ 9.472987] ---[ end trace 93d72a36b9146f25 ]--- > [ 9.959305] pcnet32: pcnet32.c:v1.35 21.Apr.2008 tsbogend@alpha.franken.de > [ 9.961686] pcnet32 0000:02:01.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19 > [ 9.963766] pcnet32: PCnet/PCI II 79C970A at 0x2000, 00:0c:29:6c:1a:76 assigned IRQ 19 > > Config is at http://I-love.SAKURA.ne.jp/tmp/config-3.0-git16 . > Looking more closely, I'd say I have been too eager in the marking. The warning concern `pci_eisa_driver', not `pci_eisa_pci_tbl' which is also referenced by MODULE_DEVICE_TABLE(). Does removing the annotation from `pci_eisa_pci_tbl' fix the BUG ? Thanks, - Arnaud > Regards. > ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [3.0-git16] Oops at driver_uevent_store(). 2011-08-04 2:48 ` Arnaud Lacombe @ 2011-08-04 3:55 ` Tetsuo Handa 2011-08-04 5:47 ` Arnaud Lacombe 0 siblings, 1 reply; 10+ messages in thread From: Tetsuo Handa @ 2011-08-04 3:55 UTC (permalink / raw) To: lacombar; +Cc: greg, akpm, torvalds, linux-kernel Arnaud Lacombe wrote: > Looking more closely, I'd say I have been too eager in the marking. > The warning concern `pci_eisa_driver', not `pci_eisa_pci_tbl' which is > also referenced by MODULE_DEVICE_TABLE(). > > Does removing the annotation from `pci_eisa_pci_tbl' fix the BUG ? No. -static struct pci_device_id __initdata pci_eisa_pci_tbl[] = { +static struct pci_device_id pci_eisa_pci_tbl[] = { did not help. Printing dmesg in verbose showed below three lines. [ 0.262828] EISA bus registered [ 6.291117] EISA: Probing bus 0 at eisa.0 [ 6.295445] EISA: Cannot allocate resource for mainboard Manual printk() tracing showed below callchain. virtual_eisa_root_init() calls eisa_root_register(). eisa_root_register() calls eisa_probe(). eisa_probe() returns -EBUSY since root->force_probe == 0. eisa_root_register() calls release_resource() and returns -EBUSY. virtual_eisa_root_init() calls platform_device_unregister() and returns -1. Also, eisa_root_register() in pci_eisa_init() is not called. So, it seems that something is wrong with cleanup. pci_unregister_driver() is missing? ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [3.0-git16] Oops at driver_uevent_store(). 2011-08-04 3:55 ` Tetsuo Handa @ 2011-08-04 5:47 ` Arnaud Lacombe 2011-08-04 7:15 ` Tetsuo Handa 2011-08-04 8:40 ` Adrian Bunk 0 siblings, 2 replies; 10+ messages in thread From: Arnaud Lacombe @ 2011-08-04 5:47 UTC (permalink / raw) To: Tetsuo Handa; +Cc: greg, akpm, torvalds, linux-kernel, Adrian Bunk Hi, [Added Adrian Bunk to the Cc: list] 2011/8/3 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>: > Arnaud Lacombe wrote: >> Looking more closely, I'd say I have been too eager in the marking. >> The warning concern `pci_eisa_driver', not `pci_eisa_pci_tbl' which is >> also referenced by MODULE_DEVICE_TABLE(). >> >> Does removing the annotation from `pci_eisa_pci_tbl' fix the BUG ? > No. > ok, I had to enable DEBUG_PAGEALLOC to trigger the crash. > -static struct pci_device_id __initdata pci_eisa_pci_tbl[] = { > +static struct pci_device_id pci_eisa_pci_tbl[] = { > > did not help. > > Printing dmesg in verbose showed below three lines. > > [ 0.262828] EISA bus registered > [ 6.291117] EISA: Probing bus 0 at eisa.0 > [ 6.295445] EISA: Cannot allocate resource for mainboard > > Manual printk() tracing showed below callchain. > > virtual_eisa_root_init() calls eisa_root_register(). > eisa_root_register() calls eisa_probe(). > eisa_probe() returns -EBUSY since root->force_probe == 0. > eisa_root_register() calls release_resource() and returns -EBUSY. > virtual_eisa_root_init() calls platform_device_unregister() and returns -1. > > Also, eisa_root_register() in pci_eisa_init() is not called. > I'd guess you just have no PCI-EISA bridge in your VM. The trace you point out should only indicate that you have no EISA device either, as the comment a bit before point out: /* First try to get hold of slot 0. If there is no device * here, simply fail, unless root->force_probe is set. */ > So, it seems that something is wrong with cleanup. > pci_unregister_driver() is missing? > The crash happens when sysfs tries to access the device_driver inside 'pci_eisa_driver'. I'd argue that the root of the problem is commit 74b9a297866d which created the inconsistency at the first place: commit 74b9a297866d0416edd0be5014cb0810de049c6a Author: Adrian Bunk <bunk@stusta.de> Date: Mon Mar 26 21:32:27 2007 -0800 [PATCH] drivers/eisa/pci_eisa.c:pci_eisa_init() should be init WARNING: drivers/built-in.o - Section mismatch: reference to .init.text:eisa_root_register from .text between 'pci_eisa_init' (at offset 0xabf670) and 'virtual_eisa_release' AFAIK a PCI to EISA bridge isn't anything hotpluggable, so pci_eisa_init() can become __init. Signed-off-by: Adrian Bunk <bunk@stusta.de> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> To gain a few bytes, 'pci_eisa_init' is freed, but its reference is kept in `pci_eisa_driver' which triggers the warning. The commit log points out that PCI to EISA should not be hotpluggable, so it is not expected to be ever executed again (which would trigger a crash). Marking `pci_eisa_driver' as __refdata fix the warning and leave the struct untouched: diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c index 30da70d..cdae207 100644 --- a/drivers/eisa/pci_eisa.c +++ b/drivers/eisa/pci_eisa.c @@ -45,13 +45,13 @@ static int __init pci_eisa_init(struct pci_dev *pdev, return 0; } -static struct pci_device_id __initdata pci_eisa_pci_tbl[] = { +static struct pci_device_id pci_eisa_pci_tbl[] = { { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 }, { 0, } }; -static struct pci_driver __initdata pci_eisa_driver = { +static struct pci_driver __refdata pci_eisa_driver = { .name = "pci_eisa", .id_table = pci_eisa_pci_tbl, .probe = pci_eisa_init, - Arnaud ^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [3.0-git16] Oops at driver_uevent_store(). 2011-08-04 5:47 ` Arnaud Lacombe @ 2011-08-04 7:15 ` Tetsuo Handa 2011-08-04 7:41 ` Linus Torvalds 2011-08-04 8:40 ` Adrian Bunk 1 sibling, 1 reply; 10+ messages in thread From: Tetsuo Handa @ 2011-08-04 7:15 UTC (permalink / raw) To: lacombar, bunk; +Cc: greg, akpm, torvalds, linux-kernel Arnaud Lacombe wrote: > Marking `pci_eisa_driver' as __refdata fix the warning and leave the > struct untouched: > > diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c > index 30da70d..cdae207 100644 > --- a/drivers/eisa/pci_eisa.c > +++ b/drivers/eisa/pci_eisa.c This patch solved the oops. Thank you. ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [3.0-git16] Oops at driver_uevent_store(). 2011-08-04 7:15 ` Tetsuo Handa @ 2011-08-04 7:41 ` Linus Torvalds 2011-08-04 14:41 ` Arnaud Lacombe 0 siblings, 1 reply; 10+ messages in thread From: Linus Torvalds @ 2011-08-04 7:41 UTC (permalink / raw) To: Tetsuo Handa; +Cc: lacombar, bunk, greg, akpm, linux-kernel 2011/8/3 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>: > Arnaud Lacombe wrote: >> Marking `pci_eisa_driver' as __refdata fix the warning and leave the >> struct untouched: >> >> diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c >> index 30da70d..cdae207 100644 >> --- a/drivers/eisa/pci_eisa.c >> +++ b/drivers/eisa/pci_eisa.c > > This patch solved the oops. Thank you. Arnaud, thanks. Sign-off and slightly cleaned-up changelog? Linus ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [3.0-git16] Oops at driver_uevent_store(). 2011-08-04 7:41 ` Linus Torvalds @ 2011-08-04 14:41 ` Arnaud Lacombe 0 siblings, 0 replies; 10+ messages in thread From: Arnaud Lacombe @ 2011-08-04 14:41 UTC (permalink / raw) To: Linus Torvalds; +Cc: Tetsuo Handa, bunk, greg, akpm, linux-kernel Hi, On Thu, Aug 4, 2011 at 3:41 AM, Linus Torvalds <torvalds@linux-foundation.org> wrote: > 2011/8/3 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>: >> Arnaud Lacombe wrote: >>> Marking `pci_eisa_driver' as __refdata fix the warning and leave the >>> struct untouched: >>> >>> diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c >>> index 30da70d..cdae207 100644 >>> --- a/drivers/eisa/pci_eisa.c >>> +++ b/drivers/eisa/pci_eisa.c >> >> This patch solved the oops. Thank you. > > Arnaud, thanks. Sign-off and slightly cleaned-up changelog? > Sent in a separate patch; sorry for the breakage. - Arnaud ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [3.0-git16] Oops at driver_uevent_store(). 2011-08-04 5:47 ` Arnaud Lacombe 2011-08-04 7:15 ` Tetsuo Handa @ 2011-08-04 8:40 ` Adrian Bunk 2011-08-04 14:36 ` Arnaud Lacombe 1 sibling, 1 reply; 10+ messages in thread From: Adrian Bunk @ 2011-08-04 8:40 UTC (permalink / raw) To: Arnaud Lacombe; +Cc: Tetsuo Handa, greg, akpm, torvalds, linux-kernel On Thu, Aug 04, 2011 at 01:47:11AM -0400, Arnaud Lacombe wrote: > Hi, > > [Added Adrian Bunk to the Cc: list] Thanks. > 2011/8/3 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>: >... > commit 74b9a297866d0416edd0be5014cb0810de049c6a > Author: Adrian Bunk <bunk@stusta.de> > Date: Mon Mar 26 21:32:27 2007 -0800 > > [PATCH] drivers/eisa/pci_eisa.c:pci_eisa_init() should be init > > WARNING: drivers/built-in.o - Section mismatch: reference to > .init.text:eisa_root_register from .text between 'pci_eisa_init' (at > offset 0xabf670) and 'virtual_eisa_release' > > AFAIK a PCI to EISA bridge isn't anything hotpluggable, so > pci_eisa_init() can become __init. > > Signed-off-by: Adrian Bunk <bunk@stusta.de> > Cc: Greg KH <greg@kroah.com> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org> > Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> > > > To gain a few bytes, 'pci_eisa_init' is freed, but its reference is > kept in `pci_eisa_driver' which triggers the warning. The commit log > points out that PCI to EISA should not be hotpluggable, so it is not > expected to be ever executed again (which would trigger a crash). This was not for gaining a few bytes, and I'm not exactly seeing why I'm to blame here, since my patch is invariant to what your patch does: Calling pci_eisa_init outside of __init: - might have crashed before my patch and - after my patch and - after your patch since eisa_root_register() is __init. > Marking `pci_eisa_driver' as __refdata fix the warning and leave the > struct untouched: > > diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c > index 30da70d..cdae207 100644 > --- a/drivers/eisa/pci_eisa.c > +++ b/drivers/eisa/pci_eisa.c > @@ -45,13 +45,13 @@ static int __init pci_eisa_init(struct pci_dev *pdev, > return 0; > } > > -static struct pci_device_id __initdata pci_eisa_pci_tbl[] = { > +static struct pci_device_id pci_eisa_pci_tbl[] = { > { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, > PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 }, > { 0, } > }; > > -static struct pci_driver __initdata pci_eisa_driver = { > +static struct pci_driver __refdata pci_eisa_driver = { > .name = "pci_eisa", > .id_table = pci_eisa_pci_tbl, > .probe = pci_eisa_init, So the commit that broke it was not mine, but commit 005bdad7b80ac017ca21d795639d4214b9844a84 Author: Arnaud Lacombe <lacombar@gmail.com> Date: Mon Jul 25 17:13:04 2011 -0700 eisa/pci_eisa.c: fix section mismatch Fixes WARNING: vmlinux.o(.data+0x15d3ac): Section mismatch in reference from the The variable pci_eisa_driver references the function __init pci_eisa_init( If the reference is valid then annotate the variable with __init* or __ref *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> Cc: Greg KH <greg@kroah.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Please don't blame me for bugs you introduced. > - Arnaud cu Adrian -- "Is there not promise of rain?" Ling Tan asked suddenly out of the darkness. There had been need of rain for many days. "Only a promise," Lao Er said. Pearl S. Buck - Dragon Seed ^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [3.0-git16] Oops at driver_uevent_store(). 2011-08-04 8:40 ` Adrian Bunk @ 2011-08-04 14:36 ` Arnaud Lacombe 0 siblings, 0 replies; 10+ messages in thread From: Arnaud Lacombe @ 2011-08-04 14:36 UTC (permalink / raw) To: Adrian Bunk; +Cc: Tetsuo Handa, greg, akpm, torvalds, linux-kernel Hi, On Thu, Aug 4, 2011 at 4:40 AM, Adrian Bunk <bunk@kernel.org> wrote: > On Thu, Aug 04, 2011 at 01:47:11AM -0400, Arnaud Lacombe wrote: >> Hi, >> >> [Added Adrian Bunk to the Cc: list] > > Thanks. > >> 2011/8/3 Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>: >>... >> commit 74b9a297866d0416edd0be5014cb0810de049c6a >> Author: Adrian Bunk <bunk@stusta.de> >> Date: Mon Mar 26 21:32:27 2007 -0800 >> >> [PATCH] drivers/eisa/pci_eisa.c:pci_eisa_init() should be init >> >> WARNING: drivers/built-in.o - Section mismatch: reference to >> .init.text:eisa_root_register from .text between 'pci_eisa_init' (at >> offset 0xabf670) and 'virtual_eisa_release' >> >> AFAIK a PCI to EISA bridge isn't anything hotpluggable, so >> pci_eisa_init() can become __init. >> >> Signed-off-by: Adrian Bunk <bunk@stusta.de> >> Cc: Greg KH <greg@kroah.com> >> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> >> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> >> >> >> To gain a few bytes, 'pci_eisa_init' is freed, but its reference is >> kept in `pci_eisa_driver' which triggers the warning. The commit log >> points out that PCI to EISA should not be hotpluggable, so it is not >> expected to be ever executed again (which would trigger a crash). > > This was not for gaining a few bytes, and I'm not exactly seeing why I'm > to blame here, since my patch is invariant to what your patch does: > > Calling pci_eisa_init outside of __init: > - might have crashed before my patch and > - after my patch and > - after your patch > since eisa_root_register() is __init. > >> Marking `pci_eisa_driver' as __refdata fix the warning and leave the >> struct untouched: >> >> diff --git a/drivers/eisa/pci_eisa.c b/drivers/eisa/pci_eisa.c >> index 30da70d..cdae207 100644 >> --- a/drivers/eisa/pci_eisa.c >> +++ b/drivers/eisa/pci_eisa.c >> @@ -45,13 +45,13 @@ static int __init pci_eisa_init(struct pci_dev *pdev, >> return 0; >> } >> >> -static struct pci_device_id __initdata pci_eisa_pci_tbl[] = { >> +static struct pci_device_id pci_eisa_pci_tbl[] = { >> { PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, PCI_ANY_ID, >> PCI_CLASS_BRIDGE_EISA << 8, 0xffff00, 0 }, >> { 0, } >> }; >> >> -static struct pci_driver __initdata pci_eisa_driver = { >> +static struct pci_driver __refdata pci_eisa_driver = { >> .name = "pci_eisa", >> .id_table = pci_eisa_pci_tbl, >> .probe = pci_eisa_init, > > So the commit that broke it was not mine, but > > commit 005bdad7b80ac017ca21d795639d4214b9844a84 > Author: Arnaud Lacombe <lacombar@gmail.com> > Date: Mon Jul 25 17:13:04 2011 -0700 > > eisa/pci_eisa.c: fix section mismatch > > Fixes > > WARNING: vmlinux.o(.data+0x15d3ac): Section mismatch in reference from the > The variable pci_eisa_driver references the function __init pci_eisa_init( > If the reference is valid then annotate the variable with __init* or __ref > *_template, *_timer, *_sht, *_ops, *_probe, *_probe_one, *_console > > Signed-off-by: Arnaud Lacombe <lacombar@gmail.com> > Cc: Greg KH <greg@kroah.com> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org> > Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> > > > > Please don't blame me for bugs you introduced. > I was merely pointing out the modpost warning, but yes, I broke the stuff. - Arnaud > >> - Arnaud > > cu > Adrian > > -- > > "Is there not promise of rain?" Ling Tan asked suddenly out > of the darkness. There had been need of rain for many days. > "Only a promise," Lao Er said. > Pearl S. Buck - Dragon Seed > > ^ permalink raw reply [flat|nested] 10+ messages in thread
* [3.0-git16] Oops at driver_uevent_store(). @ 2011-08-02 2:25 Tetsuo Handa 0 siblings, 0 replies; 10+ messages in thread From: Tetsuo Handa @ 2011-08-02 2:25 UTC (permalink / raw) To: linux-kernel I'm getting below oops on CentOS 6.0 (x86_32) since at least 3.0-git11. 3.0 works OK. Config is at http://I-love.SAKURA.ne.jp/tmp/config-3.0-git16 . [ 5.434284] NET: Registered protocol family 17 [ 5.439180] Using IPI No-Shortcut mode [ 5.441357] input: ImPS/2 Generic Wheel Mouse as /devices/platform/i8042/serio1/input/input2 [ 5.451427] debug: unmapping init memory c1583000..c173d000 [ 5.453428] Write protecting the kernel text: 3848k [ 5.454413] Testing CPA: Reverting c1000000-c13c2000 [ 5.456225] Testing CPA: write protecting again [ 5.457817] Write protecting the kernel read-only data: 1488k [ 5.459136] Testing CPA: undo c13c2000-c1536000 [ 5.460662] Testing CPA: write protecting again [ 5.474749] dracut: dracut-004-33.2.el6_0 [ 5.484396] udev: starting version 147 [ 5.486118] ------------[ cut here ]------------ [ 5.487813] WARNING: at fs/proc/base.c:1123 oom_adjust_write+0x266/0x280() [ 5.490401] Hardware name: VMware Virtual Platform [ 5.491594] udevd (1193): /proc/1193/oom_adj is deprecated, please use /proc/1193/oom_score_adj instead. [ 5.494400] Modules linked in: [ 5.495771] Pid: 1193, comm: udevd Tainted: G W 3.0.0-git16 #1 [ 5.497469] Call Trace: [ 5.498398] [<c103a2bd>] warn_slowpath_common+0x6d/0xa0 [ 5.499915] [<c1113046>] ? oom_adjust_write+0x266/0x280 [ 5.502065] [<c1113046>] ? oom_adjust_write+0x266/0x280 [ 5.503676] [<c103a36e>] warn_slowpath_fmt+0x2e/0x30 [ 5.504858] [<c1113046>] oom_adjust_write+0x266/0x280 [ 5.507912] [<c10c6b7a>] vfs_write+0x9a/0x140 [ 5.509834] [<c1112de0>] ? oom_score_adj_write+0x250/0x250 [ 5.511514] [<c10c6ced>] sys_write+0x3d/0x70 [ 5.512328] [<c13c0d0c>] sysenter_do_call+0x12/0x32 [ 5.515909] ---[ end trace 93d72a36b9146f24 ]--- [ 5.819969] dracut: Starting plymouth daemon [ 5.887203] ata_id used greatest stack depth: 5840 bytes left [ 6.224024] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) [ 6.280249] dracut: Mounted root filesystem /dev/sda1 [ 6.355938] dracut: Loading SELinux policy [ 6.626868] load_policy used greatest stack depth: 5696 bytes left [ 6.629000] dracut: /sbin/load_policy: Can't load policy: No such device [ 6.692244] dracut: Switching root [ 7.657652] udev: starting version 147 [ 7.669087] BUG: unable to handle kernel paging request at c15e2744 [ 7.669648] IP: [<c1242f20>] driver_uevent_store+0x20/0x40 [ 7.669648] *pde = 01d65067 *pte = 015e2162 [ 7.671783] Oops: 0000 [#1] SMP DEBUG_PAGEALLOC [ 7.673560] Modules linked in: [ 7.673647] [ 7.673647] Pid: 2874, comm: udevadm Tainted: G W 3.0.0-git16 #1 VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform [ 7.673648] EIP: 0060:[<c1242f20>] EFLAGS: 00010246 CPU: 1 [ 7.675163] EIP is at driver_uevent_store+0x20/0x40 [ 7.676075] EAX: 00000000 EBX: 00000003 ECX: ffffffff EDX: f67ce000 [ 7.677645] ESI: c15e2710 EDI: 00000003 EBP: f1b13f30 ESP: f1b13f24 [ 7.677646] DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068 [ 7.677646] Process udevadm (pid: 2874, ti=f1b12000 task=f138c3a0 task.ti=f1b12000) [ 7.679454] Stack: [ 7.680206] 00000000 c1242f00 f4a7df70 f1b13f40 c1242c67 c13e24a0 f6662d28 f1b13f64 [ 7.682162] c111ce8c 00000003 c13e24a0 f106bf84 f4a7df70 f411ef20 00000003 bfe2df1e [ 7.686981] f1b13f8c c10c6b7a f1b13f98 f411ef28 00000020 c111cdf0 f1b13fa0 f411ef20 [ 7.689530] Call Trace: [ 7.689816] [<c1242f00>] ? bus_uevent_store+0x40/0x40 [ 7.691158] [<c1242c67>] drv_attr_store+0x27/0x40 [ 7.692418] [<c111ce8c>] sysfs_write_file+0x9c/0xf0 [ 7.695157] [<c10c6b7a>] vfs_write+0x9a/0x140 [ 7.696104] [<c111cdf0>] ? sysfs_open_file+0x1e0/0x1e0 [ 7.697762] [<c10c6ced>] sys_write+0x3d/0x70 [ 7.699155] [<c13c0d0c>] sysenter_do_call+0x12/0x32 [ 7.700128] Code: f8 89 ec 5d c3 8d b6 00 00 00 00 55 89 e5 83 ec 0c 89 5d f8 89 cb 89 75 fc 8d 4d f4 89 c6 89 d0 89 da e8 34 ae f7 ff 85 c0 75 0b <8b> 46 34 8b 55 f4 e8 b5 b2 f7 ff 89 d8 8b 75 fc 8b 5d f8 89 ec [ 7.711151] EIP: [<c1242f20>] driver_uevent_store+0x20/0x40 SS:ESP 0068:f1b13f24 [ 7.713324] CR2: 00000000c15e2744 [ 7.714362] ---[ end trace 93d72a36b9146f25 ]--- [ 8.165941] pcnet32: pcnet32.c:v1.35 21.Apr.2008 tsbogend@alpha.franken.de [ 8.168320] pcnet32 0000:02:01.0: PCI INT A -> GSI 19 (level, low) -> IRQ 19 [ 8.170581] pcnet32: PCnet/PCI II 79C970A at 0x2000, 00:0c:29:6c:1a:76 assigned IRQ 19 [ 8.175791] pcnet32: eth0: registered as PCnet/PCI II 79C970A [ 8.177491] pcnet32: 1 cards_found [ 8.281700] ip used greatest stack depth: 5588 bytes left [ 9.131734] EXT4-fs (sda1): re-mounted. Opts: (null) [ 9.687123] NET: Registered protocol family 10 ^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2011-08-04 14:41 UTC | newest] Thread overview: 10+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2011-08-04 2:21 [3.0-git16] Oops at driver_uevent_store() Tetsuo Handa 2011-08-04 2:48 ` Arnaud Lacombe 2011-08-04 3:55 ` Tetsuo Handa 2011-08-04 5:47 ` Arnaud Lacombe 2011-08-04 7:15 ` Tetsuo Handa 2011-08-04 7:41 ` Linus Torvalds 2011-08-04 14:41 ` Arnaud Lacombe 2011-08-04 8:40 ` Adrian Bunk 2011-08-04 14:36 ` Arnaud Lacombe -- strict thread matches above, loose matches on Subject: below -- 2011-08-02 2:25 Tetsuo Handa
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox