mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Alexander Gordeev <lasaine@lvk.cs.msu.su>
To: Ingo Molnar <mingo@elte.hu>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: PPS parport boot lockup: INFO: HARDIRQ-READ-safe -> HARDIRQ-READ-unsafe lock order detected
Date: Fri, 21 Jan 2011 17:44:38 +0300	[thread overview]
Message-ID: <20110121174438.7521539f@tornado.gnet> (raw)
In-Reply-To: <20110119083916.GA2166@elte.hu>

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

В Wed, 19 Jan 2011 09:39:16 +0100
Ingo Molnar <mingo@elte.hu> пишет:

> 
> .38-rc1 allyes64 bootup locks up soft, but first produces this lockdep splat:
> 
> [   73.524088] pps_ldisc: PPS line discipline registered
> [   73.529156] initcall pps_tty_init+0x0/0xa4 returned 0 after 4950 usecs
> [   73.535691] calling  pps_parport_init+0x0/0x60 @ 1
> [   73.540491] pps_parport: parallel port PPS client
> [   73.545219] 
> [   73.545220] ======================================================
> [   73.549198] [ INFO: HARDIRQ-READ-safe -> HARDIRQ-READ-unsafe lock order detected ]
> [   73.549198] 2.6.38-rc1-tip-01889-g7ca14ab-dirty #86514
> [   73.549198] ------------------------------------------------------
> [   73.549198] swapper/1 [HC0[0]:SC0[0]:HE0:SE1] is trying to acquire:
> [   73.549198]  (&(&tmp->waitlist_lock)->rlock){+.+...}, at: [<ffffffff818f7ef4>] parport_claim+0x1c3/0x22f
> [   73.549198] 
> [   73.549198] and this task is already holding:
> [   73.549198]  (&tmp->cad_lock){.-....}, at: [<ffffffff818f7d86>] parport_claim+0x55/0x22f
> [   73.549198] which would create a new lock dependency:
> [   73.549198]  (&tmp->cad_lock){.-....} -> (&(&tmp->waitlist_lock)->rlock){+.+...}
> [   73.549198] 
> [   73.549198] but this new dependency connects a HARDIRQ-READ-irq-safe lock:
> [   73.549198]  (&tmp->cad_lock){.-....}
> [   73.549198] ... which became HARDIRQ-READ-irq-safe at:
> [   73.549198]   [<ffffffff810cef78>] __lock_acquire+0x2b9/0xdcf
> [   73.549198]   [<ffffffff810cffb3>] lock_acquire+0xcf/0xf9
> [   73.549198]   [<ffffffff82dc602a>] _raw_read_lock+0x39/0x6e
> [   73.549198]   [<ffffffff818f7d07>] parport_irq_handler+0x26/0x50
> [   73.549198]   [<ffffffff81104158>] handle_IRQ_event+0x61/0x13d
> [   73.549198]   [<ffffffff81106426>] handle_edge_irq+0xe3/0x12f
> [   73.549198]   [<ffffffff810423b9>] handle_irq+0x88/0x90
> [   73.549198]   [<ffffffff82dccbdd>] do_IRQ+0x4d/0xa5
> [   73.549198]   [<ffffffff82dc6493>] ret_from_intr+0x0/0x1a
> [   73.549198]   [<ffffffff81b43553>] ppa_d_pulse+0x2d/0x52
> [   73.549198]   [<ffffffff81b43c04>] ppa_disconnect.clone.1+0x1a/0x43
> [   73.549198]   [<ffffffff81b44115>] __ppa_attach+0x238/0x64d
> [   73.549198]   [<ffffffff81b44538>] ppa_attach+0xe/0x10
> [   73.549198]   [<ffffffff818f8474>] parport_register_driver+0x3e/0x86
> [   73.549198]   [<ffffffff849e7a80>] ppa_driver_init+0x25/0x27
> [   73.549198]   [<ffffffff810021ef>] do_one_initcall+0x57/0x13c
> [   73.549198]   [<ffffffff84989e5e>] kernel_init+0x199/0x222
> [   73.549198]   [<ffffffff81040b44>] kernel_thread_helper+0x4/0x10
> [   73.549198] 
> [   73.549198] to a HARDIRQ-READ-irq-unsafe lock:
> [   73.549198]  (&(&tmp->waitlist_lock)->rlock){+.+...}
> [   73.549198] ... which became HARDIRQ-READ-irq-unsafe at:
> [   73.549198] ...  [<ffffffff810cf02a>] __lock_acquire+0x36b/0xdcf
> [   73.549198]   [<ffffffff810cffb3>] lock_acquire+0xcf/0xf9
> [   73.549198]   [<ffffffff82dc57c3>] _raw_spin_lock+0x36/0x69
> [   73.549198]   [<ffffffff818f8916>] parport_unregister_device+0xc7/0x154
> [   73.549198]   [<ffffffff818fb7a3>] parport_close+0xe/0x10
> [   73.549198]   [<ffffffff818fc34f>] parport_device_id+0x713/0x728
> [   73.549198]   [<ffffffff818fbb6a>] parport_daisy_init+0x3b0/0x42b
> [   73.549198]   [<ffffffff818f8358>] parport_announce_port+0x16/0xf4
> [   73.549198]   [<ffffffff818fdb77>] parport_pc_probe_port+0xb27/0xbaf
> [   73.549198]   [<ffffffff818fdf90>] parport_pc_pnp_probe+0x17f/0x1a7
> [   73.549198]   [<ffffffff817927f2>] pnp_device_probe+0x81/0xab
> [   73.549198]   [<ffffffff819037bf>] driver_probe_device+0x11d/0x1e5
> [   73.549198]   [<ffffffff819038d6>] __driver_attach+0x4f/0x70
> [   73.549198]   [<ffffffff8190282e>] bus_for_each_dev+0x5c/0x88
> [   73.549198]   [<ffffffff819033e4>] driver_attach+0x1e/0x20
> [   73.549198]   [<ffffffff81902fdd>] bus_add_driver+0xc7/0x21e
> [   73.549198]   [<ffffffff81903b39>] driver_register+0x9b/0x108
> [   73.549198]   [<ffffffff8179256b>] pnp_register_driver+0x21/0x23
> [   73.549198]   [<ffffffff849dcf49>] parport_pc_init+0x282/0x311
> [   73.549198]   [<ffffffff810021ef>] do_one_initcall+0x57/0x13c
> [   73.549198]   [<ffffffff84989e5e>] kernel_init+0x199/0x222
> [   73.549198]   [<ffffffff81040b44>] kernel_thread_helper+0x4/0x10
> [   73.549198] 
> [   73.549198] other info that might help us debug this:
> [   73.549198] 
> [   73.549198] 2 locks held by swapper/1:
> [   73.549198]  #0:  (registration_lock){+.+.+.}, at: [<ffffffff818f8465>] parport_register_driver+0x2f/0x86
> [   73.549198]  #1:  (&tmp->cad_lock){.-....}, at: [<ffffffff818f7d86>] parport_claim+0x55/0x22f
[snip]
> 
> That's probably one of these commits:
> 
>  563558b2c735: pps: add parallel port PPS signal generator
>  46b402a0e5e4: pps: add parallel port PPS signal generator
>  a10203c691ea: pps: add parallel port PPS client
> 
> Plus CONFIG_PPS_CLIENT_PARPORT=y.
> 
> This feature seems rather untested - this is a plain whitebox PC with a parallel 
> port.

Well, I only see that there could be a problem with parport's
waitlist_lock because it is used:
 * in parport_claim which can be called from an irq handler
 * in parport_unregister_device without disabling interrupts

But parport_unregister_device should probably never be called while
parport interrupts are enabled (in hardware). So this is a false
positive. Is this right?

But I also see here that there is probably a contention for the port
between ppa and pps_parport. So maybe I shouldn't use
parport_claim_or_block because it blocks forever and therefore can
lock up the thread that loads the module. It's strange however that
this function is used in lots of other modules without trouble.

Can you please check if the lockup is caused by parport_claim_or_block
in pps_parport/pps_gen_parport? I built 2.6.38-rc1 kernel with
allyesconfig but it locks up long before pps_parport gets loaded.

-- 
  Alexander

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 490 bytes --]

  parent reply	other threads:[~2011-01-21 14:44 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-18 23:54 Linux 2.6.38-rc1 Linus Torvalds
2011-01-19  2:07 ` Linus Torvalds
2011-01-19  3:42   ` Justin Mattock
2011-01-19  3:53     ` Linus Torvalds
2011-01-19  4:05       ` Justin Mattock
2011-01-19  5:10       ` nobody
2011-01-19  5:42         ` Linus Torvalds
2011-01-19  5:56           ` Linus Torvalds
2011-01-19 18:07             ` Steven Rostedt
2011-01-19 18:26               ` Linus Torvalds
2011-01-21  3:23           ` tag&track [Re: Linux 2.6.38-rc1] nobody
2011-01-21  8:24             ` Alexey Dobriyan
2011-01-23  8:13   ` Linux 2.6.38-rc1 Török Edwin
2011-01-19  7:39 ` Linux 2.6.38-rc1 doesn't boot Markus Trippelsdorf
2011-01-19  7:46   ` Shaohua Li
2011-01-19  7:55     ` Markus Trippelsdorf
2011-01-19  7:49   ` Markus Trippelsdorf
2011-01-19  8:12     ` Shaohua Li
2011-01-19  8:56       ` H. Peter Anvin
2011-01-19  9:09         ` Ingo Molnar
2011-01-20  2:08           ` Shaohua Li
2011-01-20  3:32             ` Lu, Hongjiu
2011-01-20 11:25             ` Ingo Molnar
2011-01-20 15:08               ` Anvin, H Peter
2011-01-21  7:18                 ` Shaohua Li
2011-01-21  7:55                   ` Shaohua Li
2011-01-21 15:28                   ` H. Peter Anvin
2011-01-21 15:37                     ` Lu, Hongjiu
2011-01-21 21:09                       ` Ingo Molnar
2011-01-19  9:33         ` [tip:x86/urgent] Revert "x86: Make relocatable kernel work with new binutils" tip-bot for Ingo Molnar
2011-01-20  4:59     ` Linux 2.6.38-rc1 doesn't boot Alexandre Courbot
2011-01-19  8:39 ` PPS parport boot lockup: INFO: HARDIRQ-READ-safe -> HARDIRQ-READ-unsafe lock order detected Ingo Molnar
2011-01-20 13:04   ` Alexander Gordeev
2011-01-21 14:44   ` Alexander Gordeev [this message]
2011-01-21 16:37     ` Linus Torvalds
2011-01-21 19:43       ` Ingo Molnar
2011-01-24 23:28         ` Alexander Gordeev
2011-01-24 23:46         ` [PATCH] pps: claim parallel port exclusively Alexander Gordeev
2011-01-25  0:19           ` Ingo Molnar
2011-01-24 15:00       ` PPS parport boot lockup: INFO: HARDIRQ-READ-safe -> HARDIRQ-READ-unsafe lock order detected Alexander Gordeev
2011-01-24 15:12   ` [PATCH] parport: make lockdep happy with waitlist_lock Alexander Gordeev
2011-01-24 15:28     ` Ingo Molnar
2011-01-24 15:33       ` Alexander Gordeev
2011-01-19 12:02 ` percpu related boot crash on x86 (was: Linux 2.6.38-rc1) Ingo Molnar
2011-01-19 12:44   ` Tejun Heo
2011-01-19 12:48   ` Peter Zijlstra
2011-01-19 12:56     ` Pekka Enberg
2011-01-19 13:12       ` Peter Zijlstra
2011-01-19 13:13       ` Tejun Heo
2011-01-19 20:53         ` Ingo Molnar
2011-01-19 23:11           ` Ingo Molnar
2011-01-20  8:31             ` percpu related boot crash on x86 Pekka Enberg
2011-01-20 10:47               ` Peter Zijlstra
2011-01-20 11:12                 ` Eric Dumazet
2011-01-20 11:19                   ` Tejun Heo
2011-01-20 11:06   ` [PATCH 1/2] lockdep: move early boot local IRQ enable/disable status to init/main.c Tejun Heo
2011-01-20 11:07     ` [PATCH 2/2] smp: allow on_each_cpu() to be called while early_boot_irqs_disabled " Tejun Heo
2011-01-20 20:22       ` [tip:core/urgent] smp: Allow " tip-bot for Tejun Heo
2011-01-20 11:11     ` [PATCH 1/2] lockdep: move early boot local IRQ enable/disable " Tejun Heo
2011-01-20 11:23       ` Peter Zijlstra
2011-01-20 11:26         ` Tejun Heo
2011-01-20 11:30           ` Pekka Enberg
2011-01-20 11:38           ` Peter Zijlstra
2011-01-20 12:00       ` Ingo Molnar
2011-01-20 12:20         ` [PATCH UPDATED " Tejun Heo
2011-01-20 11:51     ` [PATCH " Ingo Molnar
2011-01-20 20:21     ` [tip:core/urgent] lockdep: Move " tip-bot for Tejun Heo
2011-01-19 21:40 ` Linux 2.6.38-rc1 Alan Cox
2011-01-21 15:30   ` Aaro Koskinen

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=20110121174438.7521539f@tornado.gnet \
    --to=lasaine@lvk.cs.msu.su \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome