The following patch changes the intel-iommu.c code to use the TSC
instead of jiffies for detecting bad DMAR functionality. Some systems
with bad bios's have been seen to hang in early boot spinning in the
IOMMU_WAIT_IO macro. This patch will replace the forever spin with a
call to panic.
diffstat:
$ diffstat patches/wait_op_tsc.patch
intel-iommu.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
--mgross
Signed-off-by:mark gross <mgross@linux.intel.com>
Index: linux-next/drivers/pci/intel-iommu.c
===================================================================
--- linux-next.orig/drivers/pci/intel-iommu.c 2008-05-08 11:02:21.000000000 -0700
+++ linux-next/drivers/pci/intel-iommu.c 2008-05-08 11:13:02.000000000 -0700
@@ -49,7 +49,7 @@
#define DEFAULT_DOMAIN_ADDRESS_WIDTH 48
-#define DMAR_OPERATION_TIMEOUT (HZ*60) /* 1m */
+#define DMAR_OPERATION_TIMEOUT ((cycles_t) tsc_khz*10*1000) /* 10sec */
#define DOMAIN_MAX_ADDR(gaw) ((((u64)1) << gaw) - 1)
@@ -490,13 +490,13 @@
#define IOMMU_WAIT_OP(iommu, offset, op, cond, sts) \
{\
- unsigned long start_time = jiffies;\
+ cycles_t start_time = get_cycles();\
while (1) {\
sts = op (iommu->reg + offset);\
if (cond)\
break;\
- if (time_after(jiffies, start_time + DMAR_OPERATION_TIMEOUT))\
- panic("DMAR hardware is malfunctioning\n");\
+ if (DMAR_OPERATION_TIMEOUT < (get_cycles() - start_time))\
+ panic("DMAR hardware is malfunctioning\n");\
cpu_relax();\
}\
}
--
| Christoph Lameter | [04/14] vcompound: Core piece |
| Rafael J. Wysocki | 2.6.24-rc4-git5: Reported regressions from 2.6.23 |
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Andrew Morton | Re: 2.6.21-rc2-mm1 |
git: | |
| Ken Pratt | pack operation is thrashing my server |
| Kyle Moffett | Using GIT to store /etc (Or: How to make GIT store all file permission bits) |
| Nicolas Pitre | Re: Cleaning up git user-interface warts |
| Toby White | Using Filemerge.app as a git-diff viewer |
| Richard Stallman | Real men don't attack straw men |
| Peter | OpenBSD as Virtualbox guest |
| Richard Daemon | OpenBSD 4.3 running in VirtualBox? Anyone have it working properly? |
| Mark Zimmerman | alix 2c3 bios version |
| Christoph Hellwig | Re: silent semantic changes with reiser4 |
| Al Boldi | Re: [RFD] Incremental fsck |
| Theodore Tso | Re: [RFC 0/13] extents and 48bit ext3 |
| Josef Jeff Sipek | [PATCH 22 of 23] Unionfs: Unlink |
