No usb 3 Arch linux 3.15.1
Finding the device
First, we need to find out what the device number is. If the port is enabled and you can see it with the command lsusb
then use ls /sys/bus/pci/drivers/xhci_hcd
. The device will be a number in the format xxxx:xx:xx.x and will most likely be the first entries returned from the ls
command.
Resetting the port
If the port is not visible, it means that the port is not working, but it can be reset by removing all power to the machine. Shutdown the computer, remove all batteries and power cords, and wait 10 seconds. Then plug your cord back in and boot the machine. Then look for the device number again.
My device number is 0000:04:00.0, but it may be different. An example I have seen is elsewhere 0000:00:14.0. Remember or write down your number(s). We will need it for binding and unbinding. There may be more than one if you have multiple usb 3 ports.
Determining power management framework
For apt/aptitude/dpkg (ubuntu/debian/mint):
dpkg --get-selections | grep pm-utils
If something is returned, you have pm.
For pacman package manager (arch)
pacman -Qe | grep pm-utils
If something is returned, you have pm.
For rpm package manager (fedora, centos, etc...):
rpm -qa | grep pm-utils
If something is returned, you have pm.
For others, you can try these, I don't know how they all work and don't have a system to test them on.
Note: just because the packages installed does not imply that you are using it, but there is a good chance you are. Another thing you can do is simply cd /etc/pm/
and if it exists you can put the script there. Technically, I don't think there is anything wrong with having an unbinding script in both places. If someone wants to leave a comment on whether or not this is true, or if there is a better way to determine if pm is used, that would be fantastic.
systemd suspend script (no pm utils)
If you are using systemd or systemctl without pm we need to put the script in /usr/lib/systemd/system-sleep/xhci_hcd.sleep
.
For my machine the script looks like:
#!/bin/sh
#File: /usr/lib/systemd/system-sleep/xhci_hcd.sleep
case $1/$2 in
pre/*)
# Unbind
echo "Unbinding xhci Device"
echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
;;
post/*)
# bind xhci_dev
echo "Rebinding xhci Device"
echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/bind
;;
esac
Replace the 0000:04:00.0 with your device number in both instances. If you have multiple device numbers, run the bind and unbind for each. i.e if you have ports xxxx:xx:xx.x and yyyy:yy:yy.y, you will need echo -n "xxxx:xx:xx.x" > /sys/bus/pci/drivers/xhci_hcd/unbind
and echo -n "yyyy:yy:yy.y" > /sys/bus/pci/drivers/xhci_hcd/unbind
to unbind the two devices, and echo -n "xxxx:xx:xx.x" > /sys/bus/pci/drivers/xhci_hcd/bind
and echo -n "yyyy:yy:yy.y" > /sys/bus/pci/drivers/xhci_hcd/bind
to bind the devices. I put the first echo command to let us see when the binding and unbinding happens when we look at the logs using journalctl -b -u systemd-suspend
. More information on power management with systemd/systemctl. Save that file then run sudo chmod a+x /usr/lib/systemd/system-sleep/xhci_hcd.sleep
to make it executable. Personally I would reboot the system to ensure that the new file takes effect, but I believe it may take effect immediately. If it doesn't and you put the system to sleep (or suspend/hibernate), look at how you reset the port above.
pm suspend script (pm utils are installed)
If you are using pm utils we need to put the script in /etc/pm/sleep.d/20_custom-xhci_hcd
#!/bin/sh
#File: "/etc/pm/sleep.d/20_custom-xhci_hcd"
case "${1}" in
hibernate|sleep)
#unbind
echo "Unbinding xhci device"
echo -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/unbind
;;
resume|thaw)
# bind
echo "Binding xhci device"
ehco -n "0000:04:00.0" > /sys/bus/pci/drivers/xhci_hcd/bind
;;
esac
Replace the 0000:04:00.0 with your device number in both instances. If you have multiple device numbers, run the bind and unbind for each device. See the instructions below the script for systemd suspend script, but instead use chmod a+x /etc/pm/sleep.d/20_custom-xhci_hcd
to make the file executable. Then reboot and test it.
More helpful resources:
Related videos on Youtube
felix Antony
Updated on September 18, 2022Comments
-
felix Antony over 1 year
Possible Duplicate:
How do I apply OrderBy on an IQueryable using a string column name within a generic extension method?I am using LINQ orderby statement for selecting the parent table with childtable. Now I want to apply orderby in all the fields including parent table and child table. How can i achieve this using dynamic column name. Please help me... This is the code i used here.
result = (from p in StudentDB.Student.Include("Student_addr") where (p.full_nm.Contains(searchCriteria.Name)) select p);
Now I am calling an extension method for applying orderby ...
var stuType = typeof(Student); var addressType = typeof(Student_addr); list = result.Order<Student>(stuType , addressType ,searchCriteria.sortColumn, searchCriteria.sortCondition); return list.Take(searchCriteria.reccount).ToList();
Extension method....
public static IQueryable<T> Order<T>(this IQueryable<T> items, Type stuType , Type addressType, string sortColumn, string sortOrder) { var typeOfT = addressType; var parameter = Expression.Parameter(typeOfT, "parameter"); var propertyType = typeOfT.GetProperty(sortColumn).PropertyType; var propertyAccess = Expression.PropertyOrField(parameter, sortColumn); var orderExpression = Expression.Lambda(propertyAccess, parameter); Expression expression =null; if (sortOrder == "Desc") { expression=Expression.Call(typeof(Queryable), "OrderByDescending", new Type[] { stuType , propertyType }, items.Expression, Expression.Quote(orderExpression)); } else { expression = Expression.Call(typeof(Queryable), "OrderBy", new Type[] { stuType , propertyType }, items.Expression, Expression.Quote(orderExpression)); } return items.Provider.CreateQuery<T>(expression); }
While I am running on the child table column name i got error as follos:
No generic method 'OrderBy' on type 'System.Linq.Queryable' is compatible with the supplied type arguments and arguments. No type arguments should be provided if the method is non-generic.
Thanks in advance...
-
Rouben Tchakhmakhtchian almost 10 yearsAny mention of xhci-hcd in dmesg? That's the USB 3.0 module...
-
jasonwryan almost 10 years3.15.1 is in the repos: see if that makes a difference.
-
Evan almost 10 years@jasonwryan That didn't work either. It should be possible to make work without updating though since it worked before on 3.14.
-
jasonwryan almost 10 yearsAgreed: but it always pays to update on Arch. What happens if you manually load the module?
-
bsd almost 10 yearsCan you add the output of
lshw -short -class bus
-
Jakob Bennemann almost 10 yearsAt minimum, there's at least one problem with the info in this post: the kernel 3.15.6 does not exist (at least not it Arch).
-
bsd almost 10 yearsIf you were told it (USB3) was broken, perhaps it is. It might have an intermittent outage, which is why you saw it once.
-
Evan almost 10 years@HalosGhost, sorry, I just updated and missed the last number in the title. It is 3.15.1.
-
Evan almost 10 yearsI don't think it is broken, I think something just isn't getting loaded. On another machine with it working, xhci_hcd shows up a lot in dmesg, whereas on my machine it doesn't anywhere. Then if we do a hard-drive swap, the port works fine, no problem.
-
mikeserv almost 10 yearswhat happens if you disconnect the hub and reboot? failing that, can you replace your kernel in
/boot
with the 3.14.xx from your installation disc and try again? -
mikeserv almost 10 yearsJust checked it myself - I hadn't updated to 3.15 yet before reading your post and I made sure to save a copy of my kernel then ran the update. In the process not only was the kernel updated but so was
libusb
. My usb3 ports are still recognized correctly though. -
Evan almost 10 yearsI just got the libusb update and it is working.
-
Evan almost 10 yearsIt was working until I suspended the machine. At one time I had used this to fix the sleep-mode issue. Once I found that it didn't fix it, I deleted it from /etc/pm/sleep.d/.
-