Skip to content

USB devices are not removed after port power down on Linux on kernel prior 6.0 ! #458

Closed
@CpServiceSpb

Description

@CpServiceSpb

Hi.
First of all, thanks for you soft !

I use USB Hub based on Microchip 2517 with Ubuntu 18.04 LTS x63 with kernel 5.4.0-126.
And I have the same issue - that is a device on powered off port of the hub is still "remained" on the system.
I mean the virtual part of it.
As I saw at there is clearing ENABLE feature of the port and calling usb_remove_device().
I offer to add these steps to the main code of uhubctl.
First part I think will be as a follows:
if (request == LIBUSB_REQUEST_CLEAR_FEATURE) { rc = libusb_control_transfer(devh, LIBUSB_REQUEST_TYPE_CLASS | LIBUSB_RECIPIENT_OTHER, request, USB_PORT_FEAT_ENABLE, // USB_PORT_FEAT_POWER, port, NULL, 0, USB_CTRL_GET_TIMEOUT); }
And then add usb_remove_device().
At he time I don' t know how is to do so, I included usb.h but there is no effect.

By the way, there is no the issue when USB device is unplugged manually.
Why ??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions