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 C9BAEC433EF for ; Wed, 29 Sep 2021 11:19:18 +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 0DCA3613CE for ; Wed, 29 Sep 2021 11:19:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0DCA3613CE Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=denx.de 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 CB4F482DC1; Wed, 29 Sep 2021 13:19:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1632914356; bh=uxDBpwlCTavBHykHupsEN/DAQYYBRH+qooLzESixg7M=; h=Subject:To:Cc:References:From:Date:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TJR8uoXE50CV+HdrgIOWwiofxXVYRNw+xPAYmsGLohrAd8N/6Wwz1vlDAy50VIZAH pexMrCySF80adp+ql2AweSXWbds17em+U7zXDfccNJiMQfzVQNOAjPwI4YPyom/FIR H5af9mAa+0SA+5BlbHhkGOvDUb7GtNgOywepAQbO0pibx+VtovkHBeuuXOo6nVP42N gKEA7soawl/+wrVXDf2ILUxjL+yXguTdCWSd+Vgwnr8r1LkulHNLlt5jSH3WiiQ81A VGeHCC5zcQ00B9WxP1aBZAJr6MLqJVifMrAkY+GnIlMDGTh6hSxHl3E6tzRXKaKyHG XwFZKJiv1DKTA== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id 6AA098281E; Wed, 29 Sep 2021 13:19:13 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1632914354; bh=uxDBpwlCTavBHykHupsEN/DAQYYBRH+qooLzESixg7M=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=A8lbCaUcKiH6OdYzEkEFm9iwAZneRFHa8IG/IHd8/+q7Jo7UL/LOb0uXrMYj++tZT R2iIFkhxYt6dQjsBHkOyFNQSMtewo97Od6PtfEBx1ocaedoqc7aP9/UJLhCtF9uLNM 0kKtUS6/KIuVDV+uMpsOmsyy0dP3cgouEDNZnVDerGigy6SIu+4Tv/sfAp37FGJD2B +w/JV4D9sWtZygy7znNi1NFTXF4YVHNy6ot/lZn4lYQA3/Zd2wCLcslxu0cnM4x03F ixaZWlp5qdLxmgJW/deMVeMk0lcF8LzQChpAmZTMl7cJ8zqp8Sjnia7ige3FcaA6cb yFkXnuua+CwFQ== Subject: Re: [PATCH] usb: mtu3: flush cache for the first GPD when allocate GPD ring To: Chunfeng Yun Cc: Ryder Lee , Weijie Gao , GSS_MTK_Uboot_upstream , u-boot@lists.denx.de, Simon Glass , Xin Lin , Bin Meng , Tom Rini References: <20210923025923.14473-1-chunfeng.yun@mediatek.com> From: Marek Vasut Message-ID: <37544ed3-aa60-cc4b-22cb-888857262fc0@denx.de> Date: Wed, 29 Sep 2021 13:19:13 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210923025923.14473-1-chunfeng.yun@mediatek.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit 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 9/23/21 4:59 AM, Chunfeng Yun wrote: > When allocate the GPD ring, and tell its address to the controller, then > the driver starts or resumes the QMU, the controller will try to access > the first GPD, so need flush the first one to avoid wrong GPD status. > > Reported-by: Xin Lin > Signed-off-by: Chunfeng Yun > --- > drivers/usb/mtu3/mtu3_qmu.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/usb/mtu3/mtu3_qmu.c b/drivers/usb/mtu3/mtu3_qmu.c > index 95eaf6d236..e8dc0095ab 100644 > --- a/drivers/usb/mtu3/mtu3_qmu.c > +++ b/drivers/usb/mtu3/mtu3_qmu.c > @@ -112,6 +112,7 @@ int mtu3_gpd_ring_alloc(struct mtu3_ep *mep) > memset(gpd, 0, QMU_GPD_RING_SIZE); > ring->dma = (dma_addr_t)gpd; > gpd_ring_init(ring, gpd); > + mtu3_flush_cache((uintptr_t)gpd, sizeof(*gpd)); You want a RB from Bin here, then it should go into current release.