From c05a3fa6a7bbc6928d0fe4987cfa5ef1d9b9f481 Mon Sep 17 00:00:00 2001 From: Michael Lotz Date: Mon, 23 May 2011 21:53:12 +0000 Subject: [PATCH] We obviously need to mask off the interrupt threshold value before overwriting it with our new setting. Otherwise we might end up with an illegal value as the interrupt threshold which might inhibit interrupt generation alltogether depending on the controller implementation. This was the case for the ATI/AMD SBx00 chipsets. Therefore fixes #5551. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41690 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/add-ons/kernel/busses/usb/ehci.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/add-ons/kernel/busses/usb/ehci.cpp b/src/add-ons/kernel/busses/usb/ehci.cpp index 8f16aaf378..209c40fd25 100644 --- a/src/add-ons/kernel/busses/usb/ehci.cpp +++ b/src/add-ons/kernel/busses/usb/ehci.cpp @@ -552,9 +552,14 @@ EHCI::Start() bool hasPerPortChangeEvent = (ReadCapReg32(EHCI_HCCPARAMS) & EHCI_HCCPARAMS_PPCEC) != 0; - uint32 frameListSize = (ReadOpReg(EHCI_USBCMD) >> EHCI_USBCMD_FLS_SHIFT) + + uint32 config = ReadOpReg(EHCI_USBCMD); + config &= ~((EHCI_USBCMD_ITC_MASK << EHCI_USBCMD_ITC_SHIFT) + | EHCI_USBCMD_PPCEE); + uint32 frameListSize = (config >> EHCI_USBCMD_FLS_SHIFT) & EHCI_USBCMD_FLS_MASK; - WriteOpReg(EHCI_USBCMD, ReadOpReg(EHCI_USBCMD) | EHCI_USBCMD_RUNSTOP + + WriteOpReg(EHCI_USBCMD, config | EHCI_USBCMD_RUNSTOP | (hasPerPortChangeEvent ? EHCI_USBCMD_PPCEE : 0) | EHCI_USBCMD_ASENABLE | EHCI_USBCMD_PSENABLE | (frameListSize << EHCI_USBCMD_FLS_SHIFT)