net: ravb: Return cached statistics if the interface is down
authorClaudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Wed, 14 Feb 2024 13:57:57 +0000 (15:57 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 16 Feb 2024 08:32:04 +0000 (08:32 +0000)
commitbbf2345fa6582c5292bc5c537e7a29aad918be0c
treec3042aefba785a7a7a9b01ba68d0090947162d06
parenta5f149a97d09cc9340d8fb4e22a3074a7bc1e02d
net: ravb: Return cached statistics if the interface is down

Return the cached statistics in case the interface is down. There should be
no drawback to this, as cached statistics are updated in ravb_close().

In order to avoid accessing the IP registers while the IP is runtime
suspended pm_runtime_active() check was introduced. The device runtime
PM usage counter has been incremented to avoid disabling the device clocks
while the check is in progress (if any).

The commit prepares the code for the addition of runtime PM support.

Suggested-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/renesas/ravb_main.c