From patchwork Thu Feb 22 12:38:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 204741 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:aa16:b0:108:e6aa:91d0 with SMTP id by22csp221495dyb; Thu, 22 Feb 2024 04:39:09 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXcPL9U/pJyc0Jxinprd1g7AC2qpzXEWBaM+J0ll/ZXN9IwEppNlbASRKhp7HWJFKf8vjCSiBGjCBA61kUxbmbfZJO+rw== X-Google-Smtp-Source: AGHT+IF65/rYDI7TsOM5DGZU9cHWu+mni4YN9MPs/GsCeUzt4fwOsHuB5kJvpnrnl1lOOdU3zNGp X-Received: by 2002:a81:6c0f:0:b0:608:7488:8691 with SMTP id h15-20020a816c0f000000b0060874888691mr5981561ywc.38.1708605548852; Thu, 22 Feb 2024 04:39:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708605548; cv=pass; d=google.com; s=arc-20160816; b=oHLP2aOPt9lTPrmaSk4yt4muuJqveCUbfA8cwH7ix+XrkXNPUcBaUsP4w7aaF3Y2ph 4eDGJkmDiWVy+aI5vY6IhpY4ALJU8Px6Ooa12jX2EA3qbmiif+I29d13uh4pjxSEjsOA S6/YeQRqZZl1jmLRCMPiBBc3xPdvPPHP8w8Qb52s0+iKlPfwY3/ZkdALSmg7nNhnMixB odZOYhOlWJT6ivt+RTFp/QO5jP5YvoDepvlho+h0RxuSjQNWzK7fRVtY35Z9TRE25O0h S5jFFag8tMat6sBVnPn1sggHF1UKI0wCEaU5VSA2++bZer9DKBmiQIkjfUkc7CDvlHnz o0Ng== 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76522-ouuuleilei=gmail.com@vger.kernel.org" Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id g5-20020ac84805000000b0042dd79d676fsi12235479qtq.57.2024.02.22.04.39.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 22 Feb 2024 04:39:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-76522-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=pengutronix.de); spf=pass (google.com: domain of linux-kernel+bounces-76522-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-76522-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id A1E1D1C243DF for ; Thu, 22 Feb 2024 12:39:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 47F5B12DDBA; Thu, 22 Feb 2024 12:38:56 +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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791602771841211381 X-GMAIL-MSGID: 1791602771841211381 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 */