# The Great Unplug-it Test .. will you do it?

## Huey1

Hi Gentoo folk

This is about kernel 2.6 ability to recover keyboard operation after you inconsiderately unplug and then re-plug the keyboard while the system is up and running. It seems that systems running kernel 2.4 are OK, the code is robust enough to cope, no matter what keyboard, no matter what PC, no matter what distro.

Not so with kernel 2.6  It seems to depend on what keyboard is involved, its brand, its age, its type. Results are variable. Sometimes the keyboard auto-repeat goes mad. Sometimes it all works OK. Several I have tried just stop working.

I used two versions of Knoppix Live CD to check this, because it was a fast way to switch kernel, and because the result could not depend on any fumbles of my own. My Gentoo install only works with KVM switchers if I hang in there with kernel 2.4

It would help kernel developer Dmitri and myself if a few of you folk who know they are running 2.6, and don't mind a possible power-off forced reboot, would test this on your setup. We are interested in both command line function and GUI apps. Having a terminal (like Konsole or Xterm) open at the time is how I check. Just unplug, do a few mouse moves, open a browser or something, replug, try it out. Usually, the mouse can be used to do an orderly shutdown if the keyboard has quit.

Many thanks to any who will try this.

Huey1

----------

## Sgeorg

Why not ssh in to orderly shutdown?

for those of you who are afraid of a "power failure"  :Very Happy: 

maybe also do a shutdown with a timeout of 10 minutes!

 :Twisted Evil:  not what was asked, I know, but...... maybe I've encouraged a few more people 

to try it and not only the ones who aren't afraid of power failures!

georg

----------

## DaSmurf

I've done this several times without paying any attention to whether it would be hazardous or not. I run a small headless box next to my main rig that I occasionally need keyboard input on (I've since set up ssh) but back to the topic:

My system handles it without issue:

Kernel: 2.6.11-gentoo-r6-kraxel1 (v4l patches)

Keyboard: Logitech Elite USB

----------

## Randy R

I have an old box (actually its not in a box, just in pieces on the floor...) that has an old style keyboard plug in that I plug and unplug (router) now and then - never a problem. on my other systems, I have a kvm (not sure exactly how it works) but on occasion, when switching  I lose the key board input. If that happens, I just switcch a back and forth and it normally  works again. fwiw. Running 2.6.10

----------

## Keffin

Kernel: gentoo-sources-2.6.11-r1/2/6 (all of them at some point on 2 seperate machines).

Keyboard: Logitech internet navigator (USB).

I've been throwing my monitor/keyboard between machines all yesterday and had no problems.

----------

## Huey1

It seems I am (nearly) the only one in the world dogged by this intractable problem. The whole reason I ended up with a Gentoo is because I thought a compiled install might get around the catastrophic  keyboard freezeups that became increasingly common with Linux installs.  

I needed a distro that would keep going past a kernel change. It took me an unreasonable long time to figure that the kernel version was the common factor. You can't (realistically) do complete Gentoo installs as a diagnostic tryout!

Losing the keyboard means an install is hard to complete. The whole thing comes apart just after the kernel compile stage,  when we try to configure grub. On the one 2.6 install I did get all the way with,  its OK, provided it has the keyboard, monitor etc. all to itself.. always! Thats not an option here.

The whole issue with KVM switchers is a side effect. The switcher was not guilty because switching away to display another PC is "unplugging". This is not quite as crude as simply switching all the connections to the other PC, because switchers simulate the electrical presence of the keyboard while it is "away", since Windows computers before XP would not tolerate a keyboard unplug.

In spite of I changed the entire PC hardware for a ASUS A7N8X with AMD 2500 (Barton) processor, with no hard drive, only CDROM , and test the kernel change using two versions of Knoppix live CDs, it still flunks the unplug test with 2.6.

That you folk can freely unplug, use switchers etc is great for you, but I may not be able to join you.  Already I have pressure from others to install XP on the ASUS/AMD (over my Stage1!) because they say the PC is "wasted" on my first Linux installs that won't  share the hardware.  

If I find a keyboard/PC combination hardware that works like the kit you folk have, thats a (sort of) solution. Not ideal, but I am now at my limit in fighting this thing. Much of my previous postings have been on this subject, and thats sad!

Huey1

----------

## Huey1

Unplug .. replug .. keyboard is gone!

Hmm.. It seems it might be narrowed down to those who use (some) PS/2 connected keyboards.

Also, whether or not  Legacy/PS2 option is enabled in BIOS.

USB might be immune! Logitech seems to always work.

I have even been asked about XT style 180 degree 5-pin DIN connector keyboards, and what happens when a socket adaptor is used>

I hesitate to ask whether anyone out there runs such a box.

I would not want that Dmitry (kernel debug fella) be putting in work trying to fix a problem unique to me alone.

Thanks to all those who tried this out

Huey1

----------

## tabascojrc

I am having this problem with a USB keyboard not coming back after unplugging it and plugging back in.   ls usb shows the keyboard is connected its just not useable

----------

## dsd

the main problem is that PS/2 is not hotpluggable. you arent supposed to be able to unplug and replug the hardware, and some people claim you can destroy a motherboard by doing that.

that said, unplug/replug works for almost everybody, with very few exceptions. however, KVMs are a real problem, and always have been, even with linux 2.4. i don't know if its their abuse of the PS/2 "protocol", or the fact that every vendor does it differently, but this certainly isnt a new problem.

as for USB, you can safely unplug and replug the hardware at your leisure, and it *will* work. you should not have any problems there (tabascojrc, if it doesnt work for you, you should file a bug).

however, again, USB KVM's are a different species altogether, Linux doesn't support these brilliantly, and its never obvious even how to fix the linux usb stack for  a lot of them - the behaviour they exhibit is not usb-compliant

----------

## dattaway

Never experienced a problem with ps2 keyboards.  

I used to do this hundreds of times with EIDE drives until one fateful day when SCR latchup made that drive and channel go wonky.  For some reason the drive still worked, but not in that channel.

----------

## tabascojrc

PS2 "hotplugs" fine for me USB strangely enough is the only problem, both keyboard and mouse which leads me to believe it is some type of configuration problem.  I am still learning how everything interacts, but if I should be looking for a problem, where exactly should i be looking. Like I said after unplug replug lsusb lists both keyboard an mouse, but neither are useable. Any other thoughts before submitting a bug?

----------

## tabascojrc

PS2 "hotplugs" fine for me USB strangely enough is the only problem, both keyboard and mouse which leads me to believe it is some type of configuration problem.  I am still learning how everything interacts, but if I should be looking for a problem, where exactly should i be looking. Like I said after unplug replug lsusb lists both keyboard an mouse, but neither are useable. Any other thoughts before submitting a bug?

I did  state that they work fine if they are plugged in at boo, just stop working after i unplug them once.

----------

## Chris W

 *Quote:*   

> I have even been asked about XT style 180 degree 5-pin DIN connector keyboards, and what happens when a socket adaptor is used.
> 
> I hesitate to ask whether anyone out there runs such a box.

 

I'm running a headless mini-ITX box: console, no X.  The PS/2 keyboard hotplugs just fine for me although I don't often need this "feature".  The keyboard is a really old AT-style plug with adapter to PS/2.  The adapter is purely a pin reconfiguration so it should not have any bearing on the behaviour.

KVM switches that use electronics rather than a very crude rotary switch usually maintain the appearance of a connected keyboard even when it is routed elsewhere.  Using such a KVM  I've never had issues switching outside of X.  X did rarely lose the plot.

Given that USB is designed to hot plug you could consider avoiding the problem with something like this:

http://www.usbgear.com/USBG-1KPS2.html or http://www.usbgear.com/364966.html

(This is NOT an endorsement of the company)

----------

## zeek

Hot plugging PS2 is always hit and miss.  USB should always be 100%.

----------

## tabascojrc

Must have been something in my kernel configuration.  however i don't know what i changed to make it work.

Now USB hotplugging working like a charm.  I only wish i knew what i did  :Wink: 

----------

## bunder

i've done this with ps/2 and at, on several machines.  always worked in linux.

----------

