Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3336524rwa; Tue, 23 Aug 2022 03:06:03 -0700 (PDT) X-Google-Smtp-Source: AA6agR6XkpEqJIwdfg0J+Y+61VEZ7n+fUgS5GIoxgrhzg4pT6zC4Tj23Pf/aFiQR0u5Sq2jR/Nbn X-Received: by 2002:a05:6402:190e:b0:43e:1588:4c32 with SMTP id e14-20020a056402190e00b0043e15884c32mr3037822edz.76.1661249162851; Tue, 23 Aug 2022 03:06:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661249162; cv=none; d=google.com; s=arc-20160816; b=MNbQ+2CZY3/mpXBCmX5SvhmJT4sIqCxRCeNVnh+izDfHeO/IBPLRVDnrNWZzpEPNGD 7PgEBjeKf8rNp9jb+7cVXFFl//WhDyPP9X8N6pfh1SNYSybsrKFbaR5XbbIJa+Gaqf2e JG13QoThHdbTL0/m3cjHZ6tsHRrHTnpzeqvL2n5Lbd2puqw4lXpCUr6agGW2vcgeAULR 7MgRmXjuK1D8vwezt6L/gkNmAU0wdtm5WsEUmWyVAwpwXUQc9a2/cduvPod79JJo+eWD GRvZOAUJ5E60DAPuGDLty+XkbWiQR7tc5XkkWDXR+NDcPkl6VIgENzNnoRkFE5UCDECB hWzg== 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=/JaItq/zQbP+Z+KTCVt+STmka+9Z9BX5PYCltsrqXA8=; b=fuQZP61QpE23lFd4JXIVxjGzhxkxqRhe+vqcPADUTMJ1NQcFyIeRNNrGTcnvb6Q9bZ brra8GRhjAgyODS/f8JrKlElgkUL9EkQ5/EOe2GLjvd7AyGwT/dtL7oacsViLAP5afwo 0wPozW6wyfjKThQeb/vh1ddZv0JzVEFkdx8maya0aeRioGjoYxHn2ycQCbgEPLY77woO HD4KURgC5kWvXaMYHCs4bZnQ/yKfBfTqKgDkIeRALFMeOv9vx9mi0v+U825zRBtGw+0K KfhAWBC8n8W9nW9lG6SloSZwMSBmRbobtwewXGxubuXsJ2VvztNOuCTuzZN93bwEiI+4 eIIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rpCsSr2N; 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 nb36-20020a1709071ca400b0073d615565fesi8640795ejc.494.2022.08.23.03.05.34; Tue, 23 Aug 2022 03:06:02 -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=rpCsSr2N; 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 S1351992AbiHWKA7 (ORCPT + 99 others); Tue, 23 Aug 2022 06:00:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352369AbiHWJ4u (ORCPT ); Tue, 23 Aug 2022 05:56:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DABE0A1A52; Tue, 23 Aug 2022 01:47:32 -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 2BC9E6153C; Tue, 23 Aug 2022 08:47:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 34327C433D7; Tue, 23 Aug 2022 08:47:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244447; bh=eZGbWIQ2aOVW6x2f3lasoFB+MV6rwSXUOguTXwzahKY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rpCsSr2NY6dxciOW01oD4qwzhNHJL3q4DWiH8aCwLrHUS7rdhe7q0sP+icb5bHqUG EcK6uDJkxSR3LDcl2Qgmlo+paA3PTkLijbtFS912a2PCefkUFYa+YW/UFhEe9Fz05H ff6EHlymqAD3XfwKIFBC7mhDM8pIIH6L2knklaT0= 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.15 095/244] nfp: ethtool: fix the display error of `ethtool -m DEVNAME` Date: Tue, 23 Aug 2022 10:24:14 +0200 Message-Id: <20220823080102.187733538@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@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 @@ -1219,6 +1219,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;