From owner-svn-src-all@FreeBSD.ORG Tue Feb 8 22:16:30 2011 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 001611065672; Tue, 8 Feb 2011 22:16:29 +0000 (UTC) (envelope-from marcel@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id C85AE8FC26; Tue, 8 Feb 2011 22:16:29 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id p18MGTjf061669; Tue, 8 Feb 2011 22:16:29 GMT (envelope-from marcel@svn.freebsd.org) Received: (from marcel@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id p18MGTnm061667; Tue, 8 Feb 2011 22:16:29 GMT (envelope-from marcel@svn.freebsd.org) Message-Id: <201102082216.p18MGTnm061667@svn.freebsd.org> From: Marcel Moolenaar Date: Tue, 8 Feb 2011 22:16:29 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r218461 - head/sys/dev/usb/controller X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Feb 2011 22:16:30 -0000 Author: marcel Date: Tue Feb 8 22:16:29 2011 New Revision: 218461 URL: http://svn.freebsd.org/changeset/base/218461 Log: Improve the error interrupt handler. In particular, read the error address on a decoding error to unlatch it and to allow us to print a better diagnostics message. This also has the side effect of clearing the condition, which prevents an interrupt storm. Modified: head/sys/dev/usb/controller/ehci_mv.c Modified: head/sys/dev/usb/controller/ehci_mv.c ============================================================================== --- head/sys/dev/usb/controller/ehci_mv.c Tue Feb 8 22:14:19 2011 (r218460) +++ head/sys/dev/usb/controller/ehci_mv.c Tue Feb 8 22:16:29 2011 (r218461) @@ -93,8 +93,9 @@ static void *ih_err; /* EHCI HC regs start at this offset within USB range */ #define MV_USB_HOST_OFST 0x0100 -#define USB_BRIDGE_INTR_CAUSE 0x210 -#define USB_BRIDGE_INTR_MASK 0x214 +#define USB_BRIDGE_INTR_CAUSE 0x210 +#define USB_BRIDGE_INTR_MASK 0x214 +#define USB_BRIDGE_ERR_ADDR 0x21C #define MV_USB_ADDR_DECODE_ERR (1 << 0) #define MV_USB_HOST_UNDERFLOW (1 << 1) @@ -345,18 +346,22 @@ err_intr(void *arg) cause = EREAD4(sc, USB_BRIDGE_INTR_CAUSE); if (cause) { - printf("IRQ ERR: cause: 0x%08x\n", cause); - if (cause & MV_USB_ADDR_DECODE_ERR) - printf("IRQ ERR: Address decoding error\n"); + printf("USB error: "); + if (cause & MV_USB_ADDR_DECODE_ERR) { + uint32_t addr; + + addr = EREAD4(sc, USB_BRIDGE_ERR_ADDR); + printf("address decoding error (addr=%#x)\n", addr); + } if (cause & MV_USB_HOST_UNDERFLOW) - printf("IRQ ERR: USB Host Underflow\n"); + printf("host underflow\n"); if (cause & MV_USB_HOST_OVERFLOW) - printf("IRQ ERR: USB Host Overflow\n"); + printf("host overflow\n"); if (cause & MV_USB_DEVICE_UNDERFLOW) - printf("IRQ ERR: USB Device Underflow\n"); + printf("device underflow\n"); if (cause & ~(MV_USB_ADDR_DECODE_ERR | MV_USB_HOST_UNDERFLOW | MV_USB_HOST_OVERFLOW | MV_USB_DEVICE_UNDERFLOW)) - printf("IRQ ERR: Unknown error\n"); + printf("unknown cause (cause=%#x)\n", cause); EWRITE4(sc, USB_BRIDGE_INTR_CAUSE, 0); }