Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3326218rwa; Tue, 23 Aug 2022 02:54:36 -0700 (PDT) X-Google-Smtp-Source: AA6agR7DGawOGI1UB3qjolqu7cUU59xmm9mZln6L5nlILOi/ZPlhjzNMBGHudl/6hjFhveP5vy3e X-Received: by 2002:a05:6a00:f8d:b0:536:c6c9:a2d with SMTP id ct13-20020a056a000f8d00b00536c6c90a2dmr6503703pfb.52.1661248476583; Tue, 23 Aug 2022 02:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661248476; cv=none; d=google.com; s=arc-20160816; b=i8XDvzLNKmyTCYzwiEbF6bCWj2J1A2DeUX1vx1Nf7KI48erFW5aKLnd0nA3ps8jk+3 IOPqI6Ssrw3L/ok9dLmTuffJwJUYHp4SR+5aocupqoC2Je/GeJcZXzY3Q4qAxojONj0q 1VVDxE9GWKbdBhMrvs0AcRGv/trWAILsMigBAPm17BrI0qLTPWkOJ5se+ArxlU42MNpH Inz8SGpUWPvPx1GYIIyb9db0ugWu09gF1yNCl/H4mYQjfsgRLhJE0/K8kg3pc/QcTTpB c49WAs44cE0iPmbdrEqNLQnSaARiV9Wrf8gh8GT4/0/EovJQ4j/JgtSqPLvz4JslrVzj hfng== 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=01/gHdYQzOlX2j7h8tLO98B2nNTnS1Q9fBEIqv7SHIQ=; b=WISn2W0ODgOhuT7e9pIe/7a3IyRBj6C33TTW4fwHLjEPM+8JvZdTUoNhG9fpVdXjbD CdNeg5kPF6S39YDYxybLs45qNApkU3Ri6nld6izj4a+5OGN/zr1sCRfTNg8vj7A2lnqL qfc5lNb9iCk7JyNikKAYd13iwzdtTtp7mC3LYoewNeCjS279j958SfD4AH5Yu/Z8wQ4T GgsnBmhzFJyq866RvWivBW4IzCu3SfZemJiiIGyK7lPJz3Wp8++DUnWf63sOR3mWZJCC igr1f9Y5Og0lPjsh5/3gwPHz5BcTBUppzIRaSKRC63nTZej19LM4Ey5bgEFXw4PH6Hgv /goA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zKdKLBI9; 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 u7-20020a170902e5c700b0016d70bd3fd6si17117413plf.77.2022.08.23.02.54.24; Tue, 23 Aug 2022 02:54:36 -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=zKdKLBI9; 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 S1347150AbiHWIuC (ORCPT + 99 others); Tue, 23 Aug 2022 04:50:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347018AbiHWIt3 (ORCPT ); Tue, 23 Aug 2022 04:49:29 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6BA77C337; Tue, 23 Aug 2022 01:22:19 -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 sin.source.kernel.org (Postfix) with ESMTPS id EFD16CE1B39; Tue, 23 Aug 2022 08:17:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDAE4C433D6; Tue, 23 Aug 2022 08:17:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661242630; bh=yp8FAvLDJNDsj4jRUbxa7J/2sW+6J1jRQ0jGvMPpTno=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zKdKLBI90eZrOqESnpUPSfiIBJeyJ1vy1Wy2iLrkoMky+dcjPrem5EW5PUynR1h+L W4+gDSBB3jJS+WRAUang61rf21L70F3bfy5z6ZwebbGvB035v6AjdJ863IxHyGNYnr G1wX2oTJoOo4Y6tc/Cxt3A3N57NQup/x1zh8sSxw= 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.19 148/365] nfp: ethtool: fix the display error of `ethtool -m DEVNAME` Date: Tue, 23 Aug 2022 10:00:49 +0200 Message-Id: <20220823080124.407732769@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080118.128342613@linuxfoundation.org> References: <20220823080118.128342613@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 @@ -1230,6 +1230,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;