From 310cb20a73370ed3aefcb88c895a6aec79baa910 Mon Sep 17 00:00:00 2001 From: msaitoh Date: Wed, 7 Jul 2010 03:55:01 +0000 Subject: For interrupt transfer, nak throttling must be disabled, but for the other transfer type, nak throttling should be enabled from the veiwpoint that avoids the memory thrashing. Fixes a problem that interrupt transfer stall on some EHCI controllers (e.g. Geode LX). Fixed by Yamada Katsumi. --- sys/dev/usb/ehci.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'sys/dev') diff --git a/sys/dev/usb/ehci.c b/sys/dev/usb/ehci.c index e91047fa2d2..2b52fec3c38 100644 --- a/sys/dev/usb/ehci.c +++ b/sys/dev/usb/ehci.c @@ -1,4 +1,4 @@ -/* $NetBSD: ehci.c,v 1.168 2010/06/02 18:53:39 jakllsch Exp $ */ +/* $NetBSD: ehci.c,v 1.169 2010/07/07 03:55:01 msaitoh Exp $ */ /* * Copyright (c) 2004-2008 The NetBSD Foundation, Inc. @@ -52,7 +52,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.168 2010/06/02 18:53:39 jakllsch Exp $"); +__KERNEL_RCSID(0, "$NetBSD: ehci.c,v 1.169 2010/07/07 03:55:01 msaitoh Exp $"); #include "ohci.h" #include "uhci.h" @@ -1581,7 +1581,13 @@ ehci_open(usbd_pipe_handle pipe) return USBD_INVAL; } - naks = 8; /* XXX */ + /* + * For interrupt transfer, nak throttling must be disabled, but for + * the other transfer type, nak throttling should be enabled from the + * veiwpoint that avoids the memory thrashing. + */ + naks = (xfertype == UE_INTERRUPT) ? 0 + : ((speed == EHCI_QH_SPEED_HIGH) ? 4 : 0); /* Allocate sqh for everything, save isoc xfers */ if (xfertype != UE_ISOCHRONOUS) { -- cgit