Re: 2.6.27-rc5-mm1: rmmod ide-cd_mod: tried to init an initialized object, something is seriously wrong.

Previous thread: RE: mmc/card/block.c : mmc_blk_open readonly mount bug? by sasin on Thursday, September 4, 2008 - 10:36 pm. (1 message)

Next thread: __initdata and struct dmi_system_id? by Németh Márton on Thursday, September 4, 2008 - 10:45 pm. (5 messages)
From: Andrew Morton
Date: Thursday, September 4, 2008 - 10:40 pm

[Empty message]
From: Takashi Iwai
Date: Friday, September 5, 2008 - 12:20 am

At Thu, 4 Sep 2008 22:40:04 -0700,


I applied to my tree now.


thanks,

Takashi
--

From: Alexander Beregalov
Date: Friday, September 5, 2008 - 12:50 am

Hi Andrew

2.6.27-rc5-mm1.gz seems broken
gzip: 2.6.27-rc5-mm1.gz: unexpected end of file
The result does not contain drivers/net/wireless/libertas_tf/

gpg sign seems good
--

From: Andrew Morton
Date: Friday, September 5, 2008 - 1:25 am

oops, thanks, my net connection fell over at a bad time and I didn't
repair all the damage.

I just uploaded the 5160786-byte 2.6.27-rc5-mm1.gz - it should be their
in a few minutes.

--

From: Mariusz Kozlowski
Date: Friday, September 5, 2008 - 5:39 am

Hello, 

	Again 100% reproducible rmmod ide-cd_mod problem. Kernel is tainted because
of earlier sysfs acpi problems similar (probably identical) to those reported
by Li Zefan here http://marc.info/?l=linux-kernel&m=121921059026064&w=2

Steps to reproduce: unload ide-cd_mod

kobject (dd9e4a7c): tried to init an initialized object, something is seriously wrong.
Pid: 4734, comm: modprobe Tainted: G        W 2.6.27-rc5-mm1 #1
 [<c01ec982>] kobject_init+0xc4/0xc9
 [<c02cb84a>] ? _spin_unlock+0x27/0x3f
 [<c01aff2e>] ? sysfs_find_dirent+0x21/0x2b
 [<c01aff7e>] ? __sysfs_add_one+0x46/0x6d
 [<c01affb4>] ? sysfs_add_one+0xf/0x44
 [<c01b0036>] ? sysfs_addrm_start+0x4d/0x90
 [<c01b0f31>] ? sysfs_do_create_link+0x9a/0x14c
 [<c01ec9c5>] kobject_init_and_add+0x14/0x30
 [<c01b1009>] ? sysfs_create_link+0x12/0x19
 [<c01e8bad>] blk_register_filter+0x3b/0x46
 [<ded9e40a>] ide_cd_probe+0x253/0x5a8 [ide_cd_mod]
 [<c01b0000>] ? sysfs_addrm_start+0x17/0x90
 [<c01b0f31>] ? sysfs_do_create_link+0x9a/0x14c
 [<c01b004e>] ? sysfs_addrm_start+0x65/0x90
 [<c025145f>] generic_ide_probe+0x1f/0x21
 [<c024c002>] driver_probe_device+0x77/0x15b
 [<c02cb91b>] ? _spin_unlock_irqrestore+0x39/0x60
 [<c024c146>] __driver_attach+0x60/0x62
 [<c024b7bd>] bus_for_each_dev+0x44/0x62
 [<c0251461>] ? generic_ide_remove+0x0/0x1e
 [<c024bead>] driver_attach+0x19/0x1b
 [<c024c0e6>] ? __driver_attach+0x0/0x62
 [<c024bca8>] bus_add_driver+0x1ab/0x213
 [<c0251461>] ? generic_ide_remove+0x0/0x1e
 [<c024c291>] driver_register+0x4f/0x118
 [<de7bf000>] ? ide_cdrom_init+0x0/0xf [ide_cd_mod]
 [<de7bf00d>] ide_cdrom_init+0xd/0xf [ide_cd_mod]
 [<c0101114>] do_one_initcall+0x24/0x12f
 [<c02c9d8e>] ? mutex_unlock+0x8/0xa
 [<c01455ca>] sys_init_module+0xa5/0x1c1
 [<c0176a0a>] ? sys_read+0x3d/0x64
 [<c01030f1>] sysenter_do_call+0x12/0x35
 [<c012007b>] ? __set_special_pids+0x43/0x71

