From owner-freebsd-current@FreeBSD.ORG Mon Sep 22 05:12:40 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1E28886B; Mon, 22 Sep 2014 05:12:40 +0000 (UTC) Received: from smtp.mei.co.jp (smtp.mei.co.jp [133.183.100.20]) by mx1.freebsd.org (Postfix) with ESMTP id B8713ACC; Mon, 22 Sep 2014 05:12:39 +0000 (UTC) Received: from mail-gw.jp.panasonic.com ([157.8.1.157]) by smtp.mei.co.jp (8.12.11.20060614/3.7W/kc-maile12) with ESMTP id s8M4w08e010824; Mon, 22 Sep 2014 13:58:00 +0900 (JST) Received: from epochmail.jp.panasonic.com ([157.8.1.130]) by mail.jp.panasonic.com (8.11.6p2/3.7W/kc-maili14) with ESMTP id s8M4w0L14607; Mon, 22 Sep 2014 13:58:00 +0900 Received: by epochmail.jp.panasonic.com (8.12.11.20060308/3.7W/lomi13) id s8M4w0tL010515; Mon, 22 Sep 2014 13:58:00 +0900 Received: from localhost by lomi13.jp.panasonic.com (8.12.11.20060308/3.7W) with ESMTP id s8M4w0oX010470; Mon, 22 Sep 2014 13:58:00 +0900 Date: Mon, 22 Sep 2014 13:58:00 +0900 (JST) Message-Id: <20140922.135800.1954695532570247771.okuno.kohji@jp.panasonic.com> To: freebsd-current@freebsd.org Subject: Does the xHCI driver has a spec violation? From: Kohji Okuno Organization: Panasonic Corporation X-Mailer: Mew version 6.5 on Emacs 24.3 / Mule 6.0 (HANACHIRUSATO) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: okuno.kohji@jp.panasonic.com, freebsd-usb@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 22 Sep 2014 05:12:40 -0000 Hi, I encountered a issue for USB mic. In fist time, my host controller (xHCI) sends single IN-tokens every 8-SOFs. This is expected action. But, after I open, close and open, my host controller sends plural IN-tokens between SOF and SOF. In Intel Lynx Point, I could not reproduce this issue. I'm sorry. Unfortunately, I can't explain details about my proprietary host controler. I found the following explanation in the xHCI 1.1 specification http://www.intel.com/content/dam/www/public/us/en/documents/technical-specifications/extensible-host-controler-interface-usb-xhci.pdf In 4.8.3 Endpoint Context State, 6. The Configure Endpoint Command (Add (A) = `1' and Drop (D) =`1') shall transition an endpoint, except the Default Control Endpoint, from the Stopped to the Running state.' So, I modify as the following, then I can run expectedly. What do you think about this change? Best regards, Kohji Okuno static usb_error_t xhci_configure_mask(struct usb_device *udev, uint32_t mask, uint8_t drop) { struct xhci_softc *sc = XHCI_BUS2SC(udev->bus); struct usb_page_search buf_inp; struct xhci_input_dev_ctx *pinp; uint32_t temp; uint8_t index; uint8_t x; index = udev->controller_slot_id; usbd_get_page(&sc->sc_hw.devs[index].input_pc, 0, &buf_inp); pinp = buf_inp.buffer; if (drop) { mask &= XHCI_INCTX_NON_CTRL_MASK; xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, mask); xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, 0); } else { - xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, 0); + xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx0, mask); xhci_ctx_set_le32(sc, &pinp->ctx_input.dwInCtx1, mask);