From owner-svn-src-head@FreeBSD.ORG Sat Nov 22 08:47:05 2014 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id E3D7E142; Sat, 22 Nov 2014 08:47:05 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id B68EB60F; Sat, 22 Nov 2014 08:47:05 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sAM8l58F027435; Sat, 22 Nov 2014 08:47:05 GMT (envelope-from hselasky@FreeBSD.org) Received: (from hselasky@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sAM8l5ph027433; Sat, 22 Nov 2014 08:47:05 GMT (envelope-from hselasky@FreeBSD.org) Message-Id: <201411220847.sAM8l5ph027433@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: hselasky set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky Date: Sat, 22 Nov 2014 08:47:05 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r274842 - head/sys/dev/usb/controller X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 22 Nov 2014 08:47:06 -0000 Author: hselasky Date: Sat Nov 22 08:47:04 2014 New Revision: 274842 URL: https://svnweb.freebsd.org/changeset/base/274842 Log: Use correct length mask for split transactions. The hardware would sometimes put non-zero values in the upper length bits, which are available for high-speed-only USB transactions, breaking the reception of data. Modified: head/sys/dev/usb/controller/saf1761_otg.c head/sys/dev/usb/controller/saf1761_otg_reg.h Modified: head/sys/dev/usb/controller/saf1761_otg.c ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg.c Sat Nov 22 08:09:26 2014 (r274841) +++ head/sys/dev/usb/controller/saf1761_otg.c Sat Nov 22 08:47:04 2014 (r274842) @@ -510,7 +510,10 @@ saf1761_host_bulk_data_rx(struct saf1761 td->error_any = 1; goto complete; } - count = (status & SOTG_PTD_DW3_XFER_COUNT); + if (td->dw1_value & SOTG_PTD_DW1_ENABLE_SPLIT) + count = (status & SOTG_PTD_DW3_XFER_COUNT_SPLIT); + else + count = (status & SOTG_PTD_DW3_XFER_COUNT_HS); got_short = 0; /* verify the packet byte count */ @@ -700,7 +703,10 @@ saf1761_host_intr_data_rx(struct saf1761 td->error_any = 1; goto complete; } - count = (status & SOTG_PTD_DW3_XFER_COUNT); + if (td->dw1_value & SOTG_PTD_DW1_ENABLE_SPLIT) + count = (status & SOTG_PTD_DW3_XFER_COUNT_SPLIT); + else + count = (status & SOTG_PTD_DW3_XFER_COUNT_HS); got_short = 0; /* verify the packet byte count */ @@ -895,7 +901,10 @@ saf1761_host_isoc_data_rx(struct saf1761 } else if (status & SOTG_PTD_DW3_HALTED) { goto complete; } - count = (status & SOTG_PTD_DW3_XFER_COUNT); + if (td->dw1_value & SOTG_PTD_DW1_ENABLE_SPLIT) + count = (status & SOTG_PTD_DW3_XFER_COUNT_SPLIT); + else + count = (status & SOTG_PTD_DW3_XFER_COUNT_HS); /* verify the packet byte count */ if (count != td->max_packet_size) { Modified: head/sys/dev/usb/controller/saf1761_otg_reg.h ============================================================================== --- head/sys/dev/usb/controller/saf1761_otg_reg.h Sat Nov 22 08:09:26 2014 (r274841) +++ head/sys/dev/usb/controller/saf1761_otg_reg.h Sat Nov 22 08:47:04 2014 (r274842) @@ -211,7 +211,8 @@ #define SOTG_PTD_DW3_CERR_3 (3U << 23) #define SOTG_PTD_DW3_CERR_2 (2U << 23) /* infinite NAKs */ #define SOTG_PTD_DW3_CERR_1 (1U << 23) -#define SOTG_PTD_DW3_XFER_COUNT 0x7FFF +#define SOTG_PTD_DW3_XFER_COUNT_HS 0x7FFF +#define SOTG_PTD_DW3_XFER_COUNT_SPLIT 0x03FF #define SOTG_PTD_DW4 16 #define SOTG_PTD_DW5 20 #define SOTG_PTD_DW6 24