From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933845AbbCPOq3 (ORCPT ); Mon, 16 Mar 2015 10:46:29 -0400 Received: from mga09.intel.com ([134.134.136.24]:51806 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933812AbbCPOqW (ORCPT ); Mon, 16 Mar 2015 10:46:22 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.11,409,1422950400"; d="scan'208";a="699369869" Message-ID: <5506ED1B.9020503@intel.com> Date: Mon, 16 Mar 2015 16:47:55 +0200 From: Mathias Nyman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: Alistair Grant , Mathias Nyman CC: Lu Baolu , Devin Heitmueller , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] usb: xhci: apply XHCI_AVOID_BEI quirk to all Intel xHCI controllers References: <1426155339-25716-1-git-send-email-baolu.lu@linux.intel.com> <5506D2BC.9070001@linux.intel.com> In-Reply-To: X-Enigmail-Version: 1.6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 16.03.2015 16:31, Alistair Grant wrote: > On Mon, Mar 16, 2015 at 1:55 PM, Mathias Nyman > wrote: >> On 15.03.2015 21:18, Alistair Grant wrote: >>> On Sun, Mar 15, 2015 at 3:54 PM, Alistair Grant wrote: >>>> On Thu, Mar 12, 2015 at 8:14 PM, Alistair Grant wrote: >>>>> On Thu, Mar 12, 2015 at 11:15 AM, Lu Baolu wrote: >>>>>> When a device with an isochronous endpoint is plugged into the Intel >>>>>> xHCI host controller, and the driver submits multiple frames per URB, >>>>>> the xHCI driver will set the Block Event Interrupt (BEI) flag on all >>>>>> but the last TD for the URB. This causes the host controller to place >>>>>> an event on the event ring, but not send an interrupt. When the last >>>>>> TD for the URB completes, BEI is cleared, and we get an interrupt for >>>>>> the whole URB. >>>>>> >>>>>> However, under Intel xHCI host controllers, if the event ring is full >>>>>> of events from transfers with BEI set, an "Event Ring is Full" event >>>>>> will be posted to the last entry of the event ring, but no interrupt >>>>>> is generated. Host will cease all transfer and command executions and >>>>>> wait until software completes handling the pending events in the event >>>>>> ring. That means xHC stops, but event of "event ring is full" is not >>>>>> notified. As the result, the xHC looks like dead to user. >>>>>> >>>>>> This patch is to apply XHCI_AVOID_BEI quirk to Intel xHC devices. And >>>>>> it should be backported to kernels as old as 3.0, that contains the >>>>>> commit 69e848c2090a ("Intel xhci: Support EHCI/xHCI port switching."). >>>>>> >>>>>> Signed-off-by: Lu Baolu >>>>>> Cc: stable@vger.kernel.org >>>>>> --- >>>>>> drivers/usb/host/xhci-pci.c | 2 +- >>>>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>>>> >>>>>> diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c >>>>>> index fd53c9e..2af32e2 100644 >>>>>> --- a/drivers/usb/host/xhci-pci.c >>>>>> +++ b/drivers/usb/host/xhci-pci.c >>>>>> @@ -115,6 +115,7 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) >>>>>> if (pdev->vendor == PCI_VENDOR_ID_INTEL) { >>>>>> xhci->quirks |= XHCI_LPM_SUPPORT; >>>>>> xhci->quirks |= XHCI_INTEL_HOST; >>>>>> + xhci->quirks |= XHCI_AVOID_BEI; >>>>>> } >>>>>> if (pdev->vendor == PCI_VENDOR_ID_INTEL && >>>>>> pdev->device == PCI_DEVICE_ID_INTEL_PANTHERPOINT_XHCI) { >>>>>> @@ -130,7 +131,6 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci) >>>>>> * PPT chipsets. >>>>>> */ >>>>>> xhci->quirks |= XHCI_SPURIOUS_REBOOT; >>>>>> - xhci->quirks |= XHCI_AVOID_BEI; >>>>>> } >>>>>> if (pdev->vendor == PCI_VENDOR_ID_INTEL && >>>>>> pdev->device == PCI_DEVICE_ID_INTEL_LYNXPOINT_LP_XHCI) { >>>>>> -- >>>>>> 2.1.0 >>>>>> >>>>>> -- >>>>> >>>>> This works for me... >>>>> >>>>> Computer: Dell XPS13 9333 >>>>> USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04) >>>>> (prog-if 30 [XHCI]) >>>>> Kernel: 3.19.1 >>>>> USB Device: Hauppauge USB-Live2 >>>>> >>>>> Please let me know if I can help in any other way. >>>>> >>>>> Tested-by: Alistair Grant >>>> >>>> Just FYI... >>>> >>>> I was able to test this on a slightly older laptop that had both USB2 >>>> and USB3 ports and can confirm that it also works there: >>>> >>>> 00:14.0 USB controller: Intel Corporation 7 Series/C210 Series Chipset >>>> Family USB xHCI Host Controller (rev 04) >>> >>> It looks like I may have signed-off a little too soon. While the patch is >>> working correctly if the Hauppauge Live2 is plugged in after the system has >>> booted and settled down (my normal use case), it fails if the Live2 is >>> plugged in while the system is booted up. >>> >>> Unplugging the Live2 after recording (which appears to succeed from the >>> command line, but had no audio), executing lsusb just hangs. >>> >>> I've included what I think is the relevant portions of /var/log/syslog >>> below. If you'd like the entire log file posted somewhere please let me >>> know. >> >> Hi >> >> What kernel did you try this patch on? >> >> The output look a bit like the regression in 4.0-rc3 caused by: >> commit 27082e2654dc148078b0abdfc3c8e5ccbde0ebfa >> xhci: Clear the host side toggle manually when endpoint is 'soft reset' >> >> which will be reverted (in 4.0-rc5 I hope). >> >> If you boot the same base kernel without the patch does it work then? >> >> -Mathias >> > > Hi Mathias, > > This is on top of 3.19.1 with only the XHCI_AVOID_BEI quirk patch applied. > > If you'd like me to try it against 4.0-rc3, 4 or 5, please let me know. Thanks, no that's not needed. But did the patch cause regression on top of 3.19.1? I mean, did it make 3.19.1 worse, better or just different for you, while booting with the device connected? -Mathias