projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c874ea9
)
xhci: fix numintrs sanity checks
author
Gerd Hoffmann
<kraxel@redhat.com>
Tue, 19 Mar 2013 08:18:20 +0000
(09:18 +0100)
committer
Gerd Hoffmann
<kraxel@redhat.com>
Wed, 3 Apr 2013 07:55:49 +0000
(09:55 +0200)
Make sure numintrs is a power of two, msi requires this.
https://bugzilla.redhat.com/show_bug.cgi?id=918035
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
hw/usb/hcd-xhci.c
patch
|
blob
|
history
diff --git
a/hw/usb/hcd-xhci.c
b/hw/usb/hcd-xhci.c
index 5aa342bda5a99ff4660198e41d354790b5d0607f..9d06c51f9c598665b9744e223a8f9390700638fb 100644
(file)
--- a/
hw/usb/hcd-xhci.c
+++ b/
hw/usb/hcd-xhci.c
@@
-3290,6
+3290,9
@@
static int usb_xhci_initfn(struct PCIDevice *dev)
if (xhci->numintrs > MAXINTRS) {
xhci->numintrs = MAXINTRS;
}
+ while (xhci->numintrs & (xhci->numintrs - 1)) { /* ! power of 2 */
+ xhci->numintrs++;
+ }
if (xhci->numintrs < 1) {
xhci->numintrs = 1;
}