First time I modprobe/rmmod ide-cd_mod the system works but quickly gets unstable.
Second modprobe/rmmod is 100% fatal. Memory gets corruped ...
From: Rafael J. Wysocki
Date: Friday, September 5, 2008 - 6:28 am

Can you please verify if that happens with the current mainline?

Thanks,
Rafael
--

From: Mariusz Kozlowski
Date: Friday, September 5, 2008 - 6:44 am

Oops. How come I didn't find it earlier? hmm...
This is current mainline:

kobject (ddb049fc): tried to init an initialized object, something is seriously wrong.
Pid: 4650, comm: modprobe Not tainted 2.6.27-rc5-00132-gb380b0d #8
 [<c01e3196>] kobject_init+0x6a/0x6c
 [<c01e35cb>] kobject_init_and_add+0x14/0x30
 [<c01e32f7>] ? kobject_get+0x12/0x17
 [<c01df89c>] blk_register_filter+0x4b/0x5a
 [<de839310>] ide_cd_probe+0x289/0x5ae [ide_cd_mod]
 [<c01aad99>] ? sysfs_addrm_start+0x65/0x90
 [<c01aba69>] ? sysfs_do_create_link+0x9a/0x11c
 [<c024f7a0>] generic_ide_probe+0x1f/0x21
 [<c024a672>] driver_probe_device+0x77/0x15b
 [<c02c8bdb>] ? _spin_unlock_irqrestore+0x39/0x60
 [<c024a7b6>] __driver_attach+0x60/0x62
 [<c0249e2a>] bus_for_each_dev+0x44/0x62
 [<c024f7a2>] ? generic_ide_remove+0x0/0x1e
 [<c024a51d>] driver_attach+0x19/0x1b
 [<c024a756>] ? __driver_attach+0x0/0x62
 [<c024a318>] bus_add_driver+0x1ae/0x216
 [<c024f7a2>] ? generic_ide_remove+0x0/0x1e
 [<c024a901>] driver_register+0x4f/0x118
 [<dee3500d>] ide_cdrom_init+0xd/0xf [ide_cd_mod]
 [<c010111a>] do_one_initcall+0x2a/0x14c
 [<c0108560>] ? native_sched_clock+0x58/0xa1
 [<dee35000>] ? ide_cdrom_init+0x0/0xf [ide_cd_mod]
 [<c013d042>] ? trace_hardirqs_on+0xb/0xd
 [<c013cfaf>] ? trace_hardirqs_on_caller+0xac/0x134
 [<c0147083>] sys_init_module+0x7e/0x19f
 [<c013cfaf>] ? trace_hardirqs_on_caller+0xac/0x134
 [<c01e8144>] ? trace_hardirqs_on_thunk+0xc/0x10
 [<c0103035>] sysenter_do_call+0x12/0x35
 [<c012007b>] ? put_fs_struct+0x5/0x2e
 =======================
=============================================================================
BUG kmalloc-16: Object already free
-----------------------------------------------------------------------------

INFO: Allocated in kvasprintf+0x2d/0x4c age=23609 cpu=0 pid=743
INFO: Freed in kobject_release+0x3a/0x56 age=45 cpu=0 pid=4645
INFO: Slab 0xc13b74e0 objects=64 used=45 fp=0xddba70c0 flags=0x40000083
INFO: Object 0xddba7400 @offset=1024 fp=0xddba7440

Bytes b4 0xddba73f0:  ...
From: Mariusz Kozlowski
Date: Friday, September 5, 2008 - 9:25 am

It's relatively new, that's why :) And this is the culprit:

