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 X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A3830C433DF for ; Wed, 24 Jun 2020 06:05:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7FF6F20B1F for ; Wed, 24 Jun 2020 06:05:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592978719; bh=qghxJVkkiMtbRfQ/7Mj6wJLlOvY1Uw7KdE34MrVEL8U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=Bvm0SfwHAZBqiGAMJ1jzv1/950poeRinI85Podn9NJH5VY54Ou7w8vZB8J5GPS+7U UMFqOpp3CpdfXW9WNueMKeSRVpXLAqwwORwnRcQLfwFXN5PgtW0DuF9uWi1XjJPds/ eeR7PH7K6RnIvJTdACA3uJs4nZ4+4AJMAyGlz9dU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389017AbgFXGFT (ORCPT ); Wed, 24 Jun 2020 02:05:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:34860 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388164AbgFXGFS (ORCPT ); Wed, 24 Jun 2020 02:05:18 -0400 Received: from localhost (unknown [171.61.66.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 965B9207DD; Wed, 24 Jun 2020 06:05:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1592978718; bh=qghxJVkkiMtbRfQ/7Mj6wJLlOvY1Uw7KdE34MrVEL8U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SAfLleMJAysulcapubK8TBWNSkbmmaZZwroyqS+YlQaAb+NTEx+zhW6JqVVoI79rh KRL4tufD9YkGtQodvTLF/PTCgY0mFzvyRwNQ3swQB6tGC3MS0hM61HuY/DY7SSLWmY /KKwvpmWdFsgRHH3DviBEs7eQ+UyjKoKxdymSlcw= Date: Wed, 24 Jun 2020 11:35:14 +0530 From: Vinod Koul To: Yoshihiro Shimoda Cc: dmaengine@vger.kernel.org, linux-renesas-soc@vger.kernel.org Subject: Re: [PATCH v2] dmaengine: sh: usb-dmac: set tx_result parameters Message-ID: <20200624060514.GC2324254@vkoul-mobl> References: <1592482053-19433-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1592482053-19433-1-git-send-email-yoshihiro.shimoda.uh@renesas.com> Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org On 18-06-20, 21:07, Yoshihiro Shimoda wrote: > A client driver (renesas_usbhs) assumed that > dmaengine_tx_status() could return the residue even if > the transfer was completed. However, this was not correct > usage [1] and this caused to break getting the residue after > the commit 24461d9792c2 ("dmaengine: virt-dma: Fix access after > free in vchan_complete()") actually. So, this is possible to get > wrong received size if the usb controller gets a short packet. > For example, g_zero driver causes "bad OUT byte" errors. > > To use the tx_result from the renesas_usbhs driver when > the transfer is completed, set the tx_result parameters. > > Notes that the renesas_usbhs driver needs to update for it. > > [1] > https://lore.kernel.org/dmaengine/20200616165550.GP2324254@vkoul-mobl/ Applied, thanks -- ~Vinod