[kwlug-disc] USB tty driver 'stuck'

Tim Laurence timdaman at gmail.com
Sun Jan 2 22:34:53 EST 2022


Khalid ,
   Happy New Year! I recommend not using the default tty paths, they are
not deterministic and can get modified by different hardware detection
ordering. That can be caused by unplugging and replugging, driver
reloading, and/or kernel changes that change the order devices are listed
in.

Use the paths under
   /dev/serial/by-id/

These paths include unique identifiers which ensure when the same device is
detected it will be provided under a reliable name/path.

Think of this like the changes in fstab where there was a change from using
device paths to using volume ids(a.k.a. UUIDs) to ensure when drives were
detected out of order they still functioned without issue.

In a side note, once I nearly caused a major outage due to using a UUID
rather than a path.

I took a snapshot of a XFS volume before doing some maintenance. When I
rebooted everything came back up but when I tried to delete the snapshot it
was still in use.

I couldn’t figure out what was going on until I closed my eyes in bed about
8 hours later when suddenly I realized the snapshot had the same UUID as
the base volume and the system had in fact booted from it rather than the
base volume. I called the office and told them to wake the IT chain to
director level as we would have a high severity outage when the snapshot
ran out fo space in 4 hours.

In the end, we stopped our data processing pipeline, wait for all the in
process work to complete, and then rebooted back into the original
boot/base volume. We lost about 8 hours of records but managed to limit
downtime to about 10 minutes and didn’t miss any transactions of
importance. We backed up the snapshot just in case any of the missing data
was needed but it never was even noticed.

—Tim

On January 2, 2022 at 9:37:35 PM, Khalid Baheyeldin (kb at 2bits.com) wrote:

So here is the situation.
I have a few serial devices and they behave well.
Each gets the device /dev/ttyUSB0 device when plugged.
They use the cp210x driver.

No issues for years.

Until today.
Somehow a wrong a sequence, maybe unplugging while a program is still
accessing the device,
made every device that gets plugged in get /dev/ttyUSB1 instead of 0.

No matter what I do, it stays 1. I tried the following:

sudo udevadm control --reload
sudo service udev restart
sudo rmmod cp210x
rmmod: ERROR: Module cp210x is in use
But nothing is plugged in.

Trying to force it does not work either:

sudo rmmod -f cp210x
rmmod: ERROR: ../libkmod/libkmod-module.c:799 kmod_module_remove_module()
could not remove 'cp210x': Resource temporarily unavailable
rmmod: ERROR: could not remove module cp210x: Resource temporarily
unavailable

I know a reboot will fix it, but I don't want to keep rebooting if this
happens again.

Any other ideas?

-- 
Khalid M. Baheyeldin
2bits.com, Inc.
Fast Reliable Drupal
Drupal performance optimization, hosting and consulting.
"Sooner or later, this combustible mixture of ignorance and power is going
to blow up in our faces." -- Dr. Carl Sagan
_______________________________________________
kwlug-disc mailing list
kwlug-disc at kwlug.org
https://kwlug.org/mailman/listinfo/kwlug-disc_kwlug.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://kwlug.org/pipermail/kwlug-disc_kwlug.org/attachments/20220102/2e468fe0/attachment.htm>


More information about the kwlug-disc mailing list