abf5439370491dd6fbb4fe1a7939680d2a9bc9d4 is first bad commit
commit abf5439370491dd6fbb4fe1a7939680d2a9bc9d4
Author: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Date:   Sat Aug 16 14:10:05 2008 +0900

    block: move cmdfilter from gendisk to request_queue
    
    cmd_filter works only for the block layer SG_IO with SCSI block
    devices. It breaks scsi/sg.c, bsg, and the block layer SG_IO with SCSI
    character devices (such as st). We hit a kernel crash with them.
    
    The problem is that cmd_filter code accesses to gendisk (having struct
    blk_scsi_cmd_filter) via inode->i_bdev->bd_disk. It works for only
    SCSI block device files. With character device files, inode->i_bdev
    leads you to struct cdev. inode->i_bdev->bd_disk->blk_scsi_cmd_filter
    isn't safe.
    
    SCSI ULDs don't expose gendisk; they keep it private. bsg needs to be
    independent on any protocols. We shouldn't change ULDs to expose their
    gendisk.
    
    This patch moves struct blk_scsi_cmd_filter from gendisk to
    request_queue, a common object, which eveyone can access to.
    
    The user interface doesn't change; users can change the filters via
    /sys/block/. gendisk has a pointer to request_queue so the cmd_filter
    code accesses to struct blk_scsi_cmd_filter.
    
    Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>

And this is another one, this time from sparc64 on 2.6.27-rc5-mm1.
To reproduce just rmmod sr_mod.

sr0: scsi3-mmc drive: 24x/24x writer cd/rw xa/form2 cdda tray
kobject (fffff800bf669068): tried to init an initialized object, something is seriously wrong.
Call Trace:
 [0000000000559770] kobject_init_and_add+0x10/0x40
 [0000000000552764] blk_register_filter+0x24/0x40
 [00000000100dc8ec] sr_probe+0x56c/0x620 [sr_mod]
 [00000000005b0d4c] driver_probe_device+0x8c/0x1c0
 [00000000005b0ed4] __driver_attach+0x54/0x80
 [00000000005b0304] bus_for_each_dev+0x44/0x80
 ...
From: FUJITA Tomonori
Date: Saturday, September 6, 2008 - 5:35 am

On Fri, 5 Sep 2008 18:25:04 +0200

ide-cd uses multiple gendisks share one request_queue?

Here's a patch for mainline.

=
From: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Subject: [PATCH] ide: remove cmd filter support in ide-cd

Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
---
 drivers/ide/ide-cd.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
index f148999..49a8c58 100644
--- a/drivers/ide/ide-cd.c
+++ b/drivers/ide/ide-cd.c
@@ -1933,7 +1933,6 @@ static void ide_cd_remove(ide_drive_t *drive)
 
 	ide_proc_unregister_driver(drive, info->driver);
 
-	blk_unregister_filter(info->disk);
 	del_gendisk(info->disk);
 
 	ide_cd_put(info);
@@ -2159,7 +2158,6 @@ static int ide_cd_probe(ide_drive_t *drive)
 	g->fops = &idecd_ops;
 	g->flags |= GENHD_FL_REMOVABLE;
 	add_disk(g);
-	blk_register_filter(g);
 	return 0;
 
 out_free_cd:
-- 
1.5.4.2

--

From: Jens Axboe
Date: Monday, September 8, 2008 - 1:43 am

Hmm, I don't think that it does. There's a queue per drive in the old
IDE driver, so there should be a 1:1 relation between queues and gendisk

-- 
Jens Axboe

--

From: Jens Axboe
Date: Monday, September 8, 2008 - 2:27 am

I think the problem here is due to the usage of kobject_init_and_add().
When we hit the add the second time, the ->state_initalised in the kojb
is still 1. The below should fix it.

The ->state_initalised stuff is a disaster imho, it should be shot and
killed.

diff --git a/block/blk-core.c b/block/blk-core.c
index 6cb3c6d..820132b 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -495,6 +495,7 @@ struct request_queue *blk_alloc_queue_node(gfp_t gfp_mask, int node_id)
 	INIT_LIST_HEAD(&q->timeout_list);
 
 	kobject_init(&q->kobj, &blk_queue_ktype);
+	kobject_init(&q->cmd_filter.kobj, &rcf_ktype);
 
 	mutex_init(&q->sysfs_lock);
 	spin_lock_init(&q->__queue_lock);
diff --git a/block/blk.h b/block/blk.h
index eb13740..47d6b22 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -9,6 +9,7 @@
 
 extern struct kmem_cache *blk_requestq_cachep;
 extern struct kobj_type blk_queue_ktype;
+extern struct kobj_type rcf_ktype;
 
 void init_request_from_bio(struct request *req, struct bio *bio);
 void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
diff --git a/block/cmd-filter.c b/block/cmd-filter.c
index da7f7a4..9556e85 100644
--- a/block/cmd-filter.c
+++ b/block/cmd-filter.c
@@ -201,7 +201,7 @@ static struct sysfs_ops rcf_sysfs_ops = {
 	.store = rcf_attr_store,
 };
 
