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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9D64C433EF for ; Fri, 5 Nov 2021 13:29:22 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id 00F1161101 for ; Fri, 5 Nov 2021 13:29:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 00F1161101 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 6195F8332B; Fri, 5 Nov 2021 14:29:19 +0100 (CET) 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="iNvZJehe"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 503E78332B; Fri, 5 Nov 2021 14:29:17 +0100 (CET) Received: from mail-qv1-xf34.google.com (mail-qv1-xf34.google.com [IPv6:2607:f8b0:4864:20::f34]) (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 0DC74834CF for ; Fri, 5 Nov 2021 14:29:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=seanga2@gmail.com Received: by mail-qv1-xf34.google.com with SMTP id s9so7302452qvk.12 for ; Fri, 05 Nov 2021 06:29:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=oQtEYRV9+2LJl5+jWfY8qCnThxuNvF6TTdX/WgprUkk=; b=iNvZJeheo32UwG1LJhhjhW8IffrRhq4AcIKSiHyniQERxbxbTr9jA4RN4qJvJqjgi8 ksxEVysM59fHdFoNO2YFxOBpCrFz/gY6HeDZqzmmcR/tMmIzAGNOJcOLqkttxlIqTwhx 6AkwZq6fRNWFgM58U1T9Yz7ThWIWKDAS5uRwARj2yenYGh79GsH68sgtXbIS1M6KvEjA v7fs9VHE4o2gAStbUybtj6WMi5+12B+Zj6xNj4IVHjne++xAmKVROUg13UJqIfLSnoMX hIHDDhbfXDA/0MY/zuASMpiLCh/zEDqrTTW1z+LkxniiZeKmBw+RwmRbUS5Og7hLL4IX TZZg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=oQtEYRV9+2LJl5+jWfY8qCnThxuNvF6TTdX/WgprUkk=; b=DEHZX152wMET7+r9vaAQDH0AjxM1mw2tSByGF5urKS7TV6b9BDm6NGISYKJvdcNJTP Lrjfge7ccch/ubZxAVCNDzSteMoOZm7BqEcfcI0kD+pK9vQz3PiV2TZVs6siAsAWC05s esAjMZ+/dmIOtjKzsQCVNlM7psDaxt+JiHpO3mChLekVoM5cG3LcyIwccPIIU4hoIPeu 89+/HX/cbmAMxl1BpAxZeBfAC6gvMI35F37YZEgtKu6vnhX/3EP8dKyajESZTqTGr6Cw MRbvS6gW1T7l32tTaLbxI8Zm2bBzgdelbL387fgUJYzA3TI5nYSRa3Ku+F1Nu/EANXS1 Od8w== X-Gm-Message-State: AOAM530SUo9sN5qOXRxjHRUaZGpLSGALwmQbez9QYLxztkg7kYCQKf7E gFEFQoodKPe619o3Ejmtr6Q= X-Google-Smtp-Source: ABdhPJyAIlbnpV+RTxJhqdqQg/NPMR8Z3Nr4ZBsRry8H12NCUjk+85o4qQa7Z00seKYPmS70dTzF+w== X-Received: by 2002:ad4:5422:: with SMTP id g2mr53219690qvt.19.1636118946669; Fri, 05 Nov 2021 06:29:06 -0700 (PDT) Received: from [192.168.1.201] (pool-108-18-207-184.washdc.fios.verizon.net. [108.18.207.184]) by smtp.googlemail.com with ESMTPSA id y6sm5657014qkp.116.2021.11.05.06.29.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 05 Nov 2021 06:29:06 -0700 (PDT) Subject: Re: [PATCH] driver: gadget: fastboot: Link endpoint and descriptors To: qianfan , u-boot@lists.denx.de Cc: lukma@denx.de, marex@denx.de, peter.chen@nxp.com, jun.li@nxp.com, peng.fan@nxp.com References: From: Sean Anderson Message-ID: <7fd52fb3-f312-4e03-abb4-9ec4100bbfd7@gmail.com> Date: Fri, 5 Nov 2021 09:29:05 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: quoted-printable X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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.2 at phobos.denx.de X-Virus-Status: Clean On 11/5/21 2:28 AM, qianfan wrote: > =E5=9C=A8 2021/11/4 0:53, Sean Anderson =E5=86=99=E9=81=93: >=20 >> On 9/16/21 3:02 AM, qianfanguijin@163.com wrote: >>> From: qianfan Zhao >>> >>> If the downloading file size is equal to the partition size, "fastboo= t >>> flash" can't work, at least in sunxi platform, because used an >>> uninitalized point: ep->desc. >> >> Hm, I think that usb_ep_ops->enable needs to set ep->desc =3D desc on = success. >> >> Of the existing drivers, only musb-new and mtu3 skip this. >=20 > I checked the udc driver and found that not all the udc driver set "ep-= >desc =3D desc", such as atmel_usba_udc, dwc2_udc_otg, musb-new and mtu3.= Those drivers save "desc" to bsp driver's private data only, such as "ms= ub_ep->desc =3D desc", but the common usb_ep's desc is an invalid point. >=20 > And I'm not find any documents declare the behaves how usb_ep_ops->enab= le did, save desc or not.=C2=A0 So I'd prefect save desc in the fastboot = level, and the udc driver can also save desc again if they want. This idiom is also present in f_thor.c, f_rockusb.c, and f_mass_storage.c= Given that a majority of otg implementations set this, I think the other = should be changed to match. --Sean