linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alex Riesen <raa.lkml@gmail.com>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Oliver Neukum <oliver@neukum.org>, Jens Axboe <axboe@kernel.dk>,
	linux-usb@vger.kernel.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: USB device cannot be reconnected and khubd "blocked for more than 120 seconds"
Date: Mon, 14 Jan 2013 17:43:12 +0100	[thread overview]
Message-ID: <CALxABCZbrFLbnm7ZW3iTSmcfwMsSQx+fY7srEZpU1-=Ostcc0g@mail.gmail.com> (raw)
In-Reply-To: <Pine.LNX.4.44L0.1301132125530.25830-100000@netrider.rowland.org>

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

On Mon, Jan 14, 2013 at 3:39 AM, Alan Stern <stern@rowland.harvard.edu> wrote:
> On Sun, 13 Jan 2013, Oliver Neukum wrote:
>> This is not a USB problem. You need to involve the SCSI people.
>> khubd just stops working because disconnects are processed
>> in its context and the removal deadlocks.
>
> The why whould building the deadline elevator as a module make any
> difference?  Or does it make a difference?

Building elevator as module does make a difference: the system is broken.

> Alex, if the elevator is made static instead, do you still see the same
> behavior when the USB drive is removed?

How can I make the elevator static? Or did you mean "built-in"?
Or did you mean to ask if khubd hangs if the deadline is built in?
In that case - no. The behavior is normal. Nothing hangs.

> Also, are there any mounted filesystems on the drive when you unplug
> it?

No, no auto-mount. The whole of userspace init is attached, and I'm reasonably
sure nothing of it mounts anything automatically. Nothing of udev, too.

