Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3504539rwa; Tue, 23 Aug 2022 06:00:09 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ch3bLFHLrQuLTYsQVvdc6r5XlbB1HF8QKxrY9FNRst9nQgldLwULyEuKyv3KxF745iGTw X-Received: by 2002:a17:902:7297:b0:16f:975e:7c72 with SMTP id d23-20020a170902729700b0016f975e7c72mr23875826pll.45.1661259609349; Tue, 23 Aug 2022 06:00:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661259609; cv=none; d=google.com; s=arc-20160816; b=xeooB0qc6+EDPhs0XbbXIVBJs/wKxvOxl8yMosuy5rTZ+fpJQ0MQG6LHozoxepmdfT GBIans4m1ZNgNKW8Rm58qm6Y0x5to9G+/HGjxgEDNgDMKE/R9lzcArZtNhCrdZ6f05m+ 5pH5xxNG2HY+kpTR2LTYQm8+j4xFisREbxwlYHhPbZkkHCe5aeocceaxESG22Dy/VeT9 yciBL0TjR1ZTcs1cr2jNlkJxiPaKw01e9f8ujuUQclqNbtX0+aFhWRqZRTChv6rvnKMz WS4OL5V6Wyu43SqBcrmFH1zCbJeT9z3c72H7VNT5TTKByzGyQZEP7UIZb6+y6XoV0NIh jQ0Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Sv0kWPw92cRfdnFc8gQb3OeqKDs5NFb+8alnh9G7CRM=; b=rPvvdc/xQQKU9YtIbOr6Z6EZSp0/DVpO3F5fpGLlT8rEuTL80/i4bl5VocTkMBKW5M ElCY3z+zE5msANbA6wT1LvmIjyftc+0q98UQYOAO+tWntFozUozrmJVvKsgo5CiToKKq UEYOUOPFNhY0hAthYhviY7fwuASx99YkNBlv4u+fS3RQa1+oaMGOnui+UoC0JkBzCCRJ jCQr2z+4eDoG1AmQRhfgPPeVvGIfhI7auIGTZnQ9GgEWyHutyRVf0UVokAEY5G/79XPA j7chUdedAOyYOdld6gWvgL3KKdFx87c6RSKiNzzf1Pl97LbStoRkLt0VWI9lB5Cey1zw GyzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iV2uKrEs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id oo17-20020a17090b1c9100b001f2043193cfsi18102430pjb.124.2022.08.23.05.59.58; Tue, 23 Aug 2022 06:00:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=iV2uKrEs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1358462AbiHWLy1 (ORCPT + 99 others); Tue, 23 Aug 2022 07:54:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57840 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1358953AbiHWLvX (ORCPT ); Tue, 23 Aug 2022 07:51:23 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 36747D3997; Tue, 23 Aug 2022 02:32:09 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 65520613EF; Tue, 23 Aug 2022 09:32:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 55514C433D6; Tue, 23 Aug 2022 09:32:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661247124; bh=Y+qlWdUnCH0Y1VPWF46YVC7tY1kSdFucqEmRWPIB3ck=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iV2uKrEsawv0hZ1iNI9/2KSETpoyuQe8RpLkIykGHWLX0LnRbdQyaiKVc4F2N35a3 rg+e8rxw+bIN31etQ/fPx3JZyQFyh6ShQ2CAgJCvqtzoeP2JByUj0NMBEd91Vwy2jV IiXx6DVYCGL1mGsPNvAK2vUnjVkB5P3cdeqjPUeU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Louis Peens , Yu Xiao , Simon Horman , Jakub Kicinski Subject: [PATCH 5.4 324/389] nfp: ethtool: fix the display error of `ethtool -m DEVNAME` Date: Tue, 23 Aug 2022 10:26:42 +0200 Message-Id: <20220823080129.056893794@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080115.331990024@linuxfoundation.org> References: <20220823080115.331990024@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Yu Xiao commit 4ae97cae07e15d41e5c0ebabba64c6eefdeb0bbe upstream. The port flag isn't set to `NFP_PORT_CHANGED` when using `ethtool -m DEVNAME` before, so the port state (e.g. interface) cannot be updated. Therefore, it caused that `ethtool -m DEVNAME` sometimes cannot read the correct information. E.g. `ethtool -m DEVNAME` cannot work when load driver before plug in optical module, as the port interface is still NONE without port update. Now update the port state before sending info to NIC to ensure that port interface is correct (latest state). Fixes: 61f7c6f44870 ("nfp: implement ethtool get module EEPROM") Reviewed-by: Louis Peens Signed-off-by: Yu Xiao Signed-off-by: Simon Horman Link: https://lore.kernel.org/r/20220802093355.69065-1-simon.horman@corigine.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c +++ b/drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c @@ -1127,6 +1127,8 @@ nfp_port_get_module_info(struct net_devi u8 data; port = nfp_port_from_netdev(netdev); + /* update port state to get latest interface */ + set_bit(NFP_PORT_CHANGED, &port->flags); eth_port = nfp_port_get_eth_port(port); if (!eth_port) return -EOPNOTSUPP;