From nobody Mon Apr 27 04:46:47 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id CAD86C43334 for ; Thu, 16 Jun 2022 16:09:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378039AbiFPQJK (ORCPT ); Thu, 16 Jun 2022 12:09:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45838 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232667AbiFPQJH (ORCPT ); Thu, 16 Jun 2022 12:09:07 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5C8F03BBE4 for ; Thu, 16 Jun 2022 09:09:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1655395746; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=4UlfqnsKfoPacVcltxpTNbmIYI6wNPfePNniZn5M9NQ=; b=en5sYo2GBRJcNZPF6kFCQ9oGAOFqtqnooqJKCiFLyjM81jHA4Y3nUJNKDBcKwlO6Rp/Xoy /HjUHpg1hwhRJexUa7dJPNlnoV6rXZZFkVJlWSQ6BqME8OnuoHsr472cDBq1IZebsitgnp g1WIHAMJMJTH3kl3mEVcyMHcXJzTUmc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-468-JJ4HsWfnMXa8ypiro3AvUw-1; Thu, 16 Jun 2022 12:09:02 -0400 X-MC-Unique: JJ4HsWfnMXa8ypiro3AvUw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 79022100BABC; Thu, 16 Jun 2022 16:09:00 +0000 (UTC) Received: from p1.luc.cera.cz.com (unknown [10.40.193.216]) by smtp.corp.redhat.com (Postfix) with ESMTP id B76A61415106; Thu, 16 Jun 2022 16:08:58 +0000 (UTC) From: Ivan Vecera To: netdev@vger.kernel.org Cc: Michal Kubecek , Ido Schimmel , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Vladyslav Tarasiuk , Andrew Lunn , linux-kernel@vger.kernel.org (open list) Subject: [PATCH net] ethtool: Fix get module eeprom fallback Date: Thu, 16 Jun 2022 18:08:55 +0200 Message-Id: <20220616160856.3623273-1-ivecera@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.85 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Function fallback_set_params() checks if the module type returned by a driver is ETH_MODULE_SFF_8079 and in this case it assumes that buffer returns a concatenated content of page A0h and A2h. The check is wrong because the correct type is ETH_MODULE_SFF_8472. Fixes: 96d971e307cc ("ethtool: Add fallback to get_module_eeprom from netli= nk command") Cc: Ido Schimmel Signed-off-by: Ivan Vecera Reviewed-by: Ido Schimmel --- net/ethtool/eeprom.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ethtool/eeprom.c b/net/ethtool/eeprom.c index 7e6b37a54add..1c94bb8ea03f 100644 --- a/net/ethtool/eeprom.c +++ b/net/ethtool/eeprom.c @@ -36,7 +36,7 @@ static int fallback_set_params(struct eeprom_req_info *re= quest, if (request->page) offset =3D request->page * ETH_MODULE_EEPROM_PAGE_LEN + offset; =20 - if (modinfo->type =3D=3D ETH_MODULE_SFF_8079 && + if (modinfo->type =3D=3D ETH_MODULE_SFF_8472 && request->i2c_address =3D=3D 0x51) offset +=3D ETH_MODULE_EEPROM_PAGE_LEN * 2; =20 --=20 2.35.1