diff options
Diffstat (limited to 'drivers/char')
-rw-r--r-- | drivers/char/agp/intel-gtt.c | 19 | ||||
-rw-r--r-- | drivers/char/bfin_jtag_comm.c | 8 | ||||
-rw-r--r-- | drivers/char/tpm/tpm.c | 10 | ||||
-rw-r--r-- | drivers/char/tpm/tpm_tis.c | 6 |
4 files changed, 22 insertions, 21 deletions
diff --git a/drivers/char/agp/intel-gtt.c b/drivers/char/agp/intel-gtt.c index 826ab0939a12..fab3d3265adb 100644 --- a/drivers/char/agp/intel-gtt.c +++ b/drivers/char/agp/intel-gtt.c | |||
@@ -68,6 +68,7 @@ static struct _intel_private { | |||
68 | phys_addr_t gma_bus_addr; | 68 | phys_addr_t gma_bus_addr; |
69 | u32 PGETBL_save; | 69 | u32 PGETBL_save; |
70 | u32 __iomem *gtt; /* I915G */ | 70 | u32 __iomem *gtt; /* I915G */ |
71 | bool clear_fake_agp; /* on first access via agp, fill with scratch */ | ||
71 | int num_dcache_entries; | 72 | int num_dcache_entries; |
72 | union { | 73 | union { |
73 | void __iomem *i9xx_flush_page; | 74 | void __iomem *i9xx_flush_page; |
@@ -869,21 +870,12 @@ static int intel_fake_agp_free_gatt_table(struct agp_bridge_data *bridge) | |||
869 | 870 | ||
870 | static int intel_fake_agp_configure(void) | 871 | static int intel_fake_agp_configure(void) |
871 | { | 872 | { |
872 | int i; | ||
873 | |||
874 | if (!intel_enable_gtt()) | 873 | if (!intel_enable_gtt()) |
875 | return -EIO; | 874 | return -EIO; |
876 | 875 | ||
876 | intel_private.clear_fake_agp = true; | ||
877 | agp_bridge->gart_bus_addr = intel_private.gma_bus_addr; | 877 | agp_bridge->gart_bus_addr = intel_private.gma_bus_addr; |
878 | 878 | ||
879 | for (i = 0; i < intel_private.base.gtt_total_entries; i++) { | ||
880 | intel_private.driver->write_entry(intel_private.scratch_page_dma, | ||
881 | i, 0); | ||
882 | } | ||
883 | readl(intel_private.gtt+i-1); /* PCI Posting. */ | ||
884 | |||
885 | global_cache_flush(); | ||
886 | |||
887 | return 0; | 879 | return 0; |
888 | } | 880 | } |
889 | 881 | ||
@@ -945,6 +937,13 @@ static int intel_fake_agp_insert_entries(struct agp_memory *mem, | |||
945 | { | 937 | { |
946 | int ret = -EINVAL; | 938 | int ret = -EINVAL; |
947 | 939 | ||
940 | if (intel_private.clear_fake_agp) { | ||
941 | int start = intel_private.base.stolen_size / PAGE_SIZE; | ||
942 | int end = intel_private.base.gtt_mappable_entries; | ||
943 | intel_gtt_clear_range(start, end - start); | ||
944 | intel_private.clear_fake_agp = false; | ||
945 | } | ||
946 | |||
948 | if (INTEL_GTT_GEN == 1 && type == AGP_DCACHE_MEMORY) | 947 | if (INTEL_GTT_GEN == 1 && type == AGP_DCACHE_MEMORY) |
949 | return i810_insert_dcache_entries(mem, pg_start, type); | 948 | return i810_insert_dcache_entries(mem, pg_start, type); |
950 | 949 | ||
diff --git a/drivers/char/bfin_jtag_comm.c b/drivers/char/bfin_jtag_comm.c index e397df3ad98e..16402445f2b2 100644 --- a/drivers/char/bfin_jtag_comm.c +++ b/drivers/char/bfin_jtag_comm.c | |||
@@ -183,16 +183,16 @@ bfin_jc_circ_write(const unsigned char *buf, int count) | |||
183 | } | 183 | } |
184 | 184 | ||
185 | #ifndef CONFIG_BFIN_JTAG_COMM_CONSOLE | 185 | #ifndef CONFIG_BFIN_JTAG_COMM_CONSOLE |
186 | # define acquire_console_sem() | 186 | # define console_lock() |
187 | # define release_console_sem() | 187 | # define console_unlock() |
188 | #endif | 188 | #endif |
189 | static int | 189 | static int |
190 | bfin_jc_write(struct tty_struct *tty, const unsigned char *buf, int count) | 190 | bfin_jc_write(struct tty_struct *tty, const unsigned char *buf, int count) |
191 | { | 191 | { |
192 | int i; | 192 | int i; |
193 | acquire_console_sem(); | 193 | console_lock(); |
194 | i = bfin_jc_circ_write(buf, count); | 194 | i = bfin_jc_circ_write(buf, count); |
195 | release_console_sem(); | 195 | console_unlock(); |
196 | wake_up_process(bfin_jc_kthread); | 196 | wake_up_process(bfin_jc_kthread); |
197 | return i; | 197 | return i; |
198 | } | 198 | } |
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c index 1f46f1cd9225..36e0fa161c2b 100644 --- a/drivers/char/tpm/tpm.c +++ b/drivers/char/tpm/tpm.c | |||
@@ -364,12 +364,14 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip, | |||
364 | tpm_protected_ordinal_duration[ordinal & | 364 | tpm_protected_ordinal_duration[ordinal & |
365 | TPM_PROTECTED_ORDINAL_MASK]; | 365 | TPM_PROTECTED_ORDINAL_MASK]; |
366 | 366 | ||
367 | if (duration_idx != TPM_UNDEFINED) | 367 | if (duration_idx != TPM_UNDEFINED) { |
368 | duration = chip->vendor.duration[duration_idx]; | 368 | duration = chip->vendor.duration[duration_idx]; |
369 | if (duration <= 0) | 369 | /* if duration is 0, it's because chip->vendor.duration wasn't */ |
370 | /* filled yet, so we set the lowest timeout just to give enough */ | ||
371 | /* time for tpm_get_timeouts() to succeed */ | ||
372 | return (duration <= 0 ? HZ : duration); | ||
373 | } else | ||
370 | return 2 * 60 * HZ; | 374 | return 2 * 60 * HZ; |
371 | else | ||
372 | return duration; | ||
373 | } | 375 | } |
374 | EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); | 376 | EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration); |
375 | 377 | ||
diff --git a/drivers/char/tpm/tpm_tis.c b/drivers/char/tpm/tpm_tis.c index c17a305ecb28..dd21df55689d 100644 --- a/drivers/char/tpm/tpm_tis.c +++ b/drivers/char/tpm/tpm_tis.c | |||
@@ -493,9 +493,6 @@ static int tpm_tis_init(struct device *dev, resource_size_t start, | |||
493 | "1.2 TPM (device-id 0x%X, rev-id %d)\n", | 493 | "1.2 TPM (device-id 0x%X, rev-id %d)\n", |
494 | vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); | 494 | vendor >> 16, ioread8(chip->vendor.iobase + TPM_RID(0))); |
495 | 495 | ||
496 | if (is_itpm(to_pnp_dev(dev))) | ||
497 | itpm = 1; | ||
498 | |||
499 | if (itpm) | 496 | if (itpm) |
500 | dev_info(dev, "Intel iTPM workaround enabled\n"); | 497 | dev_info(dev, "Intel iTPM workaround enabled\n"); |
501 | 498 | ||
@@ -637,6 +634,9 @@ static int __devinit tpm_tis_pnp_init(struct pnp_dev *pnp_dev, | |||
637 | else | 634 | else |
638 | interrupts = 0; | 635 | interrupts = 0; |
639 | 636 | ||
637 | if (is_itpm(pnp_dev)) | ||
638 | itpm = 1; | ||
639 | |||
640 | return tpm_tis_init(&pnp_dev->dev, start, len, irq); | 640 | return tpm_tis_init(&pnp_dev->dev, start, len, irq); |
641 | } | 641 | } |
642 | 642 | ||