[{"id":1764721,"web_url":"http://patchwork.ozlabs.org/comment/1764721/","msgid":"<82c87718-7ae1-c30e-0587-220686b4efff@denx.de>","list_archive_url":null,"date":"2017-09-07T13:22:40","subject":"Re: [U-Boot] [PATCH 5/5] dm: usb: storage: Fix broken read/write\n\twhen both EHCD and xHCD are enabled","submitter":{"id":13,"url":"http://patchwork.ozlabs.org/api/people/13/","name":"Stefan Roese","email":"sr@denx.de"},"content":"On 07.09.2017 15:13, Bin Meng wrote:\n> When EHCD and xHCD are enabled at the same time, USB storage device\n> driver will fail to read/write from/to the storage device attached\n> to the xHCI interface, due to its transfer blocks exceeds the xHCD\n> driver limitation.\n> \n> With driver model, we have an API to get the controller's maximum\n> transfer size and we can use that to determine the storage driver's\n> capability of read/write.\n> \n> Note: the non-DM version driver is still broken with xHCD and the\n> intent here is not to fix the non-DM one, since the xHCD itself is\n> already broken in places like 3.0 hub support, etc.\n> \n> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n\nTested-by: Stefan Roese <sr@denx.de>\n\nThanks,\nStefan","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3xp1Q8264xz9sNd\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 23:24:32 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid E2E1DC21EE9; Thu,  7 Sep 2017 13:23:38 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 985B7C21DAC;\n\tThu,  7 Sep 2017 13:23:36 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 3404AC21E28; Thu,  7 Sep 2017 13:22:53 +0000 (UTC)","from mx1.mailbox.org (mx1.mailbox.org [80.241.60.212])\n\tby lists.denx.de (Postfix) with ESMTPS id A2F28C21EB4\n\tfor <u-boot@lists.denx.de>; Thu,  7 Sep 2017 13:22:53 +0000 (UTC)","from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mx1.mailbox.org (Postfix) with ESMTPS id 6663F4388F;\n\tThu,  7 Sep 2017 15:22:53 +0200 (CEST)","from smtp1.mailbox.org ([80.241.60.240])\n\tby spamfilter01.heinlein-hosting.de (spamfilter01.heinlein-hosting.de\n\t[80.241.56.115]) (amavisd-new, port 10030)\n\twith ESMTP id 2rchXgUfNq9E; Thu,  7 Sep 2017 15:22:41 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW\n\tautolearn=unavailable autolearn_force=no version=3.4.0","X-Virus-Scanned":"amavisd-new at heinlein-support.de","To":"Bin Meng <bmeng.cn@gmail.com>, Marek Vasut <marex@denx.de>,\n\tMasahiro Yamada <yamada.masahiro@socionext.com>,\n\tSimon Glass <sjg@chromium.org>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","References":"<1504790001-24715-1-git-send-email-bmeng.cn@gmail.com>\n\t<1504790001-24715-5-git-send-email-bmeng.cn@gmail.com>","From":"Stefan Roese <sr@denx.de>","Message-ID":"<82c87718-7ae1-c30e-0587-220686b4efff@denx.de>","Date":"Thu, 7 Sep 2017 15:22:40 +0200","MIME-Version":"1.0","In-Reply-To":"<1504790001-24715-5-git-send-email-bmeng.cn@gmail.com>","Content-Language":"en-US","Subject":"Re: [U-Boot] [PATCH 5/5] dm: usb: storage: Fix broken read/write\n\twhen both EHCD and xHCD are enabled","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Transfer-Encoding":"base64","Content-Type":"text/plain; charset=\"utf-8\"; Format=\"flowed\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1776474,"web_url":"http://patchwork.ozlabs.org/comment/1776474/","msgid":"<20170927163443.GY3112@bill-the-cat>","list_archive_url":null,"date":"2017-09-27T16:34:43","subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Thu, Sep 07, 2017 at 06:13:21AM -0700, Bin Meng wrote:\n\n> When EHCD and xHCD are enabled at the same time, USB storage device\n> driver will fail to read/write from/to the storage device attached\n> to the xHCI interface, due to its transfer blocks exceeds the xHCD\n> driver limitation.\n> \n> With driver model, we have an API to get the controller's maximum\n> transfer size and we can use that to determine the storage driver's\n> capability of read/write.\n> \n> Note: the non-DM version driver is still broken with xHCD and the\n> intent here is not to fix the non-DM one, since the xHCD itself is\n> already broken in places like 3.0 hub support, etc.\n> \n> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n> Tested-by: Stefan Roese <sr@denx.de>\n[snip]\n> @@ -953,6 +957,17 @@ static void usb_stor_set_max_xfer_blk(struct us_data *us)\n>  #else\n>  \tblk = 20;\n>  #endif\n> +#else\n> +\tret = usb_get_max_xfer_size(udev, (size_t *)&size);\n> +\tif (ret < 0) {\n> +\t\t/* unimplemented, let's use default 20 */\n> +\t\tblk = 20;\n> +\t} else {\n> +\t\tif (size > USHRT_MAX * 512)\n> +\t\t\tblk = USHRT_MAX;\n> +\t\tblk = size / 512;\n> +\t}\n> +#endif\n\nSo, Coverity saw this and found an issue (CID 167250), and I was going\nto just fix it, but I'm not sure.  The problem is that we check size >\n(USHRT_MAX * 512), and then assign blk.  Then, we always assign blk, so\nthe test above isn't used.  But my background recollection is that\nthere's a real issue that's being addressed here.  Can we really just\nalways say blk = size / 512 in this case, or did we want to be shifting\nsize not blk under the if?  Thanks!","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=konsulko.com header.i=@konsulko.com\n\theader.b=\"Km/g6nHJ\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2Nhm0QrXz9tXF\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 02:35:04 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid A53E4C21E9C; Wed, 27 Sep 2017 16:34:48 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 35E22C21DA2;\n\tWed, 27 Sep 2017 16:34:45 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 005E1C21DA2; Wed, 27 Sep 2017 16:34:43 +0000 (UTC)","from mail-yw0-f170.google.com (mail-yw0-f170.google.com\n\t[209.85.161.170])\n\tby lists.denx.de (Postfix) with ESMTPS id 4EE97C21D5B\n\tfor <u-boot@lists.denx.de>; Wed, 27 Sep 2017 16:34:43 +0000 (UTC)","by mail-yw0-f170.google.com with SMTP id v72so9702191ywa.3\n\tfor <u-boot@lists.denx.de>; Wed, 27 Sep 2017 09:34:43 -0700 (PDT)","from bill-the-cat ([2606:a000:1401:811b:a523:8806:2b32:ed54])\n\tby smtp.gmail.com with ESMTPSA id\n\tg73sm4753335ywb.4.2017.09.27.09.34.40\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 27 Sep 2017 09:34:41 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com;\n\ts=google; \n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=FGbdpOMLIsd0N4qYPM1H0A8dyMG7AkhQX0I359TIdPw=;\n\tb=Km/g6nHJztP5eMo/d61KmwF6Z2cV2//lXiCsHnwvBPxRVH5WO0WY/srqGsf9tlMaj7\n\t+C/EkufchRvH6PSMenfJ/zamz+DJ7jHQvtk9j5nLzuy/ieB1d1+yTCdd8OJq8cDNGo/U\n\tm6CMELBPT0aZhosk0jX7OMRENWXOZgi4wbErE=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=FGbdpOMLIsd0N4qYPM1H0A8dyMG7AkhQX0I359TIdPw=;\n\tb=WBzDsC/K4M+XlvWE865CFkCDKjp8au3YvEf8VjxrCqRv19gvZBIbevlHs2F98TvpPv\n\tTaQLStjEF4f/EQ6V0K3uiMOcAaBfRDKIsDlD3FlUD1s+jd2AnDNGQWiUTxNFtCE4XKHn\n\tQ9dwIeqRkPMS8A7SNYlC/LIRheyZFNzpw3zFP7qR7AyB+Tz4vMJ8oLOB4BWzXCioMRjd\n\t9yCy6VUHNWAVIwPEaWCo1/fSweeUj14MpxUmftp35qzmObei0VvbpOxTu5Azn88UyGxQ\n\t2kz+3o2elx20IFfwK1OYu5cssLsacpAvikEDcFRu0HWrOcEGXhXId2b+LZLpHgbdXQ9N\n\tyz6Q==","X-Gm-Message-State":"AHPjjUgiYDpnErGOEpHbgmO0qFobJ76QjRJEkqWmnw8b0sfuxNRe1afI\n\t5xOtocDJeuCdpv+slJ0g1yn2mg==","X-Google-Smtp-Source":"AOwi7QCUgCa8kiortSy7nFDP4Uiki+59jbfMkxfHJYr1bEdTUUm8WndrAEjg18n2cwh0KystHrsQHg==","X-Received":"by 10.37.97.84 with SMTP id v81mr1360679ybb.29.1506530082126;\n\tWed, 27 Sep 2017 09:34:42 -0700 (PDT)","Date":"Wed, 27 Sep 2017 12:34:43 -0400","From":"Tom Rini <trini@konsulko.com>","To":"Bin Meng <bmeng.cn@gmail.com>","Message-ID":"<20170927163443.GY3112@bill-the-cat>","References":"<1504790001-24715-5-git-send-email-bmeng.cn@gmail.com>","MIME-Version":"1.0","In-Reply-To":"<1504790001-24715-5-git-send-email-bmeng.cn@gmail.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Cc":"Marek Vasut <marex@denx.de>, Stefan Roese <sr@denx.de>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"multipart/mixed;\n\tboundary=\"===============7860396211840232814==\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1776714,"web_url":"http://patchwork.ozlabs.org/comment/1776714/","msgid":"<CAEUhbmVgB0azrgHov2rEcLdZ1bGdwyk1E5YG5irEsb6QXRZ1tw@mail.gmail.com>","list_archive_url":null,"date":"2017-09-28T01:34:23","subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","submitter":{"id":64981,"url":"http://patchwork.ozlabs.org/api/people/64981/","name":"Bin Meng","email":"bmeng.cn@gmail.com"},"content":"Hi Tom,\n\nOn Thu, Sep 28, 2017 at 12:34 AM, Tom Rini <trini@konsulko.com> wrote:\n> On Thu, Sep 07, 2017 at 06:13:21AM -0700, Bin Meng wrote:\n>\n>> When EHCD and xHCD are enabled at the same time, USB storage device\n>> driver will fail to read/write from/to the storage device attached\n>> to the xHCI interface, due to its transfer blocks exceeds the xHCD\n>> driver limitation.\n>>\n>> With driver model, we have an API to get the controller's maximum\n>> transfer size and we can use that to determine the storage driver's\n>> capability of read/write.\n>>\n>> Note: the non-DM version driver is still broken with xHCD and the\n>> intent here is not to fix the non-DM one, since the xHCD itself is\n>> already broken in places like 3.0 hub support, etc.\n>>\n>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n>> Tested-by: Stefan Roese <sr@denx.de>\n> [snip]\n>> @@ -953,6 +957,17 @@ static void usb_stor_set_max_xfer_blk(struct us_data *us)\n>>  #else\n>>       blk = 20;\n>>  #endif\n>> +#else\n>> +     ret = usb_get_max_xfer_size(udev, (size_t *)&size);\n>> +     if (ret < 0) {\n>> +             /* unimplemented, let's use default 20 */\n>> +             blk = 20;\n>> +     } else {\n>> +             if (size > USHRT_MAX * 512)\n>> +                     blk = USHRT_MAX;\n>> +             blk = size / 512;\n>> +     }\n>> +#endif\n>\n> So, Coverity saw this and found an issue (CID 167250), and I was going\n> to just fix it, but I'm not sure.  The problem is that we check size >\n> (USHRT_MAX * 512), and then assign blk.  Then, we always assign blk, so\n> the test above isn't used.  But my background recollection is that\n> there's a real issue that's being addressed here.  Can we really just\n> always say blk = size / 512 in this case, or did we want to be shifting\n> size not blk under the if?  Thanks!\n\nDid this patch applied to anywhere? I see it is in the usb tree, but\nnot in the u-boot/master.\n\nThe fix should be:\n\n             if (size > USHRT_MAX * 512)\n                     size = USHRT_MAX * 512;\n\nRegards,\nBin","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (2048-bit key;\n\tunprotected) header.d=gmail.com header.i=@gmail.com\n\theader.b=\"JHKPggGg\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2cgP3cHXz9t66\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 11:34:40 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid D173CC21D64; Thu, 28 Sep 2017 01:34:28 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id AC0E2C21C4A;\n\tThu, 28 Sep 2017 01:34:25 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 8ED32C21C4A; Thu, 28 Sep 2017 01:34:24 +0000 (UTC)","from mail-wr0-f193.google.com (mail-wr0-f193.google.com\n\t[209.85.128.193])\n\tby lists.denx.de (Postfix) with ESMTPS id 2DFACC21C40\n\tfor <u-boot@lists.denx.de>; Thu, 28 Sep 2017 01:34:24 +0000 (UTC)","by mail-wr0-f193.google.com with SMTP id p37so82009wrb.5\n\tfor <u-boot@lists.denx.de>; Wed, 27 Sep 2017 18:34:24 -0700 (PDT)","by 10.223.145.3 with HTTP; Wed, 27 Sep 2017 18:34:23 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=0.0 required=5.0 tests=FREEMAIL_FROM,\n\tRCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;\n\th=mime-version:in-reply-to:references:from:date:message-id:subject:to\n\t:cc; bh=scoEp9Wpr0zgjYbCTlQbWuohiybePv9yXDjNJ4F7f38=;\n\tb=JHKPggGgo3/Pbk2OIDt24K/D9F/8CMJ3p+HO8xo6StuaJsDdqQY7RSQvzYHDMXvVGb\n\t8RExDyZ7KM5Lof7UFGlV3qWPM3zQQcpZjMc/YTcDjmVvkeIJBvvUufv0n2OMWGy7xHj5\n\ti4blWfKNfMyDxno4mJ+Q25Ekr5BJ6su3L/UXDfx0ewp6oYuVY+tuJCiAWKxylJl6Ttg4\n\tvGVCJrnwDUsSgMKul21mCb8+zc9SMHHDkWlAhA65pgsVXT4WVoB5UEnjeiTu0rgLtntd\n\tVfjZncl/Xyst/xiijRB1DgTb1OhkmbhRrvheKoGlkii+QmPtITJet7FioV8OWJUPqkjf\n\tFMbg==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc;\n\tbh=scoEp9Wpr0zgjYbCTlQbWuohiybePv9yXDjNJ4F7f38=;\n\tb=T/awSPZaH6rMrsKU7lYD+rrF1nNPSpAeB8dtYpj469jejusGbi6NsqFMeuUKZsPALP\n\tQju+yUiCI079G08s+HFlYf8k1LXGO9h/FyXBRuw0KLeBXmsjYJPG3Y5NZyhc/NbNbO+p\n\tpVadQpQ8Es7Ft47IniI1LOECxZdm4AlZqPA4EpQlgi/wHMdICGyPk8N6GGu2lIt+WA4+\n\t2J4FqzkXtEANaG/zjHHbFNLKxrlCrCY9F10ACQALZxKM/Lpx1dE992dT6CPcoAvFLbJz\n\tO7W0UzX2GlhAMoJ3Z2e1NOGz1gWwhhfz64BJsezJb0U4qeJE0ZXukXSCb2MrdvtuykjZ\n\tBnDA==","X-Gm-Message-State":"AHPjjUiIK/6KldSbpbXO/ZUFDL5TggulQU8sHKTR8yJUPXayS0p/K7U2\n\tudeWQIlul5B0jqqECUL2ZC8Lzt+v7Xi9vRgwsyU=","X-Google-Smtp-Source":"AOwi7QD00DLQkVPSHM7Q4dl6mjymR6vbYfqOijMRjcYCXEcPFTP/p4SgXuHUs/XAK6pp1PvtaQw+XO7zZiMiy51Bkew=","X-Received":"by 10.223.176.46 with SMTP id f43mr3191743wra.206.1506562463793; \n\tWed, 27 Sep 2017 18:34:23 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<20170927163443.GY3112@bill-the-cat>","References":"<1504790001-24715-5-git-send-email-bmeng.cn@gmail.com>\n\t<20170927163443.GY3112@bill-the-cat>","From":"Bin Meng <bmeng.cn@gmail.com>","Date":"Thu, 28 Sep 2017 09:34:23 +0800","Message-ID":"<CAEUhbmVgB0azrgHov2rEcLdZ1bGdwyk1E5YG5irEsb6QXRZ1tw@mail.gmail.com>","To":"Tom Rini <trini@konsulko.com>","Cc":"Marek Vasut <marex@denx.de>, Stefan Roese <sr@denx.de>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1776715,"web_url":"http://patchwork.ozlabs.org/comment/1776715/","msgid":"<20170928013951.GG3112@bill-the-cat>","list_archive_url":null,"date":"2017-09-28T01:39:51","subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Thu, Sep 28, 2017 at 09:34:23AM +0800, Bin Meng wrote:\n> Hi Tom,\n> \n> On Thu, Sep 28, 2017 at 12:34 AM, Tom Rini <trini@konsulko.com> wrote:\n> > On Thu, Sep 07, 2017 at 06:13:21AM -0700, Bin Meng wrote:\n> >\n> >> When EHCD and xHCD are enabled at the same time, USB storage device\n> >> driver will fail to read/write from/to the storage device attached\n> >> to the xHCI interface, due to its transfer blocks exceeds the xHCD\n> >> driver limitation.\n> >>\n> >> With driver model, we have an API to get the controller's maximum\n> >> transfer size and we can use that to determine the storage driver's\n> >> capability of read/write.\n> >>\n> >> Note: the non-DM version driver is still broken with xHCD and the\n> >> intent here is not to fix the non-DM one, since the xHCD itself is\n> >> already broken in places like 3.0 hub support, etc.\n> >>\n> >> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n> >> Tested-by: Stefan Roese <sr@denx.de>\n> > [snip]\n> >> @@ -953,6 +957,17 @@ static void usb_stor_set_max_xfer_blk(struct us_data *us)\n> >>  #else\n> >>       blk = 20;\n> >>  #endif\n> >> +#else\n> >> +     ret = usb_get_max_xfer_size(udev, (size_t *)&size);\n> >> +     if (ret < 0) {\n> >> +             /* unimplemented, let's use default 20 */\n> >> +             blk = 20;\n> >> +     } else {\n> >> +             if (size > USHRT_MAX * 512)\n> >> +                     blk = USHRT_MAX;\n> >> +             blk = size / 512;\n> >> +     }\n> >> +#endif\n> >\n> > So, Coverity saw this and found an issue (CID 167250), and I was going\n> > to just fix it, but I'm not sure.  The problem is that we check size >\n> > (USHRT_MAX * 512), and then assign blk.  Then, we always assign blk, so\n> > the test above isn't used.  But my background recollection is that\n> > there's a real issue that's being addressed here.  Can we really just\n> > always say blk = size / 512 in this case, or did we want to be shifting\n> > size not blk under the if?  Thanks!\n> \n> Did this patch applied to anywhere? I see it is in the usb tree, but\n> not in the u-boot/master.\n> \n> The fix should be:\n> \n>              if (size > USHRT_MAX * 512)\n>                      size = USHRT_MAX * 512;\n\nIt's in usb/master, and will be in master itself shortly.  Please submit\na patch that corrects this and has the Reported-by for Coverity.  Marek,\ndo you want to take it via your tree or should I just grab it?  Thanks!","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=konsulko.com header.i=@konsulko.com\n\theader.b=\"c6xfRrHb\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2cnZ62Nfz9t66\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 11:40:02 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 7D7A2C21D63; Thu, 28 Sep 2017 01:39:55 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id B15FCC21C51;\n\tThu, 28 Sep 2017 01:39:52 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 15C17C21C51; Thu, 28 Sep 2017 01:39:50 +0000 (UTC)","from mail-yw0-f182.google.com (mail-yw0-f182.google.com\n\t[209.85.161.182])\n\tby lists.denx.de (Postfix) with ESMTPS id 6D2D8C21C4A\n\tfor <u-boot@lists.denx.de>; Thu, 28 Sep 2017 01:39:50 +0000 (UTC)","by mail-yw0-f182.google.com with SMTP id i6so44762ywc.9\n\tfor <u-boot@lists.denx.de>; Wed, 27 Sep 2017 18:39:50 -0700 (PDT)","from bill-the-cat ([2606:a000:1401:811b:a523:8806:2b32:ed54])\n\tby smtp.gmail.com with ESMTPSA id\n\tk129sm164238ywd.16.2017.09.27.18.39.47\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 27 Sep 2017 18:39:48 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com;\n\ts=google; \n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=Q4YulROhX/MRXr8T5VPJdsSZzYsqz5nCkmhrU5XjK2w=;\n\tb=c6xfRrHb2NALjlrWQhScSeVdfrdoGBbLL3cxPRJDTN0PSEX3uALo3fgpBDnbQf4U1/\n\t8NLE1N825GCGr0UUWczQuFNqbLv3CnHdzSw+CmEWy1imOTPbvtZa/9NGcwcXzycqtBiX\n\tSf+vxjNHSNVCln1ELAbu77IQuSLOwUq2/VQa0=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=Q4YulROhX/MRXr8T5VPJdsSZzYsqz5nCkmhrU5XjK2w=;\n\tb=GTLu6WQuSpDEFo3NIDwY0SlvbJoode8K4M4KPmEONGuvhoA4Kdy1VdyDTsQyxnHMpS\n\tUG7PVshgwRnidQbD3CCaHFzsBmuCSJCMUwB6ZWu0+osdcNj+XbtD5d4UkVLonG7PFTN8\n\tnJAMWAYNe9YtsY9fuyvsrIG2eJQ+iD670uQVLKaKYO6vvqfiRv0jDwcC4hfXU5/X25Mu\n\tRAFZw98XgC/RBSBU8W4lcRTh4tvEKCJyugI4eYv0RBgdGsIrWckl9eg0WIHdXan4ygDu\n\t/kppQSFRu/TESWaA41LocOA4M89CwA8NW5DSwEIfk2BTG1/Ii/W/0vI1c3EswGa4UlZX\n\tuPdw==","X-Gm-Message-State":"AHPjjUigYU4eMatLyfcJF/6IMn/klZRgWaM78jOkoeNbMQzZD0o6wHjR\n\tjZPTo+AcSrixUS+f43laCqPCQA==","X-Google-Smtp-Source":"AOwi7QAZgz6EU70bRkl24/4uccSDI5NrI3rEAqfm3bW45U94jlpsk4/kBgD2bUHm4jfhUdbkfO7BsA==","X-Received":"by 10.37.81.68 with SMTP id f65mr2379831ybb.278.1506562788965;\n\tWed, 27 Sep 2017 18:39:48 -0700 (PDT)","Date":"Wed, 27 Sep 2017 21:39:51 -0400","From":"Tom Rini <trini@konsulko.com>","To":"Bin Meng <bmeng.cn@gmail.com>","Message-ID":"<20170928013951.GG3112@bill-the-cat>","References":"<1504790001-24715-5-git-send-email-bmeng.cn@gmail.com>\n\t<20170927163443.GY3112@bill-the-cat>\n\t<CAEUhbmVgB0azrgHov2rEcLdZ1bGdwyk1E5YG5irEsb6QXRZ1tw@mail.gmail.com>","MIME-Version":"1.0","In-Reply-To":"<CAEUhbmVgB0azrgHov2rEcLdZ1bGdwyk1E5YG5irEsb6QXRZ1tw@mail.gmail.com>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Cc":"Marek Vasut <marex@denx.de>, Stefan Roese <sr@denx.de>,\n\tU-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"multipart/mixed;\n\tboundary=\"===============1387146648939840011==\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1776717,"web_url":"http://patchwork.ozlabs.org/comment/1776717/","msgid":"<52927408-0df3-4620-e8d2-44aace9af755@denx.de>","list_archive_url":null,"date":"2017-09-28T01:55:24","subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","submitter":{"id":12009,"url":"http://patchwork.ozlabs.org/api/people/12009/","name":"Marek Vasut","email":"marex@denx.de"},"content":"On 09/28/2017 03:39 AM, Tom Rini wrote:\n> On Thu, Sep 28, 2017 at 09:34:23AM +0800, Bin Meng wrote:\n>> Hi Tom,\n>>\n>> On Thu, Sep 28, 2017 at 12:34 AM, Tom Rini <trini@konsulko.com> wrote:\n>>> On Thu, Sep 07, 2017 at 06:13:21AM -0700, Bin Meng wrote:\n>>>\n>>>> When EHCD and xHCD are enabled at the same time, USB storage device\n>>>> driver will fail to read/write from/to the storage device attached\n>>>> to the xHCI interface, due to its transfer blocks exceeds the xHCD\n>>>> driver limitation.\n>>>>\n>>>> With driver model, we have an API to get the controller's maximum\n>>>> transfer size and we can use that to determine the storage driver's\n>>>> capability of read/write.\n>>>>\n>>>> Note: the non-DM version driver is still broken with xHCD and the\n>>>> intent here is not to fix the non-DM one, since the xHCD itself is\n>>>> already broken in places like 3.0 hub support, etc.\n>>>>\n>>>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n>>>> Tested-by: Stefan Roese <sr@denx.de>\n>>> [snip]\n>>>> @@ -953,6 +957,17 @@ static void usb_stor_set_max_xfer_blk(struct us_data *us)\n>>>>  #else\n>>>>       blk = 20;\n>>>>  #endif\n>>>> +#else\n>>>> +     ret = usb_get_max_xfer_size(udev, (size_t *)&size);\n>>>> +     if (ret < 0) {\n>>>> +             /* unimplemented, let's use default 20 */\n>>>> +             blk = 20;\n>>>> +     } else {\n>>>> +             if (size > USHRT_MAX * 512)\n>>>> +                     blk = USHRT_MAX;\n>>>> +             blk = size / 512;\n>>>> +     }\n>>>> +#endif\n>>>\n>>> So, Coverity saw this and found an issue (CID 167250), and I was going\n>>> to just fix it, but I'm not sure.  The problem is that we check size >\n>>> (USHRT_MAX * 512), and then assign blk.  Then, we always assign blk, so\n>>> the test above isn't used.  But my background recollection is that\n>>> there's a real issue that's being addressed here.  Can we really just\n>>> always say blk = size / 512 in this case, or did we want to be shifting\n>>> size not blk under the if?  Thanks!\n>>\n>> Did this patch applied to anywhere? I see it is in the usb tree, but\n>> not in the u-boot/master.\n>>\n>> The fix should be:\n>>\n>>              if (size > USHRT_MAX * 512)\n>>                      size = USHRT_MAX * 512;\n> \n> It's in usb/master, and will be in master itself shortly.  Please submit\n> a patch that corrects this and has the Reported-by for Coverity.  Marek,\n> do you want to take it via your tree or should I just grab it?  Thanks!\n\nA USB patch should always go through -usb , I believe that's an\nestablished practice .","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2d7f6Hsrz9t3B\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 11:55:42 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid 9DB0AC21D8D; Thu, 28 Sep 2017 01:55:33 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 353B2C21C4A;\n\tThu, 28 Sep 2017 01:55:30 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 3162FC21C4A; Thu, 28 Sep 2017 01:55:29 +0000 (UTC)","from mail-out.m-online.net (mail-out.m-online.net [212.18.0.9])\n\tby lists.denx.de (Postfix) with ESMTPS id 4B61FC21C40\n\tfor <u-boot@lists.denx.de>; Thu, 28 Sep 2017 01:55:27 +0000 (UTC)","from frontend01.mail.m-online.net (unknown [192.168.8.182])\n\tby mail-out.m-online.net (Postfix) with ESMTP id 3y2d7K4wGCz1qr00;\n\tThu, 28 Sep 2017 03:55:25 +0200 (CEST)","from localhost (dynscan1.mnet-online.de [192.168.6.70])\n\tby mail.m-online.net (Postfix) with ESMTP id 3y2d7K4KcMz1r0ww;\n\tThu, 28 Sep 2017 03:55:25 +0200 (CEST)","from mail.mnet-online.de ([192.168.8.182])\n\tby localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new,\n\tport 10024)\n\twith ESMTP id BW-LbttB5f_o; Thu, 28 Sep 2017 03:55:24 +0200 (CEST)","from [IPv6:::1] (unknown [195.140.253.167])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby mail.mnet-online.de (Postfix) with ESMTPSA;\n\tThu, 28 Sep 2017 03:55:24 +0200 (CEST)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.7 required=5.0 tests=RCVD_IN_DNSWL_LOW,\n\tRCVD_IN_MSPIKE_H3,\n\tRCVD_IN_MSPIKE_WL autolearn=unavailable autolearn_force=no\n\tversion=3.4.0","X-Virus-Scanned":"amavisd-new at mnet-online.de","X-Auth-Info":"whx1bCRskpmJ3FTXyLhLpC+t1KaOksm159cZOaE6hWM=","To":"Tom Rini <trini@konsulko.com>, Bin Meng <bmeng.cn@gmail.com>","References":"<1504790001-24715-5-git-send-email-bmeng.cn@gmail.com>\n\t<20170927163443.GY3112@bill-the-cat>\n\t<CAEUhbmVgB0azrgHov2rEcLdZ1bGdwyk1E5YG5irEsb6QXRZ1tw@mail.gmail.com>\n\t<20170928013951.GG3112@bill-the-cat>","From":"Marek Vasut <marex@denx.de>","Message-ID":"<52927408-0df3-4620-e8d2-44aace9af755@denx.de>","Date":"Thu, 28 Sep 2017 03:55:24 +0200","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<20170928013951.GG3112@bill-the-cat>","Content-Language":"en-US","Cc":"Stefan Roese <sr@denx.de>, U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"text/plain; charset=\"utf-8\"","Content-Transfer-Encoding":"base64","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}},{"id":1776723,"web_url":"http://patchwork.ozlabs.org/comment/1776723/","msgid":"<20170928020430.GI3112@bill-the-cat>","list_archive_url":null,"date":"2017-09-28T02:04:30","subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","submitter":{"id":65875,"url":"http://patchwork.ozlabs.org/api/people/65875/","name":"Tom Rini","email":"trini@konsulko.com"},"content":"On Thu, Sep 28, 2017 at 03:55:24AM +0200, Marek Vasut wrote:\n> On 09/28/2017 03:39 AM, Tom Rini wrote:\n> > On Thu, Sep 28, 2017 at 09:34:23AM +0800, Bin Meng wrote:\n> >> Hi Tom,\n> >>\n> >> On Thu, Sep 28, 2017 at 12:34 AM, Tom Rini <trini@konsulko.com> wrote:\n> >>> On Thu, Sep 07, 2017 at 06:13:21AM -0700, Bin Meng wrote:\n> >>>\n> >>>> When EHCD and xHCD are enabled at the same time, USB storage device\n> >>>> driver will fail to read/write from/to the storage device attached\n> >>>> to the xHCI interface, due to its transfer blocks exceeds the xHCD\n> >>>> driver limitation.\n> >>>>\n> >>>> With driver model, we have an API to get the controller's maximum\n> >>>> transfer size and we can use that to determine the storage driver's\n> >>>> capability of read/write.\n> >>>>\n> >>>> Note: the non-DM version driver is still broken with xHCD and the\n> >>>> intent here is not to fix the non-DM one, since the xHCD itself is\n> >>>> already broken in places like 3.0 hub support, etc.\n> >>>>\n> >>>> Signed-off-by: Bin Meng <bmeng.cn@gmail.com>\n> >>>> Tested-by: Stefan Roese <sr@denx.de>\n> >>> [snip]\n> >>>> @@ -953,6 +957,17 @@ static void usb_stor_set_max_xfer_blk(struct us_data *us)\n> >>>>  #else\n> >>>>       blk = 20;\n> >>>>  #endif\n> >>>> +#else\n> >>>> +     ret = usb_get_max_xfer_size(udev, (size_t *)&size);\n> >>>> +     if (ret < 0) {\n> >>>> +             /* unimplemented, let's use default 20 */\n> >>>> +             blk = 20;\n> >>>> +     } else {\n> >>>> +             if (size > USHRT_MAX * 512)\n> >>>> +                     blk = USHRT_MAX;\n> >>>> +             blk = size / 512;\n> >>>> +     }\n> >>>> +#endif\n> >>>\n> >>> So, Coverity saw this and found an issue (CID 167250), and I was going\n> >>> to just fix it, but I'm not sure.  The problem is that we check size >\n> >>> (USHRT_MAX * 512), and then assign blk.  Then, we always assign blk, so\n> >>> the test above isn't used.  But my background recollection is that\n> >>> there's a real issue that's being addressed here.  Can we really just\n> >>> always say blk = size / 512 in this case, or did we want to be shifting\n> >>> size not blk under the if?  Thanks!\n> >>\n> >> Did this patch applied to anywhere? I see it is in the usb tree, but\n> >> not in the u-boot/master.\n> >>\n> >> The fix should be:\n> >>\n> >>              if (size > USHRT_MAX * 512)\n> >>                      size = USHRT_MAX * 512;\n> > \n> > It's in usb/master, and will be in master itself shortly.  Please submit\n> > a patch that corrects this and has the Reported-by for Coverity.  Marek,\n> > do you want to take it via your tree or should I just grab it?  Thanks!\n> \n> A USB patch should always go through -usb , I believe that's an\n> established practice .\n\nAside from when you tell me to just pick up a fix directly, for whatever\nappropriate reason, yes.  Which is why I asked.","headers":{"Return-Path":"<u-boot-bounces@lists.denx.de>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":["ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=lists.denx.de\n\t(client-ip=81.169.180.215; helo=lists.denx.de;\n\tenvelope-from=u-boot-bounces@lists.denx.de;\n\treceiver=<UNKNOWN>)","ozlabs.org;\n\tdkim=fail reason=\"signature verification failed\" (1024-bit key;\n\tunprotected) header.d=konsulko.com header.i=@konsulko.com\n\theader.b=\"PK/K6mla\"; dkim-atps=neutral"],"Received":["from lists.denx.de (dione.denx.de [81.169.180.215])\n\tby ozlabs.org (Postfix) with ESMTP id 3y2dL42DBJz9ryr\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu, 28 Sep 2017 12:04:42 +1000 (AEST)","by lists.denx.de (Postfix, from userid 105)\n\tid BDE81C21D8C; Thu, 28 Sep 2017 02:04:33 +0000 (UTC)","from lists.denx.de (localhost [IPv6:::1])\n\tby lists.denx.de (Postfix) with ESMTP id 5B54BC21C4A;\n\tThu, 28 Sep 2017 02:04:30 +0000 (UTC)","by lists.denx.de (Postfix, from userid 105)\n\tid 6CAE0C21C4A; Thu, 28 Sep 2017 02:04:29 +0000 (UTC)","from mail-yw0-f179.google.com (mail-yw0-f179.google.com\n\t[209.85.161.179])\n\tby lists.denx.de (Postfix) with ESMTPS id EAAD6C21C40\n\tfor <u-boot@lists.denx.de>; Thu, 28 Sep 2017 02:04:28 +0000 (UTC)","by mail-yw0-f179.google.com with SMTP id p10so70523ywh.8\n\tfor <u-boot@lists.denx.de>; Wed, 27 Sep 2017 19:04:28 -0700 (PDT)","from bill-the-cat ([2606:a000:1401:811b:706c:f3a8:eab4:3cc8])\n\tby smtp.gmail.com with ESMTPSA id\n\tr13sm164361ywg.2.2017.09.27.19.04.26\n\t(version=TLS1_2 cipher=AES128-SHA bits=128/128);\n\tWed, 27 Sep 2017 19:04:27 -0700 (PDT)"],"X-Spam-Checker-Version":"SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de","X-Spam-Level":"","X-Spam-Status":"No, score=-0.0 required=5.0 tests=RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL,\n\tT_DKIM_INVALID autolearn=unavailable\n\tautolearn_force=no version=3.4.0","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com;\n\ts=google; \n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:in-reply-to:user-agent;\n\tbh=uY/EoeFM1KWwejbiqUE8z1MSUtTKV/F+rEO6u64zbaM=;\n\tb=PK/K6mlaoMxxvgRZOftc6Hle6sZ64XOz45I3FV/FSYerT9FPKkqb2sPbDbmvF2IUBr\n\to88dKDnURPdXzTfFU/HOXRVFNow758eOHlmXfe4QyU8bWzWDa7kscd/JBYo2YvxB/w/8\n\tvxqzHBmluBR7MEjffAm60TukKJsJ5Fu9cYZUM=","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:in-reply-to:user-agent;\n\tbh=uY/EoeFM1KWwejbiqUE8z1MSUtTKV/F+rEO6u64zbaM=;\n\tb=bzjl8+N5Pq8GUinQNv9yQnxfK9r1C5eFiyOiUbVTvW6CPmmYad3lBIuTWMqTUEDZN1\n\t2kUneTOVp5E3RLly3kG+SRgIrXP2+BocnQAQabhuBCGM7XoWGZN8pEG5Ng5ZWYCRpFTO\n\tYafDqICxZMTJnbIYZ5XW39fRQUC3NrZe9ghIFnvhSsf5I1kcaG5ZamAu/jdrrhmccX/D\n\thN187hOJhtayUOd220yNjxYc2y481y1bHiGw0bMt2gpsTZ4qMX9lZDQIg2B60JVZvZ4/\n\tDxO62lGhAiBDd+Nocht+30LSNKdTg4SydtLugkjjRBBS0PofdNjszTkrYktKZt8fKjcg\n\tbi8w==","X-Gm-Message-State":"AHPjjUgPcucX8gzcQYT1pfHBbPqcUeQXB+20R7UYWWOBjUPeiBzN3xt6\n\tge+0srX7dGqyJgC6nItBZvcLNA==","X-Google-Smtp-Source":"AOwi7QBNyrPUm7H1zN+nJglzpO+dYnt3AkrLcjpmUZosxdWaliHrFSo+xtydyaDeKKc9hLniDJVzMA==","X-Received":"by 10.13.209.6 with SMTP id t6mr2529471ywd.102.1506564267818;\n\tWed, 27 Sep 2017 19:04:27 -0700 (PDT)","Date":"Wed, 27 Sep 2017 22:04:30 -0400","From":"Tom Rini <trini@konsulko.com>","To":"Marek Vasut <marex@denx.de>","Message-ID":"<20170928020430.GI3112@bill-the-cat>","References":"<1504790001-24715-5-git-send-email-bmeng.cn@gmail.com>\n\t<20170927163443.GY3112@bill-the-cat>\n\t<CAEUhbmVgB0azrgHov2rEcLdZ1bGdwyk1E5YG5irEsb6QXRZ1tw@mail.gmail.com>\n\t<20170928013951.GG3112@bill-the-cat>\n\t<52927408-0df3-4620-e8d2-44aace9af755@denx.de>","MIME-Version":"1.0","In-Reply-To":"<52927408-0df3-4620-e8d2-44aace9af755@denx.de>","User-Agent":"Mutt/1.5.21 (2010-09-15)","Cc":"Stefan Roese <sr@denx.de>, U-Boot Mailing List <u-boot@lists.denx.de>","Subject":"Re: [U-Boot] [U-Boot,\n\t5/5] dm: usb: storage: Fix broken read/write when both EHCD and\n\txHCD are enabled","X-BeenThere":"u-boot@lists.denx.de","X-Mailman-Version":"2.1.18","Precedence":"list","List-Id":"U-Boot discussion <u-boot.lists.denx.de>","List-Unsubscribe":"<https://lists.denx.de/options/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=unsubscribe>","List-Archive":"<http://lists.denx.de/pipermail/u-boot/>","List-Post":"<mailto:u-boot@lists.denx.de>","List-Help":"<mailto:u-boot-request@lists.denx.de?subject=help>","List-Subscribe":"<https://lists.denx.de/listinfo/u-boot>,\n\t<mailto:u-boot-request@lists.denx.de?subject=subscribe>","Content-Type":"multipart/mixed;\n\tboundary=\"===============6996356116876885905==\"","Errors-To":"u-boot-bounces@lists.denx.de","Sender":"\"U-Boot\" <u-boot-bounces@lists.denx.de>"}}]