diff options
48 files changed, 378 insertions, 275 deletions
diff --git a/arch/alpha/include/asm/percpu.h b/arch/alpha/include/asm/percpu.h index e9e0bb5a23bf..06c5c7a4afd3 100644 --- a/arch/alpha/include/asm/percpu.h +++ b/arch/alpha/include/asm/percpu.h | |||
@@ -1,7 +1,9 @@ | |||
1 | #ifndef __ALPHA_PERCPU_H | 1 | #ifndef __ALPHA_PERCPU_H |
2 | #define __ALPHA_PERCPU_H | 2 | #define __ALPHA_PERCPU_H |
3 | |||
3 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
4 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <linux/percpu-defs.h> | ||
5 | 7 | ||
6 | /* | 8 | /* |
7 | * Determine the real variable name from the name visible in the | 9 | * Determine the real variable name from the name visible in the |
@@ -73,6 +75,28 @@ extern unsigned long __per_cpu_offset[NR_CPUS]; | |||
73 | 75 | ||
74 | #endif /* SMP */ | 76 | #endif /* SMP */ |
75 | 77 | ||
76 | #include <asm-generic/percpu.h> | 78 | #ifdef CONFIG_SMP |
79 | #define PER_CPU_BASE_SECTION ".data.percpu" | ||
80 | #else | ||
81 | #define PER_CPU_BASE_SECTION ".data" | ||
82 | #endif | ||
83 | |||
84 | #ifdef CONFIG_SMP | ||
85 | |||
86 | #ifdef MODULE | ||
87 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
88 | #else | ||
89 | #define PER_CPU_SHARED_ALIGNED_SECTION ".shared_aligned" | ||
90 | #endif | ||
91 | #define PER_CPU_FIRST_SECTION ".first" | ||
92 | |||
93 | #else | ||
94 | |||
95 | #define PER_CPU_SHARED_ALIGNED_SECTION "" | ||
96 | #define PER_CPU_FIRST_SECTION "" | ||
97 | |||
98 | #endif | ||
99 | |||
100 | #define PER_CPU_ATTRIBUTES | ||
77 | 101 | ||
78 | #endif /* __ALPHA_PERCPU_H */ | 102 | #endif /* __ALPHA_PERCPU_H */ |
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 1821c2078199..1f8510c51d6e 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -411,7 +411,6 @@ static __init int svm_hardware_setup(void) | |||
411 | 411 | ||
412 | iopm_va = page_address(iopm_pages); | 412 | iopm_va = page_address(iopm_pages); |
413 | memset(iopm_va, 0xff, PAGE_SIZE * (1 << IOPM_ALLOC_ORDER)); | 413 | memset(iopm_va, 0xff, PAGE_SIZE * (1 << IOPM_ALLOC_ORDER)); |
414 | clear_bit(0x80, iopm_va); /* allow direct access to PC debug port */ | ||
415 | iopm_base = page_to_pfn(iopm_pages) << PAGE_SHIFT; | 414 | iopm_base = page_to_pfn(iopm_pages) << PAGE_SHIFT; |
416 | 415 | ||
417 | if (boot_cpu_has(X86_FEATURE_NX)) | 416 | if (boot_cpu_has(X86_FEATURE_NX)) |
@@ -796,6 +795,11 @@ static void svm_get_segment(struct kvm_vcpu *vcpu, | |||
796 | var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1; | 795 | var->db = (s->attrib >> SVM_SELECTOR_DB_SHIFT) & 1; |
797 | var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1; | 796 | var->g = (s->attrib >> SVM_SELECTOR_G_SHIFT) & 1; |
798 | 797 | ||
798 | /* AMD's VMCB does not have an explicit unusable field, so emulate it | ||
799 | * for cross vendor migration purposes by "not present" | ||
800 | */ | ||
801 | var->unusable = !var->present || (var->type == 0); | ||
802 | |||
799 | switch (seg) { | 803 | switch (seg) { |
800 | case VCPU_SREG_CS: | 804 | case VCPU_SREG_CS: |
801 | /* | 805 | /* |
@@ -827,8 +831,6 @@ static void svm_get_segment(struct kvm_vcpu *vcpu, | |||
827 | var->type |= 0x1; | 831 | var->type |= 0x1; |
828 | break; | 832 | break; |
829 | } | 833 | } |
830 | |||
831 | var->unusable = !var->present; | ||
832 | } | 834 | } |
833 | 835 | ||
834 | static int svm_get_cpl(struct kvm_vcpu *vcpu) | 836 | static int svm_get_cpl(struct kvm_vcpu *vcpu) |
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 7c1ce5ac6131..49079a46687b 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1121,9 +1121,9 @@ void kvm_arch_vcpu_put(struct kvm_vcpu *vcpu) | |||
1121 | 1121 | ||
1122 | static int is_efer_nx(void) | 1122 | static int is_efer_nx(void) |
1123 | { | 1123 | { |
1124 | u64 efer; | 1124 | unsigned long long efer = 0; |
1125 | 1125 | ||
1126 | rdmsrl(MSR_EFER, efer); | 1126 | rdmsrl_safe(MSR_EFER, &efer); |
1127 | return efer & EFER_NX; | 1127 | return efer & EFER_NX; |
1128 | } | 1128 | } |
1129 | 1129 | ||
@@ -1259,7 +1259,7 @@ static void do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, | |||
1259 | bit(X86_FEATURE_CMOV) | bit(X86_FEATURE_PSE36) | | 1259 | bit(X86_FEATURE_CMOV) | bit(X86_FEATURE_PSE36) | |
1260 | bit(X86_FEATURE_MMX) | bit(X86_FEATURE_FXSR) | | 1260 | bit(X86_FEATURE_MMX) | bit(X86_FEATURE_FXSR) | |
1261 | bit(X86_FEATURE_SYSCALL) | | 1261 | bit(X86_FEATURE_SYSCALL) | |
1262 | (bit(X86_FEATURE_NX) && is_efer_nx()) | | 1262 | (is_efer_nx() ? bit(X86_FEATURE_NX) : 0) | |
1263 | #ifdef CONFIG_X86_64 | 1263 | #ifdef CONFIG_X86_64 |
1264 | bit(X86_FEATURE_LM) | | 1264 | bit(X86_FEATURE_LM) | |
1265 | #endif | 1265 | #endif |
diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c index 92438e9dacc3..5a87384ea4ff 100644 --- a/drivers/dma/dmaengine.c +++ b/drivers/dma/dmaengine.c | |||
@@ -804,11 +804,14 @@ dma_async_memcpy_buf_to_buf(struct dma_chan *chan, void *dest, | |||
804 | dma_addr_t dma_dest, dma_src; | 804 | dma_addr_t dma_dest, dma_src; |
805 | dma_cookie_t cookie; | 805 | dma_cookie_t cookie; |
806 | int cpu; | 806 | int cpu; |
807 | unsigned long flags; | ||
807 | 808 | ||
808 | dma_src = dma_map_single(dev->dev, src, len, DMA_TO_DEVICE); | 809 | dma_src = dma_map_single(dev->dev, src, len, DMA_TO_DEVICE); |
809 | dma_dest = dma_map_single(dev->dev, dest, len, DMA_FROM_DEVICE); | 810 | dma_dest = dma_map_single(dev->dev, dest, len, DMA_FROM_DEVICE); |
810 | tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, | 811 | flags = DMA_CTRL_ACK | |
811 | DMA_CTRL_ACK); | 812 | DMA_COMPL_SRC_UNMAP_SINGLE | |
813 | DMA_COMPL_DEST_UNMAP_SINGLE; | ||
814 | tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, flags); | ||
812 | 815 | ||
813 | if (!tx) { | 816 | if (!tx) { |
814 | dma_unmap_single(dev->dev, dma_src, len, DMA_TO_DEVICE); | 817 | dma_unmap_single(dev->dev, dma_src, len, DMA_TO_DEVICE); |
@@ -850,11 +853,12 @@ dma_async_memcpy_buf_to_pg(struct dma_chan *chan, struct page *page, | |||
850 | dma_addr_t dma_dest, dma_src; | 853 | dma_addr_t dma_dest, dma_src; |
851 | dma_cookie_t cookie; | 854 | dma_cookie_t cookie; |
852 | int cpu; | 855 | int cpu; |
856 | unsigned long flags; | ||
853 | 857 | ||
854 | dma_src = dma_map_single(dev->dev, kdata, len, DMA_TO_DEVICE); | 858 | dma_src = dma_map_single(dev->dev, kdata, len, DMA_TO_DEVICE); |
855 | dma_dest = dma_map_page(dev->dev, page, offset, len, DMA_FROM_DEVICE); | 859 | dma_dest = dma_map_page(dev->dev, page, offset, len, DMA_FROM_DEVICE); |
856 | tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, | 860 | flags = DMA_CTRL_ACK | DMA_COMPL_SRC_UNMAP_SINGLE; |
857 | DMA_CTRL_ACK); | 861 | tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, flags); |
858 | 862 | ||
859 | if (!tx) { | 863 | if (!tx) { |
860 | dma_unmap_single(dev->dev, dma_src, len, DMA_TO_DEVICE); | 864 | dma_unmap_single(dev->dev, dma_src, len, DMA_TO_DEVICE); |
@@ -898,12 +902,13 @@ dma_async_memcpy_pg_to_pg(struct dma_chan *chan, struct page *dest_pg, | |||
898 | dma_addr_t dma_dest, dma_src; | 902 | dma_addr_t dma_dest, dma_src; |
899 | dma_cookie_t cookie; | 903 | dma_cookie_t cookie; |
900 | int cpu; | 904 | int cpu; |
905 | unsigned long flags; | ||
901 | 906 | ||
902 | dma_src = dma_map_page(dev->dev, src_pg, src_off, len, DMA_TO_DEVICE); | 907 | dma_src = dma_map_page(dev->dev, src_pg, src_off, len, DMA_TO_DEVICE); |
903 | dma_dest = dma_map_page(dev->dev, dest_pg, dest_off, len, | 908 | dma_dest = dma_map_page(dev->dev, dest_pg, dest_off, len, |
904 | DMA_FROM_DEVICE); | 909 | DMA_FROM_DEVICE); |
905 | tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, | 910 | flags = DMA_CTRL_ACK; |
906 | DMA_CTRL_ACK); | 911 | tx = dev->device_prep_dma_memcpy(chan, dma_dest, dma_src, len, flags); |
907 | 912 | ||
908 | if (!tx) { | 913 | if (!tx) { |
909 | dma_unmap_page(dev->dev, dma_src, len, DMA_TO_DEVICE); | 914 | dma_unmap_page(dev->dev, dma_src, len, DMA_TO_DEVICE); |
diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c index a27c0fb1bc11..fb7da5141e96 100644 --- a/drivers/dma/dmatest.c +++ b/drivers/dma/dmatest.c | |||
@@ -531,9 +531,7 @@ static int __init dmatest_init(void) | |||
531 | chan = dma_request_channel(mask, filter, NULL); | 531 | chan = dma_request_channel(mask, filter, NULL); |
532 | if (chan) { | 532 | if (chan) { |
533 | err = dmatest_add_channel(chan); | 533 | err = dmatest_add_channel(chan); |
534 | if (err == 0) | 534 | if (err) { |
535 | continue; | ||
536 | else { | ||
537 | dma_release_channel(chan); | 535 | dma_release_channel(chan); |
538 | break; /* add_channel failed, punt */ | 536 | break; /* add_channel failed, punt */ |
539 | } | 537 | } |
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c index e4fc33c1c32f..1955ee8d6d20 100644 --- a/drivers/dma/ioat_dma.c +++ b/drivers/dma/ioat_dma.c | |||
@@ -1063,22 +1063,31 @@ static void ioat_dma_cleanup_tasklet(unsigned long data) | |||
1063 | static void | 1063 | static void |
1064 | ioat_dma_unmap(struct ioat_dma_chan *ioat_chan, struct ioat_desc_sw *desc) | 1064 | ioat_dma_unmap(struct ioat_dma_chan *ioat_chan, struct ioat_desc_sw *desc) |
1065 | { | 1065 | { |
1066 | /* | 1066 | if (!(desc->async_tx.flags & DMA_COMPL_SKIP_DEST_UNMAP)) { |
1067 | * yes we are unmapping both _page and _single | 1067 | if (desc->async_tx.flags & DMA_COMPL_DEST_UNMAP_SINGLE) |
1068 | * alloc'd regions with unmap_page. Is this | 1068 | pci_unmap_single(ioat_chan->device->pdev, |
1069 | * *really* that bad? | 1069 | pci_unmap_addr(desc, dst), |
1070 | */ | 1070 | pci_unmap_len(desc, len), |
1071 | if (!(desc->async_tx.flags & DMA_COMPL_SKIP_DEST_UNMAP)) | 1071 | PCI_DMA_FROMDEVICE); |
1072 | pci_unmap_page(ioat_chan->device->pdev, | 1072 | else |
1073 | pci_unmap_addr(desc, dst), | 1073 | pci_unmap_page(ioat_chan->device->pdev, |
1074 | pci_unmap_len(desc, len), | 1074 | pci_unmap_addr(desc, dst), |
1075 | PCI_DMA_FROMDEVICE); | 1075 | pci_unmap_len(desc, len), |
1076 | 1076 | PCI_DMA_FROMDEVICE); | |
1077 | if (!(desc->async_tx.flags & DMA_COMPL_SKIP_SRC_UNMAP)) | 1077 | } |
1078 | pci_unmap_page(ioat_chan->device->pdev, | 1078 | |
1079 | pci_unmap_addr(desc, src), | 1079 | if (!(desc->async_tx.flags & DMA_COMPL_SKIP_SRC_UNMAP)) { |
1080 | pci_unmap_len(desc, len), | 1080 | if (desc->async_tx.flags & DMA_COMPL_SRC_UNMAP_SINGLE) |
1081 | PCI_DMA_TODEVICE); | 1081 | pci_unmap_single(ioat_chan->device->pdev, |
1082 | pci_unmap_addr(desc, src), | ||
1083 | pci_unmap_len(desc, len), | ||
1084 | PCI_DMA_TODEVICE); | ||
1085 | else | ||
1086 | pci_unmap_page(ioat_chan->device->pdev, | ||
1087 | pci_unmap_addr(desc, src), | ||
1088 | pci_unmap_len(desc, len), | ||
1089 | PCI_DMA_TODEVICE); | ||
1090 | } | ||
1082 | } | 1091 | } |
1083 | 1092 | ||
1084 | /** | 1093 | /** |
@@ -1363,6 +1372,7 @@ static int ioat_dma_self_test(struct ioatdma_device *device) | |||
1363 | int err = 0; | 1372 | int err = 0; |
1364 | struct completion cmp; | 1373 | struct completion cmp; |
1365 | unsigned long tmo; | 1374 | unsigned long tmo; |
1375 | unsigned long flags; | ||
1366 | 1376 | ||
1367 | src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL); | 1377 | src = kzalloc(sizeof(u8) * IOAT_TEST_SIZE, GFP_KERNEL); |
1368 | if (!src) | 1378 | if (!src) |
@@ -1392,8 +1402,9 @@ static int ioat_dma_self_test(struct ioatdma_device *device) | |||
1392 | DMA_TO_DEVICE); | 1402 | DMA_TO_DEVICE); |
1393 | dma_dest = dma_map_single(dma_chan->device->dev, dest, IOAT_TEST_SIZE, | 1403 | dma_dest = dma_map_single(dma_chan->device->dev, dest, IOAT_TEST_SIZE, |
1394 | DMA_FROM_DEVICE); | 1404 | DMA_FROM_DEVICE); |
1405 | flags = DMA_COMPL_SRC_UNMAP_SINGLE | DMA_COMPL_DEST_UNMAP_SINGLE; | ||
1395 | tx = device->common.device_prep_dma_memcpy(dma_chan, dma_dest, dma_src, | 1406 | tx = device->common.device_prep_dma_memcpy(dma_chan, dma_dest, dma_src, |
1396 | IOAT_TEST_SIZE, 0); | 1407 | IOAT_TEST_SIZE, flags); |
1397 | if (!tx) { | 1408 | if (!tx) { |
1398 | dev_err(&device->pdev->dev, | 1409 | dev_err(&device->pdev->dev, |
1399 | "Self-test prep failed, disabling\n"); | 1410 | "Self-test prep failed, disabling\n"); |
diff --git a/drivers/dma/ipu/ipu_idmac.c b/drivers/dma/ipu/ipu_idmac.c index e202a6ce5573..9a5bc1a7389e 100644 --- a/drivers/dma/ipu/ipu_idmac.c +++ b/drivers/dma/ipu/ipu_idmac.c | |||
@@ -1272,7 +1272,8 @@ static irqreturn_t idmac_interrupt(int irq, void *dev_id) | |||
1272 | /* Other interrupts do not interfere with this channel */ | 1272 | /* Other interrupts do not interfere with this channel */ |
1273 | spin_lock(&ichan->lock); | 1273 | spin_lock(&ichan->lock); |
1274 | if (unlikely(chan_id != IDMAC_SDC_0 && chan_id != IDMAC_SDC_1 && | 1274 | if (unlikely(chan_id != IDMAC_SDC_0 && chan_id != IDMAC_SDC_1 && |
1275 | ((curbuf >> chan_id) & 1) == ichan->active_buffer)) { | 1275 | ((curbuf >> chan_id) & 1) == ichan->active_buffer && |
1276 | !list_is_last(ichan->queue.next, &ichan->queue))) { | ||
1276 | int i = 100; | 1277 | int i = 100; |
1277 | 1278 | ||
1278 | /* This doesn't help. See comment in ipu_disable_channel() */ | 1279 | /* This doesn't help. See comment in ipu_disable_channel() */ |
@@ -1547,7 +1548,7 @@ static irqreturn_t ic_sof_irq(int irq, void *dev_id) | |||
1547 | struct idmac_channel *ichan = dev_id; | 1548 | struct idmac_channel *ichan = dev_id; |
1548 | printk(KERN_DEBUG "Got SOF IRQ %d on Channel %d\n", | 1549 | printk(KERN_DEBUG "Got SOF IRQ %d on Channel %d\n", |
1549 | irq, ichan->dma_chan.chan_id); | 1550 | irq, ichan->dma_chan.chan_id); |
1550 | disable_irq(irq); | 1551 | disable_irq_nosync(irq); |
1551 | return IRQ_HANDLED; | 1552 | return IRQ_HANDLED; |
1552 | } | 1553 | } |
1553 | 1554 | ||
@@ -1556,7 +1557,7 @@ static irqreturn_t ic_eof_irq(int irq, void *dev_id) | |||
1556 | struct idmac_channel *ichan = dev_id; | 1557 | struct idmac_channel *ichan = dev_id; |
1557 | printk(KERN_DEBUG "Got EOF IRQ %d on Channel %d\n", | 1558 | printk(KERN_DEBUG "Got EOF IRQ %d on Channel %d\n", |
1558 | irq, ichan->dma_chan.chan_id); | 1559 | irq, ichan->dma_chan.chan_id); |
1559 | disable_irq(irq); | 1560 | disable_irq_nosync(irq); |
1560 | return IRQ_HANDLED; | 1561 | return IRQ_HANDLED; |
1561 | } | 1562 | } |
1562 | 1563 | ||
diff --git a/drivers/gpu/drm/Kconfig b/drivers/gpu/drm/Kconfig index 3a22eb9be378..17b24c580c09 100644 --- a/drivers/gpu/drm/Kconfig +++ b/drivers/gpu/drm/Kconfig | |||
@@ -71,6 +71,7 @@ config DRM_I915 | |||
71 | select FB_CFB_COPYAREA | 71 | select FB_CFB_COPYAREA |
72 | select FB_CFB_IMAGEBLIT | 72 | select FB_CFB_IMAGEBLIT |
73 | select FB | 73 | select FB |
74 | select FRAMEBUFFER_CONSOLE if !EMBEDDED | ||
74 | tristate "i915 driver" | 75 | tristate "i915 driver" |
75 | help | 76 | help |
76 | Choose this option if you have a system that has Intel 830M, 845G, | 77 | Choose this option if you have a system that has Intel 830M, 845G, |
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h index aa1b995dd033..4d5ee2bbc62b 100644 --- a/drivers/hid/hid-ids.h +++ b/drivers/hid/hid-ids.h | |||
@@ -113,6 +113,11 @@ | |||
113 | #define USB_VENDOR_ID_BERKSHIRE 0x0c98 | 113 | #define USB_VENDOR_ID_BERKSHIRE 0x0c98 |
114 | #define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140 | 114 | #define USB_DEVICE_ID_BERKSHIRE_PCWD 0x1140 |
115 | 115 | ||
116 | #define USB_VENDOR_ID_CH 0x068e | ||
117 | #define USB_DEVICE_ID_CH_PRO_PEDALS 0x00f2 | ||
118 | #define USB_DEVICE_ID_CH_COMBATSTICK 0x00f4 | ||
119 | #define USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE 0x00ff | ||
120 | |||
116 | #define USB_VENDOR_ID_CHERRY 0x046a | 121 | #define USB_VENDOR_ID_CHERRY 0x046a |
117 | #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 | 122 | #define USB_DEVICE_ID_CHERRY_CYMOTION 0x0023 |
118 | 123 | ||
diff --git a/drivers/hid/usbhid/hid-core.c b/drivers/hid/usbhid/hid-core.c index 900ce18dd549..ac8049b5f1e9 100644 --- a/drivers/hid/usbhid/hid-core.c +++ b/drivers/hid/usbhid/hid-core.c | |||
@@ -898,7 +898,7 @@ static int usbhid_parse(struct hid_device *hid) | |||
898 | goto err; | 898 | goto err; |
899 | } | 899 | } |
900 | 900 | ||
901 | hid->quirks = quirks; | 901 | hid->quirks |= quirks; |
902 | 902 | ||
903 | return 0; | 903 | return 0; |
904 | err: | 904 | err: |
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c index 4391717d2519..d8f7423f363e 100644 --- a/drivers/hid/usbhid/hid-quirks.c +++ b/drivers/hid/usbhid/hid-quirks.c | |||
@@ -50,6 +50,9 @@ static const struct hid_blacklist { | |||
50 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, | 50 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, |
51 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, | 51 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, |
52 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, | 52 | { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, |
53 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET }, | ||
54 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_YOKE, HID_QUIRK_NOGET }, | ||
55 | { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_PRO_PEDALS, HID_QUIRK_NOGET }, | ||
53 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, | 56 | { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, |
54 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, | 57 | { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, |
55 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, | 58 | { USB_VENDOR_ID_SUN, USB_DEVICE_ID_RARITAN_KVM_DONGLE, HID_QUIRK_NOGET }, |
diff --git a/drivers/i2c/busses/Kconfig b/drivers/i2c/busses/Kconfig index a48c8aee0218..f1c6ca7e2852 100644 --- a/drivers/i2c/busses/Kconfig +++ b/drivers/i2c/busses/Kconfig | |||
@@ -467,7 +467,7 @@ config I2C_PXA_SLAVE | |||
467 | 467 | ||
468 | config I2C_S3C2410 | 468 | config I2C_S3C2410 |
469 | tristate "S3C2410 I2C Driver" | 469 | tristate "S3C2410 I2C Driver" |
470 | depends on ARCH_S3C2410 | 470 | depends on ARCH_S3C2410 || ARCH_S3C64XX |
471 | help | 471 | help |
472 | Say Y here to include support for I2C controller in the | 472 | Say Y here to include support for I2C controller in the |
473 | Samsung S3C2410 based System-on-Chip devices. | 473 | Samsung S3C2410 based System-on-Chip devices. |
diff --git a/drivers/i2c/busses/i2c-cpm.c b/drivers/i2c/busses/i2c-cpm.c index 3fcf78e906db..b5db8b883615 100644 --- a/drivers/i2c/busses/i2c-cpm.c +++ b/drivers/i2c/busses/i2c-cpm.c | |||
@@ -531,16 +531,16 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) | |||
531 | rbdf = cpm->rbase; | 531 | rbdf = cpm->rbase; |
532 | 532 | ||
533 | for (i = 0; i < CPM_MAXBD; i++) { | 533 | for (i = 0; i < CPM_MAXBD; i++) { |
534 | cpm->rxbuf[i] = dma_alloc_coherent( | 534 | cpm->rxbuf[i] = dma_alloc_coherent(&cpm->ofdev->dev, |
535 | NULL, CPM_MAX_READ + 1, &cpm->rxdma[i], GFP_KERNEL); | 535 | CPM_MAX_READ + 1, |
536 | &cpm->rxdma[i], GFP_KERNEL); | ||
536 | if (!cpm->rxbuf[i]) { | 537 | if (!cpm->rxbuf[i]) { |
537 | ret = -ENOMEM; | 538 | ret = -ENOMEM; |
538 | goto out_muram; | 539 | goto out_muram; |
539 | } | 540 | } |
540 | out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1)); | 541 | out_be32(&rbdf[i].cbd_bufaddr, ((cpm->rxdma[i] + 1) & ~1)); |
541 | 542 | ||
542 | cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent( | 543 | cpm->txbuf[i] = (unsigned char *)dma_alloc_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL); |
543 | NULL, CPM_MAX_READ + 1, &cpm->txdma[i], GFP_KERNEL); | ||
544 | if (!cpm->txbuf[i]) { | 544 | if (!cpm->txbuf[i]) { |
545 | ret = -ENOMEM; | 545 | ret = -ENOMEM; |
546 | goto out_muram; | 546 | goto out_muram; |
@@ -585,10 +585,10 @@ static int __devinit cpm_i2c_setup(struct cpm_i2c *cpm) | |||
585 | out_muram: | 585 | out_muram: |
586 | for (i = 0; i < CPM_MAXBD; i++) { | 586 | for (i = 0; i < CPM_MAXBD; i++) { |
587 | if (cpm->rxbuf[i]) | 587 | if (cpm->rxbuf[i]) |
588 | dma_free_coherent(NULL, CPM_MAX_READ + 1, | 588 | dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, |
589 | cpm->rxbuf[i], cpm->rxdma[i]); | 589 | cpm->rxbuf[i], cpm->rxdma[i]); |
590 | if (cpm->txbuf[i]) | 590 | if (cpm->txbuf[i]) |
591 | dma_free_coherent(NULL, CPM_MAX_READ + 1, | 591 | dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, |
592 | cpm->txbuf[i], cpm->txdma[i]); | 592 | cpm->txbuf[i], cpm->txdma[i]); |
593 | } | 593 | } |
594 | cpm_muram_free(cpm->dp_addr); | 594 | cpm_muram_free(cpm->dp_addr); |
@@ -619,9 +619,9 @@ static void cpm_i2c_shutdown(struct cpm_i2c *cpm) | |||
619 | 619 | ||
620 | /* Free all memory */ | 620 | /* Free all memory */ |
621 | for (i = 0; i < CPM_MAXBD; i++) { | 621 | for (i = 0; i < CPM_MAXBD; i++) { |
622 | dma_free_coherent(NULL, CPM_MAX_READ + 1, | 622 | dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, |
623 | cpm->rxbuf[i], cpm->rxdma[i]); | 623 | cpm->rxbuf[i], cpm->rxdma[i]); |
624 | dma_free_coherent(NULL, CPM_MAX_READ + 1, | 624 | dma_free_coherent(&cpm->ofdev->dev, CPM_MAX_READ + 1, |
625 | cpm->txbuf[i], cpm->txdma[i]); | 625 | cpm->txbuf[i], cpm->txdma[i]); |
626 | } | 626 | } |
627 | 627 | ||
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 4af5c09f0e8f..dd778d7ae047 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
@@ -164,7 +164,7 @@ static int i2c_wait(struct mpc_i2c *i2c, unsigned timeout, int writing) | |||
164 | return 0; | 164 | return 0; |
165 | } | 165 | } |
166 | 166 | ||
167 | #ifdef CONFIG_PPC_52xx | 167 | #ifdef CONFIG_PPC_MPC52xx |
168 | static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = { | 168 | static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = { |
169 | {20, 0x20}, {22, 0x21}, {24, 0x22}, {26, 0x23}, | 169 | {20, 0x20}, {22, 0x21}, {24, 0x22}, {26, 0x23}, |
170 | {28, 0x24}, {30, 0x01}, {32, 0x25}, {34, 0x02}, | 170 | {28, 0x24}, {30, 0x01}, {32, 0x25}, {34, 0x02}, |
@@ -188,7 +188,7 @@ static const struct mpc_i2c_divider mpc_i2c_dividers_52xx[] = { | |||
188 | 188 | ||
189 | int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler) | 189 | int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler) |
190 | { | 190 | { |
191 | const struct mpc52xx_i2c_divider *div = NULL; | 191 | const struct mpc_i2c_divider *div = NULL; |
192 | unsigned int pvr = mfspr(SPRN_PVR); | 192 | unsigned int pvr = mfspr(SPRN_PVR); |
193 | u32 divider; | 193 | u32 divider; |
194 | int i; | 194 | int i; |
@@ -203,7 +203,7 @@ int mpc_i2c_get_fdr_52xx(struct device_node *node, u32 clock, int prescaler) | |||
203 | * We want to choose an FDR/DFSR that generates an I2C bus speed that | 203 | * We want to choose an FDR/DFSR that generates an I2C bus speed that |
204 | * is equal to or lower than the requested speed. | 204 | * is equal to or lower than the requested speed. |
205 | */ | 205 | */ |
206 | for (i = 0; i < ARRAY_SIZE(mpc52xx_i2c_dividers); i++) { | 206 | for (i = 0; i < ARRAY_SIZE(mpc_i2c_dividers_52xx); i++) { |
207 | div = &mpc_i2c_dividers_52xx[i]; | 207 | div = &mpc_i2c_dividers_52xx[i]; |
208 | /* Old MPC5200 rev A CPUs do not support the high bits */ | 208 | /* Old MPC5200 rev A CPUs do not support the high bits */ |
209 | if (div->fdr & 0xc0 && pvr == 0x80822011) | 209 | if (div->fdr & 0xc0 && pvr == 0x80822011) |
@@ -219,20 +219,23 @@ static void mpc_i2c_setclock_52xx(struct device_node *node, | |||
219 | struct mpc_i2c *i2c, | 219 | struct mpc_i2c *i2c, |
220 | u32 clock, u32 prescaler) | 220 | u32 clock, u32 prescaler) |
221 | { | 221 | { |
222 | int fdr = mpc52xx_i2c_get_fdr(node, clock, prescaler); | 222 | int ret, fdr; |
223 | |||
224 | ret = mpc_i2c_get_fdr_52xx(node, clock, prescaler); | ||
225 | fdr = (ret >= 0) ? ret : 0x3f; /* backward compatibility */ | ||
223 | 226 | ||
224 | if (fdr < 0) | ||
225 | fdr = 0x3f; /* backward compatibility */ | ||
226 | writeb(fdr & 0xff, i2c->base + MPC_I2C_FDR); | 227 | writeb(fdr & 0xff, i2c->base + MPC_I2C_FDR); |
227 | dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr); | 228 | |
229 | if (ret >= 0) | ||
230 | dev_info(i2c->dev, "clock %d Hz (fdr=%d)\n", clock, fdr); | ||
228 | } | 231 | } |
229 | #else /* !CONFIG_PPC_52xx */ | 232 | #else /* !CONFIG_PPC_MPC52xx */ |
230 | static void mpc_i2c_setclock_52xx(struct device_node *node, | 233 | static void mpc_i2c_setclock_52xx(struct device_node *node, |
231 | struct mpc_i2c *i2c, | 234 | struct mpc_i2c *i2c, |
232 | u32 clock, u32 prescaler) | 235 | u32 clock, u32 prescaler) |
233 | { | 236 | { |
234 | } | 237 | } |
235 | #endif /* CONFIG_PPC_52xx*/ | 238 | #endif /* CONFIG_PPC_MPC52xx*/ |
236 | 239 | ||
237 | #ifdef CONFIG_FSL_SOC | 240 | #ifdef CONFIG_FSL_SOC |
238 | static const struct mpc_i2c_divider mpc_i2c_dividers_8xxx[] = { | 241 | static const struct mpc_i2c_divider mpc_i2c_dividers_8xxx[] = { |
@@ -321,14 +324,17 @@ static void mpc_i2c_setclock_8xxx(struct device_node *node, | |||
321 | struct mpc_i2c *i2c, | 324 | struct mpc_i2c *i2c, |
322 | u32 clock, u32 prescaler) | 325 | u32 clock, u32 prescaler) |
323 | { | 326 | { |
324 | int fdr = mpc_i2c_get_fdr_8xxx(node, clock, prescaler); | 327 | int ret, fdr; |
328 | |||
329 | ret = mpc_i2c_get_fdr_8xxx(node, clock, prescaler); | ||
330 | fdr = (ret >= 0) ? ret : 0x1031; /* backward compatibility */ | ||
325 | 331 | ||
326 | if (fdr < 0) | ||
327 | fdr = 0x1031; /* backward compatibility */ | ||
328 | writeb(fdr & 0xff, i2c->base + MPC_I2C_FDR); | 332 | writeb(fdr & 0xff, i2c->base + MPC_I2C_FDR); |
329 | writeb((fdr >> 8) & 0xff, i2c->base + MPC_I2C_DFSRR); | 333 | writeb((fdr >> 8) & 0xff, i2c->base + MPC_I2C_DFSRR); |
330 | dev_info(i2c->dev, "clock %d Hz (dfsrr=%d fdr=%d)\n", | 334 | |
331 | clock, fdr >> 8, fdr & 0xff); | 335 | if (ret >= 0) |
336 | dev_info(i2c->dev, "clock %d Hz (dfsrr=%d fdr=%d)\n", | ||
337 | clock, fdr >> 8, fdr & 0xff); | ||
332 | } | 338 | } |
333 | 339 | ||
334 | #else /* !CONFIG_FSL_SOC */ | 340 | #else /* !CONFIG_FSL_SOC */ |
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index c1405c8f6ba5..acc7143d9655 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -265,10 +265,10 @@ static int i2c_pxa_wait_bus_not_busy(struct pxa_i2c *i2c) | |||
265 | show_state(i2c); | 265 | show_state(i2c); |
266 | } | 266 | } |
267 | 267 | ||
268 | if (timeout <= 0) | 268 | if (timeout < 0) |
269 | show_state(i2c); | 269 | show_state(i2c); |
270 | 270 | ||
271 | return timeout <= 0 ? I2C_RETRY : 0; | 271 | return timeout < 0 ? I2C_RETRY : 0; |
272 | } | 272 | } |
273 | 273 | ||
274 | static int i2c_pxa_wait_master(struct pxa_i2c *i2c) | 274 | static int i2c_pxa_wait_master(struct pxa_i2c *i2c) |
@@ -612,7 +612,7 @@ static int i2c_pxa_pio_set_master(struct pxa_i2c *i2c) | |||
612 | show_state(i2c); | 612 | show_state(i2c); |
613 | } | 613 | } |
614 | 614 | ||
615 | if (timeout <= 0) { | 615 | if (timeout < 0) { |
616 | show_state(i2c); | 616 | show_state(i2c); |
617 | dev_err(&i2c->adap.dev, | 617 | dev_err(&i2c->adap.dev, |
618 | "i2c_pxa: timeout waiting for bus free\n"); | 618 | "i2c_pxa: timeout waiting for bus free\n"); |
diff --git a/drivers/infiniband/hw/cxgb3/cxio_hal.c b/drivers/infiniband/hw/cxgb3/cxio_hal.c index 8d71086f5a1c..62f9cf2f94ec 100644 --- a/drivers/infiniband/hw/cxgb3/cxio_hal.c +++ b/drivers/infiniband/hw/cxgb3/cxio_hal.c | |||
@@ -410,6 +410,7 @@ int cxio_flush_sq(struct t3_wq *wq, struct t3_cq *cq, int count) | |||
410 | ptr = wq->sq_rptr + count; | 410 | ptr = wq->sq_rptr + count; |
411 | sqp = wq->sq + Q_PTR2IDX(ptr, wq->sq_size_log2); | 411 | sqp = wq->sq + Q_PTR2IDX(ptr, wq->sq_size_log2); |
412 | while (ptr != wq->sq_wptr) { | 412 | while (ptr != wq->sq_wptr) { |
413 | sqp->signaled = 0; | ||
413 | insert_sq_cqe(wq, cq, sqp); | 414 | insert_sq_cqe(wq, cq, sqp); |
414 | ptr++; | 415 | ptr++; |
415 | sqp = wq->sq + Q_PTR2IDX(ptr, wq->sq_size_log2); | 416 | sqp = wq->sq + Q_PTR2IDX(ptr, wq->sq_size_log2); |
diff --git a/drivers/infiniband/hw/mlx4/mlx4_ib.h b/drivers/infiniband/hw/mlx4/mlx4_ib.h index 9974e886b8de..8a7dd6795fa0 100644 --- a/drivers/infiniband/hw/mlx4/mlx4_ib.h +++ b/drivers/infiniband/hw/mlx4/mlx4_ib.h | |||
@@ -86,6 +86,7 @@ struct mlx4_ib_mr { | |||
86 | 86 | ||
87 | struct mlx4_ib_fast_reg_page_list { | 87 | struct mlx4_ib_fast_reg_page_list { |
88 | struct ib_fast_reg_page_list ibfrpl; | 88 | struct ib_fast_reg_page_list ibfrpl; |
89 | __be64 *mapped_page_list; | ||
89 | dma_addr_t map; | 90 | dma_addr_t map; |
90 | }; | 91 | }; |
91 | 92 | ||
diff --git a/drivers/infiniband/hw/mlx4/mr.c b/drivers/infiniband/hw/mlx4/mr.c index 8e4d26d56a95..8f3666b20ea4 100644 --- a/drivers/infiniband/hw/mlx4/mr.c +++ b/drivers/infiniband/hw/mlx4/mr.c | |||
@@ -231,7 +231,11 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device | |||
231 | if (!mfrpl) | 231 | if (!mfrpl) |
232 | return ERR_PTR(-ENOMEM); | 232 | return ERR_PTR(-ENOMEM); |
233 | 233 | ||
234 | mfrpl->ibfrpl.page_list = dma_alloc_coherent(&dev->dev->pdev->dev, | 234 | mfrpl->ibfrpl.page_list = kmalloc(size, GFP_KERNEL); |
235 | if (!mfrpl->ibfrpl.page_list) | ||
236 | goto err_free; | ||
237 | |||
238 | mfrpl->mapped_page_list = dma_alloc_coherent(&dev->dev->pdev->dev, | ||
235 | size, &mfrpl->map, | 239 | size, &mfrpl->map, |
236 | GFP_KERNEL); | 240 | GFP_KERNEL); |
237 | if (!mfrpl->ibfrpl.page_list) | 241 | if (!mfrpl->ibfrpl.page_list) |
@@ -242,6 +246,7 @@ struct ib_fast_reg_page_list *mlx4_ib_alloc_fast_reg_page_list(struct ib_device | |||
242 | return &mfrpl->ibfrpl; | 246 | return &mfrpl->ibfrpl; |
243 | 247 | ||
244 | err_free: | 248 | err_free: |
249 | kfree(mfrpl->ibfrpl.page_list); | ||
245 | kfree(mfrpl); | 250 | kfree(mfrpl); |
246 | return ERR_PTR(-ENOMEM); | 251 | return ERR_PTR(-ENOMEM); |
247 | } | 252 | } |
@@ -252,8 +257,9 @@ void mlx4_ib_free_fast_reg_page_list(struct ib_fast_reg_page_list *page_list) | |||
252 | struct mlx4_ib_fast_reg_page_list *mfrpl = to_mfrpl(page_list); | 257 | struct mlx4_ib_fast_reg_page_list *mfrpl = to_mfrpl(page_list); |
253 | int size = page_list->max_page_list_len * sizeof (u64); | 258 | int size = page_list->max_page_list_len * sizeof (u64); |
254 | 259 | ||
255 | dma_free_coherent(&dev->dev->pdev->dev, size, page_list->page_list, | 260 | dma_free_coherent(&dev->dev->pdev->dev, size, mfrpl->mapped_page_list, |
256 | mfrpl->map); | 261 | mfrpl->map); |
262 | kfree(mfrpl->ibfrpl.page_list); | ||
257 | kfree(mfrpl); | 263 | kfree(mfrpl); |
258 | } | 264 | } |
259 | 265 | ||
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c index f385a24d31d2..20724aee76f4 100644 --- a/drivers/infiniband/hw/mlx4/qp.c +++ b/drivers/infiniband/hw/mlx4/qp.c | |||
@@ -1365,7 +1365,7 @@ static void set_fmr_seg(struct mlx4_wqe_fmr_seg *fseg, struct ib_send_wr *wr) | |||
1365 | int i; | 1365 | int i; |
1366 | 1366 | ||
1367 | for (i = 0; i < wr->wr.fast_reg.page_list_len; ++i) | 1367 | for (i = 0; i < wr->wr.fast_reg.page_list_len; ++i) |
1368 | wr->wr.fast_reg.page_list->page_list[i] = | 1368 | mfrpl->mapped_page_list[i] = |
1369 | cpu_to_be64(wr->wr.fast_reg.page_list->page_list[i] | | 1369 | cpu_to_be64(wr->wr.fast_reg.page_list->page_list[i] | |
1370 | MLX4_MTT_FLAG_PRESENT); | 1370 | MLX4_MTT_FLAG_PRESENT); |
1371 | 1371 | ||
diff --git a/drivers/input/ff-memless.c b/drivers/input/ff-memless.c index bc4e40f3ede7..2d1415e16834 100644 --- a/drivers/input/ff-memless.c +++ b/drivers/input/ff-memless.c | |||
@@ -226,7 +226,7 @@ static int get_compatible_type(struct ff_device *ff, int effect_type) | |||
226 | */ | 226 | */ |
227 | static void ml_combine_effects(struct ff_effect *effect, | 227 | static void ml_combine_effects(struct ff_effect *effect, |
228 | struct ml_effect_state *state, | 228 | struct ml_effect_state *state, |
229 | int gain) | 229 | unsigned int gain) |
230 | { | 230 | { |
231 | struct ff_effect *new = state->effect; | 231 | struct ff_effect *new = state->effect; |
232 | unsigned int strong, weak, i; | 232 | unsigned int strong, weak, i; |
diff --git a/drivers/input/joydev.c b/drivers/input/joydev.c index 4224f0112849..012a5e753991 100644 --- a/drivers/input/joydev.c +++ b/drivers/input/joydev.c | |||
@@ -843,7 +843,13 @@ static const struct input_device_id joydev_blacklist[] = { | |||
843 | INPUT_DEVICE_ID_MATCH_KEYBIT, | 843 | INPUT_DEVICE_ID_MATCH_KEYBIT, |
844 | .evbit = { BIT_MASK(EV_KEY) }, | 844 | .evbit = { BIT_MASK(EV_KEY) }, |
845 | .keybit = { [BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) }, | 845 | .keybit = { [BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH) }, |
846 | }, /* Avoid itouchpads, touchscreens and tablets */ | 846 | }, /* Avoid itouchpads and touchscreens */ |
847 | { | ||
848 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | | ||
849 | INPUT_DEVICE_ID_MATCH_KEYBIT, | ||
850 | .evbit = { BIT_MASK(EV_KEY) }, | ||
851 | .keybit = { [BIT_WORD(BTN_DIGI)] = BIT_MASK(BTN_DIGI) }, | ||
852 | }, /* Avoid tablets, digitisers and similar devices */ | ||
847 | { } /* Terminating entry */ | 853 | { } /* Terminating entry */ |
848 | }; | 854 | }; |
849 | 855 | ||
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 444dec07e5d8..df3f8aa68115 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -895,6 +895,13 @@ static unsigned int atkbd_amilo_pa1510_forced_release_keys[] = { | |||
895 | }; | 895 | }; |
896 | 896 | ||
897 | /* | 897 | /* |
898 | * Amilo Xi 3650 key release for light touch bar not working | ||
899 | */ | ||
900 | static unsigned int atkbd_amilo_xi3650_forced_release_keys[] = { | ||
901 | 0x67, 0xed, 0x90, 0xa2, 0x99, 0xa4, 0xae, 0xb0, -1U | ||
902 | }; | ||
903 | |||
904 | /* | ||
898 | * atkbd_set_keycode_table() initializes keyboard's keycode table | 905 | * atkbd_set_keycode_table() initializes keyboard's keycode table |
899 | * according to the selected scancode set | 906 | * according to the selected scancode set |
900 | */ | 907 | */ |
@@ -1560,6 +1567,15 @@ static struct dmi_system_id atkbd_dmi_quirk_table[] __initdata = { | |||
1560 | .callback = atkbd_setup_forced_release, | 1567 | .callback = atkbd_setup_forced_release, |
1561 | .driver_data = atkbd_amilo_pa1510_forced_release_keys, | 1568 | .driver_data = atkbd_amilo_pa1510_forced_release_keys, |
1562 | }, | 1569 | }, |
1570 | { | ||
1571 | .ident = "Fujitsu Amilo Xi 3650", | ||
1572 | .matches = { | ||
1573 | DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU SIEMENS"), | ||
1574 | DMI_MATCH(DMI_PRODUCT_NAME, "AMILO Xi 3650"), | ||
1575 | }, | ||
1576 | .callback = atkbd_setup_forced_release, | ||
1577 | .driver_data = atkbd_amilo_xi3650_forced_release_keys, | ||
1578 | }, | ||
1563 | { } | 1579 | { } |
1564 | }; | 1580 | }; |
1565 | 1581 | ||
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index 536668fbda22..948e167557f1 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c | |||
@@ -200,8 +200,9 @@ static int tsc2007_read_values(struct tsc2007 *tsc) | |||
200 | static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle) | 200 | static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle) |
201 | { | 201 | { |
202 | struct tsc2007 *ts = container_of(handle, struct tsc2007, timer); | 202 | struct tsc2007 *ts = container_of(handle, struct tsc2007, timer); |
203 | unsigned long flags; | ||
203 | 204 | ||
204 | spin_lock_irq(&ts->lock); | 205 | spin_lock_irqsave(&ts->lock, flags); |
205 | 206 | ||
206 | if (unlikely(!ts->get_pendown_state() && ts->pendown)) { | 207 | if (unlikely(!ts->get_pendown_state() && ts->pendown)) { |
207 | struct input_dev *input = ts->input; | 208 | struct input_dev *input = ts->input; |
@@ -222,7 +223,7 @@ static enum hrtimer_restart tsc2007_timer(struct hrtimer *handle) | |||
222 | tsc2007_send_event(ts); | 223 | tsc2007_send_event(ts); |
223 | } | 224 | } |
224 | 225 | ||
225 | spin_unlock_irq(&ts->lock); | 226 | spin_unlock_irqrestore(&ts->lock, flags); |
226 | 227 | ||
227 | return HRTIMER_NORESTART; | 228 | return HRTIMER_NORESTART; |
228 | } | 229 | } |
diff --git a/drivers/net/mlx4/en_rx.c b/drivers/net/mlx4/en_rx.c index 7942c4d3cd88..9ee873e872b3 100644 --- a/drivers/net/mlx4/en_rx.c +++ b/drivers/net/mlx4/en_rx.c | |||
@@ -951,7 +951,6 @@ static int mlx4_en_config_rss_qp(struct mlx4_en_priv *priv, | |||
951 | if (err) { | 951 | if (err) { |
952 | mlx4_err(mdev, "Failed to allocate qp #%d\n", qpn); | 952 | mlx4_err(mdev, "Failed to allocate qp #%d\n", qpn); |
953 | goto out; | 953 | goto out; |
954 | return err; | ||
955 | } | 954 | } |
956 | qp->event = mlx4_en_sqp_event; | 955 | qp->event = mlx4_en_sqp_event; |
957 | 956 | ||
diff --git a/drivers/rtc/rtc-twl4030.c b/drivers/rtc/rtc-twl4030.c index a6341e4f9a0f..9c8c70c497dc 100644 --- a/drivers/rtc/rtc-twl4030.c +++ b/drivers/rtc/rtc-twl4030.c | |||
@@ -495,9 +495,7 @@ static int twl4030_rtc_suspend(struct platform_device *pdev, pm_message_t state) | |||
495 | { | 495 | { |
496 | irqstat = rtc_irq_bits; | 496 | irqstat = rtc_irq_bits; |
497 | 497 | ||
498 | /* REVISIT alarm may need to wake us from sleep */ | 498 | mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M); |
499 | mask_rtc_irq_bit(BIT_RTC_INTERRUPTS_REG_IT_TIMER_M | | ||
500 | BIT_RTC_INTERRUPTS_REG_IT_ALARM_M); | ||
501 | return 0; | 499 | return 0; |
502 | } | 500 | } |
503 | 501 | ||
diff --git a/drivers/spi/pxa2xx_spi.c b/drivers/spi/pxa2xx_spi.c index 885194a07418..3f3c08c6ba4e 100644 --- a/drivers/spi/pxa2xx_spi.c +++ b/drivers/spi/pxa2xx_spi.c | |||
@@ -1373,6 +1373,9 @@ static void cleanup(struct spi_device *spi) | |||
1373 | { | 1373 | { |
1374 | struct chip_data *chip = spi_get_ctldata(spi); | 1374 | struct chip_data *chip = spi_get_ctldata(spi); |
1375 | 1375 | ||
1376 | if (!chip) | ||
1377 | return; | ||
1378 | |||
1376 | if (gpio_is_valid(chip->gpio_cs)) | 1379 | if (gpio_is_valid(chip->gpio_cs)) |
1377 | gpio_free(chip->gpio_cs); | 1380 | gpio_free(chip->gpio_cs); |
1378 | 1381 | ||
diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 7826bdce4bbe..0048f1185a60 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig | |||
@@ -1128,13 +1128,6 @@ config FB_INTEL | |||
1128 | 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets. | 1128 | 830M/845G/852GM/855GM/865G/915G/915GM/945G/945GM/965G/965GM chipsets. |
1129 | Say Y if you have and plan to use such a board. | 1129 | Say Y if you have and plan to use such a board. |
1130 | 1130 | ||
1131 | If you say Y here and want DDC/I2C support you must first say Y to | ||
1132 | "I2C support" and "I2C bit-banging support" in the character devices | ||
1133 | section. | ||
1134 | |||
1135 | If you say M here then "I2C support" and "I2C bit-banging support" | ||
1136 | can be build either as modules or built-in. | ||
1137 | |||
1138 | To compile this driver as a module, choose M here: the | 1131 | To compile this driver as a module, choose M here: the |
1139 | module will be called intelfb. | 1132 | module will be called intelfb. |
1140 | 1133 | ||
@@ -1207,11 +1200,10 @@ config FB_MATROX_G | |||
1207 | pixel and 32 bpp packed pixel. You can also use font widths | 1200 | pixel and 32 bpp packed pixel. You can also use font widths |
1208 | different from 8. | 1201 | different from 8. |
1209 | 1202 | ||
1210 | If you need support for G400 secondary head, you must first say Y to | 1203 | If you need support for G400 secondary head, you must say Y to |
1211 | "I2C support" in the character devices section, and then to | 1204 | "Matrox I2C support" and "G400 second head support" right below. |
1212 | "Matrox I2C support" and "G400 second head support" here in the | 1205 | G450/G550 secondary head and digital output are supported without |
1213 | framebuffer section. G450/G550 secondary head and digital output | 1206 | additional modules. |
1214 | are supported without additional modules. | ||
1215 | 1207 | ||
1216 | The driver starts in monitor mode. You must use the matroxset tool | 1208 | The driver starts in monitor mode. You must use the matroxset tool |
1217 | (available at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to | 1209 | (available at <ftp://platan.vc.cvut.cz/pub/linux/matrox-latest/>) to |
@@ -1310,13 +1302,6 @@ config FB_RADEON | |||
1310 | a framebuffer device. There are both PCI and AGP versions. You | 1302 | a framebuffer device. There are both PCI and AGP versions. You |
1311 | don't need to choose this to run the Radeon in plain VGA mode. | 1303 | don't need to choose this to run the Radeon in plain VGA mode. |
1312 | 1304 | ||
1313 | If you say Y here and want DDC/I2C support you must first say Y to | ||
1314 | "I2C support" and "I2C bit-banging support" in the character devices | ||
1315 | section. | ||
1316 | |||
1317 | If you say M here then "I2C support" and "I2C bit-banging support" | ||
1318 | can be build either as modules or built-in. | ||
1319 | |||
1320 | There is a product page at | 1305 | There is a product page at |
1321 | http://apps.ati.com/ATIcompare/ | 1306 | http://apps.ati.com/ATIcompare/ |
1322 | 1307 | ||
diff --git a/drivers/video/via/viafbdev.c b/drivers/video/via/viafbdev.c index e327b84820d2..a0fec298216e 100644 --- a/drivers/video/via/viafbdev.c +++ b/drivers/video/via/viafbdev.c | |||
@@ -2103,7 +2103,7 @@ static void viafb_remove_proc(struct proc_dir_entry *viafb_entry) | |||
2103 | 2103 | ||
2104 | static int __devinit via_pci_probe(void) | 2104 | static int __devinit via_pci_probe(void) |
2105 | { | 2105 | { |
2106 | unsigned int default_xres, default_yres; | 2106 | unsigned long default_xres, default_yres; |
2107 | char *tmpc, *tmpm; | 2107 | char *tmpc, *tmpm; |
2108 | char *tmpc_sec, *tmpm_sec; | 2108 | char *tmpc_sec, *tmpm_sec; |
2109 | int vmode_index; | 2109 | int vmode_index; |
@@ -2196,8 +2196,8 @@ static int __devinit via_pci_probe(void) | |||
2196 | viafb_FB_MM = viaparinfo->fbmem_virt; | 2196 | viafb_FB_MM = viaparinfo->fbmem_virt; |
2197 | tmpm = viafb_mode; | 2197 | tmpm = viafb_mode; |
2198 | tmpc = strsep(&tmpm, "x"); | 2198 | tmpc = strsep(&tmpm, "x"); |
2199 | strict_strtoul(tmpc, 0, (unsigned long *)&default_xres); | 2199 | strict_strtoul(tmpc, 0, &default_xres); |
2200 | strict_strtoul(tmpm, 0, (unsigned long *)&default_yres); | 2200 | strict_strtoul(tmpm, 0, &default_yres); |
2201 | 2201 | ||
2202 | vmode_index = viafb_get_mode_index(default_xres, default_yres, 0); | 2202 | vmode_index = viafb_get_mode_index(default_xres, default_yres, 0); |
2203 | DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index); | 2203 | DEBUG_MSG(KERN_INFO "0->index=%d\n", vmode_index); |
diff --git a/fs/eventpoll.c b/fs/eventpoll.c index a89f370fadb5..5458e80fc558 100644 --- a/fs/eventpoll.c +++ b/fs/eventpoll.c | |||
@@ -1212,7 +1212,7 @@ SYSCALL_DEFINE1(epoll_create1, int, flags) | |||
1212 | 1212 | ||
1213 | SYSCALL_DEFINE1(epoll_create, int, size) | 1213 | SYSCALL_DEFINE1(epoll_create, int, size) |
1214 | { | 1214 | { |
1215 | if (size < 0) | 1215 | if (size <= 0) |
1216 | return -EINVAL; | 1216 | return -EINVAL; |
1217 | 1217 | ||
1218 | return sys_epoll_create1(0); | 1218 | return sys_epoll_create1(0); |
diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c index d1bc4d33ccbc..91f7c85f1ffd 100644 --- a/fs/fuse/inode.c +++ b/fs/fuse/inode.c | |||
@@ -911,6 +911,7 @@ static int fuse_fill_super(struct super_block *sb, void *data, int silent) | |||
911 | err_put_root: | 911 | err_put_root: |
912 | dput(root_dentry); | 912 | dput(root_dentry); |
913 | err_put_conn: | 913 | err_put_conn: |
914 | bdi_destroy(&fc->bdi); | ||
914 | fuse_conn_put(fc); | 915 | fuse_conn_put(fc); |
915 | err_fput: | 916 | err_fput: |
916 | fput(file); | 917 | fput(file); |
diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c index 153d9681192b..c1462d43e721 100644 --- a/fs/hugetlbfs/inode.c +++ b/fs/hugetlbfs/inode.c | |||
@@ -312,16 +312,6 @@ out: | |||
312 | return retval; | 312 | return retval; |
313 | } | 313 | } |
314 | 314 | ||
315 | /* | ||
316 | * Read a page. Again trivial. If it didn't already exist | ||
317 | * in the page cache, it is zero-filled. | ||
318 | */ | ||
319 | static int hugetlbfs_readpage(struct file *file, struct page * page) | ||
320 | { | ||
321 | unlock_page(page); | ||
322 | return -EINVAL; | ||
323 | } | ||
324 | |||
325 | static int hugetlbfs_write_begin(struct file *file, | 315 | static int hugetlbfs_write_begin(struct file *file, |
326 | struct address_space *mapping, | 316 | struct address_space *mapping, |
327 | loff_t pos, unsigned len, unsigned flags, | 317 | loff_t pos, unsigned len, unsigned flags, |
@@ -701,7 +691,6 @@ static void hugetlbfs_destroy_inode(struct inode *inode) | |||
701 | } | 691 | } |
702 | 692 | ||
703 | static const struct address_space_operations hugetlbfs_aops = { | 693 | static const struct address_space_operations hugetlbfs_aops = { |
704 | .readpage = hugetlbfs_readpage, | ||
705 | .write_begin = hugetlbfs_write_begin, | 694 | .write_begin = hugetlbfs_write_begin, |
706 | .write_end = hugetlbfs_write_end, | 695 | .write_end = hugetlbfs_write_end, |
707 | .set_page_dirty = hugetlbfs_set_page_dirty, | 696 | .set_page_dirty = hugetlbfs_set_page_dirty, |
diff --git a/fs/lockd/svc.c b/fs/lockd/svc.c index abf83881f68a..1a54ae14a192 100644 --- a/fs/lockd/svc.c +++ b/fs/lockd/svc.c | |||
@@ -104,6 +104,16 @@ static void set_grace_period(void) | |||
104 | schedule_delayed_work(&grace_period_end, grace_period); | 104 | schedule_delayed_work(&grace_period_end, grace_period); |
105 | } | 105 | } |
106 | 106 | ||
107 | static void restart_grace(void) | ||
108 | { | ||
109 | if (nlmsvc_ops) { | ||
110 | cancel_delayed_work_sync(&grace_period_end); | ||
111 | locks_end_grace(&lockd_manager); | ||
112 | nlmsvc_invalidate_all(); | ||
113 | set_grace_period(); | ||
114 | } | ||
115 | } | ||
116 | |||
107 | /* | 117 | /* |
108 | * This is the lockd kernel thread | 118 | * This is the lockd kernel thread |
109 | */ | 119 | */ |
@@ -149,10 +159,7 @@ lockd(void *vrqstp) | |||
149 | 159 | ||
150 | if (signalled()) { | 160 | if (signalled()) { |
151 | flush_signals(current); | 161 | flush_signals(current); |
152 | if (nlmsvc_ops) { | 162 | restart_grace(); |
153 | nlmsvc_invalidate_all(); | ||
154 | set_grace_period(); | ||
155 | } | ||
156 | continue; | 163 | continue; |
157 | } | 164 | } |
158 | 165 | ||
diff --git a/fs/nfsd/nfs4recover.c b/fs/nfsd/nfs4recover.c index 5275097a7565..b5348405046b 100644 --- a/fs/nfsd/nfs4recover.c +++ b/fs/nfsd/nfs4recover.c | |||
@@ -229,7 +229,7 @@ nfsd4_list_rec_dir(struct dentry *dir, recdir_func *f) | |||
229 | goto out; | 229 | goto out; |
230 | status = vfs_readdir(filp, nfsd4_build_namelist, &names); | 230 | status = vfs_readdir(filp, nfsd4_build_namelist, &names); |
231 | fput(filp); | 231 | fput(filp); |
232 | mutex_lock(&dir->d_inode->i_mutex); | 232 | mutex_lock_nested(&dir->d_inode->i_mutex, I_MUTEX_PARENT); |
233 | while (!list_empty(&names)) { | 233 | while (!list_empty(&names)) { |
234 | entry = list_entry(names.next, struct name_list, list); | 234 | entry = list_entry(names.next, struct name_list, list); |
235 | 235 | ||
@@ -264,7 +264,7 @@ nfsd4_unlink_clid_dir(char *name, int namlen) | |||
264 | 264 | ||
265 | dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); | 265 | dprintk("NFSD: nfsd4_unlink_clid_dir. name %.*s\n", namlen, name); |
266 | 266 | ||
267 | mutex_lock(&rec_dir.dentry->d_inode->i_mutex); | 267 | mutex_lock_nested(&rec_dir.dentry->d_inode->i_mutex, I_MUTEX_PARENT); |
268 | dentry = lookup_one_len(name, rec_dir.dentry, namlen); | 268 | dentry = lookup_one_len(name, rec_dir.dentry, namlen); |
269 | if (IS_ERR(dentry)) { | 269 | if (IS_ERR(dentry)) { |
270 | status = PTR_ERR(dentry); | 270 | status = PTR_ERR(dentry); |
diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c index c65a27b76a9d..3b711f5147a7 100644 --- a/fs/nfsd/nfs4state.c +++ b/fs/nfsd/nfs4state.c | |||
@@ -580,7 +580,6 @@ free_session(struct kref *kref) | |||
580 | struct nfsd4_cache_entry *e = &ses->se_slots[i].sl_cache_entry; | 580 | struct nfsd4_cache_entry *e = &ses->se_slots[i].sl_cache_entry; |
581 | nfsd4_release_respages(e->ce_respages, e->ce_resused); | 581 | nfsd4_release_respages(e->ce_respages, e->ce_resused); |
582 | } | 582 | } |
583 | kfree(ses->se_slots); | ||
584 | kfree(ses); | 583 | kfree(ses); |
585 | } | 584 | } |
586 | 585 | ||
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c index b820c311931c..b73549d293be 100644 --- a/fs/nfsd/nfs4xdr.c +++ b/fs/nfsd/nfs4xdr.c | |||
@@ -2214,6 +2214,15 @@ nfsd4_encode_dirent_fattr(struct nfsd4_readdir *cd, | |||
2214 | dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen); | 2214 | dentry = lookup_one_len(name, cd->rd_fhp->fh_dentry, namlen); |
2215 | if (IS_ERR(dentry)) | 2215 | if (IS_ERR(dentry)) |
2216 | return nfserrno(PTR_ERR(dentry)); | 2216 | return nfserrno(PTR_ERR(dentry)); |
2217 | if (!dentry->d_inode) { | ||
2218 | /* | ||
2219 | * nfsd_buffered_readdir drops the i_mutex between | ||
2220 | * readdir and calling this callback, leaving a window | ||
2221 | * where this directory entry could have gone away. | ||
2222 | */ | ||
2223 | dput(dentry); | ||
2224 | return nfserr_noent; | ||
2225 | } | ||
2217 | 2226 | ||
2218 | exp_get(exp); | 2227 | exp_get(exp); |
2219 | /* | 2228 | /* |
@@ -2276,6 +2285,7 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen, | |||
2276 | struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common); | 2285 | struct nfsd4_readdir *cd = container_of(ccd, struct nfsd4_readdir, common); |
2277 | int buflen; | 2286 | int buflen; |
2278 | __be32 *p = cd->buffer; | 2287 | __be32 *p = cd->buffer; |
2288 | __be32 *cookiep; | ||
2279 | __be32 nfserr = nfserr_toosmall; | 2289 | __be32 nfserr = nfserr_toosmall; |
2280 | 2290 | ||
2281 | /* In nfsv4, "." and ".." never make it onto the wire.. */ | 2291 | /* In nfsv4, "." and ".." never make it onto the wire.. */ |
@@ -2292,7 +2302,7 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen, | |||
2292 | goto fail; | 2302 | goto fail; |
2293 | 2303 | ||
2294 | *p++ = xdr_one; /* mark entry present */ | 2304 | *p++ = xdr_one; /* mark entry present */ |
2295 | cd->offset = p; /* remember pointer */ | 2305 | cookiep = p; |
2296 | p = xdr_encode_hyper(p, NFS_OFFSET_MAX); /* offset of next entry */ | 2306 | p = xdr_encode_hyper(p, NFS_OFFSET_MAX); /* offset of next entry */ |
2297 | p = xdr_encode_array(p, name, namlen); /* name length & name */ | 2307 | p = xdr_encode_array(p, name, namlen); /* name length & name */ |
2298 | 2308 | ||
@@ -2306,6 +2316,8 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen, | |||
2306 | goto fail; | 2316 | goto fail; |
2307 | case nfserr_dropit: | 2317 | case nfserr_dropit: |
2308 | goto fail; | 2318 | goto fail; |
2319 | case nfserr_noent: | ||
2320 | goto skip_entry; | ||
2309 | default: | 2321 | default: |
2310 | /* | 2322 | /* |
2311 | * If the client requested the RDATTR_ERROR attribute, | 2323 | * If the client requested the RDATTR_ERROR attribute, |
@@ -2324,6 +2336,8 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen, | |||
2324 | } | 2336 | } |
2325 | cd->buflen -= (p - cd->buffer); | 2337 | cd->buflen -= (p - cd->buffer); |
2326 | cd->buffer = p; | 2338 | cd->buffer = p; |
2339 | cd->offset = cookiep; | ||
2340 | skip_entry: | ||
2327 | cd->common.err = nfs_ok; | 2341 | cd->common.err = nfs_ok; |
2328 | return 0; | 2342 | return 0; |
2329 | fail: | 2343 | fail: |
diff --git a/fs/nilfs2/ioctl.c b/fs/nilfs2/ioctl.c index 108d281ebca5..50ff3f2cdf24 100644 --- a/fs/nilfs2/ioctl.c +++ b/fs/nilfs2/ioctl.c | |||
@@ -25,6 +25,7 @@ | |||
25 | #include <linux/smp_lock.h> /* lock_kernel(), unlock_kernel() */ | 25 | #include <linux/smp_lock.h> /* lock_kernel(), unlock_kernel() */ |
26 | #include <linux/capability.h> /* capable() */ | 26 | #include <linux/capability.h> /* capable() */ |
27 | #include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */ | 27 | #include <linux/uaccess.h> /* copy_from_user(), copy_to_user() */ |
28 | #include <linux/vmalloc.h> | ||
28 | #include <linux/nilfs2_fs.h> | 29 | #include <linux/nilfs2_fs.h> |
29 | #include "nilfs.h" | 30 | #include "nilfs.h" |
30 | #include "segment.h" | 31 | #include "segment.h" |
@@ -147,29 +148,12 @@ static ssize_t | |||
147 | nilfs_ioctl_do_get_cpinfo(struct the_nilfs *nilfs, __u64 *posp, int flags, | 148 | nilfs_ioctl_do_get_cpinfo(struct the_nilfs *nilfs, __u64 *posp, int flags, |
148 | void *buf, size_t size, size_t nmembs) | 149 | void *buf, size_t size, size_t nmembs) |
149 | { | 150 | { |
150 | return nilfs_cpfile_get_cpinfo(nilfs->ns_cpfile, posp, flags, buf, | ||
151 | nmembs); | ||
152 | } | ||
153 | |||
154 | static int nilfs_ioctl_get_cpinfo(struct inode *inode, struct file *filp, | ||
155 | unsigned int cmd, void __user *argp) | ||
156 | { | ||
157 | struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; | ||
158 | struct nilfs_argv argv; | ||
159 | int ret; | 151 | int ret; |
160 | 152 | ||
161 | if (copy_from_user(&argv, argp, sizeof(argv))) | ||
162 | return -EFAULT; | ||
163 | |||
164 | down_read(&nilfs->ns_segctor_sem); | 153 | down_read(&nilfs->ns_segctor_sem); |
165 | ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd), | 154 | ret = nilfs_cpfile_get_cpinfo(nilfs->ns_cpfile, posp, flags, buf, |
166 | nilfs_ioctl_do_get_cpinfo); | 155 | nmembs); |
167 | up_read(&nilfs->ns_segctor_sem); | 156 | up_read(&nilfs->ns_segctor_sem); |
168 | if (ret < 0) | ||
169 | return ret; | ||
170 | |||
171 | if (copy_to_user(argp, &argv, sizeof(argv))) | ||
172 | ret = -EFAULT; | ||
173 | return ret; | 157 | return ret; |
174 | } | 158 | } |
175 | 159 | ||
@@ -195,28 +179,11 @@ static ssize_t | |||
195 | nilfs_ioctl_do_get_suinfo(struct the_nilfs *nilfs, __u64 *posp, int flags, | 179 | nilfs_ioctl_do_get_suinfo(struct the_nilfs *nilfs, __u64 *posp, int flags, |
196 | void *buf, size_t size, size_t nmembs) | 180 | void *buf, size_t size, size_t nmembs) |
197 | { | 181 | { |
198 | return nilfs_sufile_get_suinfo(nilfs->ns_sufile, *posp, buf, nmembs); | ||
199 | } | ||
200 | |||
201 | static int nilfs_ioctl_get_suinfo(struct inode *inode, struct file *filp, | ||
202 | unsigned int cmd, void __user *argp) | ||
203 | { | ||
204 | struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; | ||
205 | struct nilfs_argv argv; | ||
206 | int ret; | 182 | int ret; |
207 | 183 | ||
208 | if (copy_from_user(&argv, argp, sizeof(argv))) | ||
209 | return -EFAULT; | ||
210 | |||
211 | down_read(&nilfs->ns_segctor_sem); | 184 | down_read(&nilfs->ns_segctor_sem); |
212 | ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd), | 185 | ret = nilfs_sufile_get_suinfo(nilfs->ns_sufile, *posp, buf, nmembs); |
213 | nilfs_ioctl_do_get_suinfo); | ||
214 | up_read(&nilfs->ns_segctor_sem); | 186 | up_read(&nilfs->ns_segctor_sem); |
215 | if (ret < 0) | ||
216 | return ret; | ||
217 | |||
218 | if (copy_to_user(argp, &argv, sizeof(argv))) | ||
219 | ret = -EFAULT; | ||
220 | return ret; | 187 | return ret; |
221 | } | 188 | } |
222 | 189 | ||
@@ -242,28 +209,11 @@ static ssize_t | |||
242 | nilfs_ioctl_do_get_vinfo(struct the_nilfs *nilfs, __u64 *posp, int flags, | 209 | nilfs_ioctl_do_get_vinfo(struct the_nilfs *nilfs, __u64 *posp, int flags, |
243 | void *buf, size_t size, size_t nmembs) | 210 | void *buf, size_t size, size_t nmembs) |
244 | { | 211 | { |
245 | return nilfs_dat_get_vinfo(nilfs_dat_inode(nilfs), buf, nmembs); | ||
246 | } | ||
247 | |||
248 | static int nilfs_ioctl_get_vinfo(struct inode *inode, struct file *filp, | ||
249 | unsigned int cmd, void __user *argp) | ||
250 | { | ||
251 | struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; | ||
252 | struct nilfs_argv argv; | ||
253 | int ret; | 212 | int ret; |
254 | 213 | ||
255 | if (copy_from_user(&argv, argp, sizeof(argv))) | ||
256 | return -EFAULT; | ||
257 | |||
258 | down_read(&nilfs->ns_segctor_sem); | 214 | down_read(&nilfs->ns_segctor_sem); |
259 | ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd), | 215 | ret = nilfs_dat_get_vinfo(nilfs_dat_inode(nilfs), buf, nmembs); |
260 | nilfs_ioctl_do_get_vinfo); | ||
261 | up_read(&nilfs->ns_segctor_sem); | 216 | up_read(&nilfs->ns_segctor_sem); |
262 | if (ret < 0) | ||
263 | return ret; | ||
264 | |||
265 | if (copy_to_user(argp, &argv, sizeof(argv))) | ||
266 | ret = -EFAULT; | ||
267 | return ret; | 217 | return ret; |
268 | } | 218 | } |
269 | 219 | ||
@@ -276,17 +226,21 @@ nilfs_ioctl_do_get_bdescs(struct the_nilfs *nilfs, __u64 *posp, int flags, | |||
276 | struct nilfs_bdesc *bdescs = buf; | 226 | struct nilfs_bdesc *bdescs = buf; |
277 | int ret, i; | 227 | int ret, i; |
278 | 228 | ||
229 | down_read(&nilfs->ns_segctor_sem); | ||
279 | for (i = 0; i < nmembs; i++) { | 230 | for (i = 0; i < nmembs; i++) { |
280 | ret = nilfs_bmap_lookup_at_level(bmap, | 231 | ret = nilfs_bmap_lookup_at_level(bmap, |
281 | bdescs[i].bd_offset, | 232 | bdescs[i].bd_offset, |
282 | bdescs[i].bd_level + 1, | 233 | bdescs[i].bd_level + 1, |
283 | &bdescs[i].bd_blocknr); | 234 | &bdescs[i].bd_blocknr); |
284 | if (ret < 0) { | 235 | if (ret < 0) { |
285 | if (ret != -ENOENT) | 236 | if (ret != -ENOENT) { |
237 | up_read(&nilfs->ns_segctor_sem); | ||
286 | return ret; | 238 | return ret; |
239 | } | ||
287 | bdescs[i].bd_blocknr = 0; | 240 | bdescs[i].bd_blocknr = 0; |
288 | } | 241 | } |
289 | } | 242 | } |
243 | up_read(&nilfs->ns_segctor_sem); | ||
290 | return nmembs; | 244 | return nmembs; |
291 | } | 245 | } |
292 | 246 | ||
@@ -300,10 +254,11 @@ static int nilfs_ioctl_get_bdescs(struct inode *inode, struct file *filp, | |||
300 | if (copy_from_user(&argv, argp, sizeof(argv))) | 254 | if (copy_from_user(&argv, argp, sizeof(argv))) |
301 | return -EFAULT; | 255 | return -EFAULT; |
302 | 256 | ||
303 | down_read(&nilfs->ns_segctor_sem); | 257 | if (argv.v_size != sizeof(struct nilfs_bdesc)) |
258 | return -EINVAL; | ||
259 | |||
304 | ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd), | 260 | ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd), |
305 | nilfs_ioctl_do_get_bdescs); | 261 | nilfs_ioctl_do_get_bdescs); |
306 | up_read(&nilfs->ns_segctor_sem); | ||
307 | if (ret < 0) | 262 | if (ret < 0) |
308 | return ret; | 263 | return ret; |
309 | 264 | ||
@@ -346,10 +301,10 @@ static int nilfs_ioctl_move_inode_block(struct inode *inode, | |||
346 | return 0; | 301 | return 0; |
347 | } | 302 | } |
348 | 303 | ||
349 | static ssize_t | 304 | static int nilfs_ioctl_move_blocks(struct the_nilfs *nilfs, |
350 | nilfs_ioctl_do_move_blocks(struct the_nilfs *nilfs, __u64 *posp, int flags, | 305 | struct nilfs_argv *argv, void *buf) |
351 | void *buf, size_t size, size_t nmembs) | ||
352 | { | 306 | { |
307 | size_t nmembs = argv->v_nmembs; | ||
353 | struct inode *inode; | 308 | struct inode *inode; |
354 | struct nilfs_vdesc *vdesc; | 309 | struct nilfs_vdesc *vdesc; |
355 | struct buffer_head *bh, *n; | 310 | struct buffer_head *bh, *n; |
@@ -410,19 +365,10 @@ nilfs_ioctl_do_move_blocks(struct the_nilfs *nilfs, __u64 *posp, int flags, | |||
410 | return ret; | 365 | return ret; |
411 | } | 366 | } |
412 | 367 | ||
413 | static inline int nilfs_ioctl_move_blocks(struct the_nilfs *nilfs, | 368 | static int nilfs_ioctl_delete_checkpoints(struct the_nilfs *nilfs, |
414 | struct nilfs_argv *argv, | 369 | struct nilfs_argv *argv, void *buf) |
415 | int dir) | ||
416 | { | ||
417 | return nilfs_ioctl_wrap_copy(nilfs, argv, dir, | ||
418 | nilfs_ioctl_do_move_blocks); | ||
419 | } | ||
420 | |||
421 | static ssize_t | ||
422 | nilfs_ioctl_do_delete_checkpoints(struct the_nilfs *nilfs, __u64 *posp, | ||
423 | int flags, void *buf, size_t size, | ||
424 | size_t nmembs) | ||
425 | { | 370 | { |
371 | size_t nmembs = argv->v_nmembs; | ||
426 | struct inode *cpfile = nilfs->ns_cpfile; | 372 | struct inode *cpfile = nilfs->ns_cpfile; |
427 | struct nilfs_period *periods = buf; | 373 | struct nilfs_period *periods = buf; |
428 | int ret, i; | 374 | int ret, i; |
@@ -436,36 +382,21 @@ nilfs_ioctl_do_delete_checkpoints(struct the_nilfs *nilfs, __u64 *posp, | |||
436 | return nmembs; | 382 | return nmembs; |
437 | } | 383 | } |
438 | 384 | ||
439 | static inline int nilfs_ioctl_delete_checkpoints(struct the_nilfs *nilfs, | 385 | static int nilfs_ioctl_free_vblocknrs(struct the_nilfs *nilfs, |
440 | struct nilfs_argv *argv, | 386 | struct nilfs_argv *argv, void *buf) |
441 | int dir) | ||
442 | { | 387 | { |
443 | return nilfs_ioctl_wrap_copy(nilfs, argv, dir, | 388 | size_t nmembs = argv->v_nmembs; |
444 | nilfs_ioctl_do_delete_checkpoints); | 389 | int ret; |
445 | } | ||
446 | 390 | ||
447 | static ssize_t | 391 | ret = nilfs_dat_freev(nilfs_dat_inode(nilfs), buf, nmembs); |
448 | nilfs_ioctl_do_free_vblocknrs(struct the_nilfs *nilfs, __u64 *posp, int flags, | ||
449 | void *buf, size_t size, size_t nmembs) | ||
450 | { | ||
451 | int ret = nilfs_dat_freev(nilfs_dat_inode(nilfs), buf, nmembs); | ||
452 | 392 | ||
453 | return (ret < 0) ? ret : nmembs; | 393 | return (ret < 0) ? ret : nmembs; |
454 | } | 394 | } |
455 | 395 | ||
456 | static inline int nilfs_ioctl_free_vblocknrs(struct the_nilfs *nilfs, | 396 | static int nilfs_ioctl_mark_blocks_dirty(struct the_nilfs *nilfs, |
457 | struct nilfs_argv *argv, | 397 | struct nilfs_argv *argv, void *buf) |
458 | int dir) | ||
459 | { | ||
460 | return nilfs_ioctl_wrap_copy(nilfs, argv, dir, | ||
461 | nilfs_ioctl_do_free_vblocknrs); | ||
462 | } | ||
463 | |||
464 | static ssize_t | ||
465 | nilfs_ioctl_do_mark_blocks_dirty(struct the_nilfs *nilfs, __u64 *posp, | ||
466 | int flags, void *buf, size_t size, | ||
467 | size_t nmembs) | ||
468 | { | 398 | { |
399 | size_t nmembs = argv->v_nmembs; | ||
469 | struct inode *dat = nilfs_dat_inode(nilfs); | 400 | struct inode *dat = nilfs_dat_inode(nilfs); |
470 | struct nilfs_bmap *bmap = NILFS_I(dat)->i_bmap; | 401 | struct nilfs_bmap *bmap = NILFS_I(dat)->i_bmap; |
471 | struct nilfs_bdesc *bdescs = buf; | 402 | struct nilfs_bdesc *bdescs = buf; |
@@ -504,55 +435,37 @@ nilfs_ioctl_do_mark_blocks_dirty(struct the_nilfs *nilfs, __u64 *posp, | |||
504 | return nmembs; | 435 | return nmembs; |
505 | } | 436 | } |
506 | 437 | ||
507 | static inline int nilfs_ioctl_mark_blocks_dirty(struct the_nilfs *nilfs, | 438 | static int nilfs_ioctl_free_segments(struct the_nilfs *nilfs, |
508 | struct nilfs_argv *argv, | 439 | struct nilfs_argv *argv, void *buf) |
509 | int dir) | ||
510 | { | 440 | { |
511 | return nilfs_ioctl_wrap_copy(nilfs, argv, dir, | 441 | size_t nmembs = argv->v_nmembs; |
512 | nilfs_ioctl_do_mark_blocks_dirty); | 442 | struct nilfs_sb_info *sbi = nilfs->ns_writer; |
513 | } | ||
514 | |||
515 | static ssize_t | ||
516 | nilfs_ioctl_do_free_segments(struct the_nilfs *nilfs, __u64 *posp, int flags, | ||
517 | void *buf, size_t size, size_t nmembs) | ||
518 | { | ||
519 | struct nilfs_sb_info *sbi = nilfs_get_writer(nilfs); | ||
520 | int ret; | 443 | int ret; |
521 | 444 | ||
522 | if (unlikely(!sbi)) | 445 | if (unlikely(!sbi)) { |
446 | /* never happens because called for a writable mount */ | ||
447 | WARN_ON(1); | ||
523 | return -EROFS; | 448 | return -EROFS; |
449 | } | ||
524 | ret = nilfs_segctor_add_segments_to_be_freed( | 450 | ret = nilfs_segctor_add_segments_to_be_freed( |
525 | NILFS_SC(sbi), buf, nmembs); | 451 | NILFS_SC(sbi), buf, nmembs); |
526 | nilfs_put_writer(nilfs); | ||
527 | 452 | ||
528 | return (ret < 0) ? ret : nmembs; | 453 | return (ret < 0) ? ret : nmembs; |
529 | } | 454 | } |
530 | 455 | ||
531 | static inline int nilfs_ioctl_free_segments(struct the_nilfs *nilfs, | ||
532 | struct nilfs_argv *argv, | ||
533 | int dir) | ||
534 | { | ||
535 | return nilfs_ioctl_wrap_copy(nilfs, argv, dir, | ||
536 | nilfs_ioctl_do_free_segments); | ||
537 | } | ||
538 | |||
539 | int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs, | 456 | int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs, |
540 | void __user *argp) | 457 | struct nilfs_argv *argv, void **kbufs) |
541 | { | 458 | { |
542 | struct nilfs_argv argv[5]; | ||
543 | const char *msg; | 459 | const char *msg; |
544 | int dir, ret; | 460 | int ret; |
545 | |||
546 | if (copy_from_user(argv, argp, sizeof(argv))) | ||
547 | return -EFAULT; | ||
548 | 461 | ||
549 | dir = _IOC_WRITE; | 462 | ret = nilfs_ioctl_move_blocks(nilfs, &argv[0], kbufs[0]); |
550 | ret = nilfs_ioctl_move_blocks(nilfs, &argv[0], dir); | ||
551 | if (ret < 0) { | 463 | if (ret < 0) { |
552 | msg = "cannot read source blocks"; | 464 | msg = "cannot read source blocks"; |
553 | goto failed; | 465 | goto failed; |
554 | } | 466 | } |
555 | ret = nilfs_ioctl_delete_checkpoints(nilfs, &argv[1], dir); | 467 | |
468 | ret = nilfs_ioctl_delete_checkpoints(nilfs, &argv[1], kbufs[1]); | ||
556 | if (ret < 0) { | 469 | if (ret < 0) { |
557 | /* | 470 | /* |
558 | * can safely abort because checkpoints can be removed | 471 | * can safely abort because checkpoints can be removed |
@@ -561,7 +474,7 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs, | |||
561 | msg = "cannot delete checkpoints"; | 474 | msg = "cannot delete checkpoints"; |
562 | goto failed; | 475 | goto failed; |
563 | } | 476 | } |
564 | ret = nilfs_ioctl_free_vblocknrs(nilfs, &argv[2], dir); | 477 | ret = nilfs_ioctl_free_vblocknrs(nilfs, &argv[2], kbufs[2]); |
565 | if (ret < 0) { | 478 | if (ret < 0) { |
566 | /* | 479 | /* |
567 | * can safely abort because DAT file is updated atomically | 480 | * can safely abort because DAT file is updated atomically |
@@ -570,7 +483,7 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs, | |||
570 | msg = "cannot delete virtual blocks from DAT file"; | 483 | msg = "cannot delete virtual blocks from DAT file"; |
571 | goto failed; | 484 | goto failed; |
572 | } | 485 | } |
573 | ret = nilfs_ioctl_mark_blocks_dirty(nilfs, &argv[3], dir); | 486 | ret = nilfs_ioctl_mark_blocks_dirty(nilfs, &argv[3], kbufs[3]); |
574 | if (ret < 0) { | 487 | if (ret < 0) { |
575 | /* | 488 | /* |
576 | * can safely abort because the operation is nondestructive. | 489 | * can safely abort because the operation is nondestructive. |
@@ -578,7 +491,7 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs, | |||
578 | msg = "cannot mark copying blocks dirty"; | 491 | msg = "cannot mark copying blocks dirty"; |
579 | goto failed; | 492 | goto failed; |
580 | } | 493 | } |
581 | ret = nilfs_ioctl_free_segments(nilfs, &argv[4], dir); | 494 | ret = nilfs_ioctl_free_segments(nilfs, &argv[4], kbufs[4]); |
582 | if (ret < 0) { | 495 | if (ret < 0) { |
583 | /* | 496 | /* |
584 | * can safely abort because this operation is atomic. | 497 | * can safely abort because this operation is atomic. |
@@ -598,9 +511,75 @@ int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *nilfs, | |||
598 | static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp, | 511 | static int nilfs_ioctl_clean_segments(struct inode *inode, struct file *filp, |
599 | unsigned int cmd, void __user *argp) | 512 | unsigned int cmd, void __user *argp) |
600 | { | 513 | { |
514 | struct nilfs_argv argv[5]; | ||
515 | const static size_t argsz[5] = { | ||
516 | sizeof(struct nilfs_vdesc), | ||
517 | sizeof(struct nilfs_period), | ||
518 | sizeof(__u64), | ||
519 | sizeof(struct nilfs_bdesc), | ||
520 | sizeof(__u64), | ||
521 | }; | ||
522 | void __user *base; | ||
523 | void *kbufs[5]; | ||
524 | struct the_nilfs *nilfs; | ||
525 | size_t len, nsegs; | ||
526 | int n, ret; | ||
527 | |||
601 | if (!capable(CAP_SYS_ADMIN)) | 528 | if (!capable(CAP_SYS_ADMIN)) |
602 | return -EPERM; | 529 | return -EPERM; |
603 | return nilfs_clean_segments(inode->i_sb, argp); | 530 | |
531 | if (copy_from_user(argv, argp, sizeof(argv))) | ||
532 | return -EFAULT; | ||
533 | |||
534 | nsegs = argv[4].v_nmembs; | ||
535 | if (argv[4].v_size != argsz[4]) | ||
536 | return -EINVAL; | ||
537 | /* | ||
538 | * argv[4] points to segment numbers this ioctl cleans. We | ||
539 | * use kmalloc() for its buffer because memory used for the | ||
540 | * segment numbers is enough small. | ||
541 | */ | ||
542 | kbufs[4] = memdup_user((void __user *)(unsigned long)argv[4].v_base, | ||
543 | nsegs * sizeof(__u64)); | ||
544 | if (IS_ERR(kbufs[4])) | ||
545 | return PTR_ERR(kbufs[4]); | ||
546 | |||
547 | nilfs = NILFS_SB(inode->i_sb)->s_nilfs; | ||
548 | |||
549 | for (n = 0; n < 4; n++) { | ||
550 | ret = -EINVAL; | ||
551 | if (argv[n].v_size != argsz[n]) | ||
552 | goto out_free; | ||
553 | |||
554 | if (argv[n].v_nmembs > nsegs * nilfs->ns_blocks_per_segment) | ||
555 | goto out_free; | ||
556 | |||
557 | len = argv[n].v_size * argv[n].v_nmembs; | ||
558 | base = (void __user *)(unsigned long)argv[n].v_base; | ||
559 | if (len == 0) { | ||
560 | kbufs[n] = NULL; | ||
561 | continue; | ||
562 | } | ||
563 | |||
564 | kbufs[n] = vmalloc(len); | ||
565 | if (!kbufs[n]) { | ||
566 | ret = -ENOMEM; | ||
567 | goto out_free; | ||
568 | } | ||
569 | if (copy_from_user(kbufs[n], base, len)) { | ||
570 | ret = -EFAULT; | ||
571 | vfree(kbufs[n]); | ||
572 | goto out_free; | ||
573 | } | ||
574 | } | ||
575 | |||
576 | ret = nilfs_clean_segments(inode->i_sb, argv, kbufs); | ||
577 | |||
578 | out_free: | ||
579 | while (--n > 0) | ||
580 | vfree(kbufs[n]); | ||
581 | kfree(kbufs[4]); | ||
582 | return ret; | ||
604 | } | 583 | } |
605 | 584 | ||
606 | static int nilfs_ioctl_sync(struct inode *inode, struct file *filp, | 585 | static int nilfs_ioctl_sync(struct inode *inode, struct file *filp, |
@@ -621,6 +600,33 @@ static int nilfs_ioctl_sync(struct inode *inode, struct file *filp, | |||
621 | return 0; | 600 | return 0; |
622 | } | 601 | } |
623 | 602 | ||
603 | static int nilfs_ioctl_get_info(struct inode *inode, struct file *filp, | ||
604 | unsigned int cmd, void __user *argp, | ||
605 | size_t membsz, | ||
606 | ssize_t (*dofunc)(struct the_nilfs *, | ||
607 | __u64 *, int, | ||
608 | void *, size_t, size_t)) | ||
609 | |||
610 | { | ||
611 | struct the_nilfs *nilfs = NILFS_SB(inode->i_sb)->s_nilfs; | ||
612 | struct nilfs_argv argv; | ||
613 | int ret; | ||
614 | |||
615 | if (copy_from_user(&argv, argp, sizeof(argv))) | ||
616 | return -EFAULT; | ||
617 | |||
618 | if (argv.v_size != membsz) | ||
619 | return -EINVAL; | ||
620 | |||
621 | ret = nilfs_ioctl_wrap_copy(nilfs, &argv, _IOC_DIR(cmd), dofunc); | ||
622 | if (ret < 0) | ||
623 | return ret; | ||
624 | |||
625 | if (copy_to_user(argp, &argv, sizeof(argv))) | ||
626 | ret = -EFAULT; | ||
627 | return ret; | ||
628 | } | ||
629 | |||
624 | long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | 630 | long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) |
625 | { | 631 | { |
626 | struct inode *inode = filp->f_dentry->d_inode; | 632 | struct inode *inode = filp->f_dentry->d_inode; |
@@ -632,16 +638,21 @@ long nilfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) | |||
632 | case NILFS_IOCTL_DELETE_CHECKPOINT: | 638 | case NILFS_IOCTL_DELETE_CHECKPOINT: |
633 | return nilfs_ioctl_delete_checkpoint(inode, filp, cmd, argp); | 639 | return nilfs_ioctl_delete_checkpoint(inode, filp, cmd, argp); |
634 | case NILFS_IOCTL_GET_CPINFO: | 640 | case NILFS_IOCTL_GET_CPINFO: |
635 | return nilfs_ioctl_get_cpinfo(inode, filp, cmd, argp); | 641 | return nilfs_ioctl_get_info(inode, filp, cmd, argp, |
642 | sizeof(struct nilfs_cpinfo), | ||
643 | nilfs_ioctl_do_get_cpinfo); | ||
636 | case NILFS_IOCTL_GET_CPSTAT: | 644 | case NILFS_IOCTL_GET_CPSTAT: |
637 | return nilfs_ioctl_get_cpstat(inode, filp, cmd, argp); | 645 | return nilfs_ioctl_get_cpstat(inode, filp, cmd, argp); |
638 | case NILFS_IOCTL_GET_SUINFO: | 646 | case NILFS_IOCTL_GET_SUINFO: |
639 | return nilfs_ioctl_get_suinfo(inode, filp, cmd, argp); | 647 | return nilfs_ioctl_get_info(inode, filp, cmd, argp, |
648 | sizeof(struct nilfs_suinfo), | ||
649 | nilfs_ioctl_do_get_suinfo); | ||
640 | case NILFS_IOCTL_GET_SUSTAT: | 650 | case NILFS_IOCTL_GET_SUSTAT: |
641 | return nilfs_ioctl_get_sustat(inode, filp, cmd, argp); | 651 | return nilfs_ioctl_get_sustat(inode, filp, cmd, argp); |
642 | case NILFS_IOCTL_GET_VINFO: | 652 | case NILFS_IOCTL_GET_VINFO: |
643 | /* XXX: rename to ??? */ | 653 | return nilfs_ioctl_get_info(inode, filp, cmd, argp, |
644 | return nilfs_ioctl_get_vinfo(inode, filp, cmd, argp); | 654 | sizeof(struct nilfs_vinfo), |
655 | nilfs_ioctl_do_get_vinfo); | ||
645 | case NILFS_IOCTL_GET_BDESCS: | 656 | case NILFS_IOCTL_GET_BDESCS: |
646 | return nilfs_ioctl_get_bdescs(inode, filp, cmd, argp); | 657 | return nilfs_ioctl_get_bdescs(inode, filp, cmd, argp); |
647 | case NILFS_IOCTL_CLEAN_SEGMENTS: | 658 | case NILFS_IOCTL_CLEAN_SEGMENTS: |
diff --git a/fs/nilfs2/mdt.c b/fs/nilfs2/mdt.c index 47dd815433fd..bb78745a0e30 100644 --- a/fs/nilfs2/mdt.c +++ b/fs/nilfs2/mdt.c | |||
@@ -77,19 +77,22 @@ static int nilfs_mdt_create_block(struct inode *inode, unsigned long block, | |||
77 | void *)) | 77 | void *)) |
78 | { | 78 | { |
79 | struct the_nilfs *nilfs = NILFS_MDT(inode)->mi_nilfs; | 79 | struct the_nilfs *nilfs = NILFS_MDT(inode)->mi_nilfs; |
80 | struct nilfs_sb_info *writer = NULL; | ||
81 | struct super_block *sb = inode->i_sb; | 80 | struct super_block *sb = inode->i_sb; |
82 | struct nilfs_transaction_info ti; | 81 | struct nilfs_transaction_info ti; |
83 | struct buffer_head *bh; | 82 | struct buffer_head *bh; |
84 | int err; | 83 | int err; |
85 | 84 | ||
86 | if (!sb) { | 85 | if (!sb) { |
87 | writer = nilfs_get_writer(nilfs); | 86 | /* |
88 | if (!writer) { | 87 | * Make sure this function is not called from any |
88 | * read-only context. | ||
89 | */ | ||
90 | if (!nilfs->ns_writer) { | ||
91 | WARN_ON(1); | ||
89 | err = -EROFS; | 92 | err = -EROFS; |
90 | goto out; | 93 | goto out; |
91 | } | 94 | } |
92 | sb = writer->s_super; | 95 | sb = nilfs->ns_writer->s_super; |
93 | } | 96 | } |
94 | 97 | ||
95 | nilfs_transaction_begin(sb, &ti, 0); | 98 | nilfs_transaction_begin(sb, &ti, 0); |
@@ -127,8 +130,6 @@ static int nilfs_mdt_create_block(struct inode *inode, unsigned long block, | |||
127 | err = nilfs_transaction_commit(sb); | 130 | err = nilfs_transaction_commit(sb); |
128 | else | 131 | else |
129 | nilfs_transaction_abort(sb); | 132 | nilfs_transaction_abort(sb); |
130 | if (writer) | ||
131 | nilfs_put_writer(nilfs); | ||
132 | out: | 133 | out: |
133 | return err; | 134 | return err; |
134 | } | 135 | } |
@@ -299,7 +300,7 @@ int nilfs_mdt_delete_block(struct inode *inode, unsigned long block) | |||
299 | int err; | 300 | int err; |
300 | 301 | ||
301 | err = nilfs_bmap_delete(ii->i_bmap, block); | 302 | err = nilfs_bmap_delete(ii->i_bmap, block); |
302 | if (likely(!err)) { | 303 | if (!err || err == -ENOENT) { |
303 | nilfs_mdt_mark_dirty(inode); | 304 | nilfs_mdt_mark_dirty(inode); |
304 | nilfs_mdt_forget_block(inode, block); | 305 | nilfs_mdt_forget_block(inode, block); |
305 | } | 306 | } |
diff --git a/fs/nilfs2/nilfs.h b/fs/nilfs2/nilfs.h index 3d0c18a16db1..da6fc0bba2e5 100644 --- a/fs/nilfs2/nilfs.h +++ b/fs/nilfs2/nilfs.h | |||
@@ -236,7 +236,8 @@ extern int nilfs_sync_file(struct file *, struct dentry *, int); | |||
236 | 236 | ||
237 | /* ioctl.c */ | 237 | /* ioctl.c */ |
238 | long nilfs_ioctl(struct file *, unsigned int, unsigned long); | 238 | long nilfs_ioctl(struct file *, unsigned int, unsigned long); |
239 | int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *, void __user *); | 239 | int nilfs_ioctl_prepare_clean_segments(struct the_nilfs *, struct nilfs_argv *, |
240 | void **); | ||
240 | 241 | ||
241 | /* inode.c */ | 242 | /* inode.c */ |
242 | extern struct inode *nilfs_new_inode(struct inode *, int); | 243 | extern struct inode *nilfs_new_inode(struct inode *, int); |
diff --git a/fs/nilfs2/page.c b/fs/nilfs2/page.c index 1bfbba9c0e9a..a2692bbc7b50 100644 --- a/fs/nilfs2/page.c +++ b/fs/nilfs2/page.c | |||
@@ -128,7 +128,8 @@ void nilfs_forget_buffer(struct buffer_head *bh) | |||
128 | 128 | ||
129 | lock_buffer(bh); | 129 | lock_buffer(bh); |
130 | clear_buffer_nilfs_volatile(bh); | 130 | clear_buffer_nilfs_volatile(bh); |
131 | if (test_clear_buffer_dirty(bh) && nilfs_page_buffers_clean(page)) | 131 | clear_buffer_dirty(bh); |
132 | if (nilfs_page_buffers_clean(page)) | ||
132 | __nilfs_clear_page_dirty(page); | 133 | __nilfs_clear_page_dirty(page); |
133 | 134 | ||
134 | clear_buffer_uptodate(bh); | 135 | clear_buffer_uptodate(bh); |
diff --git a/fs/nilfs2/recovery.c b/fs/nilfs2/recovery.c index 4fc081e47d70..57afa9d24061 100644 --- a/fs/nilfs2/recovery.c +++ b/fs/nilfs2/recovery.c | |||
@@ -407,6 +407,7 @@ void nilfs_dispose_segment_list(struct list_head *head) | |||
407 | } | 407 | } |
408 | 408 | ||
409 | static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs, | 409 | static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs, |
410 | struct nilfs_sb_info *sbi, | ||
410 | struct nilfs_recovery_info *ri) | 411 | struct nilfs_recovery_info *ri) |
411 | { | 412 | { |
412 | struct list_head *head = &ri->ri_used_segments; | 413 | struct list_head *head = &ri->ri_used_segments; |
@@ -421,6 +422,7 @@ static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs, | |||
421 | segnum[2] = ri->ri_segnum; | 422 | segnum[2] = ri->ri_segnum; |
422 | segnum[3] = ri->ri_nextnum; | 423 | segnum[3] = ri->ri_nextnum; |
423 | 424 | ||
425 | nilfs_attach_writer(nilfs, sbi); | ||
424 | /* | 426 | /* |
425 | * Releasing the next segment of the latest super root. | 427 | * Releasing the next segment of the latest super root. |
426 | * The next segment is invalidated by this recovery. | 428 | * The next segment is invalidated by this recovery. |
@@ -459,10 +461,10 @@ static int nilfs_prepare_segment_for_recovery(struct the_nilfs *nilfs, | |||
459 | nilfs->ns_pseg_offset = 0; | 461 | nilfs->ns_pseg_offset = 0; |
460 | nilfs->ns_seg_seq = ri->ri_seq + 2; | 462 | nilfs->ns_seg_seq = ri->ri_seq + 2; |
461 | nilfs->ns_nextnum = nilfs->ns_segnum = segnum[0]; | 463 | nilfs->ns_nextnum = nilfs->ns_segnum = segnum[0]; |
462 | return 0; | ||
463 | 464 | ||
464 | failed: | 465 | failed: |
465 | /* No need to recover sufile because it will be destroyed on error */ | 466 | /* No need to recover sufile because it will be destroyed on error */ |
467 | nilfs_detach_writer(nilfs, sbi); | ||
466 | return err; | 468 | return err; |
467 | } | 469 | } |
468 | 470 | ||
@@ -728,7 +730,7 @@ int nilfs_recover_logical_segments(struct the_nilfs *nilfs, | |||
728 | goto failed; | 730 | goto failed; |
729 | 731 | ||
730 | if (ri->ri_need_recovery == NILFS_RECOVERY_ROLLFORWARD_DONE) { | 732 | if (ri->ri_need_recovery == NILFS_RECOVERY_ROLLFORWARD_DONE) { |
731 | err = nilfs_prepare_segment_for_recovery(nilfs, ri); | 733 | err = nilfs_prepare_segment_for_recovery(nilfs, sbi, ri); |
732 | if (unlikely(err)) { | 734 | if (unlikely(err)) { |
733 | printk(KERN_ERR "NILFS: Error preparing segments for " | 735 | printk(KERN_ERR "NILFS: Error preparing segments for " |
734 | "recovery.\n"); | 736 | "recovery.\n"); |
diff --git a/fs/nilfs2/segment.c b/fs/nilfs2/segment.c index fb70ec3be20e..22c7f65c2403 100644 --- a/fs/nilfs2/segment.c +++ b/fs/nilfs2/segment.c | |||
@@ -2589,7 +2589,8 @@ nilfs_remove_written_gcinodes(struct the_nilfs *nilfs, struct list_head *head) | |||
2589 | } | 2589 | } |
2590 | } | 2590 | } |
2591 | 2591 | ||
2592 | int nilfs_clean_segments(struct super_block *sb, void __user *argp) | 2592 | int nilfs_clean_segments(struct super_block *sb, struct nilfs_argv *argv, |
2593 | void **kbufs) | ||
2593 | { | 2594 | { |
2594 | struct nilfs_sb_info *sbi = NILFS_SB(sb); | 2595 | struct nilfs_sb_info *sbi = NILFS_SB(sb); |
2595 | struct nilfs_sc_info *sci = NILFS_SC(sbi); | 2596 | struct nilfs_sc_info *sci = NILFS_SC(sbi); |
@@ -2606,7 +2607,7 @@ int nilfs_clean_segments(struct super_block *sb, void __user *argp) | |||
2606 | err = nilfs_init_gcdat_inode(nilfs); | 2607 | err = nilfs_init_gcdat_inode(nilfs); |
2607 | if (unlikely(err)) | 2608 | if (unlikely(err)) |
2608 | goto out_unlock; | 2609 | goto out_unlock; |
2609 | err = nilfs_ioctl_prepare_clean_segments(nilfs, argp); | 2610 | err = nilfs_ioctl_prepare_clean_segments(nilfs, argv, kbufs); |
2610 | if (unlikely(err)) | 2611 | if (unlikely(err)) |
2611 | goto out_unlock; | 2612 | goto out_unlock; |
2612 | 2613 | ||
diff --git a/fs/nilfs2/segment.h b/fs/nilfs2/segment.h index a98fc1ed0bbb..476bdd5df5be 100644 --- a/fs/nilfs2/segment.h +++ b/fs/nilfs2/segment.h | |||
@@ -222,7 +222,8 @@ extern int nilfs_construct_segment(struct super_block *); | |||
222 | extern int nilfs_construct_dsync_segment(struct super_block *, struct inode *, | 222 | extern int nilfs_construct_dsync_segment(struct super_block *, struct inode *, |
223 | loff_t, loff_t); | 223 | loff_t, loff_t); |
224 | extern void nilfs_flush_segment(struct super_block *, ino_t); | 224 | extern void nilfs_flush_segment(struct super_block *, ino_t); |
225 | extern int nilfs_clean_segments(struct super_block *, void __user *); | 225 | extern int nilfs_clean_segments(struct super_block *, struct nilfs_argv *, |
226 | void **); | ||
226 | 227 | ||
227 | extern int nilfs_segctor_add_segments_to_be_freed(struct nilfs_sc_info *, | 228 | extern int nilfs_segctor_add_segments_to_be_freed(struct nilfs_sc_info *, |
228 | __u64 *, size_t); | 229 | __u64 *, size_t); |
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h index 2e2aa3df170c..ffefba81c818 100644 --- a/include/linux/dmaengine.h +++ b/include/linux/dmaengine.h | |||
@@ -78,12 +78,18 @@ enum dma_transaction_type { | |||
78 | * dependency chains | 78 | * dependency chains |
79 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) | 79 | * @DMA_COMPL_SKIP_SRC_UNMAP - set to disable dma-unmapping the source buffer(s) |
80 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) | 80 | * @DMA_COMPL_SKIP_DEST_UNMAP - set to disable dma-unmapping the destination(s) |
81 | * @DMA_COMPL_SRC_UNMAP_SINGLE - set to do the source dma-unmapping as single | ||
82 | * (if not set, do the source dma-unmapping as page) | ||
83 | * @DMA_COMPL_DEST_UNMAP_SINGLE - set to do the destination dma-unmapping as single | ||
84 | * (if not set, do the destination dma-unmapping as page) | ||
81 | */ | 85 | */ |
82 | enum dma_ctrl_flags { | 86 | enum dma_ctrl_flags { |
83 | DMA_PREP_INTERRUPT = (1 << 0), | 87 | DMA_PREP_INTERRUPT = (1 << 0), |
84 | DMA_CTRL_ACK = (1 << 1), | 88 | DMA_CTRL_ACK = (1 << 1), |
85 | DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), | 89 | DMA_COMPL_SKIP_SRC_UNMAP = (1 << 2), |
86 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), | 90 | DMA_COMPL_SKIP_DEST_UNMAP = (1 << 3), |
91 | DMA_COMPL_SRC_UNMAP_SINGLE = (1 << 4), | ||
92 | DMA_COMPL_DEST_UNMAP_SINGLE = (1 << 5), | ||
87 | }; | 93 | }; |
88 | 94 | ||
89 | /** | 95 | /** |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 40617c1d8976..30520844b8da 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -433,6 +433,7 @@ asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg); | |||
433 | asmlinkage long sys_fcntl64(unsigned int fd, | 433 | asmlinkage long sys_fcntl64(unsigned int fd, |
434 | unsigned int cmd, unsigned long arg); | 434 | unsigned int cmd, unsigned long arg); |
435 | #endif | 435 | #endif |
436 | asmlinkage long sys_pipe2(int __user *fildes, int flags); | ||
436 | asmlinkage long sys_dup(unsigned int fildes); | 437 | asmlinkage long sys_dup(unsigned int fildes); |
437 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); | 438 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); |
438 | asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags); | 439 | asmlinkage long sys_dup3(unsigned int oldfd, unsigned int newfd, int flags); |
diff --git a/mm/madvise.c b/mm/madvise.c index 36d6ea2b6340..b9ce574827c8 100644 --- a/mm/madvise.c +++ b/mm/madvise.c | |||
@@ -112,14 +112,6 @@ static long madvise_willneed(struct vm_area_struct * vma, | |||
112 | if (!file) | 112 | if (!file) |
113 | return -EBADF; | 113 | return -EBADF; |
114 | 114 | ||
115 | /* | ||
116 | * Page cache readahead assumes page cache pages are order-0 which | ||
117 | * is not the case for hugetlbfs. Do not give a bad return value | ||
118 | * but ignore the advice. | ||
119 | */ | ||
120 | if (vma->vm_flags & VM_HUGETLB) | ||
121 | return 0; | ||
122 | |||
123 | if (file->f_mapping->a_ops->get_xip_mem) { | 115 | if (file->f_mapping->a_ops->get_xip_mem) { |
124 | /* no bad return value, but ignore advice */ | 116 | /* no bad return value, but ignore advice */ |
125 | return 0; | 117 | return 0; |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c index 629a28764da9..42a6f9f20285 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c +++ b/net/sunrpc/xprtrdma/svc_rdma_recvfrom.c | |||
@@ -265,7 +265,7 @@ static int fast_reg_read_chunks(struct svcxprt_rdma *xprt, | |||
265 | frmr->page_list->page_list[page_no] = | 265 | frmr->page_list->page_list[page_no] = |
266 | ib_dma_map_single(xprt->sc_cm_id->device, | 266 | ib_dma_map_single(xprt->sc_cm_id->device, |
267 | page_address(rqstp->rq_arg.pages[page_no]), | 267 | page_address(rqstp->rq_arg.pages[page_no]), |
268 | PAGE_SIZE, DMA_TO_DEVICE); | 268 | PAGE_SIZE, DMA_FROM_DEVICE); |
269 | if (ib_dma_mapping_error(xprt->sc_cm_id->device, | 269 | if (ib_dma_mapping_error(xprt->sc_cm_id->device, |
270 | frmr->page_list->page_list[page_no])) | 270 | frmr->page_list->page_list[page_no])) |
271 | goto fatal_err; | 271 | goto fatal_err; |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_sendto.c b/net/sunrpc/xprtrdma/svc_rdma_sendto.c index 6c26a675435a..8b510c5e8777 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_sendto.c +++ b/net/sunrpc/xprtrdma/svc_rdma_sendto.c | |||
@@ -183,6 +183,7 @@ static int fast_reg_xdr(struct svcxprt_rdma *xprt, | |||
183 | 183 | ||
184 | fatal_err: | 184 | fatal_err: |
185 | printk("svcrdma: Error fast registering memory for xprt %p\n", xprt); | 185 | printk("svcrdma: Error fast registering memory for xprt %p\n", xprt); |
186 | vec->frmr = NULL; | ||
186 | svc_rdma_put_frmr(xprt, frmr); | 187 | svc_rdma_put_frmr(xprt, frmr); |
187 | return -EIO; | 188 | return -EIO; |
188 | } | 189 | } |
@@ -516,6 +517,7 @@ static int send_reply(struct svcxprt_rdma *rdma, | |||
516 | "svcrdma: could not post a receive buffer, err=%d." | 517 | "svcrdma: could not post a receive buffer, err=%d." |
517 | "Closing transport %p.\n", ret, rdma); | 518 | "Closing transport %p.\n", ret, rdma); |
518 | set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags); | 519 | set_bit(XPT_CLOSE, &rdma->sc_xprt.xpt_flags); |
520 | svc_rdma_put_frmr(rdma, vec->frmr); | ||
519 | svc_rdma_put_context(ctxt, 0); | 521 | svc_rdma_put_context(ctxt, 0); |
520 | return -ENOTCONN; | 522 | return -ENOTCONN; |
521 | } | 523 | } |
@@ -606,6 +608,7 @@ static int send_reply(struct svcxprt_rdma *rdma, | |||
606 | return 0; | 608 | return 0; |
607 | 609 | ||
608 | err: | 610 | err: |
611 | svc_rdma_unmap_dma(ctxt); | ||
609 | svc_rdma_put_frmr(rdma, vec->frmr); | 612 | svc_rdma_put_frmr(rdma, vec->frmr); |
610 | svc_rdma_put_context(ctxt, 1); | 613 | svc_rdma_put_context(ctxt, 1); |
611 | return -EIO; | 614 | return -EIO; |
diff --git a/net/sunrpc/xprtrdma/svc_rdma_transport.c b/net/sunrpc/xprtrdma/svc_rdma_transport.c index 3d810e7df3fb..4b0c2fa15e0b 100644 --- a/net/sunrpc/xprtrdma/svc_rdma_transport.c +++ b/net/sunrpc/xprtrdma/svc_rdma_transport.c | |||
@@ -520,8 +520,9 @@ int svc_rdma_post_recv(struct svcxprt_rdma *xprt) | |||
520 | svc_xprt_get(&xprt->sc_xprt); | 520 | svc_xprt_get(&xprt->sc_xprt); |
521 | ret = ib_post_recv(xprt->sc_qp, &recv_wr, &bad_recv_wr); | 521 | ret = ib_post_recv(xprt->sc_qp, &recv_wr, &bad_recv_wr); |
522 | if (ret) { | 522 | if (ret) { |
523 | svc_xprt_put(&xprt->sc_xprt); | 523 | svc_rdma_unmap_dma(ctxt); |
524 | svc_rdma_put_context(ctxt, 1); | 524 | svc_rdma_put_context(ctxt, 1); |
525 | svc_xprt_put(&xprt->sc_xprt); | ||
525 | } | 526 | } |
526 | return ret; | 527 | return ret; |
527 | 528 | ||