I have three USB ports out of which one of the ports is damaged.
I think it’s better for this distro to completely ignore that port. Cut off the current supply in that port (if possible), or just let the kernel know it’s a dead piece of sh*t.
But is it possible? Is there such a command which can do this?
Here is the output of sudo dmesg -k | grep usb
That is the screenshot of GNOME-logs.
In Ubuntu 21.04, I was having the suspend problem due to this USB issue (I think). And it might create the same problem here in Fedora 34.
It looks like that you have two bad ports (2-7 and 2-8)…
AFAIK you cannot disconnect power from the pins to the USB device. You can ‘unbind’ the device to prevent it from starting up and drawing more than a few mA. something like…
echo '2-8' |sudo tee /sys/bus/usb/drivers/usb/unbind
A udev rule could possibility catch devices plugged into the port and to trigger action like preventing binding.
There is nothing to unbind until you connect something to the port. You probably need to write a udev rule to act when a device is connected (something containing SUBSYSTEMS==“usb” ATTRS{devpath}==“2.8”)
It might be simpler to put a piece of tape over the port to stop you plugging something in
I inserted a pendrive in the damaged port. And tried to run your old commands and new commands (without understanding how should I use those command arguments), but it didn’t work.
And about the second command, you mentioned about reload-rules: Do I need to reload the rules when I restart the laptop? Doesn’t restarting the distro automatically apply the rules?
Edit:
I have added ATTRS instead of ATTR and reloaded the rules and restarted the distro to check whether the GNOME Logs still throw that the same error message saying, “USB port over-current condition”. It still does. This means the udev rule is not working.
What to do @vk2bea ? Any helps/tips/info would be nice.
I would be interested in that as well. I’ve found some documentation here: https://man7.org/linux/man-pages/man7/udev.7.html
I assume that ATTR{authorized}="0" means: Disable the device? I’m not sure how this works.
Yes it’s ATTR as I had written it.
It sounds like the hardware is damaged and the overcurrent is occurring weather the device is plugged in or not. (have you looked at the port to see if there is physical damage?) If that is the case, you could try disabling the whole USB hub (but you would then lose use of all ports).
pranav@fedora /sys/bus/usb/devices> ls
1-0:1.0 1-1:1.0 2-5 2-5:1.1 2-6:1.0 usb1 usb3
1-1 2-0:1.0 2-5:1.0 2-6 3-0:1.0 usb2
pranav@fedora ~> lsusb
Bus 001 Device 002: ID 8087:8001 Intel Corp. Integrated Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 04f3:2012 Elan Microelectronics Corp. Touchscreen
Bus 002 Device 002: ID 8087:07dc Intel Corp. Bluetooth wireless interface
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
pranav@fedora ~>
All about my USB are mentioned here. Trying to figure out how to implement udev rule.
@vk2bea
So ATTR is actually correct. I will use it then.
It sounds like the hardware is damaged and the overcurrent is occurring weather the device is plugged in or not.
Any usb device inserted into the usb port (which is damaged for some reason) is useless since, the distro doesn’t recognize it. Error log is there whether I insert a pendrive on it or not.
try disabling the whole USB hub
Even though this idea is a bad idea because I will use 2 usable USB ports. But I was wondering if there Is any command to do this? Or do I have to write udev rules for this?
KGN infotech is a repair shop that is right below my floor. I told him that one of the USB ports is not working. After his research, he found out that the port IC was a short circuit and damaged. From the other motherboard, he inserted a new (but used) IC after removing my damaged IC.
Now:
When I put my data cable to connect my phone or wired mouse in that port, it does get the current and charge. But it only gets the charge, it doesn’t take any input. Why? He also can’t seem to figure it out.
Unlike the previous situation when I didn’t go to the repair shop, I now don’t see kernel throwing this error message anymore, “USB USB<n>-port<n>: over-current condition”. But I do get to see 1 thing these days, “USB: port power management may be unreliable”. What does this mean? Is there something the KGN Infotech can do to sort it out? Please do let me know. So I can fully use that USB port.