- intel-iommu-make-intel-iommu_wait_op-work-when-jiffies-arent-running.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     intel-iommu: make intel iommu_wait_op() work when jiffies aren't running
has been removed from the -mm tree.  Its filename was
     intel-iommu-make-intel-iommu_wait_op-work-when-jiffies-arent-running.patch

This patch was dropped because it was merged into mainline or a subsystem tree

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: intel-iommu: make intel iommu_wait_op() work when jiffies aren't running
From: mark gross <mgross@xxxxxxxxxxxxxxx>

I've noticed that a few times when the bios is buggy the code for detecting
failing DMAR hardware can get stuck in an infinite loop in early boot waiting
for jiffies to time out.  Which are not running at the time we get stuck in
this macro.

This patch replaces the use of the jiffies to detect the failing hardware with
the tsc counter.  Not a big change, instead of getting a black screen forever,
you get a panic...

I also changed the time out from an arbitrary 60 seconds to an arbitrary 10
seconds.

Signed-off-by: mark gross <mgross@xxxxxxxxxxxxxxx>
Cc: Greg KH <greg@xxxxxxxxx>
Cc: Jesse Barnes <jbarnes@xxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 drivers/pci/intel-iommu.c |    8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff -puN drivers/pci/intel-iommu.c~intel-iommu-make-intel-iommu_wait_op-work-when-jiffies-arent-running drivers/pci/intel-iommu.c
--- a/drivers/pci/intel-iommu.c~intel-iommu-make-intel-iommu_wait_op-work-when-jiffies-arent-running
+++ a/drivers/pci/intel-iommu.c
@@ -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 @@ static int iommu_alloc_root_entry(struct
 
 #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(KERN_ERR "DMAR hardware is malfunctioning\n");\
 		cpu_relax();\
 	}\
 }
_

Patches currently in -mm which might be from mgross@xxxxxxxxxxxxxxx are

origin.patch
linux-next.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux