generic: ar8216: add mib_poll_interval switch attribute
authorChuanhong Guo <gch981213@gmail.com>
Tue, 9 Apr 2019 13:32:32 +0000 (21:32 +0800)
committerPetr Štetiar <ynezz@true.cz>
Mon, 20 May 2019 19:17:45 +0000 (21:17 +0200)
commit107dc4326ccfaff27bd1e698b8bc7fb942233559
tree03bac9ce58d91967a902011e8d2a64e4cf1925d7
parentdf6e8c8771d5457048a5cb1e510c6bc73bd4c173
generic: ar8216: add mib_poll_interval switch attribute

This allows specifying interval of polling MIB counters from userspace
and allow completely turning off MIB counter support by setting
mib_poll_interval to 0.

Since MIB counter polling is a heavy CPU load for GPIO emulated MDIO
bus, disable this behavior by default. Those who wants to use swconfig
LEDs can enable them with qca,mib-poll-interval dts property or with
swconfig command.

Fixes: FS#2230 ("kworker spikes 100% cpu every 2 second.")
Signed-off-by: Chuanhong Guo <gch981213@gmail.com>
target/linux/generic/files/drivers/net/phy/ar8216.c
target/linux/generic/files/drivers/net/phy/ar8216.h
target/linux/generic/files/drivers/net/phy/ar8327.c