[-- Attachment #2: linuxrc-t --]
[-- Type: application/octet-stream, Size: 2520 bytes --]

#!/bin/bash -v
# SETUP
mount -nt proc  proc /proc
mount -nt sysfs sysfs /sys
(while read d m r; do [ "$d" = devtmpfs -a "$m" = /dev ] && exit 0
 done < /proc/mounts) || {
	mount -t tmpfs devfs /tmp &&
	cp -a /dev/* /tmp &&
	mount --move /tmp /dev
}
test -d /dev/pts || mkdir /dev/pts
mount -nt devpts devpts /dev/pts &
(
	ifconfig lo up
	test -f /etc/hostname && hostname --file /etc/hostname
)&

(
	cg=; while read g r; do
		[ "${g:0:1}" = '#' ] || cg="$cg,$g"
	done < /proc/cgroups
	mkdir /dev/cgroups &&
	mount -nt cgroup -o "${cg:1}" cgroup /dev/cgroups
)&

(
	mount -nt tmpfs run /run &&
	mkdir /run/lock /run/network
) &
mount -nt tmpfs tmp /tmp &
(
	mkdir /dev/shm &&
	mount -nt tmpfs shm /dev/shm -o nodev,nosuid,relatime
)&
mount -nt debugfs debugfs /sys/kernel/debug &

wait
read t < /proc/uptime && echo $t

HOME=/tmp # do not export HOME for udev
HOME=$HOME openvt -c 2 -w -- /bin/bash &
/sbin/udevd --daemon
/sbin/udevadm trigger
/sbin/udevadm settle
set +v # END OF MAIN SETUP
read t < /proc/uptime && echo -e "\e[1mUptime till now: $t\e[0m"

export HOME

test -e /proc/swaps && {
	echo Activating swap...
	swapon -a &
}

test -x /sbin/readahead-list && {
	echo Preloading programs...
	(
	for f in /usr/bin/vim /usr/bin/top ; do
		ldd -v "$f" |grep "^[	]/.*:$"|cut -c2-|cut -d: -f1
	done 2>/dev/null | grep -v "^/lib/" > /tmp/readahead
	test -e /tmp/readahead && {
		/sbin/readahead-list /tmp/readahead
		rm -f /tmp/readahead
	}
	) &
}

echo 9 >/proc/sysrq-trigger
echo -e '\e[32;1m'$(uname -a)'\e[0m'

export HOME
(shopt -s nullglob
grep -q notests /proc/cmdline ||
for LINUXRC_TEST in /boot/tests/*; do
	if test -x "$LINUXRC_TEST"
	then
		export LINUXRC_TEST
		echo TESTING "$LINUXRC_TEST"
		(. "$LINUXRC_TEST")
	fi
done) &

# reboot through three presses of power btn
(for e in /sys/class/input/event*/device/name
do
	if [ "$(< $e)" = 'Power Button' ]; then
		dev=${e%/device/name}
		exec /usr/local/bin/input-event -d /dev${dev:10} \
			-b power -t5 -r3 -- /sbin/reboot -f
	fi
done) &

# user shell
while :; do /sbin/getty 38400 tty3; done &
while :; do /sbin/getty 38400 tty4; done &
# X environment
grep -q nostartx /proc/cmdline ||
( mount -r /var
  test -d /var/lib/sudo && mount -t tmpfs -o size=$((1*1024*1024)) sudo /var/lib/sudo
  test -x /var/my-startx &&
  mount -r /home &&
  mount -t tmpfs -o size=$((1*1024*1024)) xkb /var/lib/xkb &&
  mount -t tmpfs -o size=$((15*1024*1024)) varlog /var/log &&
  /var/my-startx )&

NICE=
type -p nice >/dev/null && NICE="nice -n -3"
exec $NICE /bin/bash

  reply	other threads:[~2013-01-14 16:43 UTC|newest]

Thread overview: 93+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-01-11 21:04 USB device cannot be reconnected and khubd "blocked for more than 120 seconds" Alex Riesen
2013-01-12  7:48 ` Alex Riesen
2013-01-12  9:18   ` Lan Tianyu
2013-01-12 17:37   ` Alan Stern
2013-01-12 19:39     ` Alex Riesen
2013-01-12 20:33       ` Alex Riesen
2013-01-12 22:52         ` Alan Stern
2013-01-13 12:09           ` Alex Riesen
2013-01-13 16:56             ` Alan Stern
2013-01-13 17:42               ` Alex Riesen
2013-01-13 19:16                 ` Oliver Neukum
2013-01-14  2:39                   ` Alan Stern
2013-01-14 16:43                     ` Alex Riesen [this message]
2013-01-14  3:47                 ` Ming Lei
2013-01-14  7:15                   ` Ming Lei
2013-01-14 17:30                     ` Linus Torvalds
2013-01-14 18:04                       ` Alan Stern
2013-01-14 18:34                         ` Linus Torvalds
2013-01-15  1:53                       ` Ming Lei
2013-01-15  6:23                         ` Ming Lei
2013-01-15 17:36                           ` Linus Torvalds
2013-01-15 18:18                             ` Linus Torvalds
2013-01-15 23:17                               ` Tejun Heo
2013-01-15 18:20                             ` Alan Stern
2013-01-15 18:39                               ` Tejun Heo
2013-01-15 18:32                             ` Tejun Heo
2013-01-15 20:18                               ` Linus Torvalds
2013-01-15 23:50                                 ` Tejun Heo
2013-01-16  0:25                                   ` Arjan van de Ven
2013-01-16  0:35                                     ` Tejun Heo
2013-01-16  4:01                                       ` Alan Stern
2013-01-16 16:12                                         ` Tejun Heo
2013-01-16 17:01                                           ` Alan Stern
2013-01-16 17:37                                             ` Tejun Heo
2013-01-16 17:51                                               ` Alan Stern
2013-01-16  0:36                                   ` Linus Torvalds
2013-01-16  0:40                                     ` Linus Torvalds
2013-01-16  2:52                                       ` [PATCH] module, async: async_synchronize_full() on module init iff async is used Tejun Heo
2013-01-16  3:00                                         ` Linus Torvalds
2013-01-16  3:25                                           ` Tejun Heo
2013-01-16  3:37                                             ` Linus Torvalds
2013-01-16 16:22                                               ` Arjan van de Ven
2013-01-16 16:48                                               ` Tejun Heo
2013-01-16 17:03                                                 ` Arjan van de Ven
2013-01-16 17:06                                                   ` Linus Torvalds
2013-01-16 21:30                                                     ` [PATCH 1/2] init, block: try to load default elevator module early during boot Tejun Heo
2013-01-17 18:05                                                       ` Linus Torvalds
2013-01-17 18:38                                                         ` Tejun Heo
2013-01-17 18:46                                                           ` Linus Torvalds
2013-01-17 18:59                                                             ` Tejun Heo
2013-01-17 19:00                                                               ` Linus Torvalds
2013-01-18  1:24                                                         ` [PATCH 1/3] workqueue: set PF_WQ_WORKER on rescuers Tejun Heo
2013-01-18  1:25                                                         ` [PATCH 2/3] workqueue, async: implement work/async_current_func() Tejun Heo
2013-01-18  2:47                                                           ` Linus Torvalds
2013-01-18  2:59                                                             ` Tejun Heo
2013-01-18  3:04                                                               ` Tejun Heo
2013-01-18  3:18                                                                 ` Linus Torvalds
2013-01-18  3:47                                                                   ` Tejun Heo
2013-01-18 22:08                                                                   ` [PATCH 1/5] workqueue: set PF_WQ_WORKER on rescuers Tejun Heo
2013-01-18 22:10                                                                   ` [PATCH 2/5] workqueue: rename kernel/workqueue_sched.h to kernel/workqueue_internal.h Tejun Heo
2013-01-18 22:11                                                                   ` [PATCH 3/5] workqueue: move struct worker definition to workqueue_internal.h Tejun Heo
2013-01-18 22:11                                                                   ` [PATCH 4/5] workqueue: implement current_is_async() Tejun Heo
2013-01-18 22:12                                                                   ` [PATCH 5/5] async, kmod: warn on synchronous request_module() from async workers Tejun Heo
2022-06-23  5:25                                                                     ` Saravana Kannan
2013-01-18  1:27                                                         ` [PATCH 3/3] " Tejun Heo
2013-01-23  0:53                                                       ` [PATCH v2 1/2] init, block: try to load default elevator module early during boot Tejun Heo
2013-01-16 21:31                                                     ` [PATCH 2/2] block: don't request module during elevator init Tejun Heo
2013-01-23  0:51                                                       ` [PATCH v2 " Tejun Heo
2013-01-16  3:30                                         ` [PATCH] module, async: async_synchronize_full() on module init iff async is used Ming Lei
2013-01-16  4:24                                         ` Rusty Russell
2013-01-16 11:36                                         ` Alex Riesen
2013-08-12  7:04                                         ` [3.8-rc3 -> 3.8-rc4 regression] " Jonathan Nieder
2013-08-12 15:09                                           ` Tejun Heo
2013-11-26 21:29                                             ` Josh Hunt
2013-11-26 21:53                                               ` Linus Torvalds
2013-11-26 22:12                                                 ` Josh Hunt
2013-11-26 22:29                                                   ` Tejun Heo
2013-12-03 14:28                                                     ` Josh Hunt
2013-12-03 15:19                                                       ` Tejun Heo
2013-12-04 23:01                                                         ` Josh Hunt
2013-12-04 23:12                                                           ` Tejun Heo
2013-11-26 22:30                                                   ` Linus Torvalds
2013-01-16  0:44                                     ` USB device cannot be reconnected and khubd "blocked for more than 120 seconds" Tejun Heo
2013-01-16 17:19                               ` [PATCH] async: fix __lowest_in_progress() Tejun Heo
2013-01-17 18:16                                 ` Linus Torvalds
2013-01-17 18:50                                   ` Tejun Heo
2013-01-23  0:15                                 ` [PATCH v2] " Tejun Heo
2013-01-23  0:22                                   ` Linus Torvalds
2013-01-16  3:05                             ` USB device cannot be reconnected and khubd "blocked for more than 120 seconds" Ming Lei
2013-01-16  4:14                               ` Linus Torvalds
2013-01-14  8:22                   ` Oliver Neukum
2013-01-14  8:40                     ` Ming Lei
2013-01-12 19:56     ` Alex Riesen

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='CALxABCZbrFLbnm7ZW3iTSmcfwMsSQx+fY7srEZpU1-=Ostcc0g@mail.gmail.com' \
    --to=raa.lkml@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oliver@neukum.org \
    --cc=stern@rowland.harvard.edu \
    /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;
as well as URLs for NNTP newsgroup(s).