]> git.baikalelectronics.ru Git - kernel.git/commit
s390/qeth: cache link_info for ethtool
authorAlexandra Winter <wintera@linux.ibm.com>
Fri, 5 Aug 2022 15:57:14 +0000 (17:57 +0200)
committerJakub Kicinski <kuba@kernel.org>
Tue, 9 Aug 2022 03:57:56 +0000 (20:57 -0700)
commit3205f6cf318b3cb4b105629f8287bdfd7c1aaf97
tree0e56f45c250b27905f07b5da67a0946d6822a7e0
parent8792a86cd48294879c173585a5adf9391fbe5087
s390/qeth: cache link_info for ethtool

Since
commit 37ec61305ceb ("s390/qeth: detach netdevice while card is offline")
there was a timing window during recovery, that qeth_query_card_info could
be sent to the card, even before it was ready for it, leading to a failing
card recovery. There is evidence that this window was hit, as not all
callers of get_link_ksettings() check for netif_device_present.

Use cached values in qeth_get_link_ksettings(), instead of calling
qeth_query_card_info() and falling back to default values in case it
fails. Link info is already updated when the card goes online, e.g. after
STARTLAN (physical link up). Set the link info to default values, when the
card goes offline or at STOPLAN (physical link down). A follow-on patch
will improve values reported for link down.

Fixes: 37ec61305ceb ("s390/qeth: detach netdevice while card is offline")
Signed-off-by: Alexandra Winter <wintera@linux.ibm.com>
Reviewed-by: Thorsten Winkler <twinkler@linux.ibm.com>
Link: https://lore.kernel.org/r/20220805155714.59609-1-wintera@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_ethtool.c