From mboxrd@z Thu Jan 1 00:00:00 1970 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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id AB359C433EF for ; Thu, 14 Apr 2022 04:40:08 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AB78883E4D; Thu, 14 Apr 2022 06:40:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com 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=gmail.com header.i=@gmail.com header.b="DNQqTbTj"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 73C3883E73; Thu, 14 Apr 2022 06:40:03 +0200 (CEST) Received: from mail-oi1-x232.google.com (mail-oi1-x232.google.com [IPv6:2607:f8b0:4864:20::232]) (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 08EB383CC6 for ; Thu, 14 Apr 2022 06:40:00 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=rfried.dev@gmail.com Received: by mail-oi1-x232.google.com with SMTP id b188so4212202oia.13 for ; Wed, 13 Apr 2022 21:39:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=5zYsWY3MPTrvzZcmw2Wv3KqAmq0cC1qOFF8ao/E26W4=; b=DNQqTbTjNhgpD1JXLuBvcle4Rx31F+ynuV7LqOqp8Y6vryBGyz1buamsCTWgdUDME+ SIYiqaZ+NbYcJMY9l8VMxe5bLWruUIa8liyKfd7dv5gyaeacfTXtUNpdSPkDiJgL9GYn Y7UZfk595eDgeMjyZNHBthZ+QZ+itwoo/FEXl5kD/vzjQJVbmX7jQRbgFBTdHdBU2N05 XP3RbYKTqDXdCwl/+0DPSvdjYXR4kMTfUWiPCwIWVzSKzabsMGq6Mspb3h5dHaEkyZd5 Ns9HBFgngIjj3tM7XhrfZ4paquU4kLfPuPN3dDMs1OkKVTvPHvWWXUifn3PnrfeoVYL4 7t9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5zYsWY3MPTrvzZcmw2Wv3KqAmq0cC1qOFF8ao/E26W4=; b=hYUUXsrHanXvMNP+OnDhu8kiI2KIkPtyEvukja1IsW3G/auO+l2RL2hXs4Z7pw6HLu u53Zv89dRxBlJsZ+fnrlTehsghbzF63apGhWcxaulMK19OROuF1yPCUhYSbyG0x4jWPw wBfLTW/3fXBfD2a4VHa3/1M4v75ermS4yob/OBwc90OvO714HB0BcmXqwXVbjNmQUIl6 O5aNgyu18LZsgcsgCF7zigN8iLPbHh04CdSk9vuuRhvMgtdri+V4UyDaEusjlzZNtDaK GptOiGVAvcD84y60Q4HPQocLDnJXoh8Q39dNrL4JGMxdLfl7wAJQAbQmxlTK18/z9ZDz FyCA== X-Gm-Message-State: AOAM532wXxrodvCUNgFH97BOQbZTTxQiVjc4Z7VJNQlWsLhG3m/03hYm nwTgDZuJifeTAg0Igg2Y1Segsic4R2Dx+wrcZdk= X-Google-Smtp-Source: ABdhPJzQ0qnRekZnmHdObmeK9ZyvyJW+0V/ipRwRP9mLnKujE31fBRV0OWqGW9QQw48Z6jpNpCS4ndNsY1c9SzDq0Zg= X-Received: by 2002:aca:3e41:0:b0:2ec:f51d:946 with SMTP id l62-20020aca3e41000000b002ecf51d0946mr914988oia.138.1649911198479; Wed, 13 Apr 2022 21:39:58 -0700 (PDT) MIME-Version: 1.0 References: <20220402025836.19374-1-qianfanguijin@163.com> <20220402025836.19374-2-qianfanguijin@163.com> In-Reply-To: <20220402025836.19374-2-qianfanguijin@163.com> From: Ramon Fried Date: Thu, 14 Apr 2022 07:39:47 +0300 Message-ID: Subject: Re: [PATCH v2 2/2] net: eth-uclass: Fix data abort when tftp get nonexistent file via usb To: qianfan Cc: U-Boot Mailing List , Joe Hershberger , Matthias Schiffer , Heinrich Schuchardt Content-Type: text/plain; charset="UTF-8" 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.5 at phobos.denx.de X-Virus-Status: Clean On Sat, Apr 2, 2022 at 5:58 AM wrote: > > From: qianfan Zhao > > tftp_handler do eth_halt when TFTP_ERROR, but eth_halt will remove eth > device if it is an usb network. usbeth's private data will be unaccessable > when usb_eth_free_pkt, touch it will trigger data abort. > > Next is the console messages: > > => tftp xxx > ... > Loading: * > TFTP error: 'open failed: No such file or directory' (1) > Not retrying... > data abort > pc : [<9feb6ba2>] lr : [<9feb6b9f>] > > Fix it. > > Signed-off-by: qianfan Zhao > --- > net/eth-uclass.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/net/eth-uclass.c b/net/eth-uclass.c > index 2b88b6c145..c9bba4f8de 100644 > --- a/net/eth-uclass.c > +++ b/net/eth-uclass.c > @@ -407,6 +407,13 @@ int eth_rx(void) > flags = 0; > if (ret > 0) > net_process_received_packet(packet, ret); > + > + /* ethernet maybe halted when packet_handler, check again */ > + if (!eth_is_active(current)) { > + ret = 0; > + break; > + } > + > if (ret >= 0 && eth_get_ops(current)->free_pkt) > eth_get_ops(current)->free_pkt(current, packet, ret); > if (ret <= 0) > -- > 2.17.1 > I wonder how I never experienced this behavior. I have used USB based ethernet dongles. And I used tftp and got errors but never an abort .Is it possible that the problem is with the specific ethernet driver you are using ? Can you specify which one you used ?