From patchwork Tue Jun 18 14:57:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Caleb Connolly X-Patchwork-Id: 805204 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:144:b0:362:4979:7f74 with SMTP id r4csp239563wrx; Tue, 18 Jun 2024 07:58:45 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCWPIyYB5Rua8midIvA52zookHuRXVP2Z60c2OPaCraAq7Ugkje+UQYOyxinncnE14vGC85Yyb/7XnpjjS5c1yo3 X-Google-Smtp-Source: AGHT+IF7umg352lbq6FSFMIm/cCg+keWWwhvUCVTfdYWrhfgM5shvuCFjciSFJpyo/BvU31Gtk20 X-Received: by 2002:a2e:9e16:0:b0:2ea:e74c:40a2 with SMTP id 38308e7fff4ca-2ec3cec1131mr791401fa.20.1718722725540; Tue, 18 Jun 2024 07:58:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1718722725; cv=none; d=google.com; s=arc-20160816; b=mTHDD04UBY1TT9lJVOrBcG42CEVt88Lm31Sl9hjPEEGyHzwu/k0OwT7ej2HzQxgTGF YJmnVSoEQo/+2YRqSe8oVcnUIGq8xoT7k6XwhvJGyhDn3gSwLG6w0OlVdWW/rzj7AsHr YijvQf8QK1sMFdMgqybS14kFgtznhJLtRWQ6bY+Yh81btmvESzhmgfe6EFtMTp8J+/Wk 34fgJBMBDgfDcBH3GRkYLbN/isGa42MXX9hQYM79AWO4PM2njZB8SiY65TqpMX36tElq xeqFAQ2UBQJAzMvwsasaOFhUvPaRNFHkg1bCGhFVZDTYfIRDVRuOsrjnoGu/uWGd8phK q1Gg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from:dkim-signature; bh=o1K8xV0vnW2i9kLt8X+1mRCYkaqXwgzJer4r36WS63A=; fh=LC+LHDLYEjaonkAbgpuBc7VF35gu8ffssdD8bUy1Yk0=; b=BNnDBZ5vQJcGRye59zCOm9ollDBW+PboV8EnrkjWBcG1Kdtv6AYDJ9Gu1KDW7Lpa47 +9umWiVKMG91wlXJyvp+eDz0XRMpq1T/sRwYUVnbwW/btC1qlV5+9dAFkm1zSGCS34dw 6TnoT9zX9pE+/byLMWjuXGqtnzUpzCBLVTip1fPkxE2Jdc658hQ3WIQWyxeV7XoCMtXY TPB4HnQsU3tlq72XJpxif6DfqdEbUYpHAlbXiE3ploTlhfLqrBxO3o1yJsSg94dUgk+V eRziwn6pamLjZ3dA1tQI4FyuVw6Zqd0WjdGRyoTutUUJY2SfEd6Res8RpgNWY/m59tVv O1Vg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HPULProc; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from phobos.denx.de (phobos.denx.de. [85.214.62.61]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56dd682dsi526398766b.383.2024.06.18.07.58.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:58:45 -0700 (PDT) Received-SPF: pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) client-ip=85.214.62.61; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HPULProc; spf=pass (google.com: domain of u-boot-bounces@lists.denx.de designates 85.214.62.61 as permitted sender) smtp.mailfrom=u-boot-bounces@lists.denx.de; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 5962F88263; Tue, 18 Jun 2024 16:58:43 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="HPULProc"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A51CB88204; Tue, 18 Jun 2024 16:58:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from mail-ed1-x52f.google.com (mail-ed1-x52f.google.com [IPv6:2a00:1450:4864:20::52f]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B9AD98838E for ; Tue, 18 Jun 2024 16:58:38 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=caleb.connolly@linaro.org Received: by mail-ed1-x52f.google.com with SMTP id 4fb4d7f45d1cf-57d0699fd02so34301a12.0 for ; Tue, 18 Jun 2024 07:58:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1718722718; x=1719327518; darn=lists.denx.de; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=o1K8xV0vnW2i9kLt8X+1mRCYkaqXwgzJer4r36WS63A=; b=HPULProcgzsTO/5q+mTx4ltQ52LaICKXxi5+aZCsWA2C7clcSvlF7o5yc9fF8BL2ud zBMVF+mA7ypAiRoJoKyOqiwbzTARyPnxhkiN0Xy25G8bWU8LNE78HcByxYrWruAx0ThX jI1Uneh8WDfvBPSg56UL8H3khv1vd2I5QbNH4RQ4dL9w0L9hnQyc5KfGE8/iwqwLzWxq 9CUcAfQftOwFO1xUcKawHRa4JSO4dYPp1TBAGK2g5f43e301JkJ+nw441Mu+7oFbse9d +zkh70I7w7T1ES0Fy4pnskgYEbnTgSKMBHX89fCRyBMgER05GMSCzNR6pZIjXX/JeGxR Pl7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718722718; x=1719327518; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=o1K8xV0vnW2i9kLt8X+1mRCYkaqXwgzJer4r36WS63A=; b=v/Q5HSX2/SJwlJqnjpcPayLzZ5Pv8Tua3lvd+D0+t6wZKUyweBwKapE9JcGjyPax8S sUuGH5OYZMObg3BXAvUbVh/sTsu3Srj0+ukB1ZUsuNzorqOV0rNIahvV6HqbVGOpsnzZ O/sfeu7PeGb1FJYpRl05nTPE+GaxeopftG8LWNGr0VlFJf+a6LTM5cVCouPRTLeeCWn6 2rSVSUkLXngDs3z/ISR9faXwJNz4xVZc/pZSiAexx5I+NnH7X7ihmqc6f/4IIZSN5ch8 y3ym3jAd4jYmy/Bi7NEk3GLpmQkTgIDNQsYMAm5nG8Dixpk2z5a1IgWCHzEE6yU8a3t1 auzA== X-Gm-Message-State: AOJu0YwPXfAo4pncNb3oobZ2RIbQzHUu92BdD+noICFStAJltV2PEUKh rq1kJBN8D/74H+VeRUDB/w0QeDShlePF8zunnCugFqyVulxqbMRls4uuuDo7tJgVg3ZEJGFMkAN Ml+FFsA== X-Received: by 2002:a50:9ea9:0:b0:57d:669:caf2 with SMTP id 4fb4d7f45d1cf-57d0669cbd3mr137734a12.25.1718722718061; Tue, 18 Jun 2024 07:58:38 -0700 (PDT) Received: from cymric.caleb.rex.connolly.tech ([2a02:8109:aa0d:be00::52af]) by smtp.gmail.com with ESMTPSA id 4fb4d7f45d1cf-57cb72da824sm7831523a12.29.2024.06.18.07.58.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jun 2024 07:58:37 -0700 (PDT) From: Caleb Connolly To: Caleb Connolly , Marek Vasut , Mattijs Korpershoek , Tom Rini Cc: u-boot@lists.denx.de Subject: [PATCH] eth: asix88179: reset during probe Date: Tue, 18 Jun 2024 16:57:57 +0200 Message-ID: <20240618145759.3296876-2-caleb.connolly@linaro.org> X-Mailer: git-send-email 2.45.0 MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean In some cases (consistently in my case with an embedded board) the ethernet controller will time out on the first init but always succeed after reset. Let's reset the controller during probe so we always start with it in a known state, and don't have wait for the first asix_wait_link() to time out. Signed-off-by: Caleb Connolly Reviewed-by: Marek Vasut --- I see this behaviour consistently across three Qualcomm platforms that use this controller. --- drivers/usb/eth/asix88179.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/eth/asix88179.c b/drivers/usb/eth/asix88179.c index 7bfd285b3aa4..a0aa5c25e428 100644 --- a/drivers/usb/eth/asix88179.c +++ b/drivers/usb/eth/asix88179.c @@ -628,8 +628,14 @@ static int ax88179_eth_probe(struct udevice *dev) usb_dev = priv->ueth.pusb_dev; priv->maxpacketsize = usb_dev->epmaxpacketout[AX_ENDPOINT_OUT]; + ret = asix_basic_reset(&priv->ueth, priv); + if (ret) { + printf("Failed to reset ethernet device\n"); + return ret; + } + /* Get the MAC address */ ret = asix_read_mac(&priv->ueth, pdata->enetaddr); if (ret) return ret;