Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp308355rdb; Thu, 22 Feb 2024 04:39:02 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUCK6nEqVNAvplQ/5UKNLn84ww3M2NNl4qmenAKQ2ASIlKWR4ofqHQy7mcSz+bZXpgfA1OuK1U8bL3dtriPz2rSraEggUITk21SFzRvwA== X-Google-Smtp-Source: AGHT+IFmzzTN+6L9MG6xW2lU/S7pdthnT3sQ2KN6Qv4b7Xku3UrKpIaB30S9/wUsL3PtQSVCTyjx X-Received: by 2002:a17:906:7159:b0:a3e:980c:699d with SMTP id z25-20020a170906715900b00a3e980c699dmr10795892ejj.57.1708605542583; Thu, 22 Feb 2024 04:39:02 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708605542; cv=pass; d=google.com; s=arc-20160816; b=IsG7iDia3mSpy0cYqgWHLpBuL1CkS41DVAZmpCihUjDWfqXwvOZkVidP/OowgHkqlr 0ty/D32GiDxWEKZEXx+KXMbKfRObBp159Rb5qyyxm5vXkDkGuu8IfhiFspRiaFkATAzv 02K0Esr+1rj+4i8NrY/m1obsc68KaTjs234csI+DAl+YypRYwf5C+6eLpLcOMzZoXg6D itku2HqOSLVtEP19OGkWlRYNneWl18mUHROba1UsCPvA8bEEwhGNbdXc1IkHkTl0SBry txcMJKCSAD3zM8810UahU7e+YBUJaHMB2t5GKp4ZdskR4pHRmnEB0uNPsLoPwPvPPhk0 5ZHg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=yrC7e9Fbn3GTNLjGDh8ImotlAtQOEnte3MIJIVfQhJg=; fh=NxilBuiqz+2U7sXeqs9J6pTxX3FVKueJylk5PSevRpk=; b=whCZYxBKQfMMh1R7bI7IY7ZStF3vcbR/VwVNi7qtC3D/G32dPI9QmZkLt8MCSDFm3H wk7RG5hkcrmVPcLql8r3EnTkxhc3aLehstjr/gFqyEguUfugIhFYd8GR5hZNxUFewisL lLV62xApxQihH7K1YeuTpvY97OZo947FevkO8SaJBZPbRj4AM5Tw01pP7Yv+4+UqTOze W153+8xs6Duj76Dnike7Nb7PNcJQf/Nhb1shHpnv8jeUhcr4+u4T2O+o3XOvqmW3wzjB EeF3wb9WX/h+PZv3zF/AokZzTP2DXgLoYvBPGwAiEyv3fN2AcPyPpEGmWum0CeSbBa7x lerg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-76522-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76522-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id hd16-20020a170907969000b00a3e864d580esi4093057ejc.835.2024.02.22.04.39.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 04:39:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76522-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-76522-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76522-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 5085E1F26686 for ; Thu, 22 Feb 2024 12:39:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B02A12DD91; Thu, 22 Feb 2024 12:38:55 +0000 (UTC) Received: from metis.whiteo.stw.pengutronix.de (metis.whiteo.stw.pengutronix.de [185.203.201.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9DACD44367 for ; Thu, 22 Feb 2024 12:38:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=185.203.201.7 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708605534; cv=none; b=Ng7dETOTp4FiTh3B5n4OPEekCAoaLLSWt6dUCl7cTETDLyBr6M/vaJ53S6nV1iP9VoCIu3XsFZ36wbNuQOEiL8bLCIVUUYnXbFoGb69D+6RkyR6zX3UpdpQLC9rGGzaCP6grJot1dQR3XynMml54inYh3qW6gqPeRr8o/KeNzNA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708605534; c=relaxed/simple; bh=BgXSG/gCEdxQcMxhZfn7pF1ZUmFlN4Q+NRemkxs/KxU=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=nc2jbjbYAL5NrfMFJoCH7FyHZUh/PB49YCN/N28lRHtpOKzV0lFf4dPnDyjWYnaEoJ8Sm1Xm0gxstNSw1mm0SC8XUVZHoOQrXUB14m3qZ+a3ki+vmBYtF2HKOx3XCYFKqi0rmGUL1XBpSvgESyXQRFUscIUjxnTpw71e9jHpb8o= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de; spf=pass smtp.mailfrom=pengutronix.de; arc=none smtp.client-ip=185.203.201.7 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=pengutronix.de Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.whiteo.stw.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rd8La-0004bQ-6E; Thu, 22 Feb 2024 13:38:42 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rd8LY-002EZ4-8G; Thu, 22 Feb 2024 13:38:40 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.96) (envelope-from ) id 1rd8LY-00Boin-0b; Thu, 22 Feb 2024 13:38:40 +0100 From: Oleksij Rempel To: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Woojung Huh Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, UNGLinuxDriver@microchip.com Subject: [PATCH net v1 1/1] lan78xx: enable auto speed configuration for LAN7850 if no EEPROM is detected Date: Thu, 22 Feb 2024 13:38:38 +0100 Message-Id: <20240222123839.2816561-1-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.whiteo.stw.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Same as LAN7800, LAN7850 can be used without EEPROM. If EEPROM is not present or not flashed, LAN7850 will fail to sync the speed detected by the PHY with the MAC. In case link speed is 100Mbit, it will accidentally work, otherwise no data can be transferred. Better way would be to implement link_up callback, or set auto speed configuration unconditionally. But this changes would be more intrusive. So, for now, set it only if no EEPROM is found. Fixes: e69647a19c87 ("lan78xx: Set ASD in MAC_CR when EEE is enabled.") Signed-off-by: Oleksij Rempel --- drivers/net/usb/lan78xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c index 106282612bc2..7d7e185d7fae 100644 --- a/drivers/net/usb/lan78xx.c +++ b/drivers/net/usb/lan78xx.c @@ -3033,7 +3033,8 @@ static int lan78xx_reset(struct lan78xx_net *dev) if (dev->chipid == ID_REV_CHIP_ID_7801_) buf &= ~MAC_CR_GMII_EN_; - if (dev->chipid == ID_REV_CHIP_ID_7800_) { + if (dev->chipid == ID_REV_CHIP_ID_7800_ || + dev->chipid == ID_REV_CHIP_ID_7850_) { ret = lan78xx_read_raw_eeprom(dev, 0, 1, &sig); if (!ret && sig != EEPROM_INDICATOR) { /* Implies there is no external eeprom. Set mac speed */ -- 2.39.2