Need help with XHCI

  • Hello. Through some troubleshooting I found that disabling the XHCI wakeup allows my laptop to suspend and resume properly.

    The issue is that I cannot figure out how to make this change permanent. I found some suggestions online but they don't seem to apply or correlate with how LE works.

    Any suggestions or links are appreciated.

  • Guessing at the solution wastes time and sucks, so it would help if you posted info on the commands that work to disable it, and other links that helped you arrive at that solution.

  • Thanks for the reply.

    These are the commands I used:

    cat /proc/acpi/wakeup Shows the devices enabled/disabled states

    /bin/sh -c '/bin/echo XHCI > /proc/acpi/wakeup' Toggles XHCI wakeup


    Once it is set to disabled my computer will suspend and resume using a remote (which was my goal)


    This post describes setting up the command as a service to load on boot:

    [SOLVED] Suspend_Wakeup /proc/acpi/wakeup file / Kernel & Hardware / Arch Linux Forums

    Here is another that suggests a different method:

    Make changes to `/proc/acpi/wakeup` permanent
    I disabled most of my entries in /proc/acpi/wakeup/ to make sure only the power button and the laptop lid can resume my system, not the mouse or keyboard. The…
    unix.stackexchange.com


    I just do not know how to do these on LibreElec

    Thanks again.

  • Create the custom systemd service as /storage/.config/system.d/xhci.service

    Enable with systemctl enable /storage/.config/system.d/xhci.service

    Start with systemctl start /storage/.config/system.d/xhci.service

    Then check for errors. If you need to make changes and edit the file, run systemctl daemon-reload after the changes.

    Aside from the odd /storage location, systemd things work the same as most other distros.

  • Thank you.

    The first command to enable the service was successful.

    Attempting to start it resulted in this error:

    Failed to start storage-.config-system.d-xhcidisable.service.mount: Unit storage-.config-system.d-xhcidisable.service.mount not found.

    I also tried systemctl enable xhcidisable.service and then systemctl daemon-reload which did not give any errors.

    But after restarting the computer and using cat /proc/acpi/wakeup I can see that XHCI is not disabled.

    XHCI      S3    *enabled   pci:0000:00:14.0


    I used systemctl status xhcidisable.service

    and got:

    ○ xhcidisable.service - no_usb_wakeup
        Loaded: loaded (/storage/.config/system.d/xhcidisable.service; enabled; preset: disabled)
        Active: inactive (dead) since Wed 2025-04-16 08:45:09 CDT; 6min ago
      Duration: 53ms
       Process: 514 ExecStart=/bin/bash -c echo XHCI >> /proc/acpi/wakeup (code=exited, status=0/SUCCESS)
      Main PID: 514 (code=exited, status=0/SUCCESS)
           CPU: 3ms

    Apr 16 08:45:09 LivingRoomKodi systemd[1]: Started xhcidisable.service.
    Apr 16 08:45:09 LivingRoomKodi systemd[1]: xhcidisable.service: Deactivated successfully.

    I tried the command /bin/bash -c "echo XHCI >> /proc/acpi/wakeup" on it's own which does work.

    Could the service be executing in the wrong order with something else?

    I apologize for my ignorance of Linux. I know some things about it but I mostly work with Windows.

  • Sure here you go:

    [Unit]
    Description=no_usb_wakeup

    [Service]
    ExecStart=/bin/bash -c "echo XHCI >> /proc/acpi/wakeup"

    [Install]
    WantedBy=multi-user.target


    Oh and I should mention that I created the file using the SMB share under \\share\Configfiles\system.d\ from my Windows PC.

    Also, the file I created is called xhcidisable.service

  • Code
    # SPDX-License-Identifier: GPL-2.0-or-later
    # Copyright (C) 2009-2014 Stephan Raue ([email protected])
    # Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
    
    ACTION!="add|change", GOTO="end"
    
    DRIVER=="ehci-pci|xhci_hcd", RUN+="/usr/bin/sh -c 'echo disabled > /sys$devpath/power/wakeup'"
    
    LABEL="end"

    Create that ^ as /storage/.config/udev.rules.d/30-disable-wakeup.rules but ensure you do this via SSH/nano to ensure unix line endings are used (as Windows endings will not work). You can stop/disable and then delete the systemd service file.

    Working?

  • Okay I've created the file and then restarted but XHCI was not disabled.

    Is there anything else I needed to do to enable the new script?

  • Thank you. Unfortunately that didn't seem to work either. And I'm not sure if this is related or matters but now EHC1 is enabled. As far as I can remember it has been disabled every time I've looked at them. I rebooted a couple of times just to make sure.