From: David S. Miller Date: Wed, 7 Apr 2021 21:53:04 +0000 (-0700) Subject: Merge branch 'ethtool-link_mode' X-Git-Tag: accepted/tizen/unified/20230118.172025~7507^2~14 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cf1482852825bdf8cc4e4f09346262c80ad5cbe;p=platform%2Fkernel%2Flinux-rpi.git Merge branch 'ethtool-link_mode' Danielle Ratson says: ==================== Fix link_mode derived params functionality Currently, link_mode parameter derives 3 other link parameters, speed, lanes and duplex, and the derived information is sent to user space. Few bugs were found in that functionality. First, some drivers clear the 'ethtool_link_ksettings' struct in their get_link_ksettings() callback and cause receiving wrong link mode information in user space. And also, some drivers can report random values in the 'link_mode' field and cause general protection fault. Second, the link parameters are only derived in netlink path so in ioctl path, we don't any reasonable values. Third, setting 'speed 10000 lanes 1' fails since the lanes parameter wasn't set for ETHTOOL_LINK_MODE_10000baseR_FEC_BIT. Patch #1 solves the first two problems by removing link_mode parameter and deriving the link parameters in driver instead of ethtool. Patch #2 solves the third one, by setting the lanes parameter for the link_mode. v3: * Remove the link_mode parameter in the first patch to solve both two issues from patch#1 and patch#2. * Add the second patch to solve the third issue. v2: * Add patch #2. * Introduce 'cap_link_mode_supported' instead of adding a validity field to 'ethtool_link_ksettings' struct in patch #1. ==================== Signed-off-by: David S. Miller --- 3cf1482852825bdf8cc4e4f09346262c80ad5cbe