-static struct kobj_type rcf_ktype = {
+struct kobj_type rcf_ktype = {
 	.sysfs_ops = &rcf_sysfs_ops,
 	.default_attrs = default_attrs,
 };
@@ -211,8 +211,7 @@ int blk_register_filter(struct gendisk *disk)
 	int ret;
 	struct blk_cmd_filter *filter = &disk->queue->cmd_filter;
 
-	ret = kobject_init_and_add(&filter->kobj, &rcf_ktype,
-				   &disk_to_dev(disk)->kobj,
+	ret = kobject_add(&filter->kobj, &disk_to_dev(disk)->kobj,
 				   "%s", "cmd_filter");
 	if (ret < 0)
 		return ret;

-- 
Jens Axboe

--

From: Mariusz Kozlowski
Date: Tuesday, September 9, 2008 - 2:07 am

I applied your fix to 2.6.27-rc5-mm1 (it doesn't apply to mainline) and the result 
is that when I first rmmod ide-cd_mod it's ok, but it seems that the module is not
unregistered because when you rmmod ide-cd_mod again immediately you will see this:

BUG: atomic counter underflow at:
Pid: 4920, comm: rmmod Tainted: G        W 2.6.27-rc5-mm1 #4
 [<c01ec579>] ? kobject_release+0x0/0x59
 [<c01ed300>] kref_put+0x4c/0x7c
 [<c01ec4cc>] kobject_put+0x20/0x4e
 [<c01aed10>] ? sysfs_hash_and_remove+0x50/0x57
 [<c01e8d4b>] blk_unregister_filter+0x13/0x15
 [<dedd822b>] ide_cd_remove+0xf/0x21 [ide_cd_mod]
 [<c025147b>] generic_ide_remove+0x1a/0x1e
 [<c024bdaf>] __device_release_driver+0x59/0x7f
 [<c024be6c>] driver_detach+0x97/0x99
 [<c024b26e>] bus_remove_driver+0x6f/0x8b
 [<c024c231>] driver_unregister+0x2f/0x33
 [<deddb341>] ide_cdrom_exit+0xd/0xf [ide_cd_mod]
 [<c0143da5>] sys_delete_module+0x10d/0x1e2
 [<c0162cbc>] ? do_munmap+0x1d7/0x234
 [<c0163d13>] ? sys_munmap+0x30/0x36
 [<c01030f1>] sysenter_do_call+0x12/0x35
 =======================
hdc: ATAPI 24X DVD-ROM CD-R/RW drive, 2048kB Cache

Btw I found something interesting. On earlier kernels - 2.6.25 I can not remove ide-cd_mod
at all - it's still there when I lsmod modules:

# modprobe ide-cd_mod
# rmmod ide-cd_mod
# rmmod ide-cd_mod
# rmmod ide-cd_mod
# rmmod ide-cd_mod
# rmmod ide-cd_mod
# rmmod ide-cd_mod
# rmmod ide-cd_mod
# lsmod | grep ide_cd
ide_cd_mod             29600  0 
cdrom                  32160  1 ide_cd_mod

On the other hand on newer kernels (post 2.6.26 - these which did not blow up) right
after boot I have to run rmmod ide-cd_mod exactly three times to have ide-cd_mod
unloaded. If I modprobe and rmmod again it works as expected. Why is this?

laptop mako # modprobe ide-cd_mod
laptop mako # rmmod ide-cd_mod
laptop mako # rmmod ide-cd_mod
laptop mako # rmmod ide-cd_mod
laptop mako # rmmod ide-cd_mod
ERROR: Module ide_cd_mod does not exist in /proc/modules
laptop mako # modprobe ...
From: Jens Axboe
Date: Tuesday, September 9, 2008 - 3:29 am

Can you try the below patch from Elias?

diff --git a/block/blk-sysfs.c b/block/blk-sysfs.c
index 304ec73..0120c8e 100644
--- a/block/blk-sysfs.c
+++ b/block/blk-sysfs.c
@@ -9,12 +9,6 @@
 
 #include "blk.h"
 
-struct queue_sysfs_entry {
-	struct attribute attr;
-	ssize_t (*show)(struct request_queue *, char *);
-	ssize_t (*store)(struct request_queue *, const char *, size_t);
-};
-
 static ssize_t
 queue_var_show(unsigned int var, char *page)
 {
diff --git a/block/blk.h b/block/blk.h
index c79f30e..9ab0d6a 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -10,6 +10,12 @@
 extern struct kmem_cache *blk_requestq_cachep;
 extern struct kobj_type blk_queue_ktype;
 
+struct queue_sysfs_entry {
+	struct attribute attr;
+	ssize_t (*show)(struct request_queue *, char *);
+	ssize_t (*store)(struct request_queue *, const char *, size_t);
+};
+
 void init_request_from_bio(struct request *req, struct bio *bio);
 void blk_rq_bio_prep(struct request_queue *q, struct request *rq,
 			struct bio *bio);
diff --git a/block/cmd-filter.c b/block/cmd-filter.c
index 228b644..fc0f0b2 100644
--- a/block/cmd-filter.c
+++ b/block/cmd-filter.c
@@ -26,6 +26,8 @@
 #include <scsi/scsi.h>
 #include <linux/cdrom.h>
 
+#include "blk.h"
+
 int blk_verify_command(struct blk_cmd_filter *filter,
 		       unsigned char *cmd, int has_write_perm)
 {
@@ -50,9 +52,9 @@ int blk_verify_command(struct blk_cmd_filter *filter,
 EXPORT_SYMBOL(blk_verify_command);
 
 /* and now, the sysfs stuff */
-static ssize_t rcf_cmds_show(struct blk_cmd_filter *filter, char *page,
-			     int rw)
+static ssize_t rcf_cmds_show(struct request_queue *q, char *page, int rw)
 {
+	struct blk_cmd_filter *filter = &q->cmd_filter;
 	char *npage = page;
 	unsigned long *okbits;
 	int i;
@@ -76,24 +78,27 @@ static ssize_t rcf_cmds_show(struct blk_cmd_filter *filter, char *page,
 	return npage - page;
 }
 
-static ssize_t rcf_readcmds_show(struct blk_cmd_filter *filter, char *page)
+static ssize_t ...
From: Mariusz Kozlowski
Date: Tuesday, September 9, 2008 - 5:14 am

Sure. It applied fine to clean current mainline. It looks ok now. No oopses and no BUGs.
But still after a fresh boot I see 

# modprobe ide-cd_mod
# rmmod ide-cd_mod
# rmmod ide-cd_mod
# rmmod ide-cd_mod
ERROR: Module ide_cd_mod does not exist in /proc/modules
# modprobe ide-cd_mod
# rmmod ide-cd_mod
# rmmod ide-cd_mod
ERROR: Module ide_cd_mod does not exist in /proc/modules

You need to rmmod ide-cd_mod twice to get it unloaded. After another
modprobe/rmmod it works as expected.

	Mariusz 



--

From: Jens Axboe
Date: Tuesday, September 9, 2008 - 6:21 am

Looks like something for Bart to look into.

-- 
Jens Axboe

--

From: Alexey Dobriyan
Date: Friday, September 5, 2008 - 10:26 am

Jens, send to Andrew whatever you fixed in git://git.kernel.dk/linux-2.6-block.git for-2.6.28

[   24.567512] ------------[ cut here ]------------
[   24.567619] WARNING: at lib/list_debug.c:30 __list_add+0x95/0xa0()
[   24.567722] list_add corruption. prev->next should be next (ffff88017f9b8420), but was ffff88017f9b8588. (prev=ffff88017f9b8858).
[   24.567882] Modules linked in: ipt_MASQUERADE iptable_nat nf_nat nf_conntrack_ipv4 xt_state nf_conntrack iptable_filter ip_tables xt_tcpudp ip6table_filter ip6_tables x_tables ipv6 nls_utf8 ntfs fuse sr_mod cdrom
[   24.568925] Pid: 3366, comm: runscript.sh Tainted: G        W 2.6.27-rc5-mm1 #1
[   24.569071] Call Trace:
[   24.569168]  [<ffffffff802328b7>] warn_slowpath+0xb7/0xe0
[   24.569268]  [<ffffffff8026b321>] ? mempool_alloc_slab+0x11/0x20
[   24.569369]  [<ffffffff8026b47a>] ? mempool_alloc+0x4a/0x130
[   24.569470]  [<ffffffff80291fb7>] ? kmem_cache_alloc+0x67/0xd0
[   24.569571]  [<ffffffff80316390>] ? sg_init_table+0x20/0x80
[   24.569670]  [<ffffffff8031646c>] ? __sg_alloc_table+0x7c/0x140
[   24.569772]  [<ffffffff80388151>] ? scsi_init_sgtable+0x51/0xb0
[   24.569872]  [<ffffffff8038841f>] ? scsi_init_io+0x1f/0xd0
[   24.569971]  [<ffffffff80390d4c>] ? sd_prep_fn+0x5c/0x580
[   24.570069]  [<ffffffff80317f05>] __list_add+0x95/0xa0
[   24.570167]  [<ffffffff80304f10>] blk_add_timer+0x50/0xd0
[   24.570266]  [<ffffffff80389631>] scsi_request_fn+0xa1/0x380
[   24.570374]  [<ffffffff80300a67>] __generic_unplug_device+0x27/0x30
[   24.570484]  [<ffffffff80301201>] ? generic_unplug_device+0x21/0x40
[   24.570586]  [<ffffffff80301209>] generic_unplug_device+0x29/0x40
[   24.570688]  [<ffffffff802ff012>] blk_unplug+0x12/0x20
[   24.570785]  [<ffffffff802ff02d>] blk_backing_dev_unplug+0xd/0x10
[   24.570887]  [<ffffffff802b6f2e>] block_sync_page+0x3e/0x50
[   24.570987]  [<ffffffff802686b9>] sync_page+0x39/0x60
[   24.571083]  [<ffffffff8026a319>] sync_page_killable+0x9/0x40
[   24.571184]  [<ffffffff80430efe>] ...
From: Andrew Morton
Date: Friday, September 5, 2008 - 12:40 pm

On Fri, 5 Sep 2008 21:26:02 +0400

I went looking, but afaict the whole thing got removed from today's


--

From: Jens Axboe
Date: Monday, September 8, 2008 - 2:30 am

-- 
Jens Axboe

--

From: Alexey Dobriyan
Date: Friday, September 5, 2008 - 12:32 pm

dev_load() doesn't exist if MODULES=n.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
---

 include/linux/netdevice.h |    6 ++++++
 1 file changed, 6 insertions(+)

--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -1639,7 +1639,13 @@ extern int		dev_set_allmulti(struct net_device *dev, int inc);
 extern void		netdev_state_change(struct net_device *dev);
 extern void		netdev_bonding_change(struct net_device *dev);
 extern void		netdev_features_change(struct net_device *dev);
+#ifdef CONFIG_MODULES
 extern void		dev_load(struct net *net, const char *name);
+#else
+static inline void dev_load(struct net *net, const char *name)
+{
+}
+#endif
 extern void		dev_mcast_init(void);
 extern int		netdev_max_backlog;
 extern int		weight_p;

--

From: Hiroshi Shimamoto
Date: Friday, September 5, 2008 - 12:54 pm

Hi,

in -next tree, this patch fixes the compilation error instead of
my patch. So, there is a conflict.

commit 9b90dc7bc3079376567fc501e2e84751fa4040fd
Author: Stephen Rothwell <sfr@canb.auug.org.au>
Date:   Wed Aug 27 14:45:37 2008 +1000

    rr: build fix for remove CONFIG_KMOD from net

    Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>

thanks,
Hiroshi Shimamoto
--

From: Stephen Rothwell
Date: Saturday, September 6, 2008 - 9:08 pm

Hi Hiroshi,

On Fri, 05 Sep 2008 12:54:51 -0700 Hiroshi Shimamoto <h-shimamoto@ct.jp.nec=

My patch is a temporary work around and will be dropped if the fix turns
up in any of the trees that I merge.

--=20
Cheers,
Stephen Rothwell                    sfr@canb.auug.org.au
http://www.canb.auug.org.au/~sfr/
From: Andrew Morton
Date: Monday, September 8, 2008 - 3:17 pm

On Fri, 05 Sep 2008 12:54:51 -0700

Give that there's already a fix in linux-next, I can't do anything here.

Rusty, the regression was introduced by

commit 4cb9da6ecc2b0e25056b45981239475f8509d59d
Author:     Johannes Berg <johannes@sipsolutions.net>
AuthorDate: Wed Jul 9 10:28:42 2008 +0200
Commit:     Stephen Rothwell <sfr@canb.auug.org.au>
CommitDate: Tue Aug 26 10:19:47 2008 +1000

    remove CONFIG_KMOD from net
    
    Some code here depends on CONFIG_KMOD to not try to load
    protocol modules or similar, replace by CONFIG_MODULES
    where more than just request_module depends on CONFIG_KMOD
    and and also use try_then_request_module in ebtables.
    
    Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
    Cc: netdev@vger.kernel.org
    Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>

Could you please take care of getting it fixed up?

Thanks.
--

From: Johannes Berg
Date: Monday, September 8, 2008 - 11:27 pm

Hi,


I think I like this patch better than Stephen's, but despite causing the

Rusty, can you take
http://www.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.27-rc5/2=
.6.27-rc5-mm1/broken-out/net-fix-compilation-ng-when-config_module.patch

(although I'd rather see the blank line stay) and fold it into that
patch or put it into the tree that Stephen pulls?

johannes
From: Dmitri Vorobiev
Date: Tuesday, September 9, 2008 - 4:07 am

Hi,

<<<<<<<<

[dmitri.vorobiev@amber linux-2.6.27-rc5]$ make ARCH=mips CROSS_COMPILE=mips-unknown-linux-gnu- malta_defconfig
#
# configuration written to .config
#
[dmitri.vorobiev@amber linux-2.6.27-rc5]$ make ARCH=mips CROSS_COMPILE=mips-unknown-linux-gnu-
scripts/kconfig/conf -s arch/mips/Kconfig
#
# configuration written to .config
#
  CHK     include/linux/version.h
  CHK     include/linux/utsrelease.h
  CALL    scripts/checksyscalls.sh
  CHK     include/linux/compile.h
  CC      arch/mips/kernel/mips-mt-fpaff.o
arch/mips/kernel/mips-mt-fpaff.c: In function 'mipsmt_sys_sched_setaffinity':
arch/mips/kernel/mips-mt-fpaff.c:82: error: 'struct task_struct' has no member named 'euid'
arch/mips/kernel/mips-mt-fpaff.c:82: error: 'struct task_struct' has no member named 'uid'
make[1]: *** [arch/mips/kernel/mips-mt-fpaff.o] Error 1
make: *** [arch/mips/kernel] Error 2
[dmitri.vorobiev@amber linux-2.6.27-rc5]$

<<<<<<<<

Thanks,
Dmitri


--

From: Dmitri Vorobiev
Date: Thursday, September 11, 2008 - 3:16 am

Ping!

It's not nice that one of the MIPS defconfigs doesn't build, is it?

Dmitri


--

From: Kevin D. Kissell
Date: Thursday, September 11, 2008 - 7:59 am

I don't know why the default Malta platform build assumes a MIPS MT core
doing some kind of virtual SMP - otherwise CONFIG_MIPS_MT_FPAFF
wouldn't be set.  I'd have thought that one would configure for a basic 
MIPS32
or MIPS32R2 single-threaded core like 4KC or 24K.  But even assuming the
quirky default, you're right, it ought to build.

          Regards,

          Kevin K.

--

From: Rik van Riel
Date: Monday, September 15, 2008 - 3:01 pm

On Thu, 4 Sep 2008 22:40:04 -0700

The bnx2 driver has stopped working on 2.6.27-rc5-mm1.

Plain 2.6.27-rc5 works.  Reversing the bnx2 changes in -mm1 does not
fix the issue, so something less obvious is going on.

# ifup eth0
Determining IP information for eth0...SIOCSIFFLAGS: Invalid argument
SIOCSIFFLAGS: Invalid argument
SIOCSIFFLAGS: Invalid argument
# ifconfig eth0 up
SIOCSIFFLAGS: Invalid argument

Bringing up the interface fails with -EINVAL.  Specifically, the
SIOCSIFFLAGS ioctl is returning -EINVAL:

ioctl(4, SIOCSIFFLAGS, 0x7fffc841cc40)  = -1 EINVAL (Invalid argument)

I am running an x86-64 kernel on a Dell pe1950 with these network chips
on the mainboard:

05:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12)
09:00.0 Ethernet controller: Broadcom Corporation NetXtreme II BCM5708 Gigabit Ethernet (rev 12)

-- 
All Rights Reversed
--

From: Michael Chan
Date: Monday, September 15, 2008 - 4:00 pm

Does dmesg show anything when you run ifup?


--

From: Rik van Riel
Date: Tuesday, September 16, 2008 - 11:09 am

On Mon, 15 Sep 2008 16:00:58 -0700
 
The linux-next tree fails in the same way.  Here is the dmesg output
from the broadcom driver:

Broadcom NetXtreme II Gigabit Ethernet Driver bnx2 v1.8.0 (Aug 14, 2008)
vendor=8086 device=2690
bnx2 0000:05:00.0: PCI INT A -> GSI 16 (level, low) -> IRQ 16

eth0: Broadcom NetXtreme II BCM5708 1000Base-T (B2) PCI-X 64-bit 133MHz found at
 mem f8000000, IRQ 16, node addr 00:19:b9:ee:6c:4a
vendor=8086 device=3510
vendor=8086 device=3500
vendor=8086 device=25e2
bnx2 0000:09:00.0: PCI INT A -> GSI 17 (level, low) -> IRQ 17
eth1: Broadcom NetXtreme II BCM5708 1000Base-T (B2) PCI-X 64-bit 133MHz found at mem f4000000, IRQ 17, node addr 00:19:b9:ee:6c:4c
vendor=8086 device=350c
vendor=8086 device=25e2

Here is the dmesg from around ifup time:

lo: Disabled Privacy Extensions
ip used greatest stack depth: 4296 bytes left
try to get more irq_cfg 32
irq_irq ==> [0x434f14800 - 0x434f14e00]
found new irq_cfg for irq 5243136
try to get more irq_desc 32
irq_desc ==> [0x42f426000 - 0x42f428000]
kstat_irqs ==> [0x43c1d4c00 - 0x43c1d5000]
found new irq_desc for irq 5243136

This one might be related, not sure:

pan0: Dropping NETIF_F_UFO since no NETIF_F_HW_CSUM feature.

-- 
All rights reversed.
--

From: Rik van Riel
Date: Tuesday, September 16, 2008 - 4:01 pm

On Tue, 16 Sep 2008 14:09:17 -0400

OK, with pci=nomsi the system boots up fine and the bnx2 driver
works.

Looks like the MSI code in linux-next is broken on the Dell PE 1950.

-- 
All rights reversed.
--

From: Benjamin Li
Date: Wednesday, September 17, 2008 - 12:23 pm

Sorry for the repost... attaching the patch to the proper thread.

Hi Rik van Riel,

Please try the enclosed patch to see if it will solve your problem.

I have tested on my Dell 2900, and the 5708 LOM is operational again on
my test machine.

Thanks again.

From: Benjamin Li <benli@broadcom.com>
Date: Tue, 16 Sep 2008 17:20:11 -0700
Subject: [PATCH] bnx2: Promote vector field in bnx2_irq structure from u16 to unsigned int

The bnx2 driver stores/uses the irq value from the pci_dev internally.
But when it stores the irq value, it has been performing an
integer demotion.  Because of the recent changes made to
arch/x86/kernel/io_apic.c, the new method in creating the irq value
(using build_irq_for_pci_dev()) has exposed this bug on x86 systems.

Because of this demotion when calling request_irq() from
bnx2_request_irq(), the driver would get a return code of -EINVAL.
This is because the kernel could not find the requested irq descriptor.
By storing the irq value properly, the kernel can find the correct
irq descriptor and the bnx2 driver can operate normally.

Signed-off-by: Benjamin Li <benli@broadcom.com>
Signed-off-by: Michael Chan <mchan@broadcom.com>

---
 drivers/net/bnx2.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index c3c579f..dfacd31 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -6597,7 +6597,7 @@ struct flash_spec {
 
 struct bnx2_irq {
 	irq_handler_t	handler;
-	u16		vector;
+	unsigned int	vector;
 	u8		requested;
 	char		name[16];
 };
-- 
1.5.5.1





--

Previous thread: RE: mmc/card/block.c : mmc_blk_open readonly mount bug? by sasin on Thursday, September 4, 2008 - 10:36 pm. (1 message)

Next thread: __initdata and struct dmi_system_id? by Németh Márton on Thursday, September 4, 2008 - 10:45 pm. (5 messages)