usb: core: added uevent for over-current
authorJon Flatley <jflat@chromium.org>
Thu, 20 Sep 2018 17:17:54 +0000 (10:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 28 Sep 2018 13:08:17 +0000 (15:08 +0200)
commit201af55da8a3986297d7c3493f839dfc96ffd7db
tree06e3cdd663ed2f0918ea552c2ea7f22ba599a857
parentea3b4d5523bc8d3e955075d3716af536d6212cc7
usb: core: added uevent for over-current

After commit 1cbd53c8cd85 ("usb: core: introduce per-port over-current
counters") usb ports expose a sysfs value 'over_current_count'
to user space. This value on its own is not very useful as it requires
manual polling.

As a solution, fire a udev event from the usb hub device that specifies
the values 'OVER_CURRENT_PORT' and 'OVER_CURRENT_COUNT' that indicate
the path of the usb port where the over-current event occurred and the
value of 'over_current_count' in sysfs. Additionally, call
sysfs_notify() so the sysfs value supports poll().

Signed-off-by: Jon Flatley <jflat@chromium.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Documentation/ABI/testing/sysfs-bus-usb
drivers/usb/core/hub.c