aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-01-10 23:10:08 -0500
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2011-01-10 23:10:08 -0500
commiteed0ba0b4ab2d1668588219a8efa81bf8636a12d (patch)
treef5aa3c732e7830a1b24e6071f8bed0f799881187 /drivers/char
parent98b14d6b290d96b24ae993ceaccc59b2aa4b130c (diff)
parentc9de9333f5a860cab82052bce6ac28bcac9b2c26 (diff)
Merge remote branch 'gcl/next' into next
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/intel-gtt.c17
-rw-r--r--drivers/char/ramoops.c12
-rw-r--r--drivers/char/tpm/tpm_tis.c24
3 files changed, 44 insertions, 9 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c
index 9272c38dd3c6..29ac6d499fa6 100644
--- a/drivers/char/agp/intel-gtt.c
+++ b/drivers/char/agp/intel-gtt.c
@@ -812,8 +812,10 @@ static int intel_fake_agp_fetch_size(void)
812 812
813static void i830_cleanup(void) 813static void i830_cleanup(void)
814{ 814{
815 kunmap(intel_private.i8xx_page); 815 if (intel_private.i8xx_flush_page) {
816 intel_private.i8xx_flush_page = NULL; 816 kunmap(intel_private.i8xx_flush_page);
817 intel_private.i8xx_flush_page = NULL;
818 }
817 819
818 __free_page(intel_private.i8xx_page); 820 __free_page(intel_private.i8xx_page);
819 intel_private.i8xx_page = NULL; 821 intel_private.i8xx_page = NULL;
@@ -1190,12 +1192,19 @@ static void i9xx_chipset_flush(void)
1190 writel(1, intel_private.i9xx_flush_page); 1192 writel(1, intel_private.i9xx_flush_page);
1191} 1193}
1192 1194
1193static void i965_write_entry(dma_addr_t addr, unsigned int entry, 1195static void i965_write_entry(dma_addr_t addr,
1196 unsigned int entry,
1194 unsigned int flags) 1197 unsigned int flags)
1195{ 1198{
1199 u32 pte_flags;
1200
1201 pte_flags = I810_PTE_VALID;
1202 if (flags == AGP_USER_CACHED_MEMORY)
1203 pte_flags |= I830_PTE_SYSTEM_CACHED;
1204
1196 /* Shift high bits down */ 1205 /* Shift high bits down */
1197 addr |= (addr >> 28) & 0xf0; 1206 addr |= (addr >> 28) & 0xf0;
1198 writel(addr | I810_PTE_VALID, intel_private.gtt + entry); 1207 writel(addr | pte_flags, intel_private.gtt + entry);
1199} 1208}
1200 1209
1201static bool gen6_check_flags(unsigned int flags) 1210static bool gen6_check_flags(unsigned int flags)
diff --git a/drivers/char/ramoops.c b/drivers/char/ramoops.c
index 73dcb0ee41fd..d3d63be2cd37 100644
--- a/drivers/char/ramoops.c
+++ b/drivers/char/ramoops.c
@@ -29,7 +29,6 @@
29#include <linux/ramoops.h> 29#include <linux/ramoops.h>
30 30
31#define RAMOOPS_KERNMSG_HDR "====" 31#define RAMOOPS_KERNMSG_HDR "===="
32#define RAMOOPS_HEADER_SIZE (5 + sizeof(struct timeval))
33 32
34#define RECORD_SIZE 4096 33#define RECORD_SIZE 4096
35 34
@@ -65,8 +64,8 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
65 struct ramoops_context, dump); 64 struct ramoops_context, dump);
66 unsigned long s1_start, s2_start; 65 unsigned long s1_start, s2_start;
67 unsigned long l1_cpy, l2_cpy; 66 unsigned long l1_cpy, l2_cpy;
68 int res; 67 int res, hdr_size;
69 char *buf; 68 char *buf, *buf_orig;
70 struct timeval timestamp; 69 struct timeval timestamp;
71 70
72 /* Only dump oopses if dump_oops is set */ 71 /* Only dump oopses if dump_oops is set */
@@ -74,6 +73,8 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
74 return; 73 return;
75 74
76 buf = (char *)(cxt->virt_addr + (cxt->count * RECORD_SIZE)); 75 buf = (char *)(cxt->virt_addr + (cxt->count * RECORD_SIZE));
76 buf_orig = buf;
77
77 memset(buf, '\0', RECORD_SIZE); 78 memset(buf, '\0', RECORD_SIZE);
78 res = sprintf(buf, "%s", RAMOOPS_KERNMSG_HDR); 79 res = sprintf(buf, "%s", RAMOOPS_KERNMSG_HDR);
79 buf += res; 80 buf += res;
@@ -81,8 +82,9 @@ static void ramoops_do_dump(struct kmsg_dumper *dumper,
81 res = sprintf(buf, "%lu.%lu\n", (long)timestamp.tv_sec, (long)timestamp.tv_usec); 82 res = sprintf(buf, "%lu.%lu\n", (long)timestamp.tv_sec, (long)timestamp.tv_usec);
82 buf += res; 83 buf += res;
83 84
84 l2_cpy = min(l2, (unsigned long)(RECORD_SIZE - RAMOOPS_HEADER_SIZE)); 85 hdr_size = buf - buf_orig;
85 l1_cpy = min(l1, (unsigned long)(RECORD_SIZE - RAMOOPS_HEADER_SIZE) - l2_cpy); 86 l2_cpy = min(l2, (unsigned long)(RECORD_SIZE - hdr_size));
87 l1_cpy = min(l1, (unsigned long)(RECORD_SIZE - hdr_size) - l2_cpy);
86 88
87 s2_start = l2 - l2_cpy; 89 s2_start = l2 - l2_cpy;
88 s1_start = l1 - l1_cpy; 90 s1_start = l1 - l1_cpy;
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c
index 1030f8420137..c17a305ecb28 100644
--- a/drivers/char/tpm/tpm_tis.c
+++ b/drivers/char/tpm/tpm_tis.c
@@ -25,6 +25,7 @@
25#include <linux/slab.h> 25#include <linux/slab.h>
26#include <linux/interrupt.h> 26#include <linux/interrupt.h>
27#include <linux/wait.h> 27#include <linux/wait.h>
28#include <linux/acpi.h>
28#include "tpm.h" 29#include "tpm.h"
29 30
30#define TPM_HEADER_SIZE 10 31#define TPM_HEADER_SIZE 10
@@ -78,6 +79,26 @@ enum tis_defaults {
78static LIST_HEAD(tis_chips); 79static LIST_HEAD(tis_chips);
79static DEFINE_SPINLOCK(tis_lock); 80static DEFINE_SPINLOCK(tis_lock);
80 81
82#ifdef CONFIG_ACPI
83static int is_itpm(struct pnp_dev *dev)
84{
85 struct acpi_device *acpi = pnp_acpi_device(dev);
86 struct acpi_hardware_id *id;
87
88 list_for_each_entry(id, &acpi->pnp.ids, list) {
89 if (!strcmp("INTC0102", id->id))
90 return 1;
91 }
92
93 return 0;
94}
95#else
96static int is_itpm(struct pnp_dev *dev)
97{
98 return 0;
99}
100#endif
101
81static int check_locality(struct tpm_chip *chip, int l) 102static int check_locality(struct tpm_chip *chip, int l)
82{ 103{
83 if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) & 104 if ((ioread8(chip->vendor.iobase + TPM_ACCESS(l)) &
@@ -472,6 +493,9 @@ static int tpm_tis_init(struct device *dev, resource_size_t start,
472 "1.2 TPM (device-id 0x%X, rev-id %d)\n", 493 "1.2 TPM (device-id 0x%X, rev-id %d)\n",
473 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); 494 vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0)));
474 495
496 if (is_itpm(to_pnp_dev(dev)))
497 itpm = 1;
498
475 if (itpm) 499 if (itpm)
476 dev_info(dev, "Intel iTPM workaround enabled\n"); 500 dev_info(dev, "Intel iTPM workaround enabled\n");
477 501