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 A2C28C433EF for ; Fri, 28 Jan 2022 20:15:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A58E837F5; Fri, 28 Jan 2022 21:15:37 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="qW6nB/0J"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 81EC5837E7; Fri, 28 Jan 2022 21:15:36 +0100 (CET) Received: from mail-qv1-xf2b.google.com (mail-qv1-xf2b.google.com [IPv6:2607:f8b0:4864:20::f2b]) (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 60543837B6 for ; Fri, 28 Jan 2022 21:15:31 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2b.google.com with SMTP id b4so2061280qvf.0 for ; Fri, 28 Jan 2022 12:15:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=6QOKksIhGav7CfkYlsOw7Hh4bOyFt/zxD6N6hF23E3g=; b=qW6nB/0JuZIahywpYCmBGANxqEX6eBxndtnEkUhZxDBlQtJGi5xJZCSasmE0wkseOI ejE6XDbmFx2QGOMYp+il7HP7TkY9/hft9PYIoIqsEQAcH7HGa8lRVd/Y6FQFYSEvXiqM 1yF7olfw7cuClq8YmKSkEjLW1vbxCAfjwAlX4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6QOKksIhGav7CfkYlsOw7Hh4bOyFt/zxD6N6hF23E3g=; b=eEAVLfNeBQ+GNXh1G7fN0G1k+yYf6uG/4NNiOGxpi+EEPJRnw9zO6ciyWfSYmxdySE 68cLx8doXhDForsKrzI9pAaMFaGaVicUoRg/ReiPljpHNFMBKjpLmtw8KTsaIyvS/X2p tPZ0o6M7aAXiTK4AxSDO4izZjvAKaVftVqk2PxRHqOcYR1BTOhqBT7Ald6hYquIiYe5a E6pbJ4J9LgNYimCa0mvp3CkmhuiItLyqrWgxBZTEwNfTGR86QS4GawU9N0whnYOFy4UC pzUt4wQ2GOmgD8QabXF14/5QqXzse9toSNKe9UDxX96KoNfAo7m3MjTUzIvrQX6jQz9Q U0+g== X-Gm-Message-State: AOAM530BOS7v/3n6i6oDX4yPej10jVxEo4Q8Zf84WDKM1+2iNEYuasx5 JByadQMgu6O1KRsScTCatuzFyasfSd9zzA== X-Google-Smtp-Source: ABdhPJz3l+2fOf2eX6zTvbxtl8VI7FzdY+pcMNLqC6wWYNRjnGLt2r13UbVEtcepnYdCc6tnbk3o7A== X-Received: by 2002:ad4:5949:: with SMTP id eo9mr8572642qvb.95.1643400930193; Fri, 28 Jan 2022 12:15:30 -0800 (PST) Received: from bill-the-cat (2603-6081-7b01-cbda-2ef0-5dff-fedb-a8ba.res6.spectrum.com. [2603:6081:7b01:cbda:2ef0:5dff:fedb:a8ba]) by smtp.gmail.com with ESMTPSA id d13sm3487898qtx.35.2022.01.28.12.15.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jan 2022 12:15:29 -0800 (PST) Date: Fri, 28 Jan 2022 15:15:28 -0500 From: Tom Rini To: Patrick Delaunay Cc: u-boot@lists.denx.de, Lukasz Majewski , Marek Vasut , U-Boot STM32 Subject: Re: [PATCH] dfu: handle short frame result of UPLOAD in state_dfu_idle Message-ID: <20220128201528.GL7515@bill-the-cat> References: <20211013170053.1.I1158bd6d095c996f2dbd4b0aa9327e4eee202331@changeid> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="3h0UNLyY10zL13pE" Content-Disposition: inline In-Reply-To: <20211013170053.1.I1158bd6d095c996f2dbd4b0aa9327e4eee202331@changeid> X-Clacks-Overhead: GNU Terry Pratchett 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 --3h0UNLyY10zL13pE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Wed, Oct 13, 2021 at 05:01:37PM +0200, Patrick Delaunay wrote: > In DFU v1.1 specification [1] the DFU_UPLOAD (Short Frame) > is handled only in dfuUPLOADIDLE state: >=20 > - Figure A.1 Interface state transition diagram >=20 > - the state description in chapter A.2 >=20 > A.2.3 State 2 dfuIDLE > on Receipt of the DFU_UPLOAD request,and bitCanUpload =3D 1 > the Next State is dfuUPLOADIDLE >=20 > A.2.10 State 9 dfuUPLOAD-IDLE > When the length of the data transferred by the device in response > to a DFU_UPLOAD request is less than wLength. (Short frame) > the Next State is dfuIDLE >=20 > In current code, when an UPLOAD is completely performed after the first > request (for example with wLength=3D200 and data read =3D 9), the DFU sta= te > stay at dfuUPLOADIDLE until receiving a DFU_UPLOAD or a DFU_ABORT request > even it is unnecessary as the previous DFU_UPLOAD request already reached > the EOF. >=20 > This patch proposes to finish the DFU uploading (don't go to dfuUPLOADIDL= E) > and completes the control-read operation (go to DFU_STATE_dfuIDLE) when > the first UPLOAD response has a short frame as an end of file (EOF) > indicator even if it is not explicitly allowed in the DFU specification > but this seems logical. >=20 > [1] https://www.usb.org/sites/default/files/DFU_1.1.pdf >=20 > Signed-off-by: Patrick Delaunay Applied to u-boot/master, thanks! --=20 Tom --3h0UNLyY10zL13pE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmH0Tt8ACgkQFHw5/5Y0 tyyAiwv+Lbun7lMUL/ObifB6e5CicnOQSIEW5k8dri3PAjxgi2IVNJ1G/ooc6wPe /TbxtnW7sfC05J9fc2Egs2rAiybZXmgbXXgOidkaZcTzvToKpOcMaRlyDyt3bEFy s/F8clUoz9ienZ2OnX3imO+sHbt0Pav5hDPXT2HHP9E19XmtTfKXQGX5gOZLFSZW ipLIS0HgbaG08talzN4B7zdwTzL++gFtQ3wmcVcnvJP4GLBUON9vBqnxBF4Q1mSs uE3TCwfm5b7fBTJC1qMfP+a3aBFG1sa0nvJBX+dhH7ZrIrxY1DQUeSadodE9yU7b 0vJECahyNlFh64l8APfwTQUJYexhqOqGG3iLsYtpVOwlKgMPYAgLsZDOZuQt9htv VsiAePHLY91vEEHcsGGIU0qxVHaAuFh53AVdFV9Ffn1OxyJCC/Q+nOT0brRRwQZG qzQQPOPeDRdinGsYBmKCocivHDgV1oGfuwgAlJAEQhdyc/k/d0BW8oGNx5N9YbLE /WChQR6q =ysKS -----END PGP SIGNATURE----- --3h0UNLyY10zL13pE--