--- zzzz-none-000/linux-3.10.107/drivers/usb/core/driver.c 2017-06-27 09:49:32.000000000 +0000 +++ vr9-7490-729/linux-3.10.107/drivers/usb/core/driver.c 2021-11-10 11:53:55.000000000 +0000 @@ -281,6 +281,13 @@ return error; } +#if 1 /* == 20150309 AVM/WK Extension == */ + if (udev->noprobe) { + dev_err(&intf->dev, "Probing is disabled for this device\n"); + return error; + } +#endif + id = usb_match_id(intf, driver->id_table); if (!id) id = usb_match_dynamic_id(intf, driver); @@ -338,6 +345,10 @@ intf->condition = USB_INTERFACE_BOUND; + /* == 20170208 AVM/VGJ - Inc USB use counter -> prevents suspension + * The interface's driver must dec the counter to allow suspension ==*/ + avm_usb_suspend_get_locked(udev); + /* If the LPM disable succeeded, balance the ref counts. */ if (!lpm_disable_error) usb_unlocked_enable_lpm(udev); @@ -385,10 +396,11 @@ */ lpm_disable_error = usb_unlocked_disable_lpm(udev); - /* Terminate all URBs for this interface unless the driver - * supports "soft" unbinding. + /* + * Terminate all URBs for this interface unless the driver + * supports "soft" unbinding and the device is still present. */ - if (!driver->soft_unbind) + if (!driver->soft_unbind || udev->state == USB_STATE_NOTATTACHED) usb_disable_interface(udev, intf, false); driver->disconnect(intf); @@ -418,6 +430,9 @@ intf->condition = USB_INTERFACE_UNBOUND; intf->needs_remote_wakeup = 0; + /* == 20170208 AVM/VGJ - Dec USB use counter -> allows suspension ==*/ + avm_usb_suspend_put_locked(udev); + /* Attempt to re-enable USB3 LPM, if the disable succeeded. */ if (!lpm_disable_error) usb_unlocked_enable_lpm(udev); @@ -481,6 +496,10 @@ iface->condition = USB_INTERFACE_BOUND; + /* == 20170208 AVM/VGJ - Inc USB use counter -> prevents suspension + * The interface's driver must dec the counter to allow suspension ==*/ + avm_usb_suspend_get_locked(udev); + /* Disable LPM until this driver is bound. */ lpm_disable_error = usb_unlocked_disable_lpm(udev); if (lpm_disable_error && driver->disable_hub_initiated_lpm) {