LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 04-24-2019, 12:21 PM   #1
Dênio
LQ Newbie
 
Registered: Apr 2019
Posts: 10

Rep: Reputation: Disabled
Unhappy USB device being ejected by the kernel when plugged in


Dear

I have a question on the Slackware distribution from version 14.2, because every time I plug in a Gertec PPC920 USB PINPAD the Kernel ejects the device as if it is no longer plugged in.
I did tests on Linux Slackware 14.1 and also other distributions like Linux Mint 19 and work without problems, already with Slackware 14.2 and also with the current version of Slackware the problem occurs.

Monitoring the UDEV we can see:

root@darkstar:/u# udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[3626.013100] add /devices/pci0000:00/0000:00:1d.1/usb3/3-1 (usb)
KERNEL[3626.015922] add /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0 (usb)
KERNEL[3626.017935] add /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/tty/ttyACM0 (tty)
KERNEL[3626.017993] bind /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0 (usb)
KERNEL[3626.018037] add /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.1 (usb)
KERNEL[3626.018078] bind /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.1 (usb)
KERNEL[3626.018127] bind /devices/pci0000:00/0000:00:1d.1/usb3/3-1 (usb)
KERNEL[3626.086078] remove /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/tty/ttyACM0 (tty)
KERNEL[3626.086128] unbind /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.1 (usb)
KERNEL[3626.086160] unbind /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0 (usb)
KERNEL[3626.086192] remove /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0 (usb)
KERNEL[3626.086225] remove /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.1 (usb)
KERNEL[3626.086639] unbind /devices/pci0000:00/0000:00:1d.1/usb3/3-1 (usb)
KERNEL[3626.086690] remove /devices/pci0000:00/0000:00:1d.1/usb3/3-1 (usb)
UDEV [3626.538480] add /devices/pci0000:00/0000:00:1d.1/usb3/3-1 (usb)
UDEV [3626.545897] add /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.1 (usb)
UDEV [3626.545943] add /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0 (usb)
UDEV [3626.546245] bind /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.1 (usb)
UDEV [3626.547268] add /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/tty/ttyACM0 (tty)
UDEV [3626.547527] bind /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0 (usb)
UDEV [3626.547720] bind /devices/pci0000:00/0000:00:1d.1/usb3/3-1 (usb)
UDEV [3626.548004] unbind /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.1 (usb)
UDEV [3626.548567] remove /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0/tty/ttyACM0 (tty)
UDEV [3626.548612] remove /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.1 (usb)
UDEV [3626.548931] unbind /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0 (usb)
UDEV [3626.549360] remove /devices/pci0000:00/0000:00:1d.1/usb3/3-1/3-1:1.0 (usb)
UDEV [3626.549570] unbind /devices/pci0000:00/0000:00:1d.1/usb3/3-1 (usb)
UDEV [3626.550063] remove /devices/pci0000:00/0000:00:1d.1/usb3/3-1 (usb)

-------------------- dmesg --------------------------------

[ 900.329260] usb 3-2: new full-speed USB device number 7 using uhci_hcd
[ 900.499278] usb 3-2: Dual-Role OTG device on non-HNP port
[ 900.502284] usb 3-2: New USB device found, idVendor=1753, idProduct=c902, bcdDevice= 0.01
[ 900.502288] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 900.502292] usb 3-2: Product: PPC920 Pinpad Terminal
[ 900.502295] usb 3-2: Manufacturer: GERTEC
[ 900.505428] cdc_acm 3-2:1.0: ttyACM0: USB ACM device
[ 900.507994] usb 3-2: USB disconnect, device number 7


Anyone with any suggestions?
Thank you!
 
Old 04-25-2019, 07:15 PM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
According to this blogpost,
you need a custom udev rule
Quote:
SUBSYSTEM=="tty", ATTRSidVendor=="1753", ATTRSidProduct=="c902", SYMLINK+="ttyACM-Gertec", MODE="0777"
I suggest adding a file "60-gertec.rules" in /etc/udev/rules.d/ containing the above rule.
 
Old 04-26-2019, 06:31 AM   #3
Dênio
LQ Newbie
 
Registered: Apr 2019
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks Allend but this rule is not enough.

By doing several tests, I realize that I have a problem with Slackware packaging.
Using 2 computers for the tests, follow the results:

1. Computer with USB only 1.10 - No USB device works with this device.
2. Computer with USB 2.0 and 3.0 - Some USB ports work only with this device.

Now using Linux Mint 19 - Live on the same computers
1. Computer with USB only 1.10 - All USB ports working with the device.
2. Computer with USB 2.0 and 3.0 - Also all USB ports working with the device.

Slackware simply ejects the device and ignores any rule it places for the usb device.

--------------------- LINUX MINT 19 LIVE ---------------------

root@mint:~# udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[1163.504310] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1 (usb)
KERNEL[1163.507162] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0 (usb)
KERNEL[1163.509131] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/tty/ttyACM0 (tty)
KERNEL[1163.509220] bind /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0 (usb)
KERNEL[1163.509283] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.1 (usb)
KERNEL[1163.509356] bind /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.1 (usb)
KERNEL[1163.509447] bind /devices/pci0000:00/0000:00:1d.0/usb2/2-1 (usb)
UDEV [1163.821591] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1 (usb)
UDEV [1163.827317] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.1 (usb)
UDEV [1163.830945] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0 (usb)
UDEV [1163.833829] bind /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.1 (usb)
UDEV [1163.837665] add /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0/tty/ttyACM0 (tty)
UDEV [1163.849951] bind /devices/pci0000:00/0000:00:1d.0/usb2/2-1/2-1:1.0 (usb)
UDEV [1163.854187] bind /devices/pci0000:00/0000:00:1d.0/usb2/2-1 (usb)
KERNEL[1164.516377] add /devices/parport0/ppdev0.0 (parport)
KERNEL[1164.517050] bind /devices/parport0/ppdev0.0 (parport)
KERNEL[1164.517500] unbind /devices/parport0/ppdev0.0 (parport)
KERNEL[1164.517801] remove /devices/parport0/ppdev0.0 (parport)
UDEV [1164.518488] add /devices/parport0/ppdev0.0 (parport)
UDEV [1164.519576] bind /devices/parport0/ppdev0.0 (parport)
UDEV [1164.520484] unbind /devices/parport0/ppdev0.0 (parport)
UDEV [1164.521255] remove /devices/parport0/ppdev0.0 (parport)
KERNEL[1168.910406] add /devices/parport0/ppdev0.0 (parport)
KERNEL[1168.910458] bind /devices/parport0/ppdev0.0 (parport)
UDEV [1168.913998] add /devices/parport0/ppdev0.0 (parport)
UDEV [1168.915360] bind /devices/parport0/ppdev0.0 (parport)
KERNEL[1168.956354] unbind /devices/parport0/ppdev0.0 (parport)
KERNEL[1168.957455] remove /devices/parport0/ppdev0.0 (parport)
UDEV [1168.961207] unbind /devices/parport0/ppdev0.0 (parport)
UDEV [1168.962744] remove /devices/parport0/ppdev0.0 (parport)

-------------------- dmesg --------------------------------

[ 1163.335657] usb 2-1: new full-speed USB device number 4 using uhci_hcd
[ 1163.523543] usb 2-1: New USB device found, idVendor=1753, idProduct=c902
[ 1163.523548] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 1163.523552] usb 2-1: Product: PPC920 Pinpad Terminal
[ 1163.523556] usb 2-1: Manufacturer: GERTEC
[ 1163.526705] cdc_acm 2-1:1.0: ttyACM0: USB ACM device


Anyone with any suggestions?
Thank you!

Last edited by Dênio; 04-26-2019 at 06:32 AM.
 
Old 04-26-2019, 10:16 AM   #4
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,371

Rep: Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750Reputation: 2750
Quote:
2. Computer with USB 2.0 and 3.0 - Some USB ports work only with this device.
Are these the USB 3 .0 ports?
This suggests a problem with your USB kernel modules. Are you using the generic kernel with an initrd?
 
1 members found this post helpful.
Old 04-30-2019, 01:49 PM   #5
Dênio
LQ Newbie
 
Registered: Apr 2019
Posts: 10

Original Poster
Rep: Reputation: Disabled
Dear

Solution to the problem is to just recompile the kernel by unchecking the CONFIG_USB_OTG option.

The .config file in the default Slackware build looks like this:
CONFIG_USB_OTG = y

The .config file in the build looks like this:
# CONFIG_USB_OTG is not set

Questions to recompile the kernel use the link:
https://edersoncorbari.github.io/tut...-build-kernel/

No need to recompile modules!

After compiling the kernel update the files:
vmlinuz-huge-smp-4.4.14-smp
System.map-huge-smp-4.4.14-smp
config-huge-smp-4.4.14-smp

And rewrite lilo again.

Last edited by Dênio; 05-01-2019 at 04:13 PM.
 
1 members found this post helpful.
Old 04-30-2019, 11:41 PM   #6
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
If it included the pound/hash symbol (#) in front of it, then making that change does nothing. Those are used to "comment out" lines in kernel configs (along with many other configs and some scripting languages).

Anything in your kernel config that has a # in front of it won't be considered when compiling the kernel.

I'm not sure if you put it there as a copy/paste (which means recompiling won't change anything) or to indicate something else and in reality, they do not exist in the configs (in which case, recompiling would remove that feature). If you're curious, you can designate text as "code" using [code][/code] tags.

Code:
# CONFIG_USB_OTG = y
Code:
# CONFIG_USB_OTG is not set
This can be used to make it easy to differentiate between output from a console/file/command vs just text that's being typed.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
USB Harddrive unmounted but not ejected arubin Slackware 2 07-24-2009 12:24 PM
12.2 The device was successfully unmounted, but could not be ejected arubin Slackware 8 12-22-2008 03:16 AM
USB pen drives get automatically ejected kypbre Linux - Hardware 4 07-07-2007 05:58 AM
How to detect programatically if a USB device is is plugged-in / plugged out? franc Linux - Software 3 02-01-2007 04:01 AM
Un-plugged PS/2 mouse then plugged it into usb. mouse now dead deathman Mandriva 2 11-20-2006 07:35 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 03:07 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration