All of lore.kernel.org
 help / color / mirror / Atom feed
From: Petr Mladek <pmladek@suse.com>
To: lkp@lists.01.org
Subject: Re: [ppdev] e7223f1860: kernel BUG at drivers/base/driver.c:153!
Date: Thu, 24 Mar 2016 15:41:34 +0100	[thread overview]
Message-ID: <20160324144134.GH5522@pathway.suse.cz> (raw)
In-Reply-To: <20160215115001.GA22934@sudip-pc>

[-- Attachment #1: Type: text/plain, Size: 4573 bytes --]

On Mon 2016-02-15 17:20:01, Sudip Mukherjee wrote:
> On Mon, Feb 15, 2016 at 04:20:45PM +0800, kernel test robot wrote:
> > Greetings,
> > 
> > 0day kernel testing robot got the below dmesg and the first bad commit is
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing
> > 
> > commit e7223f18603374d235d8bb0398532323e5f318b9
> > Author:     Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> > AuthorDate: Fri Feb 12 18:33:45 2016 +0530
> > Commit:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > CommitDate: Sun Feb 14 17:43:50 2016 -0800
> > 
> >     ppdev: use new parport device model
> >     
> >     Modify ppdev driver to use the new parallel port device model.
> >     
> >     Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> >     Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Can you please send the .config file so that i can reproduce in my local
> system and test?
> 
> Ying Huang also sent a similar report after posting the patches. I tried
> his .config and your scripts to reproduce this but was not able to.
> 
> Anyway, this error is not related to this patch, this patch has just
> uncovered this error in parport. And will only happen if ppdev tries to
> register with parport before parport bus is registered.

The problem has been propagated to the Linus' tree for 4.6. I get

[    1.281235] kernel BUG at drivers/base/driver.c:153!
[    1.281924] invalid opcode: 0000 [#1] SMP 
[    1.282560] Modules linked in:
[    1.283095] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.5.0-4-default+ #2448
[    1.284015] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
[    1.284553] task: ffff88013a6a8000 ti: ffff88013a6ac000 task.ti: ffff88013a6ac000
[    1.284553] RIP: 0010:[<ffffffff81562a86>]  [<ffffffff81562a86>] driver_register+0xd6/0xe0
[    1.284553] RSP: 0000:ffff88013a6afdc0  EFLAGS: 00010246
[    1.284553] RAX: ffffffff81d1f68b RBX: ffffffff81f2af08 RCX: 0000000000000000
[    1.284553] RDX: ffffffff81d1f68b RSI: ffffffff81f2e5a0 RDI: ffffffff81f2af08
[    1.284553] RBP: ffff88013a6afdd0 R08: 0000000000000000 R09: 0000000000000000
[    1.284553] R10: 0000000000000001 R11: 00000000000013bd R12: ffffffff81f2aee0
[    1.284553] R13: 0000000000000000 R14: ffffffff8201f353 R15: ffff88013fc17558
[    1.284553] FS:  0000000000000000(0000) GS:ffff88013fc80000(0000) knlGS:0000000000000000
[    1.284553] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    1.284553] CR2: 0000000000000000 CR3: 0000000001e06000 CR4: 00000000000006e0
[    1.284553] Stack:
[    1.284553]  0000000000000000 ffffffff81f2aee0 ffff88013a6afdf8 ffffffff81554c6a
[    1.284553]  ffffffff81d1f68b 00000000b9226c80 ffff8800b91bfce0 ffff88013a6afe10
[    1.284553]  ffffffff8201f3d3 ffffffff81e0b050 ffff88013a6afe80 ffffffff810003b8
[    1.284553] Call Trace:
[    1.284553]  [<ffffffff81554c6a>] __parport_register_driver+0x5a/0x150
[    1.284553]  [<ffffffff8201f3d3>] ppdev_init+0x80/0xd1
[    1.284553]  [<ffffffff810003b8>] do_one_initcall+0x88/0x1c0
[    1.284553]  [<ffffffff8108f200>] ? parse_args+0x210/0x3b0
[    1.284553]  [<ffffffff81fd22e1>] kernel_init_freeable+0x1f9/0x289
[    1.284553]  [<ffffffff81fd19b2>] ? set_debug_rodata+0x12/0x12
[    1.284553]  [<ffffffff8190fc4e>] kernel_init+0xe/0x110
[    1.284553]  [<ffffffff8191dc32>] ret_from_fork+0x22/0x50
[    1.284553]  [<ffffffff8190fc40>] ? rest_init+0x130/0x130
[    1.284553] Code: c7 20 f0 cd 81 31 c0 e8 a8 68 c2 ff 48 8b 73 08 eb 8e 48 8b 33 48 c7 c7 60 f0 cd 81 31 c0 41 bc f0 ff ff ff e8 8b 68 c2 ff eb 91 <0f> 0b 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 85 ff 48 89 
[    1.284553] RIP  [<ffffffff81562a86>] driver_register+0xd6/0xe0
[    1.284553]  RSP <ffff88013a6afdc0>


> Can you please check if the below patch solves the problem:
>
> 
> diff --git a/drivers/parport/share.c b/drivers/parport/share.c
> index 3308427..176b2b6 100644
> --- a/drivers/parport/share.c
> +++ b/drivers/parport/share.c
> @@ -273,6 +273,9 @@ int __parport_register_driver(struct parport_driver *drv, struct module *owner,
>  		/* using device model */
>  		int ret;
>  
> +		if (!parport_bus_type.p)
> +			return -EAGAIN;
> +
>  		/* initialize common driver fields */
>  		drv->driver.name = drv->name;
>  		drv->driver.bus = &parport_bus_type;
> 
> 
This patch helps. Feel free to use:

Tested-by: Petr Mladek <pmladek@suse.com>

Could we please get the fix into the mainline?

Best Regards,
Petr

WARNING: multiple messages have this Message-ID (diff)
From: Petr Mladek <pmladek@suse.com>
To: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
Cc: kernel test robot <fengguang.wu@intel.com>, LKP <lkp@01.org>,
	linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	wfg@linux.intel.com,
	Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: [ppdev] e7223f1860:  kernel BUG at drivers/base/driver.c:153!
Date: Thu, 24 Mar 2016 15:41:34 +0100	[thread overview]
Message-ID: <20160324144134.GH5522@pathway.suse.cz> (raw)
In-Reply-To: <20160215115001.GA22934@sudip-pc>

On Mon 2016-02-15 17:20:01, Sudip Mukherjee wrote:
> On Mon, Feb 15, 2016 at 04:20:45PM +0800, kernel test robot wrote:
> > Greetings,
> > 
> > 0day kernel testing robot got the below dmesg and the first bad commit is
> > 
> > https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing
> > 
> > commit e7223f18603374d235d8bb0398532323e5f318b9
> > Author:     Sudip Mukherjee <sudipm.mukherjee@gmail.com>
> > AuthorDate: Fri Feb 12 18:33:45 2016 +0530
> > Commit:     Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> > CommitDate: Sun Feb 14 17:43:50 2016 -0800
> > 
> >     ppdev: use new parport device model
> >     
> >     Modify ppdev driver to use the new parallel port device model.
> >     
> >     Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
> >     Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> 
> Can you please send the .config file so that i can reproduce in my local
> system and test?
> 
> Ying Huang also sent a similar report after posting the patches. I tried
> his .config and your scripts to reproduce this but was not able to.
> 
> Anyway, this error is not related to this patch, this patch has just
> uncovered this error in parport. And will only happen if ppdev tries to
> register with parport before parport bus is registered.

The problem has been propagated to the Linus' tree for 4.6. I get

[    1.281235] kernel BUG at drivers/base/driver.c:153!
[    1.281924] invalid opcode: 0000 [#1] SMP 
[    1.282560] Modules linked in:
[    1.283095] CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.5.0-4-default+ #2448
[    1.284015] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011
[    1.284553] task: ffff88013a6a8000 ti: ffff88013a6ac000 task.ti: ffff88013a6ac000
[    1.284553] RIP: 0010:[<ffffffff81562a86>]  [<ffffffff81562a86>] driver_register+0xd6/0xe0
[    1.284553] RSP: 0000:ffff88013a6afdc0  EFLAGS: 00010246
[    1.284553] RAX: ffffffff81d1f68b RBX: ffffffff81f2af08 RCX: 0000000000000000
[    1.284553] RDX: ffffffff81d1f68b RSI: ffffffff81f2e5a0 RDI: ffffffff81f2af08
[    1.284553] RBP: ffff88013a6afdd0 R08: 0000000000000000 R09: 0000000000000000
[    1.284553] R10: 0000000000000001 R11: 00000000000013bd R12: ffffffff81f2aee0
[    1.284553] R13: 0000000000000000 R14: ffffffff8201f353 R15: ffff88013fc17558
[    1.284553] FS:  0000000000000000(0000) GS:ffff88013fc80000(0000) knlGS:0000000000000000
[    1.284553] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[    1.284553] CR2: 0000000000000000 CR3: 0000000001e06000 CR4: 00000000000006e0
[    1.284553] Stack:
[    1.284553]  0000000000000000 ffffffff81f2aee0 ffff88013a6afdf8 ffffffff81554c6a
[    1.284553]  ffffffff81d1f68b 00000000b9226c80 ffff8800b91bfce0 ffff88013a6afe10
[    1.284553]  ffffffff8201f3d3 ffffffff81e0b050 ffff88013a6afe80 ffffffff810003b8
[    1.284553] Call Trace:
[    1.284553]  [<ffffffff81554c6a>] __parport_register_driver+0x5a/0x150
[    1.284553]  [<ffffffff8201f3d3>] ppdev_init+0x80/0xd1
[    1.284553]  [<ffffffff810003b8>] do_one_initcall+0x88/0x1c0
[    1.284553]  [<ffffffff8108f200>] ? parse_args+0x210/0x3b0
[    1.284553]  [<ffffffff81fd22e1>] kernel_init_freeable+0x1f9/0x289
[    1.284553]  [<ffffffff81fd19b2>] ? set_debug_rodata+0x12/0x12
[    1.284553]  [<ffffffff8190fc4e>] kernel_init+0xe/0x110
[    1.284553]  [<ffffffff8191dc32>] ret_from_fork+0x22/0x50
[    1.284553]  [<ffffffff8190fc40>] ? rest_init+0x130/0x130
[    1.284553] Code: c7 20 f0 cd 81 31 c0 e8 a8 68 c2 ff 48 8b 73 08 eb 8e 48 8b 33 48 c7 c7 60 f0 cd 81 31 c0 41 bc f0 ff ff ff e8 8b 68 c2 ff eb 91 <0f> 0b 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 55 48 85 ff 48 89 
[    1.284553] RIP  [<ffffffff81562a86>] driver_register+0xd6/0xe0
[    1.284553]  RSP <ffff88013a6afdc0>


> Can you please check if the below patch solves the problem:
>
> 
> diff --git a/drivers/parport/share.c b/drivers/parport/share.c
> index 3308427..176b2b6 100644
> --- a/drivers/parport/share.c
> +++ b/drivers/parport/share.c
> @@ -273,6 +273,9 @@ int __parport_register_driver(struct parport_driver *drv, struct module *owner,
>  		/* using device model */
>  		int ret;
>  
> +		if (!parport_bus_type.p)
> +			return -EAGAIN;
> +
>  		/* initialize common driver fields */
>  		drv->driver.name = drv->name;
>  		drv->driver.bus = &parport_bus_type;
> 
> 
This patch helps. Feel free to use:

Tested-by: Petr Mladek <pmladek@suse.com>

Could we please get the fix into the mainline?

Best Regards,
Petr

  parent reply	other threads:[~2016-03-24 14:41 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-15  8:20 [ppdev] e7223f1860: kernel BUG at drivers/base/driver.c:153! kernel test robot
2016-02-15  8:20 ` kernel test robot
2016-02-15 11:50 ` Sudip Mukherjee
2016-02-15 11:50   ` Sudip Mukherjee
2016-03-02 21:24   ` Ross Zwisler
2016-03-03  5:51     ` Sudip Mukherjee
2016-03-03  5:51       ` Sudip Mukherjee
2016-03-03 15:36       ` Ross Zwisler
2016-03-03 15:36         ` Ross Zwisler
2016-03-24 14:41   ` Petr Mladek [this message]
2016-03-24 14:41     ` Petr Mladek
2016-03-25 16:12     ` Linus Torvalds
2016-03-25 16:12       ` Linus Torvalds

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160324144134.GH5522@pathway.suse.cz \
    --to=pmladek@suse.com \
    --cc=lkp@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.