aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/base/core.c5
-rw-r--r--drivers/pci/intel-iommu.c7
-rw-r--r--drivers/pci/pci.c21
-rw-r--r--drivers/uio/uio.c2
-rw-r--r--fs/sysfs/file.c8
-rw-r--r--include/linux/pci.h4
6 files changed, 21 insertions, 26 deletions
diff --git a/drivers/base/core.c b/drivers/base/core.c
index 7de543d1d0b4..24198ad01976 100644
--- a/drivers/base/core.c
+++ b/drivers/base/core.c
@@ -19,6 +19,7 @@
19#include <linux/kdev_t.h> 19#include <linux/kdev_t.h>
20#include <linux/notifier.h> 20#include <linux/notifier.h>
21#include <linux/genhd.h> 21#include <linux/genhd.h>
22#include <linux/kallsyms.h>
22#include <asm/semaphore.h> 23#include <asm/semaphore.h>
23 24
24#include "base.h" 25#include "base.h"
@@ -68,6 +69,10 @@ static ssize_t dev_attr_show(struct kobject *kobj, struct attribute *attr,
68 69
69 if (dev_attr->show) 70 if (dev_attr->show)
70 ret = dev_attr->show(dev, dev_attr, buf); 71 ret = dev_attr->show(dev, dev_attr, buf);
72 if (ret >= (ssize_t)PAGE_SIZE) {
73 print_symbol("dev_attr_show: %s returned bad count\n",
74 (unsigned long)dev_attr->show);
75 }
71 return ret; 76 return ret;
72} 77}
73 78
diff --git a/drivers/pci/intel-iommu.c b/drivers/pci/intel-iommu.c
index 977d29b32295..4cb949f0ebd9 100644
--- a/drivers/pci/intel-iommu.c
+++ b/drivers/pci/intel-iommu.c
@@ -1097,6 +1097,8 @@ static void iommu_free_domain(struct dmar_domain *domain)
1097} 1097}
1098 1098
1099static struct iova_domain reserved_iova_list; 1099static struct iova_domain reserved_iova_list;
1100static struct lock_class_key reserved_alloc_key;
1101static struct lock_class_key reserved_rbtree_key;
1100 1102
1101static void dmar_init_reserved_ranges(void) 1103static void dmar_init_reserved_ranges(void)
1102{ 1104{
@@ -1107,6 +1109,11 @@ static void dmar_init_reserved_ranges(void)
1107 1109
1108 init_iova_domain(&reserved_iova_list, DMA_32BIT_PFN); 1110 init_iova_domain(&reserved_iova_list, DMA_32BIT_PFN);
1109 1111
1112 lockdep_set_class(&reserved_iova_list.iova_alloc_lock,
1113 &reserved_alloc_key);
1114 lockdep_set_class(&reserved_iova_list.iova_rbtree_lock,
1115 &reserved_rbtree_key);
1116
1110 /* IOAPIC ranges shouldn't be accessed by DMA */ 1117 /* IOAPIC ranges shouldn't be accessed by DMA */
1111 iova = reserve_iova(&reserved_iova_list, IOVA_PFN(IOAPIC_RANGE_START), 1118 iova = reserve_iova(&reserved_iova_list, IOVA_PFN(IOAPIC_RANGE_START),
1112 IOVA_PFN(IOAPIC_RANGE_END)); 1119 IOVA_PFN(IOAPIC_RANGE_END));
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c
index 183fddaa38b7..a4445b7210bf 100644
--- a/drivers/pci/pci.c
+++ b/drivers/pci/pci.c
@@ -314,24 +314,6 @@ int pci_find_ht_capability(struct pci_dev *dev, int ht_cap)
314} 314}
315EXPORT_SYMBOL_GPL(pci_find_ht_capability); 315EXPORT_SYMBOL_GPL(pci_find_ht_capability);
316 316
317void pcie_wait_pending_transaction(struct pci_dev *dev)
318{
319 int pos;
320 u16 reg16;
321
322 pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
323 if (!pos)
324 return;
325 while (1) {
326 pci_read_config_word(dev, pos + PCI_EXP_DEVSTA, &reg16);
327 if (!(reg16 & PCI_EXP_DEVSTA_TRPND))
328 break;
329 cpu_relax();
330 }
331
332}
333EXPORT_SYMBOL_GPL(pcie_wait_pending_transaction);
334
335/** 317/**
336 * pci_find_parent_resource - return resource region of parent bus of given region 318 * pci_find_parent_resource - return resource region of parent bus of given region
337 * @dev: PCI device structure contains resources to be searched 319 * @dev: PCI device structure contains resources to be searched
@@ -936,9 +918,6 @@ pci_disable_device(struct pci_dev *dev)
936 if (atomic_sub_return(1, &dev->enable_cnt) != 0) 918 if (atomic_sub_return(1, &dev->enable_cnt) != 0)
937 return; 919 return;
938 920
939 /* Wait for all transactions are finished before disabling the device */
940 pcie_wait_pending_transaction(dev);
941
942 pci_read_config_word(dev, PCI_COMMAND, &pci_command); 921 pci_read_config_word(dev, PCI_COMMAND, &pci_command);
943 if (pci_command & PCI_COMMAND_MASTER) { 922 if (pci_command & PCI_COMMAND_MASTER) {
944 pci_command &= ~PCI_COMMAND_MASTER; 923 pci_command &= ~PCI_COMMAND_MASTER;
diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c
index e8a01f264540..11759080ca54 100644
--- a/drivers/uio/uio.c
+++ b/drivers/uio/uio.c
@@ -470,6 +470,8 @@ static int uio_mmap_physical(struct vm_area_struct *vma)
470 470
471 vma->vm_flags |= VM_IO | VM_RESERVED; 471 vma->vm_flags |= VM_IO | VM_RESERVED;
472 472
473 vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
474
473 return remap_pfn_range(vma, 475 return remap_pfn_range(vma,
474 vma->vm_start, 476 vma->vm_start,
475 idev->info->mem[mi].addr >> PAGE_SHIFT, 477 idev->info->mem[mi].addr >> PAGE_SHIFT,
diff --git a/fs/sysfs/file.c b/fs/sysfs/file.c
index a271c87c4472..baa663e69388 100644
--- a/fs/sysfs/file.c
+++ b/fs/sysfs/file.c
@@ -12,6 +12,7 @@
12 12
13#include <linux/module.h> 13#include <linux/module.h>
14#include <linux/kobject.h> 14#include <linux/kobject.h>
15#include <linux/kallsyms.h>
15#include <linux/namei.h> 16#include <linux/namei.h>
16#include <linux/poll.h> 17#include <linux/poll.h>
17#include <linux/list.h> 18#include <linux/list.h>
@@ -86,7 +87,12 @@ static int fill_read_buffer(struct dentry * dentry, struct sysfs_buffer * buffer
86 * The code works fine with PAGE_SIZE return but it's likely to 87 * The code works fine with PAGE_SIZE return but it's likely to
87 * indicate truncated result or overflow in normal use cases. 88 * indicate truncated result or overflow in normal use cases.
88 */ 89 */
89 BUG_ON(count >= (ssize_t)PAGE_SIZE); 90 if (count >= (ssize_t)PAGE_SIZE) {
91 print_symbol("fill_read_buffer: %s returned bad count\n",
92 (unsigned long)ops->show);
93 /* Try to struggle along */
94 count = PAGE_SIZE - 1;
95 }
90 if (count >= 0) { 96 if (count >= 0) {
91 buffer->needs_read_fill = 0; 97 buffer->needs_read_fill = 0;
92 buffer->count = count; 98 buffer->count = count;
diff --git a/include/linux/pci.h b/include/linux/pci.h
index b7e4b633c69b..ea760e519c46 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -513,7 +513,6 @@ int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap);
513int pci_find_ext_capability(struct pci_dev *dev, int cap); 513int pci_find_ext_capability(struct pci_dev *dev, int cap);
514int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); 514int pci_find_ht_capability(struct pci_dev *dev, int ht_cap);
515int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); 515int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap);
516void pcie_wait_pending_transaction(struct pci_dev *dev);
517struct pci_bus *pci_find_next_bus(const struct pci_bus *from); 516struct pci_bus *pci_find_next_bus(const struct pci_bus *from);
518 517
519struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, 518struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device,
@@ -884,9 +883,6 @@ static inline int pci_find_ext_capability(struct pci_dev *dev, int cap)
884 return 0; 883 return 0;
885} 884}
886 885
887static inline void pcie_wait_pending_transaction(struct pci_dev *dev)
888{ }
889
890/* Power management related routines */ 886/* Power management related routines */
891static inline int pci_save_state(struct pci_dev *dev) 887static inline int pci_save_state(struct pci_dev *dev)
892{ 888{