Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750895AbdLGGx3 (ORCPT ); Thu, 7 Dec 2017 01:53:29 -0500 Received: from mga11.intel.com ([192.55.52.93]:2192 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750744AbdLGGx2 (ORCPT ); Thu, 7 Dec 2017 01:53:28 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.45,371,1508828400"; d="scan'208";a="9817397" Subject: Re: [PATCH] usb: xhci: fix TDS for MTK xHCI1.1 To: Chunfeng Yun , Mathias Nyman Cc: Greg Kroah-Hartman , Matthias Brugger , Felipe Balbi , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org References: <035626be9cb863b145b02369fe517d1c80335398.1512542108.git.chunfeng.yun@mediatek.com> From: Mathias Nyman Message-ID: <27d72801-417e-5726-561a-dd521795bc23@linux.intel.com> Date: Thu, 7 Dec 2017 08:55:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <035626be9cb863b145b02369fe517d1c80335398.1512542108.git.chunfeng.yun@mediatek.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1601 Lines: 44 On 06.12.2017 08:42, Chunfeng Yun wrote: > For MTK's xHCI 1.0 or latter, TD size is the number of max > packet sized packets remaining in the TD, not including > this TRB (following spec). > > For MTK's xHCI 0.96 and older, TD size is the number of max > packet sized packets remaining in the TD, including this TRB > (not following spec). > > Signed-off-by: Chunfeng Yun > --- > drivers/usb/host/xhci-ring.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c > index c239c68..0619869 100644 > --- a/drivers/usb/host/xhci-ring.c > +++ b/drivers/usb/host/xhci-ring.c > @@ -3108,7 +3108,7 @@ static u32 xhci_td_remainder(struct xhci_hcd *xhci, int transferred, > { > u32 maxp, total_packet_count; > > - /* MTK xHCI is mostly 0.97 but contains some features from 1.0 */ > + /* MTK xHCI 0.96 contains some features from 1.0 */ > if (xhci->hci_version < 0x100 && !(xhci->quirks & XHCI_MTK_HOST)) > return ((td_total_len - transferred) >> 10); > > @@ -3117,8 +3117,8 @@ static u32 xhci_td_remainder(struct xhci_hcd *xhci, int transferred, > trb_buff_len == td_total_len) > return 0; > > - /* for MTK xHCI, TD size doesn't include this TRB */ > - if (xhci->quirks & XHCI_MTK_HOST) > + /* for MTK xHCI 0.96, TD size include this TRB, but not in 1.x */ > + if ((xhci->quirks & XHCI_MTK_HOST) && (xhci->hci_version < 0x100)) > trb_buff_len = 0; > > maxp = usb_endpoint_maxp(&urb->ep->desc); > Thanks, adding. Adding stable tag as well -